summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibJS/Runtime/JSONObject.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Userland/Libraries/LibJS/Runtime/JSONObject.cpp')
-rw-r--r--Userland/Libraries/LibJS/Runtime/JSONObject.cpp9
1 files changed, 3 insertions, 6 deletions
diff --git a/Userland/Libraries/LibJS/Runtime/JSONObject.cpp b/Userland/Libraries/LibJS/Runtime/JSONObject.cpp
index 41e26403b6..7473125bdc 100644
--- a/Userland/Libraries/LibJS/Runtime/JSONObject.cpp
+++ b/Userland/Libraries/LibJS/Runtime/JSONObject.cpp
@@ -468,13 +468,10 @@ Value JSONObject::internalize_json_property(GlobalObject& global_object, Object*
auto element = internalize_json_property(global_object, &value_object, key, reviver);
if (auto* exception = vm.exception())
return throw_completion(exception->value());
- if (element.is_undefined()) {
+ if (element.is_undefined())
TRY(value_object.internal_delete(key));
- } else {
- value_object.create_data_property(key, element);
- if (auto* exception = vm.exception())
- return throw_completion(exception->value());
- }
+ else
+ TRY(value_object.create_data_property(key, element));
return {};
};