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

Unified Diff: lib/src/compiler/code_generator.dart

Issue 1895903002: emit 'this.x' when 'super.x' accesses a field (Closed) Base URL: git@github.com:dart-lang/dev_compiler.git@master
Patch Set: Created 4 years, 8 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 | test/codegen/expect/language-all.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/src/compiler/code_generator.dart
diff --git a/lib/src/compiler/code_generator.dart b/lib/src/compiler/code_generator.dart
index ca56b1f7938fadaa362d2916ea0bc13415cc0d81..0f0b61950dbf10279ad862346fa8e4547c8ac764 100644
--- a/lib/src/compiler/code_generator.dart
+++ b/lib/src/compiler/code_generator.dart
@@ -3054,6 +3054,14 @@ class CodeGenerator extends GeneralizingAstVisitor
return js.call('dart.dload(#, #)', [_visit(target), name]);
}
+ if (target is SuperExpression &&
+ member is FieldElement &&
+ member.getter.isSynthetic) {
vsm 2016/04/18 20:27:43 Do we need this for setters as well?
Harry Terkelsen 2016/04/18 20:59:50 Doesn't synthetic getter imply synthetic setter? A
+ // If super.x is actually a field, then x is an instance property since
+ // subclasses cannot override x.
+ return js.call('this.#', [name]);
+ }
+
String code;
if (member != null && member is MethodElement && !isStatic) {
// Tear-off methods: explicitly bind it.
« no previous file with comments | « no previous file | test/codegen/expect/language-all.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698