Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[v16.x] test: update list of known globals #45255

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
40 changes: 32 additions & 8 deletions test/common/index.js
Expand Up @@ -291,6 +291,9 @@ if (global.gc) {
knownGlobals.push(global.gc);
}

if (global.Performance) {
knownGlobals.push(global.Performance);
}
if (global.performance) {
knownGlobals.push(global.performance);
}
Expand All @@ -301,16 +304,16 @@ if (global.PerformanceMeasure) {
knownGlobals.push(global.PerformanceMeasure);
}

if (global.fetch) {
knownGlobals.push(
global.fetch,
global.FormData,
global.Request,
global.Response,
global.Headers,
);
// TODO(@ethan-arrowood): Similar to previous checks, this can be temporary
// until v16.x is EOL. Once all supported versions have structuredClone we
// can add this to the list above instead.
if (global.structuredClone) {
knownGlobals.push(global.structuredClone);
}

if (global.fetch) {
knownGlobals.push(fetch);
}
if (hasCrypto && global.crypto) {
knownGlobals.push(global.crypto);
knownGlobals.push(global.Crypto);
Expand All @@ -320,6 +323,27 @@ if (hasCrypto && global.crypto) {
if (global.CustomEvent) {
knownGlobals.push(global.CustomEvent);
}
if (global.ReadableStream) {
knownGlobals.push(
global.ReadableStream,
global.ReadableStreamDefaultReader,
global.ReadableStreamBYOBReader,
global.ReadableStreamBYOBRequest,
global.ReadableByteStreamController,
global.ReadableStreamDefaultController,
global.TransformStream,
global.TransformStreamDefaultController,
global.WritableStream,
global.WritableStreamDefaultWriter,
global.WritableStreamDefaultController,
global.ByteLengthQueuingStrategy,
global.CountQueuingStrategy,
global.TextEncoderStream,
global.TextDecoderStream,
global.CompressionStream,
global.DecompressionStream,
);
}

function allowGlobals(...allowlist) {
knownGlobals = knownGlobals.concat(allowlist);
Expand Down