Index: pkg/compiler/lib/src/js_backend/backend.dart |
diff --git a/pkg/compiler/lib/src/js_backend/backend.dart b/pkg/compiler/lib/src/js_backend/backend.dart |
index 48544c30a2b70c18aa28b8c755fff358c8d5572e..969da6f98a40c5b03ee9977f297a73cea5c6af49 100644 |
--- a/pkg/compiler/lib/src/js_backend/backend.dart |
+++ b/pkg/compiler/lib/src/js_backend/backend.dart |
@@ -1470,6 +1470,16 @@ class JavaScriptBackend extends Backend { |
element == jsFixedArrayClass; |
} |
+ bool mayGenerateInstanceofCheck(DartType type) { |
+ // We can use an instanceof check for raw types that have no subclass that |
+ // is mixed-in or in an implements clause. |
+ |
+ if (!type.isRaw) return false; |
+ ClassElement classElement = type.element; |
+ if (isInterceptorClass(classElement)) return false; |
+ return compiler.world.hasOnlySubclasses(classElement); |
+ } |
+ |
Element getExceptionUnwrapper() { |
return findHelper('unwrapException'); |
} |