Index: sdk/lib/_internal/compiler/implementation/js_backend/backend.dart |
diff --git a/sdk/lib/_internal/compiler/implementation/js_backend/backend.dart b/sdk/lib/_internal/compiler/implementation/js_backend/backend.dart |
index c31113de53bb4600a9955e0cd5d7b412ed4d107a..1e6c8364068dbc4ae3590ae3498eed470327d2b8 100644 |
--- a/sdk/lib/_internal/compiler/implementation/js_backend/backend.dart |
+++ b/sdk/lib/_internal/compiler/implementation/js_backend/backend.dart |
@@ -1103,7 +1103,11 @@ class JavaScriptBackend extends Backend { |
Element element = type.element; |
bool nativeCheck = |
emitter.nativeEmitter.requiresNativeIsCheck(element); |
- if (type == compiler.types.voidType) { |
+ if (type.isMalformed) { |
+ // Check for malformed types first, because the type may be a list type |
+ // with a malformed argument type. |
+ return const SourceString('malformedTypeCheck'); |
+ } else if (type == compiler.types.voidType) { |
return const SourceString('voidTypeCheck'); |
} else if (element == compiler.stringClass) { |
return const SourceString('stringTypeCheck'); |
@@ -1127,8 +1131,6 @@ class JavaScriptBackend extends Backend { |
: const SourceString('stringSuperTypeCheck'); |
} else if (identical(element, compiler.listClass)) { |
return const SourceString('listTypeCheck'); |
- } else if (type.isMalformed) { |
- return const SourceString('malformedTypeCheck'); |
} else { |
if (Elements.isListSupertype(element, compiler)) { |
return nativeCheck |