mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-22 04:25:13 +00:00
LibWeb: Make [PutForwards] work together with [ImplementedAs]
This commit is contained in:
parent
d5c913082b
commit
63ca149be5
Notes:
sideshowbarker
2024-07-17 04:57:23 +09:00
Author: https://github.com/skyrising Commit: https://github.com/SerenityOS/serenity/commit/63ca149be5 Pull-request: https://github.com/SerenityOS/serenity/pull/17949 Reviewed-by: https://github.com/trflynn89 ✅
1 changed files with 1 additions and 2 deletions
|
@ -2571,7 +2571,6 @@ JS_DEFINE_NATIVE_FUNCTION(@class_name@::@attribute.setter_callback@)
|
|||
}
|
||||
)~~~");
|
||||
} else if (auto put_forwards_identifier = attribute.extended_attributes.get("PutForwards"sv); put_forwards_identifier.has_value()) {
|
||||
attribute_generator.set("attribute.name", attribute.name.to_snakecase());
|
||||
attribute_generator.set("put_forwards_identifier"sv, *put_forwards_identifier);
|
||||
|
||||
attribute_generator.append(R"~~~(
|
||||
|
@ -2580,7 +2579,7 @@ JS_DEFINE_NATIVE_FUNCTION(@class_name@::@attribute.setter_callback@)
|
|||
auto* impl = TRY(impl_from(vm));
|
||||
auto value = vm.argument(0);
|
||||
|
||||
auto receiver = TRY(throw_dom_exception_if_needed(vm, [&]() { return impl->@attribute.name@(); }));
|
||||
auto receiver = TRY(throw_dom_exception_if_needed(vm, [&]() { return impl->@attribute.cpp_name@(); }));
|
||||
TRY(receiver->set(JS::PropertyKey { "@put_forwards_identifier@" }, value, JS::Object::ShouldThrowExceptions::Yes));
|
||||
|
||||
return JS::js_undefined();
|
||||
|
|
Loading…
Add table
Reference in a new issue