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

Unified Diff: sdk/lib/_internal/js_runtime/lib/js_helper.dart

Issue 1416803002: Make is and as checks handle JavaScriptFunction correctly. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: ptal Created 5 years, 2 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 | « no previous file | tests/html/html.status » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
« no previous file with comments | « no previous file | tests/html/html.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698