Closed Bug 1362451 Opened 7 years ago Closed 6 years ago

let/const variables in block scope change value in Debugger when executing first statement in block

Categories

(DevTools :: Debugger, defect)

53 Branch
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED DUPLICATE of bug 1432885

People

(Reporter: account-mozilla-bugzilla, Unassigned)

Details

Attachments

(2 files)

Attached file example.html
User Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:53.0) Gecko/20100101 Firefox/53.0
Build ID: 20170418123106

Steps to reproduce:

1. Open attached example.html in Firefox 53.0 or Firefox Developer Edition 54.0a2 (both affected, new and old debugger).
2. Open Developer Tools, go to Debugger.
3. Set breakpoint in line 8 (first statement in block).
4. Look at debugger Variables/Scopes view.
5. Click "step over".
6. Look at debugger Variables/Scopes view again.


Actual results:

- At step 4: letBlock/constBlock variables (bound via let/const) are shown as undefined in debugger (in Firefox 53.0 or Firefox Developer Edition 54.0a2)
- At step 6, in Firefox 53.0 (old debugger): letBlock/constBlock shown as "(uninitialized)"
- At step 6, in Firefox Developer Edition 54.0a2 (debugger.html): letBlock/constBlock shown as null


Expected results:

- Block scoped variables should not visibly change their value when an unrelated statement is executed. Should either stay at undefined or shown "(uninitialized)" all the time (until declaration statement is actually reaced).
- Firefox Developer Edition 54.0a2 / debugger.html behavior is especially confusing, since "null" indicates explicit intent by the programmer, unlike undefined which is more sensible.
Component: Untriaged → Developer Tools: Debugger
Hey Jason, is this a duplicate of bug 1432885
Flags: needinfo?(jorendorff)
Yes.
Status: UNCONFIRMED → RESOLVED
Closed: 6 years ago
Flags: needinfo?(jorendorff)
Resolution: --- → DUPLICATE
Product: Firefox → DevTools
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: