Bug 189466 - Add bindings support for representing attributes with JSValueInWrappedObject
Summary: Add bindings support for representing attributes with JSValueInWrappedObject
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: Bindings (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-09-09 19:37 PDT by Andy Estes
Modified: 2018-09-10 03:01 PDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Andy Estes 2018-09-09 19:37:43 PDT
In CustomEvent, History, MessageEvent, PaymentMethodChangeEvent, and PaymentResponse, we have custom bindings support for representing attributes of type object or any.

These custom bindings tend to do two things:

1. Add a custom getter for an attribute of type object or any that converts the native value to a JSValue, cache that JSValue in a JSValueInWrappedObject in the wrapper class, then return the cached JSValue.
2. Add a custom mark function that visits the cached JSValueInWrappedObject as well as any other JSValueInWrappedObjects in the wrapper class.

We should teach the bindings generator to do this for us for attributes of object or any type (perhaps with a custom annotation).
Comment 1 Andy Estes 2018-09-09 19:41:24 PDT
(In reply to Andy Estes from comment #0)
> In CustomEvent, History, MessageEvent, PaymentMethodChangeEvent, and
> PaymentResponse, we have custom bindings support for representing attributes
> of type object or any.
> 
> These custom bindings tend to do two things:
> 
> 1. Add a custom getter for an attribute of type object or any that converts
> the native value to a JSValue, cache that JSValue in a
> JSValueInWrappedObject in the wrapper class, then return the cached JSValue.
> 2. Add a custom mark function that visits the cached JSValueInWrappedObject
> as well as any other JSValueInWrappedObjects in the wrapper class.
> 
> We should teach the bindings generator to do this for us for attributes of
> object or any type (perhaps with a custom annotation).

s/wrapper class/wrapped class