mirror of
https://github.com/zebrajr/node.git
synced 2025-12-06 12:20:27 +01:00
lib: expose global ErrorEvent
PR-URL: https://github.com/nodejs/node/pull/58920 Reviewed-By: Zeyu "Alex" Yang <himself65@outlook.com> Reviewed-By: Matthew Aitken <maitken033380023@gmail.com> Reviewed-By: Jason Zhang <xzha4350@gmail.com> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: Filip Skokan <panva.ip@gmail.com>
This commit is contained in:
parent
f5e6ba3d7c
commit
663554abdf
|
|
@ -454,6 +454,14 @@ changes:
|
|||
|
||||
A browser-compatible implementation of [`DecompressionStream`][].
|
||||
|
||||
## `ErrorEvent`
|
||||
|
||||
<!-- YAML
|
||||
added: REPLACEME
|
||||
-->
|
||||
|
||||
A browser-compatible implementation of {ErrorEvent}.
|
||||
|
||||
## Class: `Event`
|
||||
|
||||
<!-- YAML
|
||||
|
|
|
|||
|
|
@ -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.",
|
||||
|
|
|
|||
|
|
@ -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/
|
||||
|
|
|
|||
|
|
@ -132,6 +132,7 @@ const webIdlExposedWindow = new Set([
|
|||
'WebSocket',
|
||||
'EventSource',
|
||||
'CloseEvent',
|
||||
'ErrorEvent',
|
||||
]);
|
||||
|
||||
const nodeGlobals = new Set([
|
||||
|
|
|
|||
|
|
@ -12,6 +12,7 @@ export default [
|
|||
globals: {
|
||||
...globals.node,
|
||||
CloseEvent: true,
|
||||
ErrorEvent: true,
|
||||
},
|
||||
},
|
||||
rules: {
|
||||
|
|
|
|||
|
|
@ -140,6 +140,7 @@ const customTypesMap = {
|
|||
'EventListener': 'events.html#event-listener',
|
||||
|
||||
'CloseEvent': `${mdnPrefix}/API/CloseEvent`,
|
||||
'ErrorEvent': `${mdnPrefix}/API/ErrorEvent`,
|
||||
'EventSource': `${mdnPrefix}/API/EventSource`,
|
||||
'MessageEvent': `${mdnPrefix}/API/MessageEvent`,
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user