From 29626d8731792aaba94ddc7e680e93147b312ab9 Mon Sep 17 00:00:00 2001 From: Ryan Dahl Date: Sat, 1 Jan 2011 21:14:24 -0800 Subject: [PATCH] Syntax error hack for modules. --- src/node.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/node.js b/src/node.js index 7bb85cc4f5..5bc5e46357 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); }