mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 00:17:46 +00:00
LibJS: Replace boolean without_side_effects parameters with an enum
This commit is contained in:
parent
864beb0bd5
commit
dcb55db99b
16 changed files with 56 additions and 51 deletions
|
@ -11,12 +11,12 @@
|
|||
|
||||
namespace Web::Bindings {
|
||||
|
||||
JS::Value CSSStyleDeclarationWrapper::get(const JS::PropertyName& name, JS::Value receiver, bool without_side_effects) const
|
||||
JS::Value CSSStyleDeclarationWrapper::get(const JS::PropertyName& name, JS::Value receiver, JS::AllowSideEffects allow_side_effects) const
|
||||
{
|
||||
// FIXME: These should actually use camelCase versions of the property names!
|
||||
auto property_id = CSS::property_id_from_string(name.to_string());
|
||||
if (property_id == CSS::PropertyID::Invalid)
|
||||
return Base::get(name, receiver, without_side_effects);
|
||||
return Base::get(name, receiver, allow_side_effects);
|
||||
for (auto& property : impl().properties()) {
|
||||
if (property.property_id == property_id)
|
||||
return js_string(vm(), property.value->to_string());
|
||||
|
|
|
@ -12,21 +12,21 @@
|
|||
|
||||
namespace Web::Bindings {
|
||||
|
||||
JS::Value HTMLCollectionWrapper::get(JS::PropertyName const& name, JS::Value receiver, bool without_side_effects) const
|
||||
JS::Value HTMLCollectionWrapper::get(JS::PropertyName const& name, JS::Value receiver, JS::AllowSideEffects allow_side_effects) const
|
||||
{
|
||||
if (!name.is_string())
|
||||
return Base::get(name, receiver, without_side_effects);
|
||||
return Base::get(name, receiver, allow_side_effects);
|
||||
auto* item = const_cast<DOM::HTMLCollection&>(impl()).named_item(name.to_string());
|
||||
if (!item)
|
||||
return Base::get(name, receiver, without_side_effects);
|
||||
return Base::get(name, receiver, allow_side_effects);
|
||||
return JS::Value { wrap(global_object(), *item) };
|
||||
}
|
||||
|
||||
JS::Value HTMLCollectionWrapper::get_by_index(u32 property_index, bool without_side_effects) const
|
||||
JS::Value HTMLCollectionWrapper::get_by_index(u32 property_index, JS::AllowSideEffects allow_side_effects) const
|
||||
{
|
||||
auto* item = const_cast<DOM::HTMLCollection&>(impl()).item(property_index);
|
||||
if (!item)
|
||||
return Base::get_by_index(property_index, without_side_effects);
|
||||
return Base::get_by_index(property_index, allow_side_effects);
|
||||
return wrap(global_object(), *item);
|
||||
}
|
||||
|
||||
|
|
|
@ -786,12 +786,12 @@ public:
|
|||
|
||||
if (interface.extended_attributes.contains("CustomGet")) {
|
||||
generator.append(R"~~~(
|
||||
virtual JS::Value get(const JS::PropertyName&, JS::Value receiver = {}, bool without_side_effects = false) const override;
|
||||
virtual JS::Value get(const JS::PropertyName&, JS::Value receiver = {}, JS::AllowSideEffects = JS::AllowSideEffects::Yes) const override;
|
||||
)~~~");
|
||||
}
|
||||
if (interface.extended_attributes.contains("CustomGetByIndex")) {
|
||||
generator.append(R"~~~(
|
||||
virtual JS::Value get_by_index(u32 property_index, bool without_side_effects = false) const override;
|
||||
virtual JS::Value get_by_index(u32 property_index, JS::AllowSideEffects = JS::AllowSideEffects::Yes) const override;
|
||||
)~~~");
|
||||
}
|
||||
if (interface.extended_attributes.contains("CustomPut")) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue