From 77ce3f2d4f33ed7f451cc2ae8e97c8a63c9ec06e Mon Sep 17 00:00:00 2001 From: Andreu Botella Date: Thu, 6 Mar 2025 20:34:30 +0100 Subject: [PATCH] Add APIs exposed in ShadowRealms As discussed in today's meeting, this PR adds the `CustomEvent`, `globalThis.reportError()` and `globalThis.self` APIs to the Minimum Common API. This is done because they will be exposed in ShadowRealms in browsers, and it is useful for code running in ShadowRealms to also be able to run in server-side runtimes. --- index.bs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/index.bs b/index.bs index 29e0baf..48964ac 100644 --- a/index.bs +++ b/index.bs @@ -46,6 +46,7 @@ Interfaces: * {{CountQueuingStrategy}} * {{Crypto}} * {{CryptoKey}} +* {{CustomEvent}} * DecompressionStream * {{DOMException}} * {{Event}} @@ -98,6 +99,15 @@ Global methods / properties: * globalThis.{{performance}}.{{Performance/now()}} * globalThis.{{performance}}.{{timeOrigin}} * globalThis.{{queueMicrotask()}} +* globalThis.{{reportError()}} +* globalThis.self (on {{Window/self|Window}} and {{WorkerGlobalScope/self|WorkerGlobalScope}}) + + Note: This returns the value of `globalThis`. + + Issue: When the ShadowRealm integration PR + is merged into the HTML spec, + `self` will also need to be exposed on `ShadowRealmGlobalScope`. + * globalThis.{{setTimeout()}} / globalThis.{{clearTimeout()}} * globalThis.{{setInterval()}} / globalThis.{{clearInterval()}} * globalThis.{{structuredClone()}}