mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-12 19:19:30 +00:00
LibJS: Add missing CommonPropertyNames
s and StringMayBeNumber::No
s
This commit is contained in:
parent
cfb00ba494
commit
58631e9eef
Notes:
github-actions[bot]
2024-12-01 09:43:42 +00:00
Author: https://github.com/yyny
Commit: 58631e9eef
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/2670
9 changed files with 27 additions and 19 deletions
|
@ -3954,6 +3954,7 @@ 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("put_forwards_identifier"sv, *put_forwards_identifier);
|
||||
VERIFY(!put_forwards_identifier->is_empty() && !is_ascii_digit(put_forwards_identifier->byte_at(0))); // Ensure `PropertyKey`s are not Numbers.
|
||||
|
||||
attribute_generator.append(R"~~~(
|
||||
JS_DEFINE_NATIVE_FUNCTION(@class_name@::@attribute.setter_callback@)
|
||||
|
@ -3963,7 +3964,7 @@ JS_DEFINE_NATIVE_FUNCTION(@class_name@::@attribute.setter_callback@)
|
|||
auto value = vm.argument(0);
|
||||
|
||||
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));
|
||||
TRY(receiver->set(JS::PropertyKey { "@put_forwards_identifier@", JS::PropertyKey::StringMayBeNumber::No }, value, JS::Object::ShouldThrowExceptions::Yes));
|
||||
|
||||
return JS::js_undefined();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue