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

Unified Diff: sdk/lib/_internal/compiler/implementation/js_backend/backend.dart

Issue 12047040: Return correct helper for malformed type checks. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Add a comment. Created 7 years, 11 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698