LibJS: Add missing exception check in internalize_json_property

The call to enumerable_own_property_names in the non-array case was
missing an exception check.

Fixes 1 test262 case (JSON/parse/reviver-object-own-keys-err.js)
This commit is contained in:
Luke 2021-07-06 01:30:02 +01:00 committed by Linus Groh
parent 5c3f781031
commit 99cb54670f
Notes: sideshowbarker 2024-07-18 10:19:53 +09:00

View File

@ -509,6 +509,8 @@ Value JSONObject::internalize_json_property(GlobalObject& global_object, Object*
} }
} else { } else {
auto property_list = value_object.enumerable_own_property_names(Object::PropertyKind::Key); auto property_list = value_object.enumerable_own_property_names(Object::PropertyKind::Key);
if (vm.exception())
return {};
for (auto& property_name : property_list) { for (auto& property_name : property_list) {
process_property(property_name.as_string().string()); process_property(property_name.as_string().string());
if (vm.exception()) if (vm.exception())