diff options
author | Anonymous <65428781+00ff0000red@users.noreply.github.com> | 2021-01-07 07:50:57 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-01-07 10:50:57 -0500 |
commit | b40d5e5e0b44187737651d155d2e67fcc26f14e8 (patch) | |
tree | da9e3adfb0c59ee8f800ca429465981fd939c273 | |
parent | 9b3338fa2f61060ed92abe850fbd31170006217e (diff) |
ignore "use asm" (#9019)
Preventing V8 from logging erroneous line numbers. Use wasm.
-rw-r--r-- | cli/tests/integration_tests.rs | 17 | ||||
-rw-r--r-- | cli/tests/no_validate_asm.js | 20 | ||||
-rw-r--r-- | core/runtime.rs | 1 |
3 files changed, 38 insertions, 0 deletions
diff --git a/cli/tests/integration_tests.rs b/cli/tests/integration_tests.rs index cd222f0b4..68cfe0b50 100644 --- a/cli/tests/integration_tests.rs +++ b/cli/tests/integration_tests.rs @@ -3522,6 +3522,23 @@ itest!(inline_js_source_map_with_contents_from_graph { }); #[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; let _g = util::http_server(); 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, + }; +}(); diff --git a/core/runtime.rs b/core/runtime.rs index 7e8ac48fa..700d378b1 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); } |