Skip to content
Closed
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
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.
  • Loading branch information
BridgeAR committed May 14, 2018
commit 52eb6035107c1a35fe0d5875c4f6c985826843d9
25 changes: 0 additions & 25 deletions test/common/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -310,8 +310,6 @@ let knownGlobals = [
clearImmediate,
clearInterval,
clearTimeout,
console,
constructor, // Enumerable in V8 3.21.
global,
process,
setImmediate,
Expand Down Expand Up @@ -341,29 +339,6 @@ if (global.COUNTER_NET_SERVER_CONNECTION) {
knownGlobals.push(COUNTER_HTTP_CLIENT_RESPONSE);
}

if (global.ArrayBuffer) {
knownGlobals.push(ArrayBuffer);
knownGlobals.push(Int8Array);
knownGlobals.push(Uint8Array);
knownGlobals.push(Uint8ClampedArray);
knownGlobals.push(Int16Array);
knownGlobals.push(Uint16Array);
knownGlobals.push(Int32Array);
knownGlobals.push(Uint32Array);
knownGlobals.push(Float32Array);
knownGlobals.push(Float64Array);
knownGlobals.push(DataView);
}

// Harmony features.
if (global.Proxy) {
knownGlobals.push(Proxy);
}

if (global.Symbol) {
knownGlobals.push(Symbol);
}

if (process.env.NODE_TEST_KNOWN_GLOBALS) {
const knownFromEnv = process.env.NODE_TEST_KNOWN_GLOBALS.split(',');
allowGlobals(...knownFromEnv);
Expand Down
25 changes: 0 additions & 25 deletions test/common/index.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ let knownGlobals = [
clearImmediate,
clearInterval,
clearTimeout,
console,
constructor, // Enumerable in V8 3.21.
global,
process,
setImmediate,
Expand Down Expand Up @@ -50,29 +48,6 @@ export function leakedGlobals() {
knownGlobals.push(COUNTER_HTTP_CLIENT_RESPONSE);
}

if (global.ArrayBuffer) {
knownGlobals.push(ArrayBuffer);
knownGlobals.push(Int8Array);
knownGlobals.push(Uint8Array);
knownGlobals.push(Uint8ClampedArray);
knownGlobals.push(Int16Array);
knownGlobals.push(Uint16Array);
knownGlobals.push(Int32Array);
knownGlobals.push(Uint32Array);
knownGlobals.push(Float32Array);
knownGlobals.push(Float64Array);
knownGlobals.push(DataView);
}

// Harmony features.
if (global.Proxy) {
knownGlobals.push(Proxy);
}

if (global.Symbol) {
knownGlobals.push(Symbol);
}

const leaked = [];

for (const val in global) {
Expand Down
9 changes: 6 additions & 3 deletions test/message/console_low_stack_space.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
'use strict';
// copy console accessor because requiring ../common touches it
// Copy console accessor because requiring ../common touches it
const consoleDescriptor = Object.getOwnPropertyDescriptor(global, 'console');
delete global.console;
global.console = {};
Object.defineProperty(global, 'console', {
configurable: true,
writable: true,
value: {}
});

require('../common');

Expand Down