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 7def6be498043d7a006c81f2b43635c8999b6ab1..aeb4fb83d503180aa0b7cc191ed501e59e7bbde9 100644 |
--- a/pkg/compiler/lib/src/js_backend/backend.dart |
+++ b/pkg/compiler/lib/src/js_backend/backend.dart |
@@ -1642,6 +1642,18 @@ class JavaScriptBackend extends Backend { |
element == jsFixedArrayClass; |
} |
+ /// Return [true] if the class is represented by a native JavaSCript type in |
+ /// the generated code. |
+ bool isNativePrimitiveType(ClassElement cls ) { |
+ // TODO(karlklose): cleanup/merge with hasDirectCheck, when the rest of the |
+ // checks are implemented in the CPS IR. |
+ return cls == compiler.intClass || |
+ cls == compiler.numClass || |
+ cls == compiler.doubleClass || |
+ cls == compiler.boolClass || |
+ cls == compiler.stringClass; |
+ } |
+ |
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. |