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

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
kasperl 2013/01/21 09:45:11 Maybe add ( ) around the == expression.
ngeoffray 2013/01/21 10:41:44 Done.
+ ? js.equals
+ : js.identity;
+ builder.addProperty(name, js.fun(['receiver', 'a'],
+ js.block1(js.return_(kind(js.use('receiver'), js.use('a'))))));
+ }
}
void emitRuntimeClassesAndTests(CodeBuffer buffer) {

Powered by Google App Engine
This is Rietveld 408576698