Open Bug 1642641 Opened 4 years ago Updated 2 years ago

Variable is undefined when using source maps

Categories

(DevTools :: Debugger, defect, P3)

defect

Tracking

(Not tracked)

People

(Reporter: jlast, Unassigned)

References

(Blocks 1 open bug)

Details

Attachments

(3 files)

What were you doing?

  1. go to https://mm4j1.csb.app/ (https://codesandbox.io/s/switch-statement-examples-mm4j1)

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!!";
  }
};
Priority: -- → P2

The severity field is not set for this bug.
:jlast, could you have a look please?

For more information, please visit auto_nag documentation.

Flags: needinfo?(jlaster)
Severity: -- → S2
Flags: needinfo?(jlaster)
Attached image image.png (deleted) —

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

Severity: S2 → S3
Priority: P2 → P3
Attached image obrazek.png (deleted) —

STRs:

  1. Load https://mm4j1.csb.app/
  2. Open DevTools and select the Debugger panel
  3. Reload the page to hit debugger; keyword
  4. Hover over the test variable (in the current frame), the tooltip says undefined => BUG

Note that the Watch Expression panel is also saying undefined (so, something changed since the last comment).

Honza

Summary: `test` variable maps to the wrong expression → Variable is undefined when using source maps
Has STR: --- → yes
No longer blocks: dbg-sourcemap
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: