diff --git a/sdk/lib/_internal/js_dev_runtime/patch/js_patch.dart b/sdk/lib/_internal/js_dev_runtime/patch/js_patch.dart index 31ff5e636f5..43376e543e4 100644 --- a/sdk/lib/_internal/js_dev_runtime/patch/js_patch.dart +++ b/sdk/lib/_internal/js_dev_runtime/patch/js_patch.dart @@ -440,7 +440,7 @@ JsObject _wrapToDartHelper(Object o) { if (JS('!', 'typeof # == "function"', o)) { return JsFunction._fromJs(o); } - if (JS('!', '# instanceof Array', o)) { + if (JS('!', 'Array.isArray(#)', o)) { return JsArray._fromJs(o); } return JsObject._fromJs(o); diff --git a/sdk/lib/_internal/js_runtime/lib/js_patch.dart b/sdk/lib/_internal/js_runtime/lib/js_patch.dart index b1a138ac085..c2111a470d6 100644 --- a/sdk/lib/_internal/js_runtime/lib/js_patch.dart +++ b/sdk/lib/_internal/js_runtime/lib/js_patch.dart @@ -548,7 +548,7 @@ Object _wrapToDart(o) { (o) => JsFunction._fromJs(o), ); } - if (JS('bool', '# instanceof Array', o)) { + if (JS('bool', 'Array.isArray(#)', o)) { return _getDartProxy( o, _DART_OBJECT_PROPERTY_NAME,