Skip to content

Commit cec0148

Browse files
authored
Temporarily modify wasm2js expectations to allow binaryen change to roll in. (#17860)
1 parent 28f9210 commit cec0148

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

test/test_other.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9455,7 +9455,8 @@ def test(args, closure, opt):
94559455

94569456
@parameterized({
94579457
'hello_world_wasm': ('hello_world', False, True),
9458-
'hello_world_wasm2js': ('hello_world', True, True),
9458+
# Temporarily disabled compare_js_output here while https://github.com/WebAssembly/binaryen/pull/5018 rolls in
9459+
'hello_world_wasm2js': ('hello_world', True, False),
94599460
'random_printf_wasm': ('random_printf', False),
94609461
'random_printf_wasm2js': ('random_printf', True),
94619462
'hello_webgl_wasm': ('hello_webgl', False),

tools/maybe_wasm2js.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,12 @@
4545
cmd += opts
4646
js = shared.run_process(cmd, stdout=subprocess.PIPE).stdout
4747
# assign the instantiate function to where it will be used
48-
js = shared.do_replace(js, 'function instantiate(asmLibraryArg) {',
49-
"Module['__wasm2jsInstantiate__'] = function(asmLibraryArg) {")
48+
if 'instantiate(asmLibraryArg)' in js:
49+
js = shared.do_replace(js, 'function instantiate(asmLibraryArg) {',
50+
"Module['__wasm2jsInstantiate__'] = function(asmLibraryArg) {")
51+
else:
52+
js = shared.do_replace(js, 'function instantiate(info) {',
53+
"Module['__wasm2jsInstantiate__'] = function(info) {")
5054

5155
# create the combined js to run in wasm2js mode
5256
print('var Module = { doWasm2JS: true };\n')

0 commit comments

Comments
 (0)