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

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

Issue 23477003: Getters and setters must also be added to the list of intercepted names, to make invocations throug… (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 4 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/mirror_intercepted_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
===================================================================
--- sdk/lib/_internal/compiler/implementation/js_backend/emitter.dart (revision 26686)
+++ sdk/lib/_internal/compiler/implementation/js_backend/emitter.dart (working copy)
@@ -1822,12 +1822,16 @@
// 01: function() { return this.field; }
// 10: function(receiver) { return receiver.field; }
// 11: function(receiver) { return this.field; }
- getterCode += backend.fieldHasInterceptedGetter(field) ? 2 : 0;
+ bool isIntercepted = backend.fieldHasInterceptedGetter(field);
+ getterCode += isIntercepted ? 2 : 0;
getterCode += backend.isInterceptorClass(element) ? 0 : 1;
// TODO(sra): 'isInterceptorClass' might not be the correct test
// for methods forced to use the interceptor convention because
// the method's class was elsewhere mixed-in to an interceptor.
assert(!field.isInstanceMember() || getterCode != 0);
+ if (isIntercepted) {
+ interceptorInvocationNames.add(namer.getterName(field));
+ }
} else {
getterCode = 1;
}
@@ -1838,9 +1842,13 @@
// 01: function(value) { this.field = value; }
// 10: function(receiver, value) { receiver.field = value; }
// 11: function(receiver, value) { this.field = value; }
- setterCode += backend.fieldHasInterceptedSetter(field) ? 2 : 0;
+ bool isIntercepted = backend.fieldHasInterceptedSetter(field);
+ setterCode += isIntercepted ? 2 : 0;
setterCode += backend.isInterceptorClass(element) ? 0 : 1;
assert(!field.isInstanceMember() || setterCode != 0);
+ if (isIntercepted) {
+ interceptorInvocationNames.add(namer.setterName(field));
+ }
} else {
setterCode = 1;
}
« no previous file with comments | « no previous file | tests/compiler/dart2js_native/mirror_intercepted_field_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698