summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibWeb
diff options
context:
space:
mode:
authorLinus Groh <mail@linusgroh.de>2021-09-29 17:54:25 +0100
committerLinus Groh <mail@linusgroh.de>2021-09-29 23:49:53 +0100
commit5da210125e1ae62278ddf708ad85b037f1891a81 (patch)
treea184dafd5fe0707a7a3890df0cd6a7f97294f902 /Userland/Libraries/LibWeb
parent0e69a6e487a3d00b329e01bd21b5acfce9070765 (diff)
downloadserenity-5da210125e1ae62278ddf708ad85b037f1891a81.zip
LibJS: Convert internal_define_own_property() to ThrowCompletionOr
Diffstat (limited to 'Userland/Libraries/LibWeb')
-rw-r--r--Userland/Libraries/LibWeb/Bindings/Replaceable.h15
1 files changed, 8 insertions, 7 deletions
diff --git a/Userland/Libraries/LibWeb/Bindings/Replaceable.h b/Userland/Libraries/LibWeb/Bindings/Replaceable.h
index 6617922fe9..fce41f813c 100644
--- a/Userland/Libraries/LibWeb/Bindings/Replaceable.h
+++ b/Userland/Libraries/LibWeb/Bindings/Replaceable.h
@@ -6,11 +6,12 @@
#pragma once
-#define REPLACEABLE_PROPERTY_SETTER(ObjectType, property) \
- auto this_value = vm.this_value(global_object); \
- if (!this_value.is_object() || !is<ObjectType>(this_value.as_object())) { \
- vm.throw_exception<JS::TypeError>(global_object, JS::ErrorType::NotAnObjectOfType, #ObjectType); \
- return {}; \
- } \
- this_value.as_object().internal_define_own_property(#property, JS::PropertyDescriptor { .value = vm.argument(0), .writable = true }); \
+#define REPLACEABLE_PROPERTY_SETTER(ObjectType, property) \
+ auto this_value = vm.this_value(global_object); \
+ if (!this_value.is_object() || !is<ObjectType>(this_value.as_object())) { \
+ vm.throw_exception<JS::TypeError>(global_object, JS::ErrorType::NotAnObjectOfType, #ObjectType); \
+ return {}; \
+ } \
+ TRY_OR_DISCARD(this_value.as_object().internal_define_own_property( \
+ #property, JS::PropertyDescriptor { .value = vm.argument(0), .writable = true })); \
return JS::js_undefined();