Index: sdk/lib/_internal/js_runtime/lib/js_helper.dart |
diff --git a/sdk/lib/_internal/js_runtime/lib/js_helper.dart b/sdk/lib/_internal/js_runtime/lib/js_helper.dart |
index e8b0a6bded4316b37da9f1b771d5c253647ef2c7..8b3020a56a7a93278921d19b403656b8bd3ec460 100644 |
--- a/sdk/lib/_internal/js_runtime/lib/js_helper.dart |
+++ b/sdk/lib/_internal/js_runtime/lib/js_helper.dart |
@@ -3179,8 +3179,9 @@ propertyTypeCast(value, property) { |
*/ |
interceptedTypeCheck(value, property) { |
if (value == null) return value; |
- if ((identical(JS('String', 'typeof #', value), 'object')) |
- && JS('bool', '#[#]', getInterceptor(value), property)) { |
+ if ((JS('bool', 'typeof # === "object"', value) || |
+ JS('bool', 'typeof # === "function"', value)) && |
+ JS('bool', '#[#]', getInterceptor(value), property)) { |
return value; |
} |
propertyTypeError(value, property); |
@@ -3192,9 +3193,10 @@ interceptedTypeCheck(value, property) { |
* prototype at load time. |
*/ |
interceptedTypeCast(value, property) { |
- if (value == null |
- || ((JS('bool', 'typeof # === "object"', value)) |
- && JS('bool', '#[#]', getInterceptor(value), property))) { |
+ if (value == null || |
+ ((JS('bool', 'typeof # === "object"', value) || |
+ JS('bool', 'typeof # === "function"', value)) && |
+ JS('bool', '#[#]', getInterceptor(value), property))) { |
return value; |
} |
propertyTypeCastError(value, property); |