mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 18:27:35 +00:00
LibJS: Rename PropertyName to PropertyKey
Let's use the same name as the spec. :^)
This commit is contained in:
parent
715e7fada8
commit
398c181c79
55 changed files with 287 additions and 287 deletions
|
@ -21,14 +21,14 @@ static CSS::PropertyID property_id_from_name(StringView name)
|
|||
return CSS::PropertyID::Invalid;
|
||||
}
|
||||
|
||||
JS::ThrowCompletionOr<bool> CSSStyleDeclarationWrapper::internal_has_property(JS::PropertyName const& name) const
|
||||
JS::ThrowCompletionOr<bool> CSSStyleDeclarationWrapper::internal_has_property(JS::PropertyKey const& name) const
|
||||
{
|
||||
if (!name.is_string())
|
||||
return Base::internal_has_property(name);
|
||||
return property_id_from_name(name.to_string()) != CSS::PropertyID::Invalid;
|
||||
}
|
||||
|
||||
JS::ThrowCompletionOr<JS::Value> CSSStyleDeclarationWrapper::internal_get(JS::PropertyName const& name, JS::Value receiver) const
|
||||
JS::ThrowCompletionOr<JS::Value> CSSStyleDeclarationWrapper::internal_get(JS::PropertyKey const& name, JS::Value receiver) const
|
||||
{
|
||||
if (!name.is_string())
|
||||
return Base::internal_get(name, receiver);
|
||||
|
@ -40,7 +40,7 @@ JS::ThrowCompletionOr<JS::Value> CSSStyleDeclarationWrapper::internal_get(JS::Pr
|
|||
return { js_string(vm(), String::empty()) };
|
||||
}
|
||||
|
||||
JS::ThrowCompletionOr<bool> CSSStyleDeclarationWrapper::internal_set(JS::PropertyName const& name, JS::Value value, JS::Value receiver)
|
||||
JS::ThrowCompletionOr<bool> CSSStyleDeclarationWrapper::internal_set(JS::PropertyKey const& name, JS::Value value, JS::Value receiver)
|
||||
{
|
||||
if (!name.is_string())
|
||||
return Base::internal_set(name, value, receiver);
|
||||
|
|
|
@ -6,13 +6,13 @@
|
|||
|
||||
#include <AK/NumericLimits.h>
|
||||
#include <LibJS/Runtime/AbstractOperations.h>
|
||||
#include <LibJS/Runtime/PropertyName.h>
|
||||
#include <LibJS/Runtime/PropertyKey.h>
|
||||
#include <LibWeb/Bindings/IDLAbstractOperations.h>
|
||||
|
||||
namespace Web::Bindings::IDL {
|
||||
|
||||
// https://webidl.spec.whatwg.org/#is-an-array-index
|
||||
bool is_an_array_index(JS::GlobalObject& global_object, JS::PropertyName const& property_name)
|
||||
bool is_an_array_index(JS::GlobalObject& global_object, JS::PropertyKey const& property_name)
|
||||
{
|
||||
// 1. If Type(P) is not String, then return false.
|
||||
if (!property_name.is_number())
|
||||
|
|
|
@ -10,6 +10,6 @@
|
|||
|
||||
namespace Web::Bindings::IDL {
|
||||
|
||||
bool is_an_array_index(JS::GlobalObject&, JS::PropertyName const&);
|
||||
bool is_an_array_index(JS::GlobalObject&, JS::PropertyKey const&);
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue