process
Advanced tools
Comparing version 0.11.3 to 0.11.4
// shim for using process in browser | ||
var process = module.exports = {}; | ||
// cached from whatever global is present so that test runners that stub it don't break things. | ||
var cachedSetTimeout = setTimeout; | ||
var cachedClearTimeout = clearTimeout; | ||
var queue = []; | ||
@@ -28,3 +33,3 @@ var draining = false; | ||
} | ||
var timeout = setTimeout(cleanUpNextTick); | ||
var timeout = cachedSetTimeout(cleanUpNextTick); | ||
draining = true; | ||
@@ -46,3 +51,3 @@ | ||
draining = false; | ||
clearTimeout(timeout); | ||
cachedClearTimeout(timeout); | ||
} | ||
@@ -59,3 +64,3 @@ | ||
if (queue.length === 1 && !draining) { | ||
setTimeout(drainQueue, 0); | ||
cachedSetTimeout(drainQueue, 0); | ||
} | ||
@@ -62,0 +67,0 @@ }; |
@@ -11,3 +11,3 @@ { | ||
}, | ||
"version": "0.11.3", | ||
"version": "0.11.4", | ||
"repository": { | ||
@@ -14,0 +14,0 @@ "type": "git", |
27
test.js
@@ -66,2 +66,29 @@ var assert = require('assert'); | ||
}); | ||
describe('rename globals', function (t) { | ||
it('throws an error', function (done){ | ||
var oldTimeout = setTimeout; | ||
var oldClear = clearTimeout; | ||
function cleanUp() { | ||
setTimeout = oldTimeout; | ||
clearTimeout = oldClear; | ||
} | ||
setTimeout = function () { | ||
cleanUp(); | ||
assert.ok(false); | ||
done(); | ||
} | ||
clearTimeout = function () { | ||
cleanUp(); | ||
assert.ok(false); | ||
done(); | ||
} | ||
ourProcess.nextTick(function () { | ||
cleanUp(); | ||
assert.ok(true); | ||
done(); | ||
}); | ||
}); | ||
}); | ||
} |
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
8258
176
0