You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When you set a breakpoint on counter = 1, that maps it to the binary expression being passed as an argument, as you would expect. However V8 cannot set a breakpoint here, so it moves it to the next available location, which is after the statement and before the closing brace. However, there are no sourcemap mappings on this line, so the debugger doesn't know where (or if) it has a location in the source file, and so it shows you the generated location it mapped to.
You can see the effects of the poor breakpoint placement in chrome devtools too: notice the count has already been incremented by the time you hit a breakpoint that should happen before it's executed. They just don't show you where the breakpoint actually ended up being placed, so the issue is hidden a bit 🙂 In this debugger I prefer to make such failures more obvious so a developer can figure out what's going wrong. There's nothing more frustrating that your debugger lying to you!
It would be better if Svelte kept the increment as its own expression statement and then added an unmapped $$invalidate statement afterwards, like
Describe the bug
count = 1
and debug, depending on what you're using...count
is already1
when the breakpoint is hitReproduction
See above
Logs
N/A.
This was reported on microsoft/vscode-js-debug#2029 and I commented on what's going on:
System Info
The text was updated successfully, but these errors were encountered: