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

Unified Diff: dart/sdk/lib/_internal/compiler/implementation/dart2js.dart

Issue 16135004: Rename JS_CURRENT_ISOLATE to JS_CURRENT_ISOLATE_CONTEXT. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 7 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
Index: dart/sdk/lib/_internal/compiler/implementation/dart2js.dart
diff --git a/dart/sdk/lib/_internal/compiler/implementation/dart2js.dart b/dart/sdk/lib/_internal/compiler/implementation/dart2js.dart
index 8d3c7da267dd827a5c2765fd143b337892ddbe12..b77b0b3348dd5cd48449ed5630e70a524d14a477 100644
--- a/dart/sdk/lib/_internal/compiler/implementation/dart2js.dart
+++ b/dart/sdk/lib/_internal/compiler/implementation/dart2js.dart
@@ -165,7 +165,15 @@ void compile(List<String> argv) {
}
}
}
- return passThrough('--categories=${categories.join(",")}');
+ passThrough('--categories=${categories.join(",")}');
+ }
+
+ checkGlobalName(String argument) {
+ String globalName = extractParameter(argument);
+ if (!new RegExp(r'^\$[a-z]*$').hasMatch(globalName)) {
+ fail('Error: "$globalName" must match "\\\$[a-z]*"');
ngeoffray 2013/05/28 20:01:54 Why? We could reserve the name in the namer.
ahe 2013/05/30 09:13:31 That wouldn't handle calling it "init", for exampl
+ }
+ passThrough(argument);
}
handleShortOptions(String argument) {
@@ -224,6 +232,7 @@ void compile(List<String> argv) {
new OptionHandler('--report-sdk-use-of-deprecated-language-features',
passThrough),
new OptionHandler('--categories=.*', setCategories),
+ new OptionHandler('--global-js-name=.*', checkGlobalName),
// The following two options must come last.
new OptionHandler('-.*', (String argument) {
@@ -395,7 +404,7 @@ Common options:
}
void verboseHelp() {
- print('''
+ print(r'''
Usage: dart2js [options] dartfile
Compiles Dart to JavaScript.
@@ -484,6 +493,11 @@ be removed in a future version:
unsupported category, for example, --categories=help. To enable
all categories, use --categories=all.
+ --global-js-name=<name>
+ By default, dart2js generates JavaScript output that uses a global
+ variable named "$". The name of this global can be overridden
+ with this option. The name must match the regular expression "\$[a-z]*".
+
'''.trim());
}

Powered by Google App Engine
This is Rietveld 408576698