Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(812)

Unified Diff: lib/src/codegen/js_codegen.dart

Issue 1689013002: Use Uris for corelibOrder (Closed) Base URL: git@github.com:dart-lang/dev_compiler.git@master
Patch Set: Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « lib/runtime/dart/html.js ('k') | lib/src/codegen/js_module_item_order.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/src/codegen/js_codegen.dart
diff --git a/lib/src/codegen/js_codegen.dart b/lib/src/codegen/js_codegen.dart
index 005808114b65eefe3e35961473b15a75dcb16424..9939e6016459544e6a2a14b080dca6d06477c667 100644
--- a/lib/src/codegen/js_codegen.dart
+++ b/lib/src/codegen/js_codegen.dart
@@ -186,14 +186,16 @@ class JSCodegenVisitor extends GeneralizingAstVisitor
_exports.forEach(moduleBuilder.addExport);
+ var currentModuleName = compiler.getModuleName(currentLibrary.source.uri);
var items = <JS.ModuleItem>[];
if (!_isDartRuntime) {
if (currentLibrary.source.isInSystemLibrary) {
// Force the import order of runtime libs.
// TODO(ochafik): Reduce this to a minimum.
- for (var lib in corelibOrder.reversed) {
- // TODO(ochafik): Use uris instead in corelibOrder.
- moduleBuilder.addImport(getCorelibModuleName(lib), null);
+ for (var libUri in corelibOrder.reversed) {
+ var moduleName = compiler.getModuleName(libUri);
+ if (moduleName == currentModuleName) continue;
+ moduleBuilder.addImport(moduleName, null);
}
}
moduleBuilder.addImport('dart/_runtime', _runtimeLibVar);
@@ -216,7 +218,7 @@ class JSCodegenVisitor extends GeneralizingAstVisitor
// String scriptTag = null;
// if (library.library.scriptTag != null) scriptTag = '/usr/bin/env $jsBin';
return moduleBuilder.build(
- compiler.getModuleName(currentLibrary.source.uri),
+ currentModuleName,
_jsModuleValue,
_exportsVar,
items);
« no previous file with comments | « lib/runtime/dart/html.js ('k') | lib/src/codegen/js_module_item_order.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698