Chromium Code Reviews| Index: pkg/dev_compiler/tool/input_sdk/private/ddc_runtime/operations.dart |
| diff --git a/pkg/dev_compiler/tool/input_sdk/private/ddc_runtime/operations.dart b/pkg/dev_compiler/tool/input_sdk/private/ddc_runtime/operations.dart |
| index 5299374ca4c7a8c8b2feb2136cd40eca1b1416ac..35f706be3f519ac02247376421c8a99dcc4d41b0 100644 |
| --- a/pkg/dev_compiler/tool/input_sdk/private/ddc_runtime/operations.dart |
| +++ b/pkg/dev_compiler/tool/input_sdk/private/ddc_runtime/operations.dart |
| @@ -439,6 +439,7 @@ final _ignoreTypeFailure = JS( |
| })()'''); |
| /// Returns true if [obj] is an instance of [type] |
| +/// Returns true if [obj] is a JS function and [type] is a function type |
| /// Returns false if [obj] is not an instance of [type] in both spec |
| /// and strong mode |
| /// Returns null if [obj] is not an instance of [type] in strong mode |
| @@ -448,8 +449,8 @@ bool strongInstanceOf(obj, type, ignoreFromWhiteList) => JS( |
| '''(() => { |
| let actual = $getReifiedType($obj); |
| let result = $isSubtype(actual, $type); |
| - if (result || actual == $jsobject || |
| - (actual == $int && $isSubtype($double, $type))) return true; |
| + if (result || (actual == $int && $isSubtype($double, $type))) return true; |
| + if (actual == $jsobject && $isFunctionType(type) && typeof(obj) === 'function') return true; |
|
vsm
2017/04/21 12:35:58
nit: line len
|
| if (result === false) return false; |
| if (!$_ignoreWhitelistedErrors || ($ignoreFromWhiteList == void 0)) return result; |
| if ($_ignoreTypeFailure(actual, $type)) return true; |