mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 13:18:13 +00:00
LibJS: Handle Proxy with Array target in IsArray() abstract operation
This was missing from Value::is_array(), which is equivalent to the spec's IsArray() abstract operation - it treats a Proxy value with an Array target object as being an Array. It can throw, so needs both the global object and an exception check now.
This commit is contained in:
parent
9b35231453
commit
83be39c91a
11 changed files with 52 additions and 24 deletions
|
@ -142,7 +142,7 @@ JS_DEFINE_NATIVE_FUNCTION(ArrayConstructor::from)
|
|||
JS_DEFINE_NATIVE_FUNCTION(ArrayConstructor::is_array)
|
||||
{
|
||||
auto value = vm.argument(0);
|
||||
return Value(value.is_array());
|
||||
return Value(value.is_array(global_object));
|
||||
}
|
||||
|
||||
JS_DEFINE_NATIVE_FUNCTION(ArrayConstructor::of)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue