Skip to content

Comments

fix: format wasm stack traces per W3C spec#32246

Open
bartlomieju wants to merge 1 commit intodenoland:mainfrom
bartlomieju:fix/wasm-stack-trace-format
Open

fix: format wasm stack traces per W3C spec#32246
bartlomieju wants to merge 1 commit intodenoland:mainfrom
bartlomieju:fix/wasm-stack-trace-format

Conversation

@bartlomieju
Copy link
Member

Summary

  • Update wasm stack trace formatting to use the W3C WebAssembly Web API spec format: wasm-function[<funcIndex>]:0x<hexOffset> instead of the generic line:col format
  • Update existing wasm_url test expectation to match
  • Add new integration test (wasm_stack_trace) covering:
    • Basic unreachable trap with correct wasm-function[0]:0x<offset> format
    • Multi-frame wasm call chain verifying correct function indices across frames
    • Error.prepareStackTrace callsite toString() producing correct wasm format

Fixes #32239

Note: This PR contains the test-side changes. The core formatting fix is in deno_core (updating format_location, from_callsite_object, and callsite_fns::to_string_inner in core/error.rs to detect wasm frames and format them according to spec).

Test plan

  • cargo test specs::run::wasm_stack_trace — new test verifying all three wasm stack trace scenarios
  • cargo test specs::run::wasm_url — existing test with updated expectation
  • cargo test specs::run::wasm_unreachable — existing test (broad wildcards, should still pass)

🤖 Generated with Claude Code

…rmat

Wasm stack frames should use the format `wasm-function[N]:0x<offset>` per
the W3C WebAssembly Web API spec, not `line:col`. Updates the existing
wasm_url test expectation and adds a new integration test covering
unreachable traps, multi-frame wasm call chains, and
Error.prepareStackTrace with wasm frames.

Ref: denoland#32239

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Wasm stack traces are not correctly formatted

1 participant