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

tobie commented on this pull request.



> +The “toJSON” [=regular operation=] is reserved for this usage.
+It must take zero arguments and return a [=JSON value=].
+
+The list of types that <dfn id="dfn-json-values" export lt="JSON value">JSON values</dfn> can have
+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=],
+*   an [=interface type=] that has a “toJSON” method declared on itself or

fixed

-- 
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#discussion_r104475513

Received on Monday, 6 March 2017 17:43:21 UTC