From 5e3f26285100854cead459effe409e250a6b4d2f Mon Sep 17 00:00:00 2001 From: Alon Zakai Date: Tue, 11 Oct 2016 11:51:19 -0700 Subject: update spidermonkify.py --- scripts/spidermonkify.py | 19 +------------------ 1 file changed, 1 insertion(+), 18 deletions(-) (limited to 'scripts/spidermonkify.py') diff --git a/scripts/spidermonkify.py b/scripts/spidermonkify.py index b199faafc..69ad437f1 100644 --- a/scripts/spidermonkify.py +++ b/scripts/spidermonkify.py @@ -22,7 +22,6 @@ This is meant to be run using BINARYEN_SCRIPTS in emcc, and not standalone. ''' import os -import shutil import subprocess import sys @@ -35,27 +34,11 @@ wast_target = sys.argv[2] wasm_target = wast_target[:-5] + '.wasm' -base_wast_target = os.path.basename(wast_target) -base_wasm_target = os.path.basename(wasm_target) - - -def fix(js, before, after): - assert js.count(before) == 1 - return js.replace(before, after) - -# fix up js -js = open(js_target).read() -# use the wasm, not wast -js = js.replace('"' + base_wast_target + '"', '"' + base_wasm_target + '"') -js = js.replace("'" + base_wast_target + "'", "'" + base_wasm_target + "'") -open(js_target, 'w').write(js) -shutil.copyfile(wast_target + '.mappedGlobals', wasm_target + '.mappedGlobals') - # convert to binary using spidermonkey ''' using something like mozjs -e 'os.file.writeTypedArrayToFile("moz.wasm", -new Uint8Array(wasmTextToBinary(os.file.readFile("test/hello_world.wast"))))' +new Uint8Array(wasmTextToBinary(os.file.readFile("a.out.wast"))))' investigate with >>> map(chr, map(ord, open('moz.wasm').read())) or -- cgit v1.2.3