summaryrefslogtreecommitdiff
path: root/src/shell.js
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2013-07-16 13:41:37 -0700
committerAlon Zakai <alonzakai@gmail.com>2013-07-16 13:41:37 -0700
commitb0d268d121d8868be33d8633b09499b34a4db45f (patch)
treed67eaf4f5e200b5b5f57099c46a1413d43cbd287 /src/shell.js
parent6b730836aa53f6b4896f24dd8a4b456669ae4f1a (diff)
parent475e72dc5539d9c59fc267927441a502c14a178f (diff)
Merge branch 'incoming'
Diffstat (limited to 'src/shell.js')
-rw-r--r--src/shell.js10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/shell.js b/src/shell.js
index 873bcc65..1f987926 100644
--- a/src/shell.js
+++ b/src/shell.js
@@ -12,10 +12,6 @@ var ENVIRONMENT_IS_WEB = typeof window === 'object';
var ENVIRONMENT_IS_WORKER = typeof importScripts === 'function';
var ENVIRONMENT_IS_SHELL = !ENVIRONMENT_IS_WEB && !ENVIRONMENT_IS_NODE && !ENVIRONMENT_IS_WORKER;
-if (typeof module === "object") {
- module.exports = Module;
-}
-
if (ENVIRONMENT_IS_NODE) {
// Expose functionality in the same simple way that the shells work
// Note that we pollute the global namespace here, otherwise we break in node
@@ -50,6 +46,8 @@ if (ENVIRONMENT_IS_NODE) {
if (!Module['arguments']) {
Module['arguments'] = process['argv'].slice(2);
}
+
+ module.exports = Module;
}
if (ENVIRONMENT_IS_SHELL) {
@@ -68,6 +66,8 @@ if (ENVIRONMENT_IS_SHELL) {
Module['arguments'] = arguments;
}
}
+
+ this['{{{ EXPORT_NAME }}}'] = Module;
}
if (ENVIRONMENT_IS_WEB && !ENVIRONMENT_IS_WORKER) {
@@ -82,6 +82,8 @@ if (ENVIRONMENT_IS_WEB && !ENVIRONMENT_IS_WORKER) {
console.log(x);
};
}
+
+ this['{{{ EXPORT_NAME }}}'] = Module;
}
if (ENVIRONMENT_IS_WEB || ENVIRONMENT_IS_WORKER) {