Skip to content

Commit 5ffce3e

Browse files
BridgeARMylesBorins
authored andcommitted
test: remove untested knownGlobals
These values are all non-enumerable and will never be checked. By removing them, we make sure they will not become enumerable unnoticed. PR-URL: #20717 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Matteo Collina <[email protected]>
1 parent e7c2616 commit 5ffce3e

File tree

3 files changed

+6
-53
lines changed

3 files changed

+6
-53
lines changed

test/common/index.js

-25
Original file line numberDiff line numberDiff line change
@@ -310,8 +310,6 @@ let knownGlobals = [
310310
clearImmediate,
311311
clearInterval,
312312
clearTimeout,
313-
console,
314-
constructor, // Enumerable in V8 3.21.
315313
global,
316314
process,
317315
setImmediate,
@@ -341,29 +339,6 @@ if (global.COUNTER_NET_SERVER_CONNECTION) {
341339
knownGlobals.push(COUNTER_HTTP_CLIENT_RESPONSE);
342340
}
343341

344-
if (global.ArrayBuffer) {
345-
knownGlobals.push(ArrayBuffer);
346-
knownGlobals.push(Int8Array);
347-
knownGlobals.push(Uint8Array);
348-
knownGlobals.push(Uint8ClampedArray);
349-
knownGlobals.push(Int16Array);
350-
knownGlobals.push(Uint16Array);
351-
knownGlobals.push(Int32Array);
352-
knownGlobals.push(Uint32Array);
353-
knownGlobals.push(Float32Array);
354-
knownGlobals.push(Float64Array);
355-
knownGlobals.push(DataView);
356-
}
357-
358-
// Harmony features.
359-
if (global.Proxy) {
360-
knownGlobals.push(Proxy);
361-
}
362-
363-
if (global.Symbol) {
364-
knownGlobals.push(Symbol);
365-
}
366-
367342
if (process.env.NODE_TEST_KNOWN_GLOBALS) {
368343
const knownFromEnv = process.env.NODE_TEST_KNOWN_GLOBALS.split(',');
369344
allowGlobals(...knownFromEnv);

test/common/index.mjs

-25
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@ let knownGlobals = [
88
clearImmediate,
99
clearInterval,
1010
clearTimeout,
11-
console,
12-
constructor, // Enumerable in V8 3.21.
1311
global,
1412
process,
1513
setImmediate,
@@ -50,29 +48,6 @@ export function leakedGlobals() {
5048
knownGlobals.push(COUNTER_HTTP_CLIENT_RESPONSE);
5149
}
5250

53-
if (global.ArrayBuffer) {
54-
knownGlobals.push(ArrayBuffer);
55-
knownGlobals.push(Int8Array);
56-
knownGlobals.push(Uint8Array);
57-
knownGlobals.push(Uint8ClampedArray);
58-
knownGlobals.push(Int16Array);
59-
knownGlobals.push(Uint16Array);
60-
knownGlobals.push(Int32Array);
61-
knownGlobals.push(Uint32Array);
62-
knownGlobals.push(Float32Array);
63-
knownGlobals.push(Float64Array);
64-
knownGlobals.push(DataView);
65-
}
66-
67-
// Harmony features.
68-
if (global.Proxy) {
69-
knownGlobals.push(Proxy);
70-
}
71-
72-
if (global.Symbol) {
73-
knownGlobals.push(Symbol);
74-
}
75-
7651
const leaked = [];
7752

7853
for (const val in global) {

test/message/console_low_stack_space.js

+6-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
11
'use strict';
2-
// copy console accessor because requiring ../common touches it
2+
// Copy console accessor because requiring ../common touches it
33
const consoleDescriptor = Object.getOwnPropertyDescriptor(global, 'console');
4-
delete global.console;
5-
global.console = {};
4+
Object.defineProperty(global, 'console', {
5+
configurable: true,
6+
writable: true,
7+
value: {}
8+
});
69

710
require('../common');
811

0 commit comments

Comments
 (0)