1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-19 00:15:08 +00:00
Commit graph

3 commits

Author SHA1 Message Date
Timothy Flynn
85dc3a8099 LibWeb: Convert the Window object to ThrowCompletionOr 2021-10-31 15:48:36 +01:00
Linus Groh
5da210125e LibJS: Convert internal_define_own_property() to ThrowCompletionOr 2021-09-29 23:49:53 +01:00
Linus Groh
a05c998e69 LibWeb: Add A JS setter macro for [Replaceable] IDL properties
The [Replaceable] attribute "indicates that setting the corresponding
property on the platform object will result in an own property with the
same name being created on the object which has the value being
assigned. This property will shadow the accessor property corresponding
to the attribute, which exists on the interface prototype object."
(https://heycam.github.io/webidl/#Replaceable)

The spec doesn't tell how exactly this is supposed to be done, but other
engines just have a setter as well that just redefines the property
as a data descriptor when called, and returns undefined.
It's bound to the property name and requires an object of the correct
type, so I mirrored these constraints here. Storing the setter and
calling it multiple times will therefore just work.

Implementing this in the wrapper generator is left as an exercise for
the reader, this is going to be used in WindowObject, which isn't
generated from IDL yet.
2021-09-12 15:53:48 +02:00