summaryrefslogtreecommitdiff
path: root/cli/tests/no_validate_asm.js
diff options
context:
space:
mode:
authorAnonymous <65428781+00ff0000red@users.noreply.github.com>2021-01-07 07:50:57 -0800
committerGitHub <noreply@github.com>2021-01-07 10:50:57 -0500
commitb40d5e5e0b44187737651d155d2e67fcc26f14e8 (patch)
treeda9e3adfb0c59ee8f800ca429465981fd939c273 /cli/tests/no_validate_asm.js
parent9b3338fa2f61060ed92abe850fbd31170006217e (diff)
ignore "use asm" (#9019)
Preventing V8 from logging erroneous line numbers. Use wasm.
Diffstat (limited to 'cli/tests/no_validate_asm.js')
-rw-r--r--cli/tests/no_validate_asm.js20
1 files changed, 20 insertions, 0 deletions
diff --git a/cli/tests/no_validate_asm.js b/cli/tests/no_validate_asm.js
new file mode 100644
index 000000000..38ea0a446
--- /dev/null
+++ b/cli/tests/no_validate_asm.js
@@ -0,0 +1,20 @@
+// V8 logs any asmjs validation errors to stdout, but it shows line numbers that
+// are non-existent in the source.
+
+const asmJsModule = function () {
+ "use asm";
+
+ function func(
+ x,
+ ) {
+ x = +x; // cast to float
+
+ ~x;
+ // asmjs error: `~` is only valid on integers
+ // should not log to stdout with --no-validate-asm
+ }
+
+ return {
+ f: func,
+ };
+}();