Chromium Code Reviews| Index: pkg/compiler/lib/src/compiler.dart |
| diff --git a/pkg/compiler/lib/src/compiler.dart b/pkg/compiler/lib/src/compiler.dart |
| index c26087dc10523cce49a3b4959a4d68b82c995ee3..6d65c50cd9960ada7fd49a5284d66dc71a783b2f 100644 |
| --- a/pkg/compiler/lib/src/compiler.dart |
| +++ b/pkg/compiler/lib/src/compiler.dart |
| @@ -362,10 +362,20 @@ abstract class Backend { |
| void registerRuntimeType(Enqueuer enqueuer, Registry registry) {} |
| /** |
| + * Call this to register a `noSuchMethod` implementation. |
| + */ |
| + void registerNoSuchMethod(Element noSuchMethodElement, Enqueuer enqueuer) { |
|
Johnni Winther
2015/03/16 14:20:43
Leave the default implementation empty. Only the J
Harry Terkelsen
2015/03/17 21:43:11
Done.
|
| + if (compiler.enabledNoSuchMethod) return; |
| + if (isDefaultNoSuchMethodImplementation(noSuchMethodElement)) return; |
| + enableNoSuchMethod(enqueuer); |
| + compiler.enabledNoSuchMethod = true; |
|
floitsch
2015/03/13 15:51:49
I would have expected this to be in `enableNoSuchM
Johnni Winther
2015/03/16 14:20:43
Add a TODO on Compiler.enabledNoSuchMethod to move
Harry Terkelsen
2015/03/17 21:43:11
It is just a flag that says if noSuchMethod suppor
Harry Terkelsen
2015/03/17 21:43:11
I just moved it
|
| + } |
| + |
| + /** |
| * Call this method to enable [noSuchMethod] handling in the |
| * backend. |
| */ |
| - void enableNoSuchMethod(Element context, Enqueuer enqueuer) { |
| + void enableNoSuchMethod(Enqueuer enqueuer) { |
|
floitsch
2015/03/13 15:51:49
Can we remove this method? (or make it private)
Harry Terkelsen
2015/03/17 21:43:11
Done.
|
| enqueuer.registerInvocation(compiler.noSuchMethodSelector); |
| } |
| @@ -1627,7 +1637,7 @@ abstract class Compiler implements DiagnosticListener { |
| backend.enableIsolateSupport(enqueuer.codegen); |
| } |
| if (enabledNoSuchMethod) { |
| - backend.enableNoSuchMethod(null, enqueuer.codegen); |
| + backend.enableNoSuchMethod(enqueuer.codegen); |
| } |
| if (compileAll) { |
| libraryLoader.libraries.forEach((LibraryElement library) { |