Index: pkg/compiler/lib/src/js_backend/namer.dart |
diff --git a/pkg/compiler/lib/src/js_backend/namer.dart b/pkg/compiler/lib/src/js_backend/namer.dart |
index 78966e3d53a6377f8f0ba3dbbae4f16b52a515d3..768a0726f57d7103af5c9b87bd80c87e884f9c3d 100644 |
--- a/pkg/compiler/lib/src/js_backend/namer.dart |
+++ b/pkg/compiler/lib/src/js_backend/namer.dart |
@@ -785,9 +785,10 @@ class Namer { |
// However, as boxes are not really instances of classes, the usual naming |
// scheme that tries to avoid name clashes with super classes does not |
// apply. So we can directly grab a name. |
- if (element is JSEntity) { |
+ Entity asEntity = element; |
+ if (asEntity is JSEntity) { |
return _disambiguateInternalMember(element, |
- () => element.declaredEntity.name); |
+ () => asEntity.declaredEntity.name); |
} |
// If the name of the field might clash with another field, |
@@ -1012,8 +1013,9 @@ class Namer { |
if (newName == null) { |
String name = proposeName(); |
- if (element is PrivatelyNamedJSEntity) { |
- NamingScope scope = _getPrivateScopeFor(element); |
+ Entity asEntity = element; |
+ if (asEntity is PrivatelyNamedJSEntity) { |
+ NamingScope scope = _getPrivateScopeFor(asEntity); |
newName = getFreshName(scope, name, |
sanitizeForAnnotations: true, |
sanitizeForNatives: false); |