diff options
author | Bruce Mitchener <bruce.mitchener@gmail.com> | 2014-02-20 18:03:33 +0700 |
---|---|---|
committer | Bruce Mitchener <bruce.mitchener@gmail.com> | 2014-02-21 07:42:28 +0700 |
commit | d4edc4c8614d43d3b46c6d01bbc00bd00835587e (patch) | |
tree | 589cb32e668f556eb5a7855fc4a09744c8e09129 /src/postamble.js | |
parent | 686d2e6a68f02da35a4fc4d71c5d152c7ed2d177 (diff) |
strict fix: Don't define functions within conditionals or try blocks.
Diffstat (limited to 'src/postamble.js')
-rw-r--r-- | src/postamble.js | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/postamble.js b/src/postamble.js index 382d3117..bb1e334c 100644 --- a/src/postamble.js +++ b/src/postamble.js @@ -2,19 +2,21 @@ // === Auto-generated postamble setup entry stuff === if (memoryInitializer) { - function applyData(data) { + if (ENVIRONMENT_IS_NODE || ENVIRONMENT_IS_SHELL) { + var data = Module['readBinary'](memoryInitializer); #if USE_TYPED_ARRAYS == 2 HEAPU8.set(data, STATIC_BASE); #else allocate(data, 'i8', ALLOC_NONE, STATIC_BASE); #endif - } - if (ENVIRONMENT_IS_NODE || ENVIRONMENT_IS_SHELL) { - applyData(Module['readBinary'](memoryInitializer)); } else { addRunDependency('memory initializer'); Browser.asyncLoad(memoryInitializer, function(data) { - applyData(data); +#if USE_TYPED_ARRAYS == 2 + HEAPU8.set(data, STATIC_BASE); +#else + allocate(data, 'i8', ALLOC_NONE, STATIC_BASE); +#endif removeRunDependency('memory initializer'); }, function(data) { throw 'could not load memory initializer ' + memoryInitializer; |