diff options
author | Herbert Vojčík <herby@mailbox.sk> | 2010-08-18 17:47:36 +0200 |
---|---|---|
committer | Ryan Dahl <ry@tinyclouds.org> | 2010-08-18 12:08:39 -0700 |
commit | 2b126da395142f6ffad7ce1c6349056a707d86b4 (patch) | |
tree | 6818ffb6c1a366c7d9898b6490661c89a40f1d7d /test/fixtures/global | |
parent | 5dc2b9331149436b9331deb890bbd2deb6dfe0e5 (diff) | |
download | android-node-v8-2b126da395142f6ffad7ce1c6349056a707d86b4.tar.gz android-node-v8-2b126da395142f6ffad7ce1c6349056a707d86b4.tar.bz2 android-node-v8-2b126da395142f6ffad7ce1c6349056a707d86b4.zip |
Tests for behaviour of 'global'.
Diffstat (limited to 'test/fixtures/global')
-rw-r--r-- | test/fixtures/global/plain.js | 6 | ||||
-rw-r--r-- | test/fixtures/global/sub1.js | 13 | ||||
-rw-r--r-- | test/fixtures/global/sub2.js | 18 |
3 files changed, 37 insertions, 0 deletions
diff --git a/test/fixtures/global/plain.js b/test/fixtures/global/plain.js new file mode 100644 index 0000000000..ae187c29fb --- /dev/null +++ b/test/fixtures/global/plain.js @@ -0,0 +1,6 @@ +foo = "foo"; +global.bar = "bar"; + +exports.fooBar = function () { + return {foo: global.foo, bar: bar}; +}; diff --git a/test/fixtures/global/sub1.js b/test/fixtures/global/sub1.js new file mode 100644 index 0000000000..a89fc7fd04 --- /dev/null +++ b/test/fixtures/global/sub1.js @@ -0,0 +1,13 @@ +foo1 = "foo1"; +global.bar1 = "bar1"; + +var sub2 = require('./sub2'); + + +exports.subGlobalKeys = function () { + return sub2.globalKeys(); +}; + +exports.subAllFooBars = function () { + return sub2.allFooBars(); +}; diff --git a/test/fixtures/global/sub2.js b/test/fixtures/global/sub2.js new file mode 100644 index 0000000000..540bde4ca1 --- /dev/null +++ b/test/fixtures/global/sub2.js @@ -0,0 +1,18 @@ +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 + }; +}; |