-
Notifications
You must be signed in to change notification settings - Fork 282
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
Sometimes, Closure Variables are not available in the Debug Console / Watch window #737
Comments
This is the same as microsoft/vscode#12066. I want to look at tacking that at some point... it's a good chunk of work. It requires the debugger to parse and understand the runtime scripts, because sourcemaps only give us a mapping between source positions and names, it doesn't say "here's a variable, here's a function argument." At the moment, we never look at source content or try to parse anything, we rely only in CDP messages from the debug targets. Participation of the source content in debugging will also unlock a few other advanced scenarios, such as smarter deminification, referenced in #371 (comment) |
Thanks for your quick response on a Saturday ;) Variable mapping would be awesome too, but this issue is about closure variables. As you can see, vscode_1 is in the closure and vscode can explore the content, but it is not accessible in the Debug console. I guess this is a nodejs problem though - I will try to reproduce the issue with the chrome debugger for nodejs. Or did I misunderstand you? |
Oh, apologies. That's a V8 optimization, it optimizes away variables unused in the current scope. However we could be clever and hoist those like we do |
@connor4312 is there any way to disable such optimization ? I tried several node flags without success. EDIT : even if it means we have to recompile node |
Maybe, but I'm not an expert on v8 internals |
Sometimes, variables from the Closure section are not available in the Debug Console / Watch window:
This is what the debug console reports:
I wonder whether there is a way to overcome that.
The text was updated successfully, but these errors were encountered: