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

Unified Diff: pkg/compiler/lib/src/js_backend/field_naming_mixin.dart

Issue 1428853004: Use better names for captured variables in closures. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Address comments Created 5 years, 1 month 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
« no previous file with comments | « pkg/compiler/lib/src/closure.dart ('k') | pkg/compiler/lib/src/js_backend/frequency_namer.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/js_backend/field_naming_mixin.dart
diff --git a/pkg/compiler/lib/src/js_backend/field_naming_mixin.dart b/pkg/compiler/lib/src/js_backend/field_naming_mixin.dart
index 70d597ef6bd21b18c982608b5eb1fc62019035f3..0a89b42c528461f7a019af081a0d18eec51064c4 100644
--- a/pkg/compiler/lib/src/js_backend/field_naming_mixin.dart
+++ b/pkg/compiler/lib/src/js_backend/field_naming_mixin.dart
@@ -22,9 +22,7 @@ abstract class _MinifiedFieldNamer implements Namer {
if (element is BoxFieldElement) {
names = new _FieldNamingScope.forBox(element.box, fieldRegistry);
} else {
- ClassElement cls = element is ClosureFieldElement
- ? element.closureClass
- : element.enclosingClass;
+ ClassElement cls = element.enclosingClass;
names =
new _FieldNamingScope.forClass(cls, compiler.world, fieldRegistry);
}
@@ -77,7 +75,7 @@ class _FieldNamingRegistry {
nameStore.add(
new StringBackedName(MinifyNamer._reservedNativeProperties[index]));
} else {
- nameStore.add(namer.getFreshName(NamingScope.instance, "field$index"));
+ nameStore.add(namer.getFreshName(namer.instanceScope, "field$index"));
}
}
« no previous file with comments | « pkg/compiler/lib/src/closure.dart ('k') | pkg/compiler/lib/src/js_backend/frequency_namer.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698