CodeSampleX

サンプル

jsdom 26.1.0: Control script execution scope and capture uncaught script exceptions using JSDOM runScripts modes and VirtualConsole event routing

検証済みサンプル — npm jsdom 26.1.0: Control script execution scope and capture uncaught script exceptions using JSDOM runScripts modes and VirtualConsole event…

sha256:25b9a38825174ba5a14d0ac2113dc8725a5d805f5e75e487a2d3e0f235436362

このネットワークが提供するのは一つだけです。ビルドされるサンプル。サンドボックスで実行し、署名済みの受領証を保管します。等級はつけず、何も保証しません — 同じコードがあなたの環境でビルドされるかは測定していません。 合格した契約受領証を提出した異なる署名鍵の数です。1 なら作者だけ、2 以上なら他の誰かもビルドしています。鍵は自己生成で背後に登録された身元がないため、数えているのは人ではなく鍵です。 MIT-0

実行証拠

宣言された環境と署名済みの実行を分けてあります。このサンプルが何をどこで実行したかをそのまま確認できます。

証拠の基準
署名済みコントラクト合格
検証レシート
2
ビルドした署名鍵
2
宣言された環境 node linux x64 node node npm

検証実行環境

環境 コントラクト ステージ 実行日
node 22 · linux alpine/x64 · docker ed25519:d91480838ac982c9 PASS compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS
CONTAINER_RUN · node-typescript@1
2026-08-17
node 22 · linux alpine/x64 · docker ed25519:2175b912ea1c23b1 PASS compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS
CONTAINER_RUN · node-typescript@1
2026-08-18

ケース

HOW
ゴール
Control script execution scope and capture uncaught script exceptions using JSDOM runScripts modes and VirtualConsole event routing
パッケージ
シンボル
  • JSDOM
  • VirtualConsole
環境
node
作成日
2026-08-17T17:23:31Z

コントラクト

  1. Instantiating JSDOM with default settings suppresses all inline script tags and inline event handlers, and window.eval throws a ReferenceError because no VM context is attached.
  2. Configuring runScripts to outside-only establishes a VM execution context for window.eval while continuing to block inline script tags and event handlers in markup.
  3. Configuring runScripts to dangerously executes inline script tags and event handler attributes within the JSDOM window context.
  4. Unhandled script errors and event handler exceptions do not throw from the JSDOM constructor or event dispatchers, but instead route to VirtualConsole as jsdomError events.
  5. VirtualConsole sendTo forwards console logging methods while supporting omitJSDOMErrors to filter out uncaught script exceptions.

ファイル

  • NOTES.md
  • csx.json
  • package-lock.json
  • package.json
  • test/contract.mjs

ソースアーティファクトをダウンロード (tar.gz)

オリジンシーダー

csx-seed