Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allowing something to be the serializer and stringifier #260

Closed
annevk opened this issue Dec 19, 2016 · 1 comment · Fixed by #323
Closed

Allowing something to be the serializer and stringifier #260

annevk opened this issue Dec 19, 2016 · 1 comment · Fixed by #323

Comments

@annevk
Copy link
Member

annevk commented Dec 19, 2016

For whatwg/url#137 we want URL's href attribute to also be the value the serializer returns. However, it's already the stringifier and as far as I can tell the IDL grammar does not allow for both. There's the prose escape-hatch of course, but that seems sad?

@bzbarsky
Copy link
Collaborator

I still think that all serializer options except "serialize all the attributes" should be handled via prose or explicit toJSON functions (which we should allow). The current serializer complexity is ridiculous and not implemented by anyone; allowing people to define toJSON functions would let them handle all this themselves as desired if they want weird serialization behavior, with the one "serialize all the attributes" simple thing for the common case of objects which basically represent a collection of values.

tobie added a commit to tobie/webidl that referenced this issue Feb 27, 2017
* Remove all serializers.
* Add support for JSON stringification through the toJSON operation.
* Add the [Default] extended attribute.
* Add a default JSON operation.

Fixes whatwg#260.
Fixes whatwg#188.
Closes https://www.w3.org/Bugs/Public/show_bug.cgi?id=27428.
tobie added a commit to tobie/webidl that referenced this issue May 11, 2017
* Remove all serializers.
* Add support for JSON stringification through the toJSON operation.
* Add the [Default] extended attribute.
* Add a default JSON operation.

Fixes whatwg#260.
Fixes whatwg#188.
Closes https://www.w3.org/Bugs/Public/show_bug.cgi?id=27428.
tobie added a commit that referenced this issue Jun 21, 2017
* Remove all serializers.
* Add support for JSON stringification through the toJSON operation.
* Add the [Default] extended attribute.
* Add a default JSON operation.

Fixes #188.
Closes #259.
Fixes #260.
Fixes #262.
Fixes #370.
Closes https://www.w3.org/Bugs/Public/show_bug.cgi?id=27428.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging a pull request may close this issue.

2 participants