Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nodejs/node.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorRyan Dahl <ry@tinyclouds.org>2011-01-02 08:14:24 +0300
committerRyan Dahl <ry@tinyclouds.org>2011-01-02 08:14:24 +0300
commit29626d8731792aaba94ddc7e680e93147b312ab9 (patch)
tree6b99090af289c8cbf635bbfe5645efd5586fc717 /src
parent8b352bdc5d0988291750402ec4f30c8bcefcec2f (diff)
Syntax error hack for modules.
Diffstat (limited to 'src')
-rw-r--r--src/node.js9
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);
}