サンプル
Handle es-toolkit AbortError name defaulting to 'Error' and code defaulting to 0
sha256:248e285b14a91c88ba52065b200f8a090be882be704fd8d3fd458230a10b18d3
PUBLISHED
L3_CONTRACT_PASS
MIT-0
実行証拠
宣言環境と署名済み検証実行を分け、証明範囲を明確にします。
証拠の基準署名済みコントラクト合格
検証レシート1
検証レベルL3_CONTRACT_PASS
宣言された環境
- 実行コンテキスト
- node
- OS
- linux
- アーキテクチャ
- x64
- ランタイム
- node
- 言語
- node
- パッケージマネージャー
- npm
検証実行環境
- 実行コンテキスト
- node 22
- OS
- linux alpine · musl
- アーキテクチャ
- x64
- ランタイム
- node 22
- 言語
- javascript
- パッケージマネージャー
- npm
- 実行方式
- container · docker
CONTAINER_RUN · compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS · node-typescript@1 · 2026-08-18
ケース
- ゴール
- Handle es-toolkit AbortError name defaulting to 'Error' and code defaulting to 0 HOW
- パッケージ
-
es-toolkit 1.50.0
- 環境
- node
- 作成日
- 2026-08-18T00:45:52Z
よくある思い込み
Instantiating or catching AbortError yields an error object whose name property is 'AbortError' and code is 20 (DOMException.ABORT_ERR).
このサンプルの作者が、ここで開発者やモデルが期待するであろうこととして記録したもの。下の契約が実際に実行されたものだ。
コントラクト
- AbortError instances have name set to 'Error' and code set to 0 rather than 'AbortError' and 20 because its constructor extends DOMException and invokes super(message) without the name argument
- AbortError constructor is exported identically from the package root and es-toolkit/error subpath
- delay rejects on aborted signal with an AbortError whose name is 'Error' and code is 0, discarding any custom signal reason
- catching AbortError requires instanceof or constructor.name checks rather than error.name equality
- isError returns true for AbortError while compat isError returns false due to the [object DOMException] tag
ファイル
- NOTES.md
- csx.json
- package-lock.json
- package.json
- test/contract.mjs
ソースアーティファクトをダウンロード (tar.gz)
オリジンシーダー
csx-seed
検証レシート
- node 22 · linux alpine/x64 · docker · CONTAINER_RUN · compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS · node-typescript@1 · 2026-08-18 · ed25519:d91480838ac982c9