Index: pkg/compiler/lib/src/dart2js.dart |
diff --git a/pkg/compiler/lib/src/dart2js.dart b/pkg/compiler/lib/src/dart2js.dart |
index d034f3df1b4900d708641e003bad3c8e6500edde..4bf3baf3d3a0e5451cfd46e5230564b189ac1d81 100644 |
--- a/pkg/compiler/lib/src/dart2js.dart |
+++ b/pkg/compiler/lib/src/dart2js.dart |
@@ -115,6 +115,7 @@ Future compile(List<String> argv) { |
bool analyzeOnly = false; |
bool analyzeAll = false; |
bool enableAsyncAwait = false; |
+ bool allowNativeExtensions = false; |
bool trustTypeAnnotations = false; |
bool checkedMode = false; |
// List of provided options that imply that output is expected. |
@@ -195,6 +196,11 @@ Future compile(List<String> argv) { |
passThrough(argument); |
} |
+ setAllowNativeExtensions(String argument) { |
+ allowNativeExtensions = true; |
+ passThrough(argument); |
+ } |
+ |
setVerbose(_) { |
diagnosticHandler.verbose = true; |
passThrough('--verbose'); |
@@ -324,6 +330,7 @@ Future compile(List<String> argv) { |
new OptionHandler('--show-package-warnings', passThrough), |
new OptionHandler('--csp', passThrough), |
new OptionHandler('--enable-async', setEnableAsync), |
+ new OptionHandler('--allow-native-extensions', setAllowNativeExtensions), |
new OptionHandler('-D.+=.*', addInEnvironment), |
// The following two options must come last. |
@@ -384,9 +391,15 @@ Future compile(List<String> argv) { |
api.Diagnostic.INFO); |
} |
if (analyzeAll) analyzeOnly = true; |
- if (enableAsyncAwait && !analyzeOnly) { |
- helpAndFail("Option '--enable-async' is currently only supported in " |
- "combination with the '--analyze-only' option."); |
+ if (!analyzeOnly) { |
+ if (enableAsyncAwait) { |
+ helpAndFail("Option '--enable-async' is currently only supported in " |
+ "combination with the '--analyze-only' option."); |
+ } |
+ if (allowNativeExtensions) { |
+ helpAndFail("Option '--allow-native-extensions' is only supported in " |
+ "combination with the '--analyze-only' option."); |
+ } |
} |
diagnosticHandler.info('Package root is $packageRoot'); |