Bug 173767 - [WebIDL] Replace serializers with toJSON and [Default] extended attribute
Summary: [WebIDL] Replace serializers with toJSON and [Default] extended attribute
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: 2017-06-23 06:06 PDT by Tobie Langel
Modified: 2017-06-23 07:37 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 Tobie Langel 2017-06-23 06:06:47 PDT
Hi!

We just removed serializers[1] from WebIDL and allowed editors to specify toJSON operations[2] directly instead (WebIDL treated toJSON as a reserved identifier up until now).

To deal with common cases, we added a new [Default] extended attribute[3] which triggers the default toJSON operation[4] that behaves similarly to how serializers={attributes} or serializers={attributes, inherit} used to.

All serializer-related productions were removed from the WebIDL grammar. In particular the following non-terminals:

* Serializer
    * Serializer was also removed from the rhs expression of InterfaceMember.
* SerializerRest
* OperationRest
* SerializationPattern
* SerializationPatternMap
* SerializationPatternList

and the following terminals:

* "serializer" in ArgumentNameKeyword.

As usual, please feel free to reach out if anything needs clarification or if you have questions.

Thanks!

[1]: https://github.com/heycam/webidl/pull/323
[2]: https://heycam.github.io/webidl/#idl-tojson-operation
[3]: https://heycam.github.io/webidl/#Default
[4]]: https://heycam.github.io/webidl/#es-default-tojson