From 99cb54670f409f57fa79488db9a18465cf80f9b1 Mon Sep 17 00:00:00 2001 From: Luke Date: Tue, 6 Jul 2021 01:30:02 +0100 Subject: [PATCH] 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) --- Userland/Libraries/LibJS/Runtime/JSONObject.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Userland/Libraries/LibJS/Runtime/JSONObject.cpp b/Userland/Libraries/LibJS/Runtime/JSONObject.cpp index 7946cf53fe3..4213785f519 100644 --- a/Userland/Libraries/LibJS/Runtime/JSONObject.cpp +++ b/Userland/Libraries/LibJS/Runtime/JSONObject.cpp @@ -509,6 +509,8 @@ Value JSONObject::internalize_json_property(GlobalObject& global_object, Object* } } else { auto property_list = value_object.enumerable_own_property_names(Object::PropertyKind::Key); + if (vm.exception()) + return {}; for (auto& property_name : property_list) { process_property(property_name.as_string().string()); if (vm.exception())