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

Unified Diff: lib/src/compiler.dart

Issue 1633003002: Add --modules=node support (Closed) Base URL: git@github.com:dart-lang/dev_compiler.git@master
Patch Set: merged master Created 4 years, 11 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/src/codegen/module_builder.dart ('k') | lib/src/options.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/src/compiler.dart
diff --git a/lib/src/compiler.dart b/lib/src/compiler.dart
index 61c568591624e3a99238c4a54937cf2f6f85bcf8..921b857ae5caa60a93b86f94bddb242c601deb4e 100644
--- a/lib/src/compiler.dart
+++ b/lib/src/compiler.dart
@@ -513,13 +513,27 @@ const corelibOrder = const [
'dart._js_mirrors',
'dart.js',
'dart._metadata',
- 'dart.dom.html_common',
'dart.dom.html',
+ 'dart.dom.html_common',
'dart._debugger'
// _foreign_helper is not included, as it only defines the JS builtin that
// the compiler handles at compile time.
];
+/// Returns the JS module name corresponding to a core library name (must be
+/// from the [corelibOrder] list).
+String getCorelibModuleName(String lib) {
+ assert(corelibOrder.contains(lib));
+ switch (lib) {
+ case 'dart.dom.html_common':
+ return 'dart/html_common';
+ case 'dart.dom.html':
+ return 'dart/html';
+ default:
+ return lib.replaceAll('dart.', 'dart/');
+ }
+}
+
/// Runtime files added to all applications when running the compiler in the
/// command line.
final defaultRuntimeFiles = () {
« no previous file with comments | « lib/src/codegen/module_builder.dart ('k') | lib/src/options.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698