aboutsummaryrefslogtreecommitdiff
path: root/src/shell.js
diff options
context:
space:
mode:
authorFraser Adams <fraser.adams@blueyonder.co.uk>2013-10-02 19:59:27 +0100
committerFraser Adams <fraser.adams@blueyonder.co.uk>2013-10-02 19:59:27 +0100
commit17be1563475e5a2d7a5e7c88c02061253669db5f (patch)
tree82b35dd5159270f3f55fcc495d502784ac86f326 /src/shell.js
parent4faa7bd2204efbaad697250180fb4f324fed34ab (diff)
fixed problem where module.exports, which is needed by node.js gets incorrectly minified by Closure. Simple change from module.exports = Module to module['exports'] = Module fixes this. Added simple test case compiling with --O2 -closure 1 to /tests/Module-exports
Diffstat (limited to 'src/shell.js')
-rw-r--r--src/shell.js4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/shell.js b/src/shell.js
index 7bfbe781..bb89ab6e 100644
--- a/src/shell.js
+++ b/src/shell.js
@@ -68,7 +68,9 @@ if (ENVIRONMENT_IS_NODE) {
Module['arguments'] = process['argv'].slice(2);
- module.exports = Module;
+ // Explicitly using associative array form instead of dot notation form prevents the closure compiler
+ // minifying the exports property, which is important if Module is to remain visible to node.js
+ module['exports'] = Module;
}
else if (ENVIRONMENT_IS_SHELL) {
Module['print'] = print;