summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2016-10-11 16:15:15 -0700
committerGitHub <noreply@github.com>2016-10-11 16:15:15 -0700
commit85900965a12a3f07c9cca8ef620d4bee039f16fc (patch)
tree184203f372600d547705ce3d11b616d52ad522aa /scripts
parent1dbdfff8e997f74154dfebce124756e415aa431a (diff)
parent943fd287247f9d23d463a24e8eb4b0f666900c43 (diff)
downloadbinaryen-85900965a12a3f07c9cca8ef620d4bee039f16fc.tar.gz
binaryen-85900965a12a3f07c9cca8ef620d4bee039f16fc.tar.bz2
binaryen-85900965a12a3f07c9cca8ef620d4bee039f16fc.zip
Merge pull request #757 from WebAssembly/js-api
Tiny fixes for native wasm support
Diffstat (limited to 'scripts')
-rw-r--r--scripts/spidermonkify.py19
1 files changed, 1 insertions, 18 deletions
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