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

Unified Diff: lib/src/options.dart

Issue 1263593003: restore arrow function bind this workaround (Closed) Base URL: git@github.com:dart-lang/dev_compiler.git@master
Patch Set: Created 5 years, 5 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/js/printer.dart ('k') | tool/build_sdk.sh » ('j') | 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 5642296befec5b1f5cf1d38987e11f7110d020e0..e919ed0dada51c3b4e82e11354c1327c9e4e34c8 100644
--- a/lib/src/options.dart
+++ b/lib/src/options.dart
@@ -60,8 +60,12 @@ class CodegenOptions {
/// Output directory for generated code.
final String outputDir;
- const CodegenOptions(
- {this.emitSourceMaps: true, this.forceCompile: false, this.outputDir});
+ /// Whether to emit a workaround for missing arrow function bind-this in
+ /// other V8 builds
+ final bool arrowFnBindThisWorkaround;
+
+ const CodegenOptions({this.emitSourceMaps: true, this.forceCompile: false,
+ this.outputDir, this.arrowFnBindThisWorkaround: false});
}
/// General options used by the dev compiler and server.
@@ -175,7 +179,8 @@ CompilerOptions parseOptions(List<String> argv) {
codegenOptions: new CodegenOptions(
emitSourceMaps: args['source-maps'],
forceCompile: args['force-compile'] || serverMode,
- outputDir: outputDir),
+ outputDir: outputDir,
+ arrowFnBindThisWorkaround: args['arrow-fn-bind-this']),
sourceOptions: new SourceResolverOptions(
useMockSdk: args['mock-sdk'],
dartSdkPath: sdkPath,
@@ -237,6 +242,8 @@ final ArgParser argParser = StrongModeOptions.addArguments(new ArgParser()
help: 'Whether to emit source map files', defaultsTo: true)
..addOption('runtime-dir',
help: 'Where to find dev_compiler\'s runtime files', defaultsTo: null)
+ ..addFlag('arrow-fn-bind-this',
+ help: 'Work around `this` binding in => functions')
// general options
..addFlag('help', abbr: 'h', help: 'Display this message')
« no previous file with comments | « lib/src/js/printer.dart ('k') | tool/build_sdk.sh » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698