mirror of
https://github.com/denoland/deno.git
synced 2024-12-22 15:24:46 -05:00
ignore "use asm" (#9019)
Preventing V8 from logging erroneous line numbers. Use wasm.
This commit is contained in:
parent
9b3338fa2f
commit
b40d5e5e0b
3 changed files with 38 additions and 0 deletions
|
@ -3521,6 +3521,23 @@ itest!(inline_js_source_map_with_contents_from_graph {
|
||||||
http_server: true,
|
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]
|
#[test]
|
||||||
fn cafile_env_fetch() {
|
fn cafile_env_fetch() {
|
||||||
use deno_core::url::Url;
|
use deno_core::url::Url;
|
||||||
|
|
20
cli/tests/no_validate_asm.js
Normal file
20
cli/tests/no_validate_asm.js
Normal file
|
@ -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,
|
||||||
|
};
|
||||||
|
}();
|
|
@ -158,6 +158,7 @@ pub unsafe fn v8_init() {
|
||||||
"--wasm-test-streaming".to_string(),
|
"--wasm-test-streaming".to_string(),
|
||||||
"--no-wasm-async-compilation".to_string(),
|
"--no-wasm-async-compilation".to_string(),
|
||||||
"--harmony-top-level-await".to_string(),
|
"--harmony-top-level-await".to_string(),
|
||||||
|
"--no-validate-asm".to_string(),
|
||||||
];
|
];
|
||||||
v8::V8::set_flags_from_command_line(argv);
|
v8::V8::set_flags_from_command_line(argv);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue