[JS SCRIPT] refactor js script infrastructure

- Implement proper script compiler proxy to correctly handle script and its closed-world dependencies
 - Clean up zoo of JsScriptCompilers
This commit is contained in:
Roman Artemev
2019-09-25 20:50:23 +03:00
committed by romanart
parent f59e393e37
commit c0f279811e
25 changed files with 404 additions and 357 deletions
@@ -44,7 +44,7 @@ class JsIrBackendContext(
val symbolTable: SymbolTable,
irModuleFragment: IrModuleFragment,
val additionalExportedDeclarations: Set<FqName>,
override val configuration: CompilerConfiguration,
override val configuration: CompilerConfiguration, // TODO: remove configuration from backend context
override val scriptMode: Boolean = false
) : CommonBackendContext {
override val transformedFunction = mutableMapOf<IrFunctionSymbol, IrSimpleFunctionSymbol>()
@@ -86,7 +86,7 @@ fun compile(
return transformer.generateModule(moduleFragment)
}
fun compileForRepl(
fun generateJsCode(
context: JsIrBackendContext,
moduleFragment: IrModuleFragment,
nameTables: NameTables