Re: [heycam/webidl] Replace serializers by toJSON and [Default] extended attribute (#323)

Cleaned-up the algorithm to rely on underlying value and abstract operations instead of ES Get and calling the toJSON method of objects.

Being very explicit about order of inherited and consequential interfaces. I hope that's both readable and correct.

Rebased the whole thing and adjusted accordingly (hopefully) to deal with type attributes.

Haven't simplified the examples yet. Maybe that would be a useful thing to do before merging.

Decided to keep [Default] instead of [DefaultToJSON] as:

1. Even if we never have another use for [Default], it still reads better than [DefaultToJSON], so I'd like to settle on it whether or nor we keep the infrastructure that allows to generelize it.
2. The infrastructure to generalize the use case is not exposed, so we can always remove it later.
3. Some of the stuff discussed around arrays might call for some other use of [Default] (maybe?).
4. I'm lazy.



-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/heycam/webidl/pull/323#issuecomment-300783775

Received on Thursday, 11 May 2017 13:09:24 UTC