From 7e4c1285dc8fcdcd5bad5a9df4c2ce6a4fd81483 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Herbert=20Voj=C4=8D=C3=ADk?= Date: Wed, 28 Apr 2010 22:37:09 +0200 Subject: [PATCH] Minor stylistic changes. --- src/node.js | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/src/node.js b/src/node.js index f080ef1c68..d745588c16 100644 --- a/src/node.js +++ b/src/node.js @@ -26,7 +26,7 @@ process.createChildProcess = removed("childProcess API has changed. See doc/api. process.inherits = removed("process.inherits() has moved to sys.inherits."); process.assert = function (x, msg) { - if (!(x)) throw new Error(msg || "assertion error"); + if (!x) throw new Error(msg || "assertion error"); }; process.evalcx = process.binding('evals').Script.runInNewContext; @@ -36,10 +36,8 @@ process.evalcx = process.binding('evals').Script.runInNewContext; var nextTickQueue = []; process._tickCallback = function () { - var l = nextTickQueue.length; - while (l--) { - var cb = nextTickQueue.shift(); - cb(); + for (var l = nextTickQueue.length; l; l--) { + nextTickQueue.shift()(); } }; @@ -135,9 +133,9 @@ var stdin; process.openStdin = function () { if (stdin) return stdin; - var net = module.requireNative('net') - , fs = module.requireNative('fs') - , fd = process.binding('stdio').openStdin(); + var net = basicRequire('net'), + fs = basicRequire('fs'), + fd = process.binding('stdio').openStdin(); if (process.binding('stdio').isStdinBlocking()) { stdin = new net.Stream(fd);