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

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

Issue 2772573003: Handle casts from Number to FutureOr<double>. (Closed)
Patch Set: Formatting 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 unified diff | Download patch
« no previous file with comments | « pkg/dev_compiler/test/browser/runtime_tests.js ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 /// This library defines runtime operations on objects used by the code 5 /// This library defines runtime operations on objects used by the code
6 /// generator. 6 /// generator.
7 part of dart._runtime; 7 part of dart._runtime;
8 8
9 class InvocationImpl extends Invocation { 9 class InvocationImpl extends Invocation {
10 final Symbol memberName; 10 final Symbol memberName;
(...skipping 478 matching lines...) Expand 10 before | Expand all | Expand 10 after
489 /// Returns false if [obj] is not an instance of [type] in both spec 489 /// Returns false if [obj] is not an instance of [type] in both spec
490 /// and strong mode 490 /// and strong mode
491 /// Returns null if [obj] is not an instance of [type] in strong mode 491 /// Returns null if [obj] is not an instance of [type] in strong mode
492 /// but might be in spec mode 492 /// but might be in spec mode
493 bool strongInstanceOf(obj, type, ignoreFromWhiteList) => JS( 493 bool strongInstanceOf(obj, type, ignoreFromWhiteList) => JS(
494 '', 494 '',
495 '''(() => { 495 '''(() => {
496 let actual = $getReifiedType($obj); 496 let actual = $getReifiedType($obj);
497 let result = $isSubtype(actual, $type); 497 let result = $isSubtype(actual, $type);
498 if (result || actual == $jsobject || 498 if (result || actual == $jsobject ||
499 actual == $int && type == $double) return true; 499 (actual == $int && $isSubtype($double, $type))) return true;
500 if (result === false) return false; 500 if (result === false) return false;
501 if (!$_ignoreWhitelistedErrors || ($ignoreFromWhiteList == void 0)) return res ult; 501 if (!$_ignoreWhitelistedErrors || ($ignoreFromWhiteList == void 0)) return res ult;
502 if ($_ignoreTypeFailure(actual, $type)) return true; 502 if ($_ignoreTypeFailure(actual, $type)) return true;
503 return result; 503 return result;
504 })()'''); 504 })()''');
505 505
506 /// Returns true if [obj] is null or an instance of [type] 506 /// Returns true if [obj] is null or an instance of [type]
507 /// Returns false if [obj] is non-null and not an instance of [type] 507 /// Returns false if [obj] is non-null and not an instance of [type]
508 /// in strong mode 508 /// in strong mode
509 instanceOfOrNull(obj, type) => JS( 509 instanceOfOrNull(obj, type) => JS(
(...skipping 465 matching lines...) Expand 10 before | Expand all | Expand 10 after
975 name = '+' + name; 975 name = '+' + name;
976 } 976 }
977 return name; 977 return name;
978 } 978 }
979 979
980 /// Emulates the implicit "loadLibrary" function provided by a deferred library. 980 /// Emulates the implicit "loadLibrary" function provided by a deferred library.
981 /// 981 ///
982 /// Libraries are not actually deferred in DDC, so this just returns a future 982 /// Libraries are not actually deferred in DDC, so this just returns a future
983 /// that completes immediately. 983 /// that completes immediately.
984 Future loadLibrary() => new Future.value(); 984 Future loadLibrary() => new Future.value();
OLDNEW
« 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