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:
authorisaacs <i@izs.me>2010-11-22 22:26:37 +0300
committerRyan Dahl <ry@tinyclouds.org>2010-11-22 22:55:31 +0300
commitb52b4196ab22227aea7afef100c4ca8e2f1b8729 (patch)
treec28352ceac4493911dd8df7e933913698c77fd93 /src
parent12554380d541d984d7ddff329d4c664ba48644d5 (diff)
Fix problem with requireNative not exporting 'module' object
Broke require('constants'). Add unrelated test which breaks it.
Diffstat (limited to 'src')
-rw-r--r--src/node.js4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/node.js b/src/node.js
index 9feda005e55..a3a5b2b93d3 100644
--- a/src/node.js
+++ b/src/node.js
@@ -80,10 +80,10 @@ function requireNative (id) {
if (!natives[id]) throw new Error('No such native module ' + id);
var fn = evals.Script.runInThisContext(
- "(function (exports, require) {" + natives[id] + "\n})",
+ "(function (module, exports, require) {" + natives[id] + "\n})",
id + '.js');
var m = {id: id, exports: {}};
- fn(m.exports, requireNative);
+ fn(m, m.exports, requireNative);
m.loaded = true;
internalModuleCache[id] = m;
return m.exports;