From 5edd2771619ddc3cd2f6c76cc93ee64277aa17c2 Mon Sep 17 00:00:00 2001 From: Andreu Botella Date: Sun, 10 Oct 2021 07:03:23 -0700 Subject: feat: Show the URL of streaming WASM modules in stack traces (#12268) WebAssembly modules compiled through `WebAssembly.compile()` and similar non-streaming APIs don't have a URL associated to them, because they have been compiled from a buffer source. In stack traces, V8 will use a URL such as `wasm://wasm/d1c677ea`, with a hash of the module. However, wasm modules compiled through streaming APIs, like `WebAssembly.compileStreaming()`, do have a known URL, which can be obtained from the `Response` object passed into the streaming APIs. And as per the developer-facing display conventions in the WebAssembly Web API spec, this URL should be used in stack traces. This change implements that. --- cli/tests/integration/run_tests.rs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'cli/tests/integration') diff --git a/cli/tests/integration/run_tests.rs b/cli/tests/integration/run_tests.rs index 8c337b771..f247aa93f 100644 --- a/cli/tests/integration/run_tests.rs +++ b/cli/tests/integration/run_tests.rs @@ -856,11 +856,18 @@ itest!(wasm_async { }); itest!(wasm_unreachable { - args: "run wasm_unreachable.js", + args: "run --allow-read wasm_unreachable.js", output: "wasm_unreachable.out", exit_code: 1, }); +itest!(wasm_url { + args: "run --quiet --allow-net=localhost:4545 wasm_url.js", + output: "wasm_url.out", + exit_code: 1, + http_server: true, +}); + itest!(weakref { args: "run --quiet --reload weakref.ts", output: "weakref.ts.out", -- cgit v1.2.3