mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 05:57:45 +00:00
LibJS: Add new PropertyDescriptor class and related abstract operations
This is an implementation of 'The Property Descriptor Specification Type' and related abstract operations, namely: - IsAccessorDescriptor - IsDataDescriptor - IsGenericDescriptor - FromPropertyDescriptor - ToPropertyDescriptor - CompletePropertyDescriptor It works with Optional<T> to enable omitting certain fields, which will eventually replace the Attribute::Has{Getter,Setter,Configurable, Enumerable,Writable} bit flags, which are awkward to work with - being able to use an initializer list with any of the possible attributes is much more convenient. Parts of the current PropertyAttributes implementation as well as the much simpler PropertyDescriptor struct in Object.h will eventually be replaced with this and completely go away. Property storage will still use the PropertyAttributes bit flags, this is for the layers above. Note that this is currently guarded behind an #if 0 as if conflicts with the existing PropertyDescriptor struct, but it's known to compile and work just fine - I simply want to have this in a separate commit, the primary object rewrite commit will be large enough as is.
This commit is contained in:
parent
a3c8ebd709
commit
bb1a98d809
4 changed files with 271 additions and 0 deletions
|
@ -144,6 +144,8 @@ class PrimitiveString;
|
|||
class PromiseReaction;
|
||||
class PromiseReactionJob;
|
||||
class PromiseResolveThenableJob;
|
||||
class PropertyAttributes;
|
||||
class PropertyDescriptor;
|
||||
class PropertyName;
|
||||
class Reference;
|
||||
class ScopeNode;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue