diff options
Diffstat (limited to 'Userland/Libraries/LibJS/Runtime/StringConstructor.cpp')
-rw-r--r-- | Userland/Libraries/LibJS/Runtime/StringConstructor.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/Userland/Libraries/LibJS/Runtime/StringConstructor.cpp b/Userland/Libraries/LibJS/Runtime/StringConstructor.cpp index 30746e16e4..f27a47be6f 100644 --- a/Userland/Libraries/LibJS/Runtime/StringConstructor.cpp +++ b/Userland/Libraries/LibJS/Runtime/StringConstructor.cpp @@ -72,7 +72,8 @@ JS_DEFINE_NATIVE_FUNCTION(StringConstructor::raw) vm.throw_exception<TypeError>(global_object, ErrorType::StringRawCannotConvert, raw.is_null() ? "null" : "undefined"); return {}; } - if (!raw.is_array()) + // FIXME: This should use length_of_array_like() and work with any object + if (!raw.is_object() || !raw.as_object().is_array()) return js_string(vm, ""); auto* array = static_cast<Array*>(raw.to_object(global_object)); |