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

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

Issue 12042003: Move relational operators to the new interceptors. (Closed) Base URL: http://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
Index: sdk/lib/_internal/compiler/implementation/js_backend/emitter.dart
===================================================================
--- sdk/lib/_internal/compiler/implementation/js_backend/emitter.dart (revision 17334)
+++ sdk/lib/_internal/compiler/implementation/js_backend/emitter.dart (working copy)
@@ -765,6 +765,22 @@
emitNoSuchMethodHandlers(builder.addProperty);
}
}
+
+ if (backend.isInterceptorClass(classElement)) {
+ // The operator== method in [:Object:] does not take the same
+ // number of arguments as an intercepted method, therefore we
+ // explicitely add one to all interceptor classes. Note that we
+ // would not have do do that if all intercepted methods had
+ // a calling convention where the receiver is the first
+ // parameter.
+ String name = backend.namer.publicInstanceMethodNameByArity(
+ const SourceString('=='), 1);
+ Function kind = (classElement == backend.jsNullClass)
+ ? js.equals
+ : js.strictEquals;
+ builder.addProperty(name, js.fun(['receiver', 'a'],
+ js.block1(js.return_(kind(js.use('receiver'), js.use('a'))))));
+ }
}
void emitRuntimeClassesAndTests(CodeBuffer buffer) {
« no previous file with comments | « sdk/lib/_internal/compiler/implementation/js/nodes.dart ('k') | sdk/lib/_internal/compiler/implementation/lib/js_helper.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698