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

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

Issue 2835743002: add an option to turn off errors from strong mode is-checks (Closed)
Patch Set: fix comment Created 3 years, 8 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/tool/input_sdk/private/ddc_runtime/errors.dart ('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 462 matching lines...) Expand 10 before | Expand all | Expand 10 after
473 473
474 @JSExportName('is') 474 @JSExportName('is')
475 instanceOf(obj, type) => JS( 475 instanceOf(obj, type) => JS(
476 '', 476 '',
477 '''(() => { 477 '''(() => {
478 if ($obj == null) { 478 if ($obj == null) {
479 return $type == $Null || $_isTop($type); 479 return $type == $Null || $_isTop($type);
480 } 480 }
481 let result = $strongInstanceOf($obj, $type); 481 let result = $strongInstanceOf($obj, $type);
482 if (result !== null) return result; 482 if (result !== null) return result;
483 if (!$_failForWeakModeIsChecks) return false;
483 let actual = $getReifiedType($obj); 484 let actual = $getReifiedType($obj);
484 $throwStrongModeError('Strong mode is-check failure: ' + 485 $throwStrongModeError('Strong mode is-check failure: ' +
485 $typeName(actual) + ' does not soundly subtype ' + 486 $typeName(actual) + ' does not soundly subtype ' +
486 $typeName($type)); 487 $typeName($type));
487 })()'''); 488 })()''');
488 489
489 @JSExportName('as') 490 @JSExportName('as')
490 cast(obj, type) { 491 cast(obj, type) {
491 if (JS('bool', '# == #', type, dynamic) || obj == null) return obj; 492 if (JS('bool', '# == #', type, dynamic) || obj == null) return obj;
492 bool result = strongInstanceOf(obj, type, true); 493 bool result = strongInstanceOf(obj, type, true);
(...skipping 439 matching lines...) Expand 10 before | Expand all | Expand 10 after
932 name = '+' + name; 933 name = '+' + name;
933 } 934 }
934 return name; 935 return name;
935 } 936 }
936 937
937 /// Emulates the implicit "loadLibrary" function provided by a deferred library. 938 /// Emulates the implicit "loadLibrary" function provided by a deferred library.
938 /// 939 ///
939 /// Libraries are not actually deferred in DDC, so this just returns a future 940 /// Libraries are not actually deferred in DDC, so this just returns a future
940 /// that completes immediately. 941 /// that completes immediately.
941 Future loadLibrary() => new Future.value(); 942 Future loadLibrary() => new Future.value();
OLDNEW
« no previous file with comments | « pkg/dev_compiler/tool/input_sdk/private/ddc_runtime/errors.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698