mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-04 07:36:50 +00:00
LibJS: Throw if the trap result of OwnPropertyKeys contains duplicates
This commit is contained in:
committed by
Linus Groh
parent
d577678658
commit
dd27490ee1
@@ -57,7 +57,7 @@ size_t length_of_array_like(GlobalObject& global_object, Object const& object)
|
||||
}
|
||||
|
||||
// 7.3.19 CreateListFromArrayLike ( obj [ , elementTypes ] ), https://tc39.es/ecma262/#sec-createlistfromarraylike
|
||||
MarkedValueList create_list_from_array_like(GlobalObject& global_object, Value value, Function<Result<void, ErrorType>(Value)> check_value)
|
||||
MarkedValueList create_list_from_array_like(GlobalObject& global_object, Value value, Function<void(Value)> check_value)
|
||||
{
|
||||
auto& vm = global_object.vm();
|
||||
auto& heap = global_object.heap();
|
||||
@@ -76,11 +76,9 @@ MarkedValueList create_list_from_array_like(GlobalObject& global_object, Value v
|
||||
if (vm.exception())
|
||||
return MarkedValueList { heap };
|
||||
if (check_value) {
|
||||
auto result = check_value(next);
|
||||
if (result.is_error()) {
|
||||
vm.throw_exception<TypeError>(global_object, result.release_error());
|
||||
check_value(next);
|
||||
if (vm.exception())
|
||||
return MarkedValueList { heap };
|
||||
}
|
||||
}
|
||||
list.append(next);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user