diff --git a/cli/tests/integration_tests.rs b/cli/tests/integration_tests.rs index cd222f0b4e..68cfe0b507 100644 --- a/cli/tests/integration_tests.rs +++ b/cli/tests/integration_tests.rs @@ -3521,6 +3521,23 @@ itest!(inline_js_source_map_with_contents_from_graph { http_server: true, }); +#[test] +fn no_validate_asm() { + let output = util::deno_cmd() + .current_dir(util::root_path()) + .arg("run") + .arg("cli/tests/no_validate_asm.js") + .stderr(std::process::Stdio::piped()) + .stdout(std::process::Stdio::piped()) + .spawn() + .unwrap() + .wait_with_output() + .unwrap(); + assert!(output.status.success()); + assert!(output.stderr.is_empty()); + assert!(output.stdout.is_empty()); +} + #[test] fn cafile_env_fetch() { use deno_core::url::Url; diff --git a/cli/tests/no_validate_asm.js b/cli/tests/no_validate_asm.js new file mode 100644 index 0000000000..38ea0a446b --- /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, + }; +}(); diff --git a/core/runtime.rs b/core/runtime.rs index 7e8ac48faa..700d378b12 100644 --- a/core/runtime.rs +++ b/core/runtime.rs @@ -158,6 +158,7 @@ pub unsafe fn v8_init() { "--wasm-test-streaming".to_string(), "--no-wasm-async-compilation".to_string(), "--harmony-top-level-await".to_string(), + "--no-validate-asm".to_string(), ]; v8::V8::set_flags_from_command_line(argv); }