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

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

Issue 1879373004: Implement modular compilation (Closed) Base URL: git@github.com:dart-lang/dev_compiler.git@master
Patch Set: Created 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tool/input_sdk/private/ddc_runtime/classes.dart ('k') | tool/input_sdk/private/ddc_runtime/rtti.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tool/input_sdk/private/ddc_runtime/operations.dart
diff --git a/tool/input_sdk/private/ddc_runtime/operations.dart b/tool/input_sdk/private/ddc_runtime/operations.dart
index 56308aebf2b35f354f20db5d56f4b2fcdab4438a..6c4e7400b3a4c88a397d372d0d392be8b9d08f94 100644
--- a/tool/input_sdk/private/ddc_runtime/operations.dart
+++ b/tool/input_sdk/private/ddc_runtime/operations.dart
@@ -152,13 +152,13 @@ _ignoreTypeFailure(actual, type) => JS('', '''(() => {
// TODO(vsm): Remove this hack ...
// This is primarily due to the lack of generic methods,
// but we need to triage all the types.
- if (isSubtype($type, $Iterable) && isSubtype($actual, $Iterable) ||
- isSubtype($type, $Future) && isSubtype($actual, $Future) ||
- isSubtype($type, $Map) && isSubtype($actual, $Map) ||
- isSubtype($type, $Function) && isSubtype($actual, $Function) ||
- isSubtype($type, $Stream) && isSubtype($actual, $Stream) ||
- isSubtype($type, $StreamSubscription) &&
- isSubtype($actual, $StreamSubscription)) {
+ if ($isSubtype($type, $Iterable) && $isSubtype($actual, $Iterable) ||
+ $isSubtype($type, $Future) && $isSubtype($actual, $Future) ||
+ $isSubtype($type, $Map) && $isSubtype($actual, $Map) ||
+ $isSubtype($type, $Function) && $isSubtype($actual, $Function) ||
+ $isSubtype($type, $Stream) && $isSubtype($actual, $Stream) ||
+ $isSubtype($type, $StreamSubscription) &&
+ $isSubtype($actual, $StreamSubscription)) {
console.warn('Ignoring cast fail from ' + $typeName($actual) +
' to ' + $typeName($type));
return true;
@@ -181,6 +181,7 @@ instanceOfOrNull(obj, type) => JS('', '''(() => {
return false;
})()''');
+@JSExportName('is')
instanceOf(obj, type) => JS('', '''(() => {
if ($strongInstanceOf($obj, $type)) return true;
// TODO(#296): This is perhaps too eager to throw a StrongModeError?
@@ -194,6 +195,7 @@ instanceOf(obj, type) => JS('', '''(() => {
$typeName($type));
})()''');
+@JSExportName('as')
cast(obj, type) => JS('', '''(() => {
// TODO(#296): This is perhaps too eager to throw a StrongModeError?
// TODO(vsm): handle non-nullable types
« no previous file with comments | « tool/input_sdk/private/ddc_runtime/classes.dart ('k') | tool/input_sdk/private/ddc_runtime/rtti.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698