Add the ability to evaluate expression in console with original variable name when paused at an original location in debugger (retrieving sourcemap information)
Categories
(DevTools :: Console, enhancement, P3)
Tracking
(Not tracked)
People
(Reporter: kes-kes, Unassigned)
References
(Blocks 1 open bug)
Details
Attachments
(1 file)
|
45.96 KB,
image/jpeg
|
Details |
User Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:90.0) Gecko/20100101 Firefox/90.0
Steps to reproduce:
I import FormDataJson into module and try to use it
import FormDataJson from './form-data-json.cjs'
window.addEventListener( ' "DOMContentLoaded", (event) => {
debugger;
FormDataJson.toJson( $('#form') )
});
Actual results:
At break point I try to call FormDataJson at console and get FormDataJson is not defined. Still when I run script then no error happened
Expected results:
FormDataJson is scoped to module, but console, I suppose, work at global contex.
local/scoped FormDataJson should be visible to console
Comment 1•4 years ago
|
||
The Bugbug bot thinks this bug should belong to the 'DevTools::Debugger' component, and is moving the bug to that component. Please revert this change in case you think the bot is wrong.
Comment 2•4 years ago
|
||
Hello Eugen,
I guess your project is using sourcemaps, can you confirm?
In such case, there's a mismatch between what the debugger shows (the original variable names) and what the JS engine knows about (the generated variable names, which usually don't match).
Bug 1658238 might make the mapping available for autocomplete, which I guess can be re-used for plain evaluation.
Updated•4 years ago
|
Updated•4 years ago
|
Odd, this should already work. Autocomplete mapping builds on the existing expression mapping support.
However, it requires Map Scopes to be enabled and that the source map has detailed column information - in webpack.config.js, is devtool set to either eval-source-map or source-map?
Description
•