Skip to content

Commit

Permalink
[test] Make global detection work with older node versions
Browse files Browse the repository at this point in the history
  • Loading branch information
mmalecki committed Oct 28, 2012
1 parent fefbf04 commit 3531fd6
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions test/core/common.js
Expand Up @@ -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);
} }
Expand All @@ -114,14 +117,17 @@ 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);
knownGlobals.push(Uint32Array); knownGlobals.push(Uint32Array);
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) {
Expand Down

0 comments on commit 3531fd6

Please sign in to comment.