From b40d5e5e0b44187737651d155d2e67fcc26f14e8 Mon Sep 17 00:00:00 2001 From: Anonymous <65428781+00ff0000red@users.noreply.github.com> Date: Thu, 7 Jan 2021 07:50:57 -0800 Subject: ignore "use asm" (#9019) Preventing V8 from logging erroneous line numbers. Use wasm. --- cli/tests/no_validate_asm.js | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 cli/tests/no_validate_asm.js (limited to 'cli/tests/no_validate_asm.js') 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, + }; +}(); -- cgit v1.2.3