diff --git a/lib/net.js b/lib/net.js index 3f75d16b474..5d11da493d9 100644 --- a/lib/net.js +++ b/lib/net.js @@ -287,12 +287,10 @@ function setImplmentationMethods (self) { // calling emit() after recvMsg() has been called again and end up // emitting null (or another FD). if (recvMsg.fd !== null) { - (function () { - var fd = recvMsg.fd; - process.nextTick(function () { - self.emit('fd', fd); - }); - })(); + var fd = recvMsg.fd; + process.nextTick(function () { + self.emit('fd', fd); + }); } return bytesRead; diff --git a/src/node.js b/src/node.js index 2b8fc249a8a..ab296d2dc1d 100644 --- a/src/node.js +++ b/src/node.js @@ -616,9 +616,7 @@ if (process.argv[1]) { } // REMOVEME: nextTick should not be necessary. This hack to get // test/simple/test-exception-handler2.js working. - process.nextTick(function() { - module.runMain(); - }); + process.nextTick(module.runMain); } else if (process._eval) { // -e, --eval diff --git a/test/message/undefined_reference_in_new_context.out b/test/message/undefined_reference_in_new_context.out index 6d3ab75fffe..bf5d8945ed0 100644 --- a/test/message/undefined_reference_in_new_context.out +++ b/test/message/undefined_reference_in_new_context.out @@ -9,7 +9,6 @@ ReferenceError: foo is not defined at Module._compile (node.js:*) at Object..js (node.js:*) at Module.load (node.js:*) - at Object.runMain (node.js:*) at Array. (node.js:*) at EventEmitter._tickCallback (node.js:*) at node.js:*