summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/wasm/wasm-s-parser.cpp3
-rw-r--r--test/wasm2js.asserts.js4
-rw-r--r--test/wasm2js.traps.js8
3 files changed, 9 insertions, 6 deletions
diff --git a/src/wasm/wasm-s-parser.cpp b/src/wasm/wasm-s-parser.cpp
index a42b341f6..98a6cb827 100644
--- a/src/wasm/wasm-s-parser.cpp
+++ b/src/wasm/wasm-s-parser.cpp
@@ -125,6 +125,9 @@ std::ostream& operator<<(std::ostream& o, Element& e) {
}
o << " )";
} else {
+ if (e.dollared()) {
+ o << '$';
+ }
o << e.str_.str;
}
return o;
diff --git a/test/wasm2js.asserts.js b/test/wasm2js.asserts.js
index e2da0da5c..6ff356893 100644
--- a/test/wasm2js.asserts.js
+++ b/test/wasm2js.asserts.js
@@ -74,9 +74,9 @@ function check1() {
return 1 | 0;
}
-if (!check1()) throw 'assertion failed: ( assert_return ( call empty ) )';
+if (!check1()) throw 'assertion failed: ( assert_return ( call $empty ) )';
function check2() {
return (retasmFunc0.add(1 | 0, 1 | 0) | 0 | 0) == (2 | 0) | 0;
}
-if (!check2()) throw 'assertion failed: ( assert_return ( call add ( i32.const 1 ) ( i32.const 1 ) ) ( i32.const 2 ) )';
+if (!check2()) throw 'assertion failed: ( assert_return ( call $add ( i32.const 1 ) ( i32.const 1 ) ) ( i32.const 2 ) )';
diff --git a/test/wasm2js.traps.js b/test/wasm2js.traps.js
index dfe3a5212..f5bb8477f 100644
--- a/test/wasm2js.traps.js
+++ b/test/wasm2js.traps.js
@@ -74,12 +74,12 @@ function check1() {
return 1 | 0;
}
-if (!check1()) throw 'assertion failed: ( assert_return ( call empty ) )';
+if (!check1()) throw 'assertion failed: ( assert_return ( call $empty ) )';
function check2() {
return (retasmFunc0.add(1 | 0, 1 | 0) | 0 | 0) == (2 | 0) | 0;
}
-if (!check2()) throw 'assertion failed: ( assert_return ( call add ( i32.const 1 ) ( i32.const 1 ) ) ( i32.const 2 ) )';
+if (!check2()) throw 'assertion failed: ( assert_return ( call $add ( i32.const 1 ) ( i32.const 1 ) ) ( i32.const 2 ) )';
function check3() {
function f() {
retasmFunc0.div_s(0 | 0, 0 | 0);
@@ -93,7 +93,7 @@ function check3() {
return 0;
}
-if (!check3()) throw 'assertion failed: ( assert_trap ( call div_s ( i32.const 0 ) ( i32.const 0 ) ) integer divide by zero )';
+if (!check3()) throw 'assertion failed: ( assert_trap ( call $div_s ( i32.const 0 ) ( i32.const 0 ) ) integer divide by zero )';
function check4() {
function f() {
retasmFunc0.div_s(-2147483648 | 0, -1 | 0);
@@ -107,4 +107,4 @@ function check4() {
return 0;
}
-if (!check4()) throw 'assertion failed: ( assert_trap ( call div_s ( i32.const 0x80000000 ) ( i32.const -1 ) ) integer overflow )';
+if (!check4()) throw 'assertion failed: ( assert_trap ( call $div_s ( i32.const 0x80000000 ) ( i32.const -1 ) ) integer overflow )';