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

Unified Diff: pkg/compiler/lib/src/dart2js.dart

Issue 745533002: Support native extensions for analysis and docgen. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 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
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');

Powered by Google App Engine
This is Rietveld 408576698