From c5eb1b55d9e329d477b9b9ba9b24d681c287491c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Herbert=20Voj=C4=8D=C3=ADk?= Date: Thu, 19 Aug 2010 01:37:45 +0200 Subject: [PATCH] Making "root" available in both context and non-context mode. --- src/node.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/node.js b/src/node.js index 3561406b35..d38f12d67a 100644 --- a/src/node.js +++ b/src/node.js @@ -3,6 +3,7 @@ process.global.process = process; process.global.global = process.global; global.GLOBAL = global; +global.root = global; /** deprecation errors ************************************************/ @@ -429,7 +430,7 @@ var module = (function () { sandbox.__filename = filename; sandbox.__dirname = dirname; sandbox.module = self; - sandbox.root = global; + sandbox.root = root; Script.runInNewContext(content, sandbox, filename); @@ -441,7 +442,6 @@ var module = (function () { global.__filename = filename; global.__dirname = dirname; global.module = self; - global.root = global; Script.runInThisContext(content, filename); }