diff options
Diffstat (limited to 'Userland/Libraries/LibWeb/Bindings/Replaceable.h')
-rw-r--r-- | Userland/Libraries/LibWeb/Bindings/Replaceable.h | 15 |
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(); |