Skip to content

Commit 3531fd6

Browse files
committed
[test] Make global detection work with older node versions
1 parent fefbf04 commit 3531fd6

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

test/core/common.js

+9-3
Original file line numberDiff line numberDiff line change
@@ -82,15 +82,18 @@ process.on('exit', function() {
8282
if (!exports.globalCheck) return;
8383
var knownGlobals = [setTimeout,
8484
setInterval,
85-
setImmediate,
8685
clearTimeout,
8786
clearInterval,
88-
clearImmediate,
8987
console,
9088
Buffer,
9189
process,
9290
global];
9391

92+
if (global.setImmediate) {
93+
knownGlobals.push(setImmediate);
94+
knownGlobals.push(clearImmediate);
95+
}
96+
9497
if (global.errno) {
9598
knownGlobals.push(errno);
9699
}
@@ -114,14 +117,17 @@ process.on('exit', function() {
114117
knownGlobals.push(ArrayBuffer);
115118
knownGlobals.push(Int8Array);
116119
knownGlobals.push(Uint8Array);
117-
knownGlobals.push(Uint8ClampedArray);
118120
knownGlobals.push(Int16Array);
119121
knownGlobals.push(Uint16Array);
120122
knownGlobals.push(Int32Array);
121123
knownGlobals.push(Uint32Array);
122124
knownGlobals.push(Float32Array);
123125
knownGlobals.push(Float64Array);
124126
knownGlobals.push(DataView);
127+
128+
if (global.Uint8ClampedArray) {
129+
knownGlobals.push(Uint8ClampedArray);
130+
}
125131
}
126132

127133
for (var x in global) {

0 commit comments

Comments
 (0)