[7] [DFN[[CODE[toJSON]]]] [[メソッド]]は、 [[JSON]] に変換可能な
[[JavaScriptオブジェクト]]を得るものです。色々な [[JavaScriptオブジェクト]]に定義されています。

* インターフェイス

[FIG(short list)[ [32] [CODE[toJSON]] を持つ[[インターフェイス]]
- [CODE[PushSubscription]]
]FIG]

* 歴史

** Web IDL [CODE[serializer]]

[1] [CITE@en[Merge pull request #58 from nox/fix-serializer-rule · heycam/webidl@ccc69c9]]
([TIME[2015-11-22 20:07:10 +09:00]] 版)
<https://github.com/heycam/webidl/commit/ccc69c93ccd9b1d70800319d445499e3127dffad>

[2] [CITE@en[''''''[''''''geometry'''''']'''''' Add JSON serializers · w3c/fxtf-drafts@75c3961]]
([TIME[2016-01-20 17:25:28 +09:00]] 版)
<https://github.com/w3c/fxtf-drafts/commit/75c3961700dcd8c8dde1d4fa16dba3fd1b717e17>

[3] [CITE@en[''''''[''''''geometry'''''']'''''' Include all attributes in DOMMatrixReadOnly JSON serializa… · w3c/fxtf-drafts@7b5664a]]
([TIME[2016-01-21 12:14:14 +09:00]] 版)
<https://github.com/w3c/fxtf-drafts/commit/7b5664a99dff3a3c3afd5085c65fea7ad7791d9c>

[15] [CITE@en[27428 – '''['''ArrayClass''']''' should serialize as an array by default]] ([TIME[2017-08-19 17:34:15 +09:00]]) <https://www.w3.org/Bugs/Public/show_bug.cgi?id=27428>

[10] [CITE@en[Consider simplifying serializers · Issue #188 · heycam/webidl]] ([TIME[2017-08-19 17:31:21 +09:00]]) <https://github.com/heycam/webidl/issues/188>

[11] [CITE@en[Serialized value should allow any string type · Issue #259 · heycam/webidl]] ([TIME[2017-08-19 17:31:48 +09:00]]) <https://github.com/heycam/webidl/issues/259>

[14] [CITE@en[Serializable types should include unrestricted double and unrestricted float · Issue #370 · heycam/webidl]] ([TIME[2017-08-19 17:33:26 +09:00]]) <https://github.com/heycam/webidl/issues/370>

[12] [CITE@en[Allowing something to be the serializer and stringifier · Issue #260 · heycam/webidl]] ([TIME[2017-08-19 17:32:16 +09:00]]) <https://github.com/heycam/webidl/issues/260>

[13] [CITE@en[Serializable types should include records · Issue #262 · heycam/webidl]] ([TIME[2017-08-19 17:32:34 +09:00]]) <https://github.com/heycam/webidl/issues/262>

[8] [CITE@en[Replace serializers by toJSON and '''['''Default''']''' extended attribute (#323)]] ([[tobie]]著, [TIME[2017-06-22 05:41:00 +09:00]]) <https://github.com/heycam/webidl/commit/a505f332dbc3d619d540b87983ec85df7f0877b1>

[9] [CITE@en[Replace serializers by toJSON and '''['''Default''']''' extended attribute by tobie · Pull Request #323 · heycam/webidl]] ([TIME[2017-08-19 17:14:07 +09:00]]) <https://github.com/heycam/webidl/pull/323>

** Web IDL [CODE[toJSON]]

[4] [CITE@en[Drop toJSON as reserved identifier (#293)]]
([[annevk]]著, [TIME[2017-02-02 23:21:36 +09:00]])
<https://github.com/heycam/webidl/commit/c1ff4b291a27c212eee976c7b9f76263ce93e438>

[5] [CITE@en[Define URL's toJSON()]]
([[annevk]]著, [TIME[2017-02-08 18:20:34 +09:00]])
<https://github.com/whatwg/url/commit/7dcfe5b5d766fd092b8ce09b6ab47ab2cb2a13f5>

[6] [CITE@en[When cloning a JS Object, look for `toJSON`]]
([[shs96c]]著, [TIME[2017-05-04 17:53:40 +09:00]])
<https://github.com/w3c/webdriver/commit/1ee4c61c11004f38bb3db0fb6a1d740e185a2196>



[16] [CITE@en[Merge pull request #114 from marcoscaceres/toJSON]]
([[igrigorik]]著, [TIME[2017-07-11 06:59:51 +09:00]])
<https://github.com/w3c/resource-timing/commit/95021bab1be8a983e58f7059a8653c64272b0e32>

[17] [CITE@en[WebIDL serializer has been deprecated in favor of toJSON operation · Issue #112 · w3c/resource-timing]]
([TIME[2017-08-19 17:35:26 +09:00]])
<https://github.com/w3c/resource-timing/issues/112>

[18] [CITE@en[fix: define toJSON (closes #112) by marcoscaceres · Pull Request #114 · w3c/resource-timing]]
([TIME[2017-08-19 17:36:26 +09:00]])
<https://github.com/w3c/resource-timing/pull/114>

[19] [CITE@en[Merge pull request #1449 from w3c/tojson]]
([[aboba]]著, [TIME[2017-07-13 23:07:51 +09:00]])
<https://github.com/w3c/webrtc-pc/commit/d37c684955efcc6beca7e86ce8de7c3b1c1b89d2>

[20] [CITE@en[Replace serializers by toJSON definitions by dontcallmedom · Pull Request #1449 · w3c/webrtc-pc]]
([TIME[2017-08-19 17:37:26 +09:00]])
<https://github.com/w3c/webrtc-pc/pull/1449>

[21] [CITE@en[define toJSON serializer]]
([[igrigorik]]著, [TIME[2017-07-22 03:41:17 +09:00]])
<https://github.com/w3c/performance-timeline/commit/ec048276cb7656a8131aca7307e183da4a8957b4>

[22] [CITE@en[WebIDL serializer has been deprecated in favor of toJSON operation · Issue #82 · w3c/performance-timeline]]
([TIME[2017-08-19 17:39:12 +09:00]])
<https://github.com/w3c/performance-timeline/issues/82>

[23] [CITE@en[define toJSON serializer]]
([[igrigorik]]著, [TIME[2017-07-22 03:13:35 +09:00]])
<https://github.com/w3c/hr-time/commit/7d8d194259e2c321f945b7ac7dfd3393c5c20b41>

[24] [CITE@en[WebIDL serializer has been deprecated in favor of toJSON operation · Issue #49 · w3c/hr-time]]
([TIME[2017-08-19 18:10:04 +09:00]])
<https://github.com/w3c/hr-time/issues/49>

[25] [CITE@en[Editorial: Manually add default toJSON description (remove when autom…]]
([[adam-be]]著, [TIME[2017-08-22 16:40:03 +09:00]])
<https://github.com/w3c/webrtc-pc/commit/4b744d7ef5c75ce5a2cf01d615c6e128774c0142>

[26] [CITE@en[Merge pull request #474 from w3c/tojson]]
([[adam-be]]著, [TIME[2017-08-25 17:20:38 +09:00]])
<https://github.com/w3c/mediacapture-main/commit/433e36d55b4c33974ff8534770df4753b04367a2>

[27] [CITE@en[Add '''['''Exposed=Window''']''' and use toJSON]]
([[plehegar]]著, [TIME[2017-09-26 04:26:57 +09:00]])
<https://github.com/w3c/navigation-timing/commit/906cbdad95aa79e0e41279dddd0c766b26134c08>

[28] [CITE@en[Add support for interface mixins]]
([[tobie]]著, [TIME[2017-10-11 16:48:12 +09:00]])
<https://github.com/heycam/webidl/commit/45e8173d40ddff8dcf81697326e094bcf8b92920>

[29] [CITE@en[Merge pull request #1960 from stefhak/defaulttojson]]
([[alvestrand]]著, [TIME[2018-08-16 23:08:48 +09:00]])
<https://github.com/w3c/webrtc-pc/commit/1df02bb1bc98ad1e199bb35c93cb5b9dc01704a9>

[30] [CITE@en[Changed to use respec's '''['''Default''']''' definition of toJSON. by stefhak · Pull Request #1960 · w3c/webrtc-pc]]
([TIME[2018-08-22 19:32:14 +09:00]])
<https://github.com/w3c/webrtc-pc/pull/1960>

[31] [CITE@en[Use automatically generated default toJSON() method (when available) · Issue #1546 · w3c/webrtc-pc]]
([TIME[2018-08-22 19:32:31 +09:00]])
<https://github.com/w3c/webrtc-pc/issues/1546>