diff options
author | Ryan Dahl <ry@tinyclouds.org> | 2010-11-22 02:16:02 +0300 |
---|---|---|
committer | Ryan Dahl <ry@tinyclouds.org> | 2010-11-22 02:16:02 +0300 |
commit | a16b3c3148554ec07ba3dd5581a6b1d2e4d62752 (patch) | |
tree | 2cb3fd7b8b6d1a070413df699a2b8597b6dd8eda /src | |
parent | b1088d6bd20a9c07614871604bdd71fea6814629 (diff) |
Use runInNewContext instead of process.compile
Diffstat (limited to 'src')
-rw-r--r-- | src/node.js | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/src/node.js b/src/node.js index 858039d9f18..377625d48f0 100644 --- a/src/node.js +++ b/src/node.js @@ -28,7 +28,7 @@ process.assert = function (x, msg) { }; var writeError = process.binding('stdio').writeError; - +var evals = process.binding('evals'); // lazy loaded. var constants; @@ -118,7 +118,7 @@ var module = (function () { return replModule.exports; } - var fn = process.compile( + var fn = evals.Script.runInThisContext( "(function (exports, require) {" + natives[id] + "\n})", id + '.js'); var m = new Module(id); @@ -303,8 +303,6 @@ var module = (function () { var dirname = path.dirname(filename); if (contextLoad) { - if (!Script) Script = process.binding('evals').Script; - if (self.id !== ".") { debug('load submodule'); // not root module @@ -320,7 +318,7 @@ var module = (function () { sandbox.global = sandbox; sandbox.root = root; - Script.runInNewContext(content, sandbox, filename); + evals.Script.runInNewContext(content, sandbox, filename); } else { debug('load root module'); @@ -330,7 +328,7 @@ var module = (function () { global.__filename = filename; global.__dirname = dirname; global.module = self; - Script.runInThisContext(content, filename); + evals.Script.runInThisContext(content, filename); } } else { @@ -339,7 +337,7 @@ var module = (function () { + content + "\n});"; - var compiledWrapper = process.compile(wrapper, filename); + var compiledWrapper = evals.Script.runInThisContext(wrapper, filename); if (filename === process.argv[1] && global.v8debug) { global.v8debug.Debug.setBreakPoint(compiledWrapper, 0, 0); } |