mirror of
https://github.com/nodejs/node.git
synced 2026-11-21 12:59:16 -05:00
Removing test-global-between-modules.
Using "global" to push data to require()d modules not supported under NODE_MODULE_CONTEXTS=1.
This commit is contained in:
1 parent
8718fa54f6
commit
2a03d5802b
3 files changed
-52
No files matched your search
Vendored
-13
@@ -1,13 +0,0 @@
|
||||
foo1 = "foo1";
|
||||
global.bar1 = "bar1";
|
||||
|
||||
var sub2 = require('./sub2');
|
||||
|
||||
|
||||
exports.subGlobalKeys = function () {
|
||||
return sub2.globalKeys();
|
||||
};
|
||||
|
||||
exports.subAllFooBars = function () {
|
||||
return sub2.allFooBars();
|
||||
};
|
||||
Vendored
-18
@@ -1,18 +0,0 @@
|
||||
foo2 = "foo2";
|
||||
global.bar2 = "bar2";
|
||||
|
||||
|
||||
exports.globalKeys = function () {
|
||||
return Object.getOwnPropertyNames(global);
|
||||
};
|
||||
|
||||
exports.allFooBars = function () {
|
||||
return {
|
||||
foo0: global.foo0,
|
||||
bar0: bar0,
|
||||
foo1: global.foo1,
|
||||
bar1: bar1,
|
||||
foo2: global.foo2,
|
||||
bar2: bar2
|
||||
};
|
||||
};
|
||||
@@ -1,21 +0,0 @@
|
||||
common = require("../common");
|
||||
assert = common.assert
|
||||
|
||||
foo0 = "foo0";
|
||||
global.bar0 = "bar0";
|
||||
|
||||
var module = require("../fixtures/global/sub1"),
|
||||
keys = module.subGlobalKeys();
|
||||
|
||||
var fooBarKeys = keys.filter(
|
||||
function (x) { return x.match(/^foo/) || x.match(/^bar/); }
|
||||
);
|
||||
fooBarKeys.sort();
|
||||
assert.equal("bar0,bar1,bar2,foo0,foo1,foo2", fooBarKeys.join(), "global keys not as expected: "+JSON.stringify(keys));
|
||||
|
||||
var fooBars = module.subAllFooBars();
|
||||
|
||||
assert.equal("foo0", fooBars.foo0, "x from base level not visible in deeper levels.");
|
||||
assert.equal("bar0", fooBars.bar0, "global.x from base level not visible in deeper levels.");
|
||||
assert.equal("foo1", fooBars.foo1, "x from medium level not visible in deeper levels.");
|
||||
assert.equal("bar1", fooBars.bar1, "global.x from medium level not visible in deeper levels.");
|
||||
Reference in new issue
Block a user