Open
Description
Version
v18.16.0
Platform
Microsoft Windows NT 10.0.19044.0 x64
Subsystem
Debugger
What steps will reproduce the bug?
-
Create a file named
index.js
containing the following script:let i = 5; while (--i > 0) { const foo = "bar" + i; }
-
Inspect it using
node inspect index.js
-
watch
foo
:watch('foo')
. Optionally,watch('i')
too. -
Go to l3 for the first time, assert that
foo = undefined
) -
Continue until you reach l3 again: the watched value of foo is then
bar4
(andi=3
): the debugger show thefoo
declared in the previous iteration
How often does it reproduce? Is there a required condition?
The reproducing steps are systematic, I reproduced similar behavior in longer scripts too
What is the expected behavior? Why is that the expected behavior?
I'd expect the watch value to stay undefined or in error until the declaration statement
What do you see instead?
Additional information
No response
Activity