| 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,
|
|
|