Bug 160511 - [Web IDL] Add support for 'any' type in dictionaries
Summary: [Web IDL] Add support for 'any' type in dictionaries
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Bindings (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Chris Dumez
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-08-03 09:37 PDT by Chris Dumez
Modified: 2016-08-05 19:34 PDT (History)
8 users (show)

See Also:


Attachments
Patch (6.28 KB, patch)
2016-08-03 09:47 PDT, Chris Dumez
no flags Details | Formatted Diff | Diff
Patch (6.26 KB, patch)
2016-08-04 15:06 PDT, Chris Dumez
no flags Details | Formatted Diff | Diff
Patch (7.29 KB, patch)
2016-08-04 18:39 PDT, Chris Dumez
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Chris Dumez 2016-08-03 09:37:56 PDT
Add support for 'any' type in dictionaries.
Comment 1 Chris Dumez 2016-08-03 09:47:04 PDT
Created attachment 285240 [details]
Patch
Comment 2 Chris Dumez 2016-08-03 09:50:25 PDT
Comment on attachment 285240 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=285240&action=review

> Source/WebCore/bindings/js/JSDOMConvert.h:122
> +    using OptionalValue = JSC::JSValue; // Use an empty JSValue to mean an optional value was not present.

Alternatively, we could pass jsUndefined() to the implementation if the member is not present since I don't think we need to distinguish missing member from member being undefined in this case. However, this would require some minor tweaking of the bindings generator.
Let me know if you'd prefer passing undefined instead of JSValue().
Comment 3 Chris Dumez 2016-08-04 15:06:39 PDT
Created attachment 285368 [details]
Patch
Comment 4 Chris Dumez 2016-08-04 15:07:17 PDT
Comment on attachment 285368 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=285368&action=review

> Source/WebCore/bindings/js/JSDOMConvert.h:133
> +    using OptionalValue = JSC::JSValue; // Use an empty JSValue to mean an optional value was not present.

Alternatively, we could pass jsUndefined() to the implementation if the member is not present since I don't think we need to distinguish missing member from member being undefined in this case. However, this would require some minor tweaking of the bindings generator.
Let me know if you'd prefer passing undefined instead of JSValue().
Comment 5 Sam Weinig 2016-08-04 18:25:01 PDT
Comment on attachment 285368 [details]
Patch

I slightly prefer jsUndefined(), just cause I am not sure where else we use JSValue()
Comment 6 Chris Dumez 2016-08-04 18:39:00 PDT
Created attachment 285391 [details]
Patch
Comment 7 Chris Dumez 2016-08-04 18:39:15 PDT
(In reply to comment #5)
> Comment on attachment 285368 [details]
> Patch
> 
> I slightly prefer jsUndefined(), just cause I am not sure where else we use
> JSValue()

Done.
Comment 8 WebKit Commit Bot 2016-08-05 19:34:32 PDT
Comment on attachment 285391 [details]
Patch

Clearing flags on attachment: 285391

Committed r204216: <http://trac.webkit.org/changeset/204216>
Comment 9 WebKit Commit Bot 2016-08-05 19:34:39 PDT
All reviewed patches have been landed.  Closing bug.