test: allow globals to be whitelisted · nodejs/node@f18b1c9

Skip to content

Navigation Menu

Sign in

Appearance settings

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

Appearance settings

Commit f18b1c9

committed

test: allow globals to be whitelisted

This commit adds a function to test/common.js that allows additional global variables to be whitelisted in a test. PR-URL: #7826 Reviewed-By: James M Snell <jasnell@gmail.com>

1 parent 99f45b2 commit f18b1c9

File tree

1 file changed

+

5

-

0

lines changed

1 file changed

+

5

-

0

lines changed

Lines changed: 5 additions & 0 deletions

Original file line numberDiff line numberDiff line change

@@ -345,6 +345,11 @@ if (global.Symbol) {

345345

knownGlobals.push(Symbol);

346346

}

347347
348+

function allowGlobals(...whitelist) {

349+

knownGlobals = knownGlobals.concat(whitelist);

350+

}

351+

exports.allowGlobals = allowGlobals;

352+
348353

function leakedGlobals() {

349354

var leaked = [];

350355

0 commit comments

Comments

 (0)