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

Unified Diff: sdk/lib/_internal/compiler/implementation/js_backend/emitter.dart

Issue 12082025: Fix minified version of mixin field test. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 11 months 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 | « no previous file | tests/compiler/dart2js_native/native_field_name_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/_internal/compiler/implementation/js_backend/emitter.dart
diff --git a/sdk/lib/_internal/compiler/implementation/js_backend/emitter.dart b/sdk/lib/_internal/compiler/implementation/js_backend/emitter.dart
index 424fdbce391821320c8fd1b6b8aa8ea23117d95e..8c5e86df52a70a231f270a03f42bbe5450cc540a 100644
--- a/sdk/lib/_internal/compiler/implementation/js_backend/emitter.dart
+++ b/sdk/lib/_internal/compiler/implementation/js_backend/emitter.dart
@@ -885,12 +885,10 @@ $lazyInitializerLogic
SourceString name = member.name;
bool isPrivate = name.isPrivate();
- // If we're dealing with a native class and we've found the
- // field in an applied mixin, we treat it as if we've found the
- // field in the class itself.
- if (classElement.isNative() && enclosingClass.isMixinApplication) {
- enclosingClass = classElement;
- }
+ // Keep track of whether or not we're dealing with a field mixin
+ // into a native class.
+ bool isMixinNativeField =
+ classElement.isNative() && enclosingClass.isMixinApplication;
// See if we can dynamically create getters and setters.
// We can only generate getters and setters for [classElement] since
@@ -901,7 +899,7 @@ $lazyInitializerLogic
// We need to name shadowed fields differently, so they don't clash with
// the non-shadowed field.
bool isShadowed = false;
- if (identical(enclosingClass, classElement)) {
+ if (isMixinNativeField || identical(enclosingClass, classElement)) {
needsGetter = instanceFieldNeedsGetter(member);
needsSetter = instanceFieldNeedsSetter(member);
} else {
@@ -916,7 +914,7 @@ $lazyInitializerLogic
: namer.getName(member);
String fieldName = member.hasFixedBackendName()
? member.fixedBackendName()
- : accessorName;
+ : (isMixinNativeField ? member.name.slowToString() : accessorName);
bool needsCheckedSetter = false;
if (needsSetter && compiler.enableTypeAssertions
&& canGenerateCheckedSetter(member)) {
« no previous file with comments | « no previous file | tests/compiler/dart2js_native/native_field_name_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698