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

Unified Diff: lib/src/js/printer.dart

Issue 998043002: Fixes in codegen and test script (Closed) Base URL: git@github.com:dart-lang/dev_compiler.git@master
Patch Set: Created 5 years, 9 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/keywords.dart ('k') | lib/src/utils.dart » ('j') | test/test.sh » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/src/js/printer.dart
diff --git a/lib/src/js/printer.dart b/lib/src/js/printer.dart
index 5ac0780e0ee07f7d221a7d538a2907805da9edb1..1ee33043bfec4629b53a9df6dde7343b59537d7f 100644
--- a/lib/src/js/printer.dart
+++ b/lib/src/js/printer.dart
@@ -812,7 +812,7 @@ class Printer implements NodeVisitor {
}
if (options.avoidKeywordsInIdentifiers) {
- return !_isJsKeyword(field.substring(1, field.length - 1));
+ return !isJsKeyword(field.substring(1, field.length - 1));
} else {
// TODO(floitsch): normally we should also check that the field is not a
// reserved word. We don't generate fields with reserved word names except
@@ -821,48 +821,6 @@ class Printer implements NodeVisitor {
}
}
- static bool _isJsKeyword(String keyword) {
- switch (keyword) {
- case "break":
- case "case":
- case "catch":
- case "class":
- case "const":
- case "continue":
- case "debugger":
- case "default":
- case "delete":
- case "do":
- case "else":
- case "export":
- case "extends":
- case "finally":
- case "for":
- case "function":
- case "if":
- case "import":
- case "in":
- case "instanceof":
- case "let":
- case "new":
- case "return":
- case "static":
- case "super":
- case "switch":
- case "this":
- case "throw":
- case "try":
- case "typeof":
- case "var":
- case "void":
- case "while":
- case "with":
- case "yield":
- return true;
- }
- return false;
- }
-
visitAccess(PropertyAccess access) {
visitNestedExpression(access.receiver, CALL,
newInForInit: inForInit,
« no previous file with comments | « lib/src/js/keywords.dart ('k') | lib/src/utils.dart » ('j') | test/test.sh » ('J')

Powered by Google App Engine
This is Rietveld 408576698