Chromium Code Reviews| Index: pkg/compiler/lib/src/inferrer/simple_types_inferrer.dart |
| diff --git a/pkg/compiler/lib/src/inferrer/simple_types_inferrer.dart b/pkg/compiler/lib/src/inferrer/simple_types_inferrer.dart |
| index fccfb8042bee4f2fb745432b3d309880a72bc3d1..8f0f26b169853be4fbcac6fef2ff4efa52a5a480 100644 |
| --- a/pkg/compiler/lib/src/inferrer/simple_types_inferrer.dart |
| +++ b/pkg/compiler/lib/src/inferrer/simple_types_inferrer.dart |
| @@ -454,7 +454,8 @@ abstract class InferrerEngine<T, V extends TypeSystem> |
| bool isNativeElement(Element element) { |
| if (element.isNative) return true; |
| return element.isClassMember |
| - && element.enclosingClass.isNative |
| + && (element.enclosingClass.isNative |
| + || element.enclosingClass.isJsInterop) |
| && element.isField; |
| } |
| @@ -1610,6 +1611,9 @@ class SimpleTypeInferrerVisitor<T> |
| // we have to forward the call to the effective target of the |
| // factory. |
| if (element.isFactoryConstructor) { |
| + |
| + if (element.isJsInterop) return types.dynamicType; |
|
sra1
2015/10/01 20:55:27
Maybe explain why.
Jacob
2015/10/02 20:08:15
Hmm. I don't think this still made sense. Reverted
|
| + |
| // TODO(herhut): Remove the while loop once effectiveTarget forwards to |
| // patches. |
| while (element.isFactoryConstructor) { |
| @@ -1621,6 +1625,7 @@ class SimpleTypeInferrerVisitor<T> |
| if (compiler.backend.isForeign(element)) { |
| return handleForeignSend(node, element); |
| } |
| + |
| Selector selector = elements.getSelector(node); |
| TypeMask mask = elements.getTypeMask(node); |
| // In erroneous code the number of arguments in the selector might not |
| @@ -2094,7 +2099,9 @@ class SimpleTypeInferrerVisitor<T> |
| assert(!element.isFactoryConstructor || |
| !(element as ConstructorElement).isRedirectingFactory); |
| // Erroneous elements may be unresolved, for example missing getters. |
| + |
|
sra1
2015/10/01 20:55:27
Remove this empty line.
|
| if (Elements.isUnresolved(element)) return types.dynamicType; |
| + |
|
sra1
2015/10/01 20:55:27
You could keep this line or remove it so there is
Jacob
2015/10/02 20:08:15
Reverted accidental whitespace edits.
|
| // TODO(herhut): should we follow redirecting constructors here? We would |
| // need to pay attention if the constructor is pointing to an erroneous |
| // element. |
| @@ -2124,6 +2131,7 @@ class SimpleTypeInferrerVisitor<T> |
| ast.Node receiver = send.receiver; |
| if (receiver != null) { |
| Element element = elements[receiver]; |
| + |
|
sra1
2015/10/01 20:55:27
Remove added empty line
Jacob
2015/10/02 20:08:15
Done.
|
| if (Elements.isLocal(element) && !capturedVariables.contains(element)) { |
| T refinedType = types.refineReceiver( |
| selector, mask, receiverType, send.isConditional); |