Permalink
Browse files

Making "root" available in both context and non-context mode.

  • Loading branch information...
1 parent 0906f94 commit c5eb1b55d9e329d477b9b9ba9b24d681c287491c Herbert Vojčík committed with ry Aug 18, 2010
Showing with 2 additions and 2 deletions.
  1. +2 −2 src/node.js
View
@@ -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);
}

0 comments on commit c5eb1b5

Please sign in to comment.