aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/preamble.js2
-rw-r--r--src/shell.js8
2 files changed, 2 insertions, 8 deletions
diff --git a/src/preamble.js b/src/preamble.js
index 41017676..ef34da6b 100644
--- a/src/preamble.js
+++ b/src/preamble.js
@@ -281,7 +281,7 @@ Module["ccall"] = ccall;
// Returns the C function with a specified identifier (for C++, you need to do manual name mangling)
function getCFunc(ident) {
try {
- var func = globalScope['Module']['_' + ident]; // closure exported function
+ var func = Module['_' + ident]; // closure exported function
if (!func) func = eval('_' + ident); // explicit lookup
} catch(e) {
}
diff --git a/src/shell.js b/src/shell.js
index 1f987926..11420123 100644
--- a/src/shell.js
+++ b/src/shell.js
@@ -1,9 +1,4 @@
-try {
- this['Module'] = Module;
- Module.test;
-} catch(e) {
- this['Module'] = Module = {};
-}
+var Module = typeof {{{ EXPORT_NAME }}} !== 'undefined' ? {{{ EXPORT_NAME }}} : {};
// The environment setup code below is customized to use Module.
// *** Environment setup code ***
@@ -150,4 +145,3 @@ if (!Module['postRun']) Module['postRun'] = [];
{{BODY}}
// {{MODULE_ADDITIONS}}
-