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

Unified Diff: pkg/dev_compiler/tool/input_sdk/private/ddc_runtime/operations.dart

Issue 2772573003: Handle casts from Number to FutureOr<double>. (Closed)
Patch Set: Created 3 years, 9 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 | « pkg/dev_compiler/test/browser/runtime_tests.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/dev_compiler/tool/input_sdk/private/ddc_runtime/operations.dart
diff --git a/pkg/dev_compiler/tool/input_sdk/private/ddc_runtime/operations.dart b/pkg/dev_compiler/tool/input_sdk/private/ddc_runtime/operations.dart
index 20001cef3e56793e142b78209742336743dc07ec..c32826e4a6eff631fc14ce0e46b53d7cdb3cac91 100644
--- a/pkg/dev_compiler/tool/input_sdk/private/ddc_runtime/operations.dart
+++ b/pkg/dev_compiler/tool/input_sdk/private/ddc_runtime/operations.dart
@@ -496,7 +496,11 @@ bool strongInstanceOf(obj, type, ignoreFromWhiteList) => JS(
let actual = $getReifiedType($obj);
let result = $isSubtype(actual, $type);
if (result || actual == $jsobject ||
- actual == $int && type == $double) return true;
+ actual == $int && type == $double ||
+ (actual == $int && $_isFutureOr(type)
vsm 2017/03/23 19:37:44 Can type be FutureOr<FutureOr<T>> ? Would somethi
Leaf 2017/03/23 20:27:31 Good idea, done.
+ && $getGenericArgs(type)[0] == $double)) {
+ return true;
+ }
if (result === false) return false;
if (!$_ignoreWhitelistedErrors || ($ignoreFromWhiteList == void 0)) return result;
if ($_ignoreTypeFailure(actual, $type)) return true;
« no previous file with comments | « pkg/dev_compiler/test/browser/runtime_tests.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698