Chromium Code Reviews| 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) { |