diff options
author | Alon Zakai <alonzakai@gmail.com> | 2011-07-30 10:26:30 -0700 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2011-07-30 10:26:30 -0700 |
commit | f6e02c614a905658fe164e19548d4436854253bd (patch) | |
tree | bf054e29b2455430d03108b00180ca607eb9dea4 /emscripten.py | |
parent | 778b071526306906ecf3c09aa307ededa1c4eddf (diff) |
workarounds for js engine bugs
Diffstat (limited to 'emscripten.py')
-rwxr-xr-x | emscripten.py | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/emscripten.py b/emscripten.py index b77c361d..a770cdd6 100755 --- a/emscripten.py +++ b/emscripten.py @@ -150,13 +150,12 @@ def emscript(infile, settings, outfile): defined in src/settings.js. outfile: The file where the output is written. """ - data = open(infile, 'r').read() + settings_file = get_temp_file('.txt').name # Save settings to a file to work around v8 issue 1579 + s = open(settings_file, 'w') + s.write(settings) + s.close() compiler = path_from_root('src', 'compiler.js') - subprocess.Popen(shared.COMPILER_ENGINE + [compiler], - stdin=subprocess.PIPE, - stdout=outfile, - cwd=path_from_root('src'), - stderr=subprocess.STDOUT).communicate(settings + '\n' + data) + shared.run_js(shared.COMPILER_ENGINE, compiler, [settings_file, infile], stdout=outfile, stderr=subprocess.STDOUT, cwd=path_from_root('src')) outfile.close() |