Skip to content

Commit d9298be

Browse files
committed
Treat our type objects as core.Type and other minor fixes
[email protected] Review URL: https://codereview.chromium.org/1099703003
1 parent 56c75ff commit d9298be

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

pkg/dev_compiler/lib/runtime/dart_runtime.js

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ var dart, _js_helper, _js_primitives;
6161
// Grab the `call` method if it's not a function.
6262
if (f !== null) f = f.call;
6363
if (!(f instanceof Function)) {
64-
throwNoSuchMethod(obj, method, args);
64+
throwNoSuchMethod(obj, name, args);
6565
}
6666
}
6767
// TODO(jmesserly): enable this when we can fix => and methods.
@@ -207,7 +207,15 @@ var dart, _js_helper, _js_primitives;
207207
} else {
208208
subtypeMap.set(t1, map = new Map());
209209
}
210-
map.set(t2, result = isSubtype_(t1, t2));
210+
if (t2 == core.Type) {
211+
// Special case Types.
212+
result = t1.prototype instanceof core.Type ||
213+
t1 instanceof AbstractFunctionType ||
214+
isSubtype_(t1, t2);
215+
} else {
216+
result = isSubtype_(t1, t2)
217+
}
218+
map.set(t2, result);
211219
return result;
212220
}
213221
dart.isSubtype = isSubtype;

0 commit comments

Comments
 (0)