diff options
-rwxr-xr-x | emscripten.py | 5 | ||||
-rw-r--r-- | src/modules.js | 3 |
2 files changed, 5 insertions, 3 deletions
diff --git a/emscripten.py b/emscripten.py index bb78e311..a93095a9 100755 --- a/emscripten.py +++ b/emscripten.py @@ -312,9 +312,12 @@ for (var _export in asm) Module[_export] = asm[_export]; post_file = temp_files.get('.post.ll').name open(post_file, 'w').write('\n') # no input, just processing of forwarded data out = shared.run_js(compiler, shared.COMPILER_ENGINE, [settings_file, post_file, 'post', forwarded_file] + libraries, stdout=subprocess.PIPE, cwd=path_from_root('src')) + post, forwarded_data = out.split('//FORWARDED_DATA:') + forwarded_json = json.loads(forwarded_data) + outfile.write(forwarded_json['Functions']['tables']) #if DEBUG: outfile.write('// post\n') - outfile.write(indexize(out)) + outfile.write(indexize(post)) if DEBUG: print >> sys.stderr, ' emscript: phase 3 took %s seconds' % (time.time() - t) outfile.close() diff --git a/src/modules.js b/src/modules.js index 2dc6c342..dbe1e43a 100644 --- a/src/modules.js +++ b/src/modules.js @@ -274,7 +274,7 @@ var Functions = { // Shared libraries reuse the parent's function table. ret += 'FUNCTION_TABLE.push.apply(FUNCTION_TABLE_' + t + ', [' + indices + ']);\n'; } else { - ret += 'FUNCTION_TABLE_' + t + ' = [' + indices + '];\nModule["FUNCTION_TABLE_' + t + '"] = FUNCTION_TABLE_' + t + ';\n'; + ret += 'var FUNCTION_TABLE_' + t + ' = [' + indices + '];\n'; } } Functions.tables = ret; @@ -341,7 +341,6 @@ var PassManager = { } })); } else if (phase == 'post') { -printErr('forward post!'); print('\n//FORWARDED_DATA:' + JSON.stringify({ Functions: { tables: Functions.tables } })); |