Chromium Code Reviews| Index: sdk/lib/_internal/compiler/implementation/ssa/optimize.dart |
| =================================================================== |
| --- sdk/lib/_internal/compiler/implementation/ssa/optimize.dart (revision 21439) |
| +++ sdk/lib/_internal/compiler/implementation/ssa/optimize.dart (working copy) |
| @@ -333,7 +333,11 @@ |
| Selector selector = receiverType.refine(node.selector, compiler); |
| Element element = compiler.world.locateSingleElement(selector); |
| // TODO(ngeoffray): Also fold if it's a getter or variable. |
| - if (element != null && element.isFunction()) { |
| + if (element != null |
| + && element.isFunction() |
| + // If we found out that the only target is a [:noSuchMethod:], |
| + // we just ignore it. |
| + && element.name != Compiler.NO_SUCH_METHOD) { |
|
sra1
2013/04/16 18:57:19
What if I explicitly call noSuchMethod?
ngeoffray
2013/04/17 09:11:18
I changed the check. Explicitly calling noSuchMeth
|
| FunctionElement method = element; |
| if (method.isNative()) { |