Index: sdk/lib/_internal/compiler/js_lib/js_rti.dart |
diff --git a/sdk/lib/_internal/compiler/js_lib/js_rti.dart b/sdk/lib/_internal/compiler/js_lib/js_rti.dart |
index 2d462802a897e6b88d7c5839c08ddff4078520aa..ec6ae53b14aa8f5210d2eb1fd1c34736bd4a0266 100644 |
--- a/sdk/lib/_internal/compiler/js_lib/js_rti.dart |
+++ b/sdk/lib/_internal/compiler/js_lib/js_rti.dart |
@@ -451,20 +451,15 @@ bool isSubtype(var s, var t) { |
// constructed from the type of [t]. |
var typeOfS = isJsArray(s) ? getIndex(s, 0) : s; |
var typeOfT = isJsArray(t) ? getIndex(t, 0) : t; |
+ |
// Check for a subtyping flag. |
- var name = runtimeTypeToString(typeOfT); |
// Get the necessary substitution of the type arguments, if there is one. |
var substitution; |
if (isNotIdentical(typeOfT, typeOfS)) { |
- // TODO(floitsch): change this to: |
- // if (!JS_BUILTIN('depends:none;effects:none;returns:bool', |
- // JsBuiltin.implementsType, |
- // typeOfSPrototype, name)) { |
- // return false; |
- // } |
- var test = '${JS_OPERATOR_IS_PREFIX()}${name}'; |
+ if (!builtinIsSubtype(typeOfS, runtimeTypeToString(typeOfT))) { |
+ return false; |
+ } |
var typeOfSPrototype = JS('', '#.prototype', typeOfS); |
- if (hasNoField(typeOfSPrototype, test)) return false; |
var field = '${JS_OPERATOR_AS_PREFIX()}${runtimeTypeToString(typeOfT)}'; |
substitution = getField(typeOfSPrototype, field); |
} |