mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-06 16:19:23 +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
|
@ -218,7 +218,7 @@ JS::ThrowCompletionOr<void> CustomElementRegistry::define(String const& name, We
|
|||
VERIFY(attribute_changed_callback_iterator != lifecycle_callbacks.end());
|
||||
if (attribute_changed_callback_iterator->value) {
|
||||
// 1. Let observedAttributesIterable be ? Get(constructor, "observedAttributes").
|
||||
auto observed_attributes_iterable = TRY(constructor->callback->get(JS::PropertyKey { "observedAttributes" }));
|
||||
auto observed_attributes_iterable = TRY(constructor->callback->get(vm.names.observedAttributes));
|
||||
|
||||
// 2. If observedAttributesIterable is not undefined, then set observedAttributes to the result of converting observedAttributesIterable to a sequence<DOMString>. Rethrow any exceptions from the conversion.
|
||||
if (!observed_attributes_iterable.is_undefined())
|
||||
|
@ -229,7 +229,7 @@ JS::ThrowCompletionOr<void> CustomElementRegistry::define(String const& name, We
|
|||
Vector<String> disabled_features;
|
||||
|
||||
// 7. Let disabledFeaturesIterable be ? Get(constructor, "disabledFeatures").
|
||||
auto disabled_features_iterable = TRY(constructor->callback->get(JS::PropertyKey { "disabledFeatures" }));
|
||||
auto disabled_features_iterable = TRY(constructor->callback->get(vm.names.disabledFeatures));
|
||||
|
||||
// 8. If disabledFeaturesIterable is not undefined, then set disabledFeatures to the result of converting disabledFeaturesIterable to a sequence<DOMString>. Rethrow any exceptions from the conversion.
|
||||
if (!disabled_features_iterable.is_undefined())
|
||||
|
@ -242,7 +242,7 @@ JS::ThrowCompletionOr<void> CustomElementRegistry::define(String const& name, We
|
|||
disable_shadow = disabled_features.contains_slow("shadow"sv);
|
||||
|
||||
// 11. Let formAssociatedValue be ? Get( constructor, "formAssociated").
|
||||
auto form_associated_value = TRY(constructor->callback->get(JS::PropertyKey { "formAssociated" }));
|
||||
auto form_associated_value = TRY(constructor->callback->get(vm.names.formAssociated));
|
||||
|
||||
// 12. Set formAssociated to the result of converting formAssociatedValue to a boolean. Rethrow any exceptions from the conversion.
|
||||
// NOTE: Converting to a boolean cannot throw with ECMAScript.
|
||||
|
|
|
@ -935,8 +935,7 @@ WebIDL::ExceptionOr<void> Window::set_opener(JS::Value value)
|
|||
|
||||
// 2. If the given value is non-null, then perform ? DefinePropertyOrThrow(this, "opener", { [[Value]]: the given value, [[Writable]]: true, [[Enumerable]]: true, [[Configurable]]: true }).
|
||||
if (!value.is_null()) {
|
||||
static JS::PropertyKey opener_property_key { "opener", JS::PropertyKey::StringMayBeNumber::No };
|
||||
TRY(define_property_or_throw(opener_property_key, { .value = value, .writable = true, .enumerable = true, .configurable = true }));
|
||||
TRY(define_property_or_throw(vm().names.opener, { .value = value, .writable = true, .enumerable = true, .configurable = true }));
|
||||
}
|
||||
|
||||
return {};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue