Skip to content
This repository was archived by the owner on Apr 25, 2025. It is now read-only.

JS Embedding: When to capture stack trace #37

Closed
eholk opened this issue Feb 9, 2018 · 4 comments
Closed

JS Embedding: When to capture stack trace #37

eholk opened this issue Feb 9, 2018 · 4 comments

Comments

@eholk
Copy link
Contributor

eholk commented Feb 9, 2018

The current Layer 1 proposal splits creating the exception object from throwing it. JavaScript exceptions usually have a stack trace associated with them. Should the embedding capture the stack trace at the point the exception is created, or when it is thrown?

See #33 (comment)

@erights
Copy link

erights commented Feb 10, 2018

For reference, https://github.com/tc39/proposal-error-stacks is the current proposal to standardize JavaScript error stacks.

@eholk
Copy link
Contributor Author

eholk commented Feb 10, 2018

Thanks!

From quickly skimming that, I assume the stack data is captured when you do new Error(), rather than at the point where you do throw? If so, it would make sense for Wasm to follow that behavior as well in the JS embedding.

@erights
Copy link

erights commented Feb 10, 2018

Hi @eholk , yes. Likewise, rethrowing has no effect on the captured stack trace.

It makes sense to me as well for wasm to follow this precedent. Thanks.

@aheejin
Copy link
Member

aheejin commented Oct 20, 2019

Now we do both creation and throwing with a single throw instruction. We can create JS API that creates and throws wasm exceptions, but I think that is a separate JS API topic. Closing.

@aheejin aheejin closed this as completed Oct 20, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants