Chromium Code Reviews| Index: lib/src/utils.dart |
| diff --git a/lib/src/utils.dart b/lib/src/utils.dart |
| index 86c579901fc43172837ae3d4cc41544b0f6a2d91..58989f874e64f2a64df8cbade30f525833d4b6ac 100644 |
| --- a/lib/src/utils.dart |
| +++ b/lib/src/utils.dart |
| @@ -26,7 +26,7 @@ import 'package:crypto/crypto.dart' show CryptoUtils, MD5; |
| import 'package:source_span/source_span.dart'; |
| import 'package:yaml/yaml.dart'; |
| -import 'js/keywords.dart'; |
| +import 'codegen/js_names.dart' show invalidJSVariableName; |
| bool isDartPrivateLibrary(LibraryElement library) { |
| var uri = library.source.uri; |
| @@ -62,9 +62,9 @@ String _toIdentifier(String name) { |
| } |
| var result = buffer != null ? '$buffer' : name; |
| - // Ensure the idenifier first character is not numeric and that the whole |
| + // Ensure the identifier first character is not numeric and that the whole |
| // identifier is not a keyword. |
|
Jacob
2015/03/27 21:18:25
tweak comment to
is a valid JS variable name
inst
|
| - if (result.startsWith(new RegExp('[0-9]')) || isJsKeyword(result)) { |
| + if (result.startsWith(new RegExp('[0-9]')) || invalidJSVariableName(result)) { |
| return '\$$result'; |
| } |
| return result; |