| Index: lib/compiler/implementation/js_backend/namer.dart
|
| diff --git a/lib/compiler/implementation/js_backend/namer.dart b/lib/compiler/implementation/js_backend/namer.dart
|
| index 80518d3fa748eda142cbac1c9f7cde1f76fddff5..9c89e19d0a0ab8d103e2a21ea206b7b8b00264b1 100644
|
| --- a/lib/compiler/implementation/js_backend/namer.dart
|
| +++ b/lib/compiler/implementation/js_backend/namer.dart
|
| @@ -18,6 +18,12 @@ class Namer {
|
| return _jsReserved;
|
| }
|
|
|
| + /**
|
| + * Map from top-level or static elements to their unique identifiers provided
|
| + * by [getName].
|
| + *
|
| + * Invariant: Keys must be declaration elements.
|
| + */
|
| final Map<Element, String> globals;
|
| final Map<String, int> usedGlobals;
|
| final Map<String, LibraryElement> shortPrivateNameOwners;
|
| @@ -113,7 +119,7 @@ class Namer {
|
| } else {
|
| StringBuffer suffix = new StringBuffer();
|
| signature.forEachOptionalParameter((Element element) {
|
| - String jsName = JsNames.getValid(element.name.slowToString());
|
| + String jsName = JsNames.getValid(element.name.slowToString());
|
| suffix.add('\$$jsName');
|
| });
|
| return '$methodName$suffix';
|
| @@ -244,6 +250,9 @@ class Namer {
|
| node: element.parseNode(compiler));
|
| }
|
| } else {
|
| + // Use declaration element to ensure invariant on [globals].
|
| + element = element.declaration;
|
| +
|
| // Dealing with a top-level or static element.
|
| String cached = globals[element];
|
| if (cached !== null) return cached;
|
|
|