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

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

Issue 1944483002: Redo how Type objects are exposed from DDC. (Closed) Base URL: https://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
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 6c4e7400b3a4c88a397d372d0d392be8b9d08f94..269181d786c50a912a3502f5241a29a0ad39b7fe 100644
--- a/tool/input_sdk/private/ddc_runtime/operations.dart
+++ b/tool/input_sdk/private/ddc_runtime/operations.dart
@@ -167,7 +167,7 @@ _ignoreTypeFailure(actual, type) => JS('', '''(() => {
})()''');
strongInstanceOf(obj, type, ignoreFromWhiteList) => JS('', '''(() => {
- let actual = $realRuntimeType($obj);
+ let actual = $getReifiedType($obj);
if ($isSubtype(actual, $type) || actual == $jsobject ||
actual == $int && type == $double) return true;
if ($ignoreFromWhiteList == void 0) return false;
@@ -189,7 +189,7 @@ instanceOf(obj, type) => JS('', '''(() => {
// TODO(vsm): We can statically detect many cases where this
// check is unnecessary.
if ($isGroundType($type)) return false;
- let actual = $realRuntimeType($obj);
+ let actual = $getReifiedType($obj);
$throwStrongModeError('Strong mode is check failure: ' +
$typeName(actual) + ' does not soundly subtype ' +
$typeName($type));
@@ -200,7 +200,7 @@ cast(obj, type) => JS('', '''(() => {
// TODO(#296): This is perhaps too eager to throw a StrongModeError?
// TODO(vsm): handle non-nullable types
if ($instanceOfOrNull($obj, $type)) return $obj;
- let actual = $realRuntimeType($obj);
+ let actual = $getReifiedType($obj);
if ($isGroundType($type)) $throwCastError(actual, $type);
if ($_ignoreTypeFailure(actual, $type)) return $obj;
@@ -215,7 +215,7 @@ asInt(obj) => JS('', '''(() => {
}
if (Math.floor($obj) != $obj) {
// Note: null will also be caught by this check
- $throwCastError($realRuntimeType($obj), $int);
+ $throwCastError($getReifiedType($obj), $int);
}
return $obj;
})()''');
@@ -362,7 +362,7 @@ final constants = JS('', 'new Map()');
///
@JSExportName('const')
const_(obj) => JS('', '''(() => {
- let objectKey = [$realRuntimeType($obj)];
+ let objectKey = [$getReifiedType($obj)];
// TODO(jmesserly): there's no guarantee in JS that names/symbols are
// returned in the same order.
//

Powered by Google App Engine
This is Rietveld 408576698