Permalink
Browse files

Fixes to Node implementation.

  • Loading branch information...
1 parent 62425e9 commit f378d5832392e7c1354e18f2d2d0c1feaf927ff1 @domenic domenic committed Dec 30, 2012
Showing with 5 additions and 4 deletions.
  1. +1 −0 .jshintrc
  2. +4 −4 setImmediate.js
View
@@ -9,6 +9,7 @@
"latedef": true,
"newcap": true,
"noarg": true,
+ "node": true,
"nonew": true,
"nomen": true,
"quotmark": "double",
View
@@ -75,8 +75,8 @@
function canUseNextTick() {
// Don't get fooled by e.g. browserify environments.
- return typeof global.process === "object" &&
- Object.prototype.toString.call(global.process) === "[object process]";
+ return typeof process === "object" &&
+ Object.prototype.toString.call(process) === "[object process]";
}
function hasMicrosoftImplementation() {
@@ -114,7 +114,7 @@
attachTo.setImmediate = function () {
var handle = tasks.addFromSetImmediateArguments(arguments);
- global.process.nextTick(function () {
+ process.nextTick(function () {
tasks.runIfPresent(handle);
});
@@ -241,4 +241,4 @@
attachTo.clearImmediate = tasks.remove;
}
}
-}(this));
+}(typeof global === "object" && global ? global : this));

0 comments on commit f378d58

Please sign in to comment.