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: https://github.com/nodejs/node/pull/7826
Reviewed-By: James M Snell <jasnell@gmail.com>
This commit is contained in:
cjihrig 2016-07-21 12:44:01 -04:00
parent 99f45b2476
commit f18b1c91b8

View File

@ -345,6 +345,11 @@ if (global.Symbol) {
knownGlobals.push(Symbol);
}
function allowGlobals(...whitelist) {
knownGlobals = knownGlobals.concat(whitelist);
}
exports.allowGlobals = allowGlobals;
function leakedGlobals() {
var leaked = [];