New issue
Advanced search Search tips

Issue 801538 link

Starred by 1 user

Issue metadata

Status: Duplicate
Merged: issue 498454
Owner:
Closed: Jan 2018
Components:
EstimatedDays: ----
NextAction: ----
OS: Windows
Pri: 2
Type: Bug



Sign in to add a comment

variable in scope is undefined (debugger only)

Reported by woody...@gmail.com, Jan 12 2018

Issue description

UserAgent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.132 Safari/537.36

Steps to reproduce the problem:
*1 testcode:
function test() {
	var v1 = 1
	var v2 = 2
	inner();

	function inner() {
>		console.log(v1);
	}
}

*2 set breakpoint at '>'

*3 execute test()

*4 when breakpoint hits, var 'v1' = 1.

*5 enter v2 in console and you get a reference error.

What is the expected behavior?
since v2 is in the same scope it should say v2 = 2

What went wrong?
because v2 is not used in the inner function it's not available in that scope.

Did this work before? N/A 

Chrome version: 63.0.3239.132  Channel: stable
OS Version: 10.0
Flash Version: 

Might be due to optimisation. Sorry if false reporting.
 
bug.png
17.6 KB View Download
Owner: kozy@chromium.org
Status: Assigned (was: Unconfirmed)
I confirmed this bug in stable and ToT. Adding console.log(v2) pulls it into the scope.

Comment 2 by kozy@chromium.org, Jan 12 2018

Mergedinto: 498454
Status: Duplicate (was: Assigned)

Sign in to add a comment