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

tobie commented on this pull request.



> +an [=interface=] specify how to convert the objects that implements it to [=JSON values=].
+
+The “toJSON” [=regular operation=] is reserved for this usage.
+It must take zero arguments and return a [=JSON value=].
+
+The list of <dfn id="dfn-json-values" export lt="JSON value">JSON values</dfn> is as follows:
+
+*   a [=numeric type=],
+*   a {{boolean}} type,
+*   a [=string type=],
+*   a [=nullable type=] whose [=inner type=] is a [=JSON value=],
+*   a [=union type=] where all of its [=member types=] are [=JSON values=],
+*   a [=sequence type=] whose parameterized type is a [=JSON value=],
+*   a [=dictionary=] where all of its [=dictionary members|members=] are [=JSON values=],
+*   a [=record=] where all of its [=map/values=] are [=JSON values=], and
+*   an [=object type=],

I'm wondering if the object type needs further restrictions here (such as having all of its properties be JSON values.

-- 
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#pullrequestreview-24122543

Received on Tuesday, 28 February 2017 04:31:47 UTC