aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAnthony Pesch <inolen@gmail.com>2013-07-22 15:04:46 -0700
committerAnthony Pesch <inolen@gmail.com>2013-07-24 14:50:33 -0700
commit005113837b0969b193c6c485f674a132140e39d1 (patch)
tree54569fa8c79cbf0a472930ab088998e7110c7956 /src
parent67b321c1617bd65bf9f24702676c2fdf51e51bb4 (diff)
eliminate default Module global
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}}
-