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

Unified Diff: lib/src/codegen/js_names.dart

Issue 1328303002: fix implicit_scope_test and builtin_identifier_test (Closed) Base URL: git@github.com:dart-lang/dev_compiler.git@master
Patch Set: format Created 5 years, 3 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/codegen/js_codegen.dart ('k') | lib/src/js/nodes.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/src/codegen/js_names.dart
diff --git a/lib/src/codegen/js_names.dart b/lib/src/codegen/js_names.dart
index 68cd40ec72f7abfb025be8f618fc30836d736dbf..956b814fc54e73c0699c45e9791b58eadfebd7c1 100644
--- a/lib/src/codegen/js_names.dart
+++ b/lib/src/codegen/js_names.dart
@@ -228,6 +228,9 @@ Object /*String|TemporaryId*/ identifierKey(Identifier node) =>
/// Also handles invalid variable names in strict mode, like "arguments".
bool invalidVariableName(String keyword, {bool strictMode: true}) {
switch (keyword) {
+ // http://www.ecma-international.org/ecma-262/6.0/#sec-future-reserved-words
+ case "await":
+
case "break":
case "case":
case "catch":
@@ -239,6 +242,7 @@ bool invalidVariableName(String keyword, {bool strictMode: true}) {
case "delete":
case "do":
case "else":
+ case "enum":
case "export":
case "extends":
case "finally":
@@ -248,11 +252,9 @@ bool invalidVariableName(String keyword, {bool strictMode: true}) {
case "import":
case "in":
case "instanceof":
- case "interface":
case "let":
case "new":
case "return":
- case "static":
case "super":
case "switch":
case "this":
@@ -263,10 +265,20 @@ bool invalidVariableName(String keyword, {bool strictMode: true}) {
case "void":
case "while":
case "with":
- case "yield":
return true;
case "arguments":
case "eval":
+ // http://www.ecma-international.org/ecma-262/6.0/#sec-future-reserved-words
+ // http://www.ecma-international.org/ecma-262/6.0/#sec-identifiers-static-semantics-early-errors
+ case "implements":
+ case "interface":
+ case "let":
+ case "package":
+ case "private":
+ case "protected":
+ case "public":
+ case "static":
+ case "yield":
return strictMode;
}
return false;
« no previous file with comments | « lib/src/codegen/js_codegen.dart ('k') | lib/src/js/nodes.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698