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

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

Issue 1967743005: remove canonicalType (Closed) Base URL: git@github.com:dart-lang/dev_compiler.git@master
Patch Set: Created 4 years, 7 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 | « lib/runtime/dart_sdk.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tool/input_sdk/private/ddc_runtime/types.dart
diff --git a/tool/input_sdk/private/ddc_runtime/types.dart b/tool/input_sdk/private/ddc_runtime/types.dart
index 4370dd09714a19cce007cd322a913e68d922327d..9d137718b0735eb55d3d6a22a95b18300f6e0cf8 100644
--- a/tool/input_sdk/private/ddc_runtime/types.dart
+++ b/tool/input_sdk/private/ddc_runtime/types.dart
@@ -427,24 +427,6 @@ isFunctionSubtype(ft1, ft2, covariant) => JS('', '''(() => {
return true;
})()''');
-///
-/// Computes the canonical type.
-/// This maps JS types onto their corresponding Dart Type.
-///
-// TODO(jmesserly): lots more needs to be done here.
-canonicalType(t) => JS('', '''(() => {
- if (t === Object) return Object;
- if (t === Function) return Function;
- if (t === Array) return List;
-
- // We shouldn't normally get here with these types, unless something strange
- // happens like subclassing Number in JS and passing it to Dart.
- if (t === String) return String;
- if (t === Number) return double;
- if (t === Boolean) return bool;
- return t;
-})()''');
-
/// TODO(leafp): This duplicates code in operations.dart.
/// I haven't found a way to factor it out that makes the
/// code generator happy though.
@@ -477,8 +459,6 @@ _isBottom(type) => JS('bool', '# == #', type, bottom);
_isTop(type) => JS('bool', '# == # || # == #', type, Object, type, dynamic);
_isSubtype(t1, t2, covariant) => JS('', '''(() => {
- $t1 = $canonicalType($t1);
- $t2 = $canonicalType($t2);
if ($t1 === $t2) return true;
// Trivially true.
@@ -521,8 +501,6 @@ isClassSubType(t1, t2, covariant) => JS('', '''(() => {
// I.e., given T1, ..., Tn where at least one Ti != dynamic we disallow:
// - S !<: S<T1, ..., Tn>
// - S<dynamic, ..., dynamic> !<: S<T1, ..., Tn>
- $t1 = $canonicalType($t1);
- $assert_($t2 == $canonicalType($t2));
if ($t1 == $t2) return true;
if ($t1 == $Object) return false;
« no previous file with comments | « lib/runtime/dart_sdk.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698