summaryrefslogtreecommitdiff
path: root/scripts/spidermonkify.py
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/spidermonkify.py')
-rw-r--r--scripts/spidermonkify.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/scripts/spidermonkify.py b/scripts/spidermonkify.py
index d7b2ea138..9c99b4087 100644
--- a/scripts/spidermonkify.py
+++ b/scripts/spidermonkify.py
@@ -52,6 +52,16 @@ 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"))))'
+investigate with
+>>> map(chr, map(ord, open('moz.wasm').read()))
+or
+import json; print json.dumps(map(chr,
+map(ord, open('moz.wasm').read()))).replace(',', '\n')
+'''
subprocess.check_call(
emscripten.shared.SPIDERMONKEY_ENGINE +
['-e', 'os.file.writeTypedArrayToFile("' + wasm_target +