-
Notifications
You must be signed in to change notification settings - Fork 224
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: function name should be obtained from next frame’s position #253
Conversation
@LinusU ping :) This is an upstream issue of babel. Are there anything I can help? |
Sorry for the delay, I've been out traveling and my inbox is a mess right now 😅 |
Released as |
@LinusU Cool. Was it also published to npm? |
🤦♂ It is now! |
This broke function names in Jest's stack traces. Using Any idea if we can change anything in Jest to fix it, or was this an honest regression? ( EDIT: I've opened a separate PR just for |
@SimenB I think that @JLHwung answered this in jestjs/jest#9147, please let me know if there is anything more that should be done from our side though, I'll try and stay up to date in that thread as well |
The issue with original names was likely due to evanw/node-source-map-support#253 and not Scala.js related.
This is a follow-up to #220.
In #220 we provided
position.name
beforestack.getFunctionName
to support mangled function calls. However,stack.getFunctionName
is supposed to return the name of the current function, that is, which function does this frame live in. Regards to the source map, it is thename
of the position in next frame instead of in this frame.To illustrate this issue, here is a reproducible repository I revised from babel/babel#9883:
The expected output should be
The current output after requiring
source-map-support/register
isApparently
foo
is incorrectly repeated.To fix this issue, we reverse the stack processing order and introduce internal state to track next frame position. As
wrapCallSite
is exported as a public API, I would consider this change as a breaking change.