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

Unified Diff: lib/runtime/dart_sdk.js

Side-by-side diff isn't available for this file because of its large size.
Issue 1958683002: Fix void subtype checks. (Closed) Base URL: git@github.com:dart-lang/dev_compiler.git@master
Patch Set: Created 4 years, 7 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:
Download patch
« no previous file with comments | « no previous file | test/browser/runtime_tests.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/runtime/dart_sdk.js
diff --git a/lib/runtime/dart_sdk.js b/lib/runtime/dart_sdk.js
index f7e60d0c91b0a2fbeafa5ba1a858d8e0c8d5e2eb..13ef971a992a8781867b40703f42c752ac9d4ac1 100644
--- a/lib/runtime/dart_sdk.js
+++ b/lib/runtime/dart_sdk.js
@@ -1072,13 +1072,9 @@ dart_library.library('dart_sdk', null, /* Imports */[
return null;
}
}
- let result = dart.isSubtype_(ret1, ret2, covariant);
- if (result === null) return result;
- if (!result) {
- if (ret2 !== dart.void) {
- return null;
- }
- }
+ if (ret2 === dart.void) return true;
+ if (ret1 === dart.void) return ret2 === dart.dynamic;
+ if (!dart.isSubtype_(ret1, ret2, covariant)) return null;
return true;
};
dart.canonicalType = function(t) {
« no previous file with comments | « no previous file | test/browser/runtime_tests.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698