aboutsummaryrefslogtreecommitdiff
path: root/src/shell.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/shell.js')
-rw-r--r--src/shell.js6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/shell.js b/src/shell.js
index 84844c85..e1c0eb54 100644
--- a/src/shell.js
+++ b/src/shell.js
@@ -14,7 +14,11 @@
// before the code. Then that object will be used in the code, and you
// can continue to use Module afterwards as well.
var Module;
+#if CLOSURE_COMPILER
if (!Module) Module = eval('(function() { try { return {{{ EXPORT_NAME }}} || {} } catch(e) { return {} } })()');
+#else
+if (!Module) Module = (typeof {{{ EXPORT_NAME }}} !== 'undefined' ? {{{ EXPORT_NAME }}} : null) || {};
+#endif
// Sometimes an existing Module object exists with properties
// meant to overwrite the default module functionality. Here
@@ -124,7 +128,7 @@ else if (ENVIRONMENT_IS_WEB || ENVIRONMENT_IS_WORKER) {
}
if (ENVIRONMENT_IS_WEB) {
- this['{{{ EXPORT_NAME }}}'] = Module;
+ window['{{{ EXPORT_NAME }}}'] = Module;
} else {
Module['load'] = importScripts;
}