summaryrefslogtreecommitdiff
path: root/test/wasm2js/refs.2asm.js
diff options
context:
space:
mode:
authorAlon Zakai <azakai@google.com>2024-06-21 08:30:55 -0700
committerGitHub <noreply@github.com>2024-06-21 08:30:55 -0700
commit02625158ebd0a15eaa6524fdbbc3af23497bb34f (patch)
treec9b8261ec5b71c2561ccdefa0739ed25c3d2f069 /test/wasm2js/refs.2asm.js
parentc3089b3b553536ece3b1d6a9cffe82cda1b813e5 (diff)
downloadbinaryen-02625158ebd0a15eaa6524fdbbc3af23497bb34f.tar.gz
binaryen-02625158ebd0a15eaa6524fdbbc3af23497bb34f.tar.bz2
binaryen-02625158ebd0a15eaa6524fdbbc3af23497bb34f.zip
wasm2js: Fix the names of temp vars with named reference types (#6689)
We were missing code to mangle such names for JS. Without that, the name of a temp var for the type `(ref $foo)` would end up with `(`, `)` in the name, which is not valid in JS.
Diffstat (limited to 'test/wasm2js/refs.2asm.js')
-rw-r--r--test/wasm2js/refs.2asm.js10
1 files changed, 9 insertions, 1 deletions
diff --git a/test/wasm2js/refs.2asm.js b/test/wasm2js/refs.2asm.js
index f4c08408f..45e510e37 100644
--- a/test/wasm2js/refs.2asm.js
+++ b/test/wasm2js/refs.2asm.js
@@ -61,6 +61,12 @@ function asmFunc(imports) {
funcref_temps(funcref_temps, +(+((wasm2js_funcref$0 = $2, wasm2js_funcref$1 = $3 || wasm2js_trap(), wasm2js_i32$0 = 0, wasm2js_i32$0 ? wasm2js_funcref$0 : wasm2js_funcref$1) == null | 0)));
}
+ function named_type_temps() {
+ var $0 = null, wasm2js__ref_null_$func_0_$0_1 = null, wasm2js__ref_null_$func_0_$1_1 = null, wasm2js_i32$0 = 0;
+ $0 = named_type_temps;
+ return wasm2js__ref_null_$func_0_$0 = null, wasm2js__ref_null_$func_0_$1 = $0 || wasm2js_trap(), wasm2js_i32$0 = 0, wasm2js_i32$0 ? wasm2js__ref_null_$func_0_$0 : wasm2js__ref_null_$func_0_$1;
+ }
+
return {
"null_": null_,
"is_null": is_null,
@@ -69,7 +75,8 @@ function asmFunc(imports) {
"ref_as": ref_as,
"use_global": use_global,
"use_global_ref": use_global_ref,
- "funcref_temps": funcref_temps
+ "funcref_temps": funcref_temps,
+ "named_type_temps": named_type_temps
};
}
@@ -83,3 +90,4 @@ export var ref_as = retasmFunc.ref_as;
export var use_global = retasmFunc.use_global;
export var use_global_ref = retasmFunc.use_global_ref;
export var funcref_temps = retasmFunc.funcref_temps;
+export var named_type_temps = retasmFunc.named_type_temps;