Variable is undefined when using source maps
Categories
(DevTools :: Debugger, defect, P3)
Tracking
(Not tracked)
People
(Reporter: jlast, Unassigned)
References
(Blocks 1 open bug)
Details
Attachments
(6 files)
What were you doing?
it looks like test
in the original code maps to test
instead of _test
.
var getDifficultyText2 = function getDifficultyText2(difficulty) {
switch (difficulty) {
case 1:
{
var test = "case 1";
return "Easy peasy, lemon squeezy!";
}
case 2:
{
var _test = "case 2";
var test2 = "case 22";
debugger;
return "Relativly simple!";
}
case 3:
return "Getting a little tricky!";
case 4:
return "Knife skills needed!";
case 5:
return "Master Chef!";
default:
return "Off the scales!!";
}
};
Reporter | ||
Comment 1•4 years ago
|
||
Reporter | ||
Updated•4 years ago
|
Comment 2•4 years ago
|
||
The severity field is not set for this bug.
:jlast, could you have a look please?
For more information, please visit auto_nag documentation.
Reporter | ||
Updated•4 years ago
|
Comment 3•4 years ago
|
||
I can still reproduce a problem here. There are no detailed STRs, but I am seeing:
- The inline preview is wrong
- The Watch expression is showing value for
_test
, which doesn't exist in the original code.
Should be fixed, but not S2
Updated•4 years ago
|
Comment 4•3 years ago
|
||
STRs:
- Load https://mm4j1.csb.app/
- Open DevTools and select the Debugger panel
- Reload the page to hit
debugger;
keyword - Hover over the
test
variable (in the current frame), the tooltip saysundefined
=> BUG
Note that the Watch Expression panel is also saying undefined
(so, something changed since the last comment).
Honza
Updated•3 years ago
|
Updated•3 years ago
|
Updated•3 years ago
|
Updated•2 years ago
|
Comment 5•1 year ago
|
||
I've been looking into this, the bug here seems to have changed. This might be a regression.
The current issue is that we get empty text content for the generated source (https://mm4j1.csb.app/src/index.js). This means there is noting to parse and and the mapped original variables are optimized away. The STR in comment 4 is still valid but the results are different.
See current attached images
Comment 6•1 year ago
|
||
Comment 7•1 year ago
|
||
Description
•