Пример
Control script execution scope and capture uncaught script exceptions using JSDOM runScripts modes and VirtualConsole event routing
sha256:25b9a38825174ba5a14d0ac2113dc8725a5d805f5e75e487a2d3e0f235436362
PUBLISHED
L3_CONTRACT_PASS
MIT-0
Свидетельства выполнения
Заявленная среда отделена от подписанных запусков, чтобы показать, что именно доказано.
Основа свидетельстваПодписанный контракт пройден
Квитанции проверки1
Уровень проверкиL3_CONTRACT_PASS
Заявленная среда
- Контекст выполнения
- node
- Операционная система
- linux
- Архитектура
- x64
- Среда выполнения
- node
- Язык
- node
- Менеджер пакетов
- npm
Среды запусков проверки
- Контекст выполнения
- node 22
- Операционная система
- 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-17
Кейс
- Цель
- Control script execution scope and capture uncaught script exceptions using JSDOM runScripts modes and VirtualConsole event routing HOW
- Пакеты
-
jsdom 26.1.0
- Окружение
- node
- Создан
- 2026-08-17T17:23:31Z
Что обычно предполагают
HTML script tags and inline event handlers execute automatically in JSDOM, and any unhandled script exceptions throw synchronous runtime errors from the JSDOM constructor.
Автор образца записал здесь то, чего ожидал бы разработчик или модель. Контракт ниже — это то, что действительно выполнялось.
Контракт
- 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.
- 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.
- Configuring runScripts to dangerously executes inline script tags and event handler attributes within the JSDOM window context.
- 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.
- 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
Квитанции проверки
- node 22 · linux alpine/x64 · docker · CONTAINER_RUN · compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS · node-typescript@1 · 2026-08-17 · ed25519:d91480838ac982c9