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

Unified Diff: sdk/lib/_internal/compiler/implementation/js_backend/minify_namer.dart

Issue 12049036: Cleanup the namer, and add a test with fields that used to clash with internal names used by the co… (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 11 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: sdk/lib/_internal/compiler/implementation/js_backend/minify_namer.dart
===================================================================
--- sdk/lib/_internal/compiler/implementation/js_backend/minify_namer.dart (revision 17447)
+++ sdk/lib/_internal/compiler/implementation/js_backend/minify_namer.dart (working copy)
@@ -21,7 +21,9 @@
// You can pass an invalid identifier to this and unlike its non-minifying
// counterpart it will never return the proposedName as the new fresh name.
- String getFreshName(String proposedName, Set<String> usedNames) {
+ String getFreshName(String proposedName,
+ Set<String> usedNames,
+ bool ensureSafe) {
var freshName = _getUnusedName(proposedName, usedNames);
usedNames.add(freshName);
return freshName;
@@ -35,7 +37,9 @@
}
void reserveBackendNames() {
- for (var name in JsNames.reservedNativeProperties) {
+ // TODO(sra): We need a complete list from the DOM.
+ const reservedNativeProperties = const <String>["x", "y", "z"];
+ for (var name in reservedNativeProperties) {
if (name.length < 3) {
instanceNameMap[name] = name;
}

Powered by Google App Engine
This is Rietveld 408576698