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

Unified Diff: pkg/compiler/lib/src/inferrer/simple_types_inferrer.dart

Issue 1318043005: Support user generated custom native JS classes. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 3 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: 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..ac375a2bc2eaf23632e1bc8a07c59188ebbe63fe 100644
--- a/pkg/compiler/lib/src/inferrer/simple_types_inferrer.dart
+++ b/pkg/compiler/lib/src/inferrer/simple_types_inferrer.dart
@@ -452,9 +452,10 @@ abstract class InferrerEngine<T, V extends TypeSystem>
}
bool isNativeElement(Element element) {
- if (element.isNative) return true;
+ if (element.isNative || element.isJsInterop) return true;
return element.isClassMember
- && element.enclosingClass.isNative
+ && (element.enclosingClass.isNative
+ || element.enclosingClass.isJsInterop)
&& element.isField;
}
@@ -556,7 +557,7 @@ class SimpleTypeInferrerVisitor<T>
inferrer.setDefaultTypeOfParameter(element, type);
});
- if (analyzedElement.isNative) {
+ if (analyzedElement.isNative || analyzedElement.isJsInterop) {
// Native methods do not have a body, and we currently just say
// they return dynamic.
return types.dynamicType;

Powered by Google App Engine
This is Rietveld 408576698