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

Unified Diff: lib/src/utils.dart

Issue 1034273003: fix for static methods and names banned in strict mode (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
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;

Powered by Google App Engine
This is Rietveld 408576698