mirror of
https://github.com/http-party/node-http-proxy.git
synced 2025-12-08 20:59:18 +00:00
[test] Make global detection work with older node versions
This commit is contained in:
parent
fefbf04ac0
commit
3531fd609a
@ -82,15 +82,18 @@ process.on('exit', function() {
|
|||||||
if (!exports.globalCheck) return;
|
if (!exports.globalCheck) return;
|
||||||
var knownGlobals = [setTimeout,
|
var knownGlobals = [setTimeout,
|
||||||
setInterval,
|
setInterval,
|
||||||
setImmediate,
|
|
||||||
clearTimeout,
|
clearTimeout,
|
||||||
clearInterval,
|
clearInterval,
|
||||||
clearImmediate,
|
|
||||||
console,
|
console,
|
||||||
Buffer,
|
Buffer,
|
||||||
process,
|
process,
|
||||||
global];
|
global];
|
||||||
|
|
||||||
|
if (global.setImmediate) {
|
||||||
|
knownGlobals.push(setImmediate);
|
||||||
|
knownGlobals.push(clearImmediate);
|
||||||
|
}
|
||||||
|
|
||||||
if (global.errno) {
|
if (global.errno) {
|
||||||
knownGlobals.push(errno);
|
knownGlobals.push(errno);
|
||||||
}
|
}
|
||||||
@ -114,7 +117,6 @@ process.on('exit', function() {
|
|||||||
knownGlobals.push(ArrayBuffer);
|
knownGlobals.push(ArrayBuffer);
|
||||||
knownGlobals.push(Int8Array);
|
knownGlobals.push(Int8Array);
|
||||||
knownGlobals.push(Uint8Array);
|
knownGlobals.push(Uint8Array);
|
||||||
knownGlobals.push(Uint8ClampedArray);
|
|
||||||
knownGlobals.push(Int16Array);
|
knownGlobals.push(Int16Array);
|
||||||
knownGlobals.push(Uint16Array);
|
knownGlobals.push(Uint16Array);
|
||||||
knownGlobals.push(Int32Array);
|
knownGlobals.push(Int32Array);
|
||||||
@ -122,6 +124,10 @@ process.on('exit', function() {
|
|||||||
knownGlobals.push(Float32Array);
|
knownGlobals.push(Float32Array);
|
||||||
knownGlobals.push(Float64Array);
|
knownGlobals.push(Float64Array);
|
||||||
knownGlobals.push(DataView);
|
knownGlobals.push(DataView);
|
||||||
|
|
||||||
|
if (global.Uint8ClampedArray) {
|
||||||
|
knownGlobals.push(Uint8ClampedArray);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for (var x in global) {
|
for (var x in global) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user