Chromium Code Reviews| Index: sdk/lib/_internal/compiler/implementation/js_backend/minify_namer.dart |
| diff --git a/sdk/lib/_internal/compiler/implementation/js_backend/minify_namer.dart b/sdk/lib/_internal/compiler/implementation/js_backend/minify_namer.dart |
| index 5d176c1530b5a60ed06675f8fbcf9d57c45e400a..9a512d8adb7026f26cf1568dad12d547203d92ca 100644 |
| --- a/sdk/lib/_internal/compiler/implementation/js_backend/minify_namer.dart |
| +++ b/sdk/lib/_internal/compiler/implementation/js_backend/minify_namer.dart |
| @@ -8,7 +8,9 @@ part of js_backend; |
| * Assigns JavaScript identifiers to Dart variables, class-names and members. |
| */ |
| class MinifyNamer extends Namer { |
| - MinifyNamer(Compiler compiler) : super(compiler); |
| + MinifyNamer(Compiler compiler) : super(compiler) { |
| + reserveBackendNames(); |
| + } |
| String get isolateName => 'I'; |
| String get isolatePropertiesName => 'p'; |
| @@ -32,6 +34,15 @@ class MinifyNamer extends Namer { |
| return new SourceString("${getMappedInstanceName('closure')}_$id"); |
| } |
| + void reserveBackendNames() { |
| + for (var name in JsNames.reservedNativeProperties) { |
| + if (name.length < 3) { |
|
ngeoffray
2012/12/18 12:34:03
What does this mean? Why 3?
|
| + instanceNameMap[name] = name; |
| + } |
| + usedInstanceNames.add(name); |
| + } |
| + } |
| + |
| // This gets a minified name based on a hash of the proposed name. This |
| // is slightly less efficient than just getting the next name in a series, |
| // but it means that small changes in the input program will give smallish |