Error

Error オブジェクト (JavaScript)

仕様書

意味

[13] Web IDL Error は、 Web IDL 例外を表します >>9

[14] DOMException も含まれます。 SyntaxError が含まれるのかは謎です。

[16] 型名は、 Error です >>15

サブクラス

単純例外

[10] Web IDL は、例外のうち次のものを単純例外 (simple exception) と呼んでいます >>9

[11] これらは JavaScriptError部分クラスに相当します。 ただし SyntaxErrorJavaScript構文解析のみに使うとして、 Error 自体は著者が使うものであるとして、 除外されています。 >>9

[12] 実際には DOM でも、 Worker の処理で SyntaxError を使っています (が JavaScript構文解析に関するエラーを表すものです)。

メンバー

[27] Errorメンバー

演算

[18] JavaScript 値から Error Web IDL値への変換は、 次のように定義されています >>17

  1. [19] 指定された値が Object でないか、 ErrorData 内部スロットを持たないなら、 TypeError投げ、停止します。
  2. [20] 指定された値と同じオブジェクトを指す Web IDL Error 値を返します。

[21] Web IDL 値から JavaScript値への変換は、 次のように定義されています >>17

  1. [22] 指定された値と同じオブジェクトを指す JavaScript Error 値を返します。

歴史

[5] JavaScriptでカスラムエラーをどう作るか - rikubaの日記 ( ( 版)) http://d.hatena.ne.jp/rikuba/20140409/1397031752

[6] Removed IDL exceptions, baked in DOMException, and added Error and DOMEx... · 50e172e · heycam/webidl ( ( 版)) https://github.com/heycam/webidl/commit/50e172ec079db073c3724c9beac1b576fb5dbc47

[7] DOMException is in IDL. DOMError removed. https://www.w3.org/Bugs/Public... · 7fe5736 · whatwg/dom ( ( 版)) https://github.com/whatwg/dom/commit/7fe5736d3ed2717d71a3d2627b07dee97e10ef05

[8] Removed IDL exceptions, baked in DOMException, and added Error and DOMEx... · 50e172e · heycam/webidl ( ( 版)) https://github.com/heycam/webidl/commit/50e172ec079db073c3724c9beac1b576fb5dbc47

[23] Write structured clone algorithm in terms of ECMAScript · whatwg/html@bfb960c ( 版) https://github.com/whatwg/html/commit/bfb960c938580c95e77365e614218b952f96375b

[24] Exception cleanup (#250) (tobie著, ) https://github.com/heycam/webidl/commit/c2d602f15a60765832e52b9c4a62f7ae76b2950c

[25] Clarify that exceptions are always thrown in the current Realm (#300) (domenic著, ) https://github.com/heycam/webidl/commit/20b87a7d44d94a153762a5c1c587779767afbfe6

[28] DOMException function definition makes no sense · Issue #55 · heycam/webidl () https://github.com/heycam/webidl/issues/55

[29] tc39/proposal-error-stacks: ECMAScript Proposal, specs, and reference implementation for Error.prototype.stack / System.getStack () https://github.com/tc39/proposal-error-stacks

[30] Use `DOMException` instead of `Error` in `SensorErrorEvent` (pozdnyakov著, ) https://github.com/w3c/sensors/commit/810d1a9b646585d954f4798e227cbf218a2ff9eb

[31] Remove the Error IDL type (Ms2ger著, ) https://github.com/heycam/webidl/commit/ad03037c82890e7ac496b96922552f465c45c0a7

[32] Remove the Error IDL type (Ms2ger著, ) https://github.com/heycam/webidl/commit/ad03037c82890e7ac496b96922552f465c45c0a7

[33] Remove the Error IDL type by Ms2ger · Pull Request #728 · heycam/webidl () https://github.com/heycam/webidl/pull/728

[34] Remove the 'exception types' definition (Ms2ger著, ) https://github.com/heycam/webidl/commit/faaee577b0c0c03338b139754835ac999de507be

[35] javascript - checking for typeof error in JS - Stack Overflow () https://stackoverflow.com/questions/30469261/checking-for-typeof-error-in-js

[36] Define serialization and deserialization steps for errors (yutakahirano, , ) https://github.com/whatwg/html/commit/af9f08794fc97d442f8a25c5eeac9f9f70aea498

[37] Allow structured cloning of native error types · Issue #4268 · whatwg/html () https://github.com/whatwg/html/issues/4268

[38] Structured cloning of errors · Issue #165 · mozilla/standards-positions () https://github.com/mozilla/standards-positions/issues/165

[39] 28389 – Allow error objects to be structured-clonable (, ) https://www.w3.org/Bugs/Public/show_bug.cgi?id=28389

[40] Define serialization and deserialization steps for Error by yutakahirano · Pull Request #4665 · whatwg/html () https://github.com/whatwg/html/pull/4665

[41] Normative: remove the [[ErrorData]] internal slot by domenic · Pull Request #438 · tc39/ecma262 () https://github.com/tc39/ecma262/pull/438

[42] Should we make native error types distinguishable? · Issue #1389 · tc39/ecma262 () https://github.com/tc39/ecma262/issues/1389