From 02625158ebd0a15eaa6524fdbbc3af23497bb34f Mon Sep 17 00:00:00 2001 From: Alon Zakai Date: Fri, 21 Jun 2024 08:30:55 -0700 Subject: 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. --- test/wasm2js/refs.2asm.js.opt | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'test/wasm2js/refs.2asm.js.opt') diff --git a/test/wasm2js/refs.2asm.js.opt b/test/wasm2js/refs.2asm.js.opt index 0071a15b5..ee8c25a7c 100644 --- a/test/wasm2js/refs.2asm.js.opt +++ b/test/wasm2js/refs.2asm.js.opt @@ -53,6 +53,10 @@ function asmFunc(imports) { funcref_temps(funcref_temps, 0.0); } + function named_type_temps() { + return named_type_temps; + } + return { "null_": null_, "is_null": is_null, @@ -61,7 +65,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 }; } @@ -75,3 +80,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; -- cgit v1.2.3