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

Unified Diff: sdk/lib/_internal/compiler/implementation/js_emitter/class_emitter.dart

Issue 62373009: Field property naming fix - issues 14096, 14806 (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: code review changes Created 7 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
Index: sdk/lib/_internal/compiler/implementation/js_emitter/class_emitter.dart
diff --git a/sdk/lib/_internal/compiler/implementation/js_emitter/class_emitter.dart b/sdk/lib/_internal/compiler/implementation/js_emitter/class_emitter.dart
index 7035dce72ae65a87d3db91bdda4e4e6a7064ac09..8cc5e3a8e118632e1ef74656f15ecaf26c6aa5be 100644
--- a/sdk/lib/_internal/compiler/implementation/js_emitter/class_emitter.dart
+++ b/sdk/lib/_internal/compiler/implementation/js_emitter/class_emitter.dart
@@ -160,8 +160,6 @@ class ClassEmitter extends CodeEmitterHelper {
buffer.write(accessorName);
if (name != accessorName) {
buffer.write(':$name');
- // Only the native classes can have renaming accessors.
- assert(classIsNative);
}
int getterCode = 0;
@@ -423,26 +421,16 @@ class ClassEmitter extends CodeEmitterHelper {
// setters.
bool needsGetter = false;
bool needsSetter = false;
- // We need to name shadowed fields differently, so they don't clash with
- // the non-shadowed field.
- bool isShadowed = false;
if (isLibrary || isMixinNativeField || holder == element) {
needsGetter = fieldNeedsGetter(field);
needsSetter = fieldNeedsSetter(field);
- } else {
- ClassElement cls = element;
- isShadowed = cls.isShadowedByField(field);
}
if ((isInstantiated && !holder.isNative())
|| needsGetter
|| needsSetter) {
- String accessorName = isShadowed
- ? namer.shadowedFieldName(field)
- : namer.getNameOfField(field);
- String fieldName = field.hasFixedBackendName()
- ? field.fixedBackendName()
- : (isMixinNativeField ? name : accessorName);
+ String accessorName = namer.fieldAccessorName(field);
+ String fieldName = namer.fieldPropertyName(field);
bool needsCheckedSetter = false;
if (compiler.enableTypeAssertions
&& needsSetter

Powered by Google App Engine
This is Rietveld 408576698