Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
lib: expose global ErrorEvent
  • Loading branch information
Richienb committed Jul 12, 2025
commit 7a8144c4accde5866119873b85aa86262f070fc7
8 changes: 8 additions & 0 deletions doc/api/globals.md
Original file line number Diff line number Diff line change
Expand Up @@ -454,6 +454,14 @@ changes:

A browser-compatible implementation of [`DecompressionStream`][].

## `ErrorEvent`

<!-- YAML
added: REPLACEME
-->

A browser-compatible implementation of {ErrorEvent}.

## Class: `Event`

<!-- YAML
Expand Down
4 changes: 4 additions & 0 deletions lib/eslint.config_partial.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,10 @@ export default [
name: 'DOMException',
message: "Use lazy function `const { lazyDOMExceptionClass } = require('internal/util');` instead of the global.",
},
{
name: 'ErrorEvent',
message: "Use `const { ErrorEvent } = require('internal/deps/undici/undici');` instead of the global.",
},
{
name: 'Event',
message: "Use `const { Event } = require('internal/event_target');` instead of the global.",
Expand Down
2 changes: 1 addition & 1 deletion lib/internal/bootstrap/web/exposed-window-or-worker.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ ObjectDefineProperty(globalThis, 'fetch', {
// https://fetch.spec.whatwg.org/#request-class
// https://fetch.spec.whatwg.org/#response-class
exposeLazyInterfaces(globalThis, 'internal/deps/undici/undici', [
'FormData', 'Headers', 'Request', 'Response', 'MessageEvent', 'CloseEvent',
'FormData', 'Headers', 'Request', 'Response', 'MessageEvent', 'CloseEvent', 'ErrorEvent',
]);

// https://html.spec.whatwg.org/multipage/server-sent-events.html#server-sent-events.org/
Expand Down
1 change: 1 addition & 0 deletions test/common/globals.js
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@ const webIdlExposedWindow = new Set([
'WebSocket',
'EventSource',
'CloseEvent',
'ErrorEvent',
]);

const nodeGlobals = new Set([
Expand Down
1 change: 1 addition & 0 deletions test/eslint.config_partial.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ export default [
globals: {
...globals.node,
CloseEvent: true,
ErrorEvent: true,
},
},
rules: {
Expand Down