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

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

Issue 12079022: Add test for native mixin fields and fix the implementation. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Fix comment. 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_mixin_field_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 44577dc9e2afd94aebf9475424d8e55da806b078..424fdbce391821320c8fd1b6b8aa8ea23117d95e 100644
--- a/sdk/lib/_internal/compiler/implementation/js_backend/emitter.dart
+++ b/sdk/lib/_internal/compiler/implementation/js_backend/emitter.dart
@@ -881,10 +881,17 @@ $lazyInitializerLogic
void visitField(ClassElement enclosingClass, Element member) {
assert(invariant(classElement, member.isDeclaration));
-
LibraryElement library = member.getLibrary();
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;
+ }
+
// See if we can dynamically create getters and setters.
// We can only generate getters and setters for [classElement] since
// the fields of super classes could be overwritten with getters or
« no previous file with comments | « no previous file | tests/compiler/dart2js_native/native_mixin_field_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698