| Index: lib/src/codegen/js_codegen.dart
|
| diff --git a/lib/src/codegen/js_codegen.dart b/lib/src/codegen/js_codegen.dart
|
| index 20a1eccf4d49d92187b63aa90a9ec7f991c0259e..42d3b60c5015f6980b58e2036920e45ef708ce83 100644
|
| --- a/lib/src/codegen/js_codegen.dart
|
| +++ b/lib/src/codegen/js_codegen.dart
|
| @@ -84,7 +84,9 @@ class JSCodegenVisitor extends GeneralizingAstVisitor {
|
|
|
| /// The name for the library's exports inside itself.
|
| /// `exports` was chosen as the most similar to ES module patterns.
|
| + final _dartxVar = new JS.Identifier('dartx');
|
| final _exportsVar = new JS.TemporaryId('exports');
|
| + final _runtimeLibVar = new JS.Identifier('dart');
|
| final _namedArgTemp = new JS.TemporaryId('opts');
|
|
|
| ConstFieldVisitor _constField;
|
| @@ -181,14 +183,14 @@ class JSCodegenVisitor extends GeneralizingAstVisitor {
|
| // TODO(jmesserly): it would be great to run the renamer on the body,
|
| // then figure out if we really need each of these parameters.
|
| // See ES6 modules: https://github.com/dart-lang/dev_compiler/issues/34
|
| - var params = [_exportsVar];
|
| + var params = [_exportsVar, _runtimeLibVar, _dartxVar];
|
| var processImport = (LibraryElement library, JS.TemporaryId temp,
|
| List list) {
|
| params.add(temp);
|
| list.add(js.string(jsOutputBase(library, root), "'"));
|
| };
|
|
|
| - var imports = [];
|
| + var imports = [js.string('dart/dart_runtime'), js.string('dart/dartx')];
|
| _imports.forEach((library, temp) {
|
| if (_loader.libraryIsLoaded(library)) {
|
| processImport(library, temp, imports);
|
| @@ -206,7 +208,7 @@ class JSCodegenVisitor extends GeneralizingAstVisitor {
|
| js.call("function(#) { 'use strict'; #; }", [params, _moduleItems]);
|
|
|
| var program = [
|
| - js.statement("dart.library(#, #, #, #, #)", [
|
| + js.statement("loader.library(#, #, #, #, #)", [
|
| jsPath,
|
| jsDefaultValue != null ? jsDefaultValue : new JS.LiteralNull(),
|
| js.commentExpression(
|
|
|