From 2f5dd77ccb72049eaed81e16f1b69724fc9dc97d Mon Sep 17 00:00:00 2001 From: Stephen Adams Date: Wed, 30 Apr 2025 16:23:14 -0700 Subject: [PATCH] [dart:js] Use Array.isArray Bug: b/411647888 Change-Id: I501808ab48798e99531114017ad3497d1f0ab2c4 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/423067 Reviewed-by: Srujan Gaddam Commit-Queue: Stephen Adams --- sdk/lib/_internal/js_dev_runtime/patch/js_patch.dart | 2 +- sdk/lib/_internal/js_runtime/lib/js_patch.dart | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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,