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

Unified Diff: lib/src/options.dart

Issue 1458243002: implement ES6 modules in JS AST. (Closed) Base URL: git@github.com:dart-lang/dev_compiler.git@master
Patch Set: Created 5 years, 1 month 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
« lib/src/js/nodes.dart ('K') | « lib/src/js/template.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/src/options.dart
diff --git a/lib/src/options.dart b/lib/src/options.dart
index d4fb08610b3531c0edba50f57a0a2967c1d53043..3162439bb8c9463765b47d6c6abeb13ef2d27402 100644
--- a/lib/src/options.dart
+++ b/lib/src/options.dart
@@ -73,12 +73,17 @@ class CodegenOptions {
/// other V8 builds
final bool arrowFnBindThisWorkaround;
+ /// Which module format to support.
+ /// Currently 'es6' and 'dart' are supported.
+ final String moduleFormat;
+
const CodegenOptions(
{this.emitSourceMaps: true,
this.forceCompile: false,
this.closure: _CLOSURE_DEFAULT,
this.outputDir,
- this.arrowFnBindThisWorkaround: false});
+ this.arrowFnBindThisWorkaround: false,
+ this.moduleFormat: 'dart'});
}
/// Options for devrun.
@@ -227,7 +232,8 @@ CompilerOptions parseOptions(List<String> argv, {bool forceOutDir: false}) {
forceCompile: args['force-compile'] || serverMode,
closure: args['closure'],
outputDir: outputDir,
- arrowFnBindThisWorkaround: args['arrow-fn-bind-this']),
+ arrowFnBindThisWorkaround: args['arrow-fn-bind-this'],
+ moduleFormat: args['modules']),
sourceOptions: new SourceResolverOptions(
useMockSdk: args['mock-sdk'],
dartSdkPath: sdkPath,
@@ -292,6 +298,14 @@ final ArgParser argParser = new ArgParser()
help: 'Where to find dev_compiler\'s runtime files', defaultsTo: null)
..addFlag('arrow-fn-bind-this',
help: 'Work around `this` binding in => functions')
+ ..addOption('modules',
+ help: 'Which module pattern to emit',
+ allowed: ['es6', 'dart'],
+ allowedHelp: {
+ 'es6': 'es6 modules',
+ 'custom-dart': 'a custom format used by dartdevc, similar to AMD'
+ },
+ defaultsTo: 'dart')
// general options
..addFlag('help', abbr: 'h', help: 'Display this message')
« lib/src/js/nodes.dart ('K') | « lib/src/js/template.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698