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

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

Issue 2739863003: Add option to suppress type-check whitelisting (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 unified diff | Download patch
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 480 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 && type == $double) return true;
500 if (result === false) return false; 500 if (result === false) return false;
501 if ($ignoreFromWhiteList == void 0) return result; 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(
510 '', 510 '',
511 '''(() => { 511 '''(() => {
(...skipping 461 matching lines...) Expand 10 before | Expand all | Expand 10 after
973 name = '+' + name; 973 name = '+' + name;
974 } 974 }
975 return name; 975 return name;
976 } 976 }
977 977
978 /// Emulates the implicit "loadLibrary" function provided by a deferred library. 978 /// Emulates the implicit "loadLibrary" function provided by a deferred library.
979 /// 979 ///
980 /// Libraries are not actually deferred in DDC, so this just returns a future 980 /// Libraries are not actually deferred in DDC, so this just returns a future
981 /// that completes immediately. 981 /// that completes immediately.
982 Future loadLibrary() => new Future.value(); 982 Future loadLibrary() => new Future.value();
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698