[8] 大変紛らわしいことに、 [[JavaScript]] の[[エラー]]
[CODE(JS)@en[SyntaxError]] と、 [[Web IDL]] の [CODE(DOMi)@en[DOMException]]
の[[例外型]] [CODE(DOMe)@en[SyntaxError]] があり、両者は異なります。

* 仕様書

[REFS[
- [4] [CITE@en-GB-x-hixie[HTML Standard]] ([TIME[2015-03-05 09:33:40 +09:00]] 版) <https://html.spec.whatwg.org/#importing-scripts-and-libraries:js-syntaxerror>
- [5] [CITE[Web IDL (Second Edition)]] ([TIME[2015-05-27 01:29:33 +09:00]] 版) <http://heycam.github.io/webidl/#dfn-simple-exception>
]REFS]

* DOM API

[6] [CODE(JS)@en[[[SyntaxError]]]] は [[Web IDL]] [[単純例外]]には含まれていません [SRC[>>5]]。

[3] [[JavaScript]] [CODE(JS)@en[[[SyntaxError]]]] は、[[ワーカー]]の[[構文解析]]に失敗した時にも[[投げ]]られます [SRC[>>4]]。

* 歴史

[1] [CITE[Less TypeError, more "SyntaxError" (DOMException) https://www.w3.org/Bug... · 1bb586f · whatwg/dom]]
( ([TIME[2014-06-06 11:46:09 +09:00]] 版))
<https://github.com/whatwg/dom/commit/1bb586f40753b5030b043c364f8eecee1e3e3d58>

[2] [CITE@en[Remove the SyntaxError simple exception (the ECMAScript-corresponding on... · 8963248 · heycam/webidl]]
( ([TIME[2014-10-04 10:21:30 +09:00]] 版))
<https://github.com/heycam/webidl/commit/8963248ebcddfc33f1296402c7e6566749d5e2d0>

[7] [CITE@en[Editorial: change wording for throwing DOMExceptions]]
( ([[domenic]]著, [TIME[2016-05-06 05:19:47 +09:00]]))
<https://github.com/whatwg/html/commit/3ac179e4e7626f11cb37690fb0f5f44972f58a48>

[9] [CITE@en[23346 – Use TypeError for argument validation]]
( ([TIME[2016-06-07 18:51:26 +09:00]]))
<https://www.w3.org/Bugs/Public/show_bug.cgi?id=23346>

[10] [CITE@en[Editorial: Add note about SyntaxError DOMException (#459)]]
([[TakayoshiKochi]]著, [TIME[2017-10-12 18:09:13 +09:00]])
<https://github.com/heycam/webidl/commit/c3e67b3fc93db8bfabfd35ca54c5b474f63070de>

[11] [CITE@en[Add a note on the difference of SyntaxError by TakayoshiKochi · Pull Request #459 · heycam/webidl]]
([TIME[2017-10-14 12:28:50 +09:00]])
<https://github.com/heycam/webidl/pull/459>

[12] [CITE@en[Editorial: use "exception name" DOMException notation]]
([[tobie]]著, [TIME[2017-10-12 18:35:25 +09:00]])
<https://github.com/whatwg/dom/commit/9d83a6406bc57a7deeb5c0831c388bae752f2e5e>

[13] [CITE@en[Editorial: use "exception name" DOMException notation by tobie · Pull Request #518 · whatwg/dom]]
([TIME[2017-10-14 12:29:59 +09:00]])
<https://github.com/whatwg/dom/pull/518>

[14] [CITE@en[609415 - Error messages from parentNode.querySelector() do not follow specification - chromium - Monorail]]
([TIME[2017-10-14 22:32:38 +09:00]])
<https://bugs.chromium.org/p/chromium/issues/detail?id=609415>