diff options
author | Ryan Dahl <ry@tinyclouds.org> | 2011-01-02 08:14:24 +0300 |
---|---|---|
committer | Ryan Dahl <ry@tinyclouds.org> | 2011-01-02 08:14:24 +0300 |
commit | 29626d8731792aaba94ddc7e680e93147b312ab9 (patch) | |
tree | 6b99090af289c8cbf635bbfe5645efd5586fc717 /src | |
parent | 8b352bdc5d0988291750402ec4f30c8bcefcec2f (diff) |
Syntax error hack for modules.
Diffstat (limited to 'src')
-rw-r--r-- | src/node.js | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/node.js b/src/node.js index 7bb85cc4f59..5bc5e46357e 100644 --- a/src/node.js +++ b/src/node.js @@ -90,7 +90,8 @@ var fn = runInThisContext( '(function (module, exports, require) {' + natives[id] + '\n})', - id + '.js'); + id + '.js', + true); var m = {id: id, exports: {}}; fn(m, m.exports, requireNative); m.loaded = true; @@ -334,7 +335,7 @@ sandbox.global = sandbox; sandbox.root = root; - return runInNewContext(content, sandbox, filename); + return runInNewContext(content, sandbox, filename, true); } else { debug('load root module'); // root module @@ -344,7 +345,7 @@ global.__dirname = dirname; global.module = self; - return runInThisContext(content, filename); + return runInThisContext(content, filename, true); } } else { @@ -354,7 +355,7 @@ content + '\n});'; - var compiledWrapper = runInThisContext(wrapper, filename); + var compiledWrapper = runInThisContext(wrapper, filename, true); if (filename === process.argv[1] && global.v8debug) { global.v8debug.Debug.setBreakPoint(compiledWrapper, 0, 0); } |