Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is not defined and identifier has already been declared at the same time

In chrome devtools if I first try to declare a variable but the operation fail (see example below I'm trying to assign to a not defined variable), then I get following behaviour: I'm not able to assign to the variable because of the ReferneceError at the same time I'm not able to declare it because of the SyntaxError. See screen below.

The following seems a bit illogical to me. Could someone explain?

I'm using Chrome Version 55.0.2883.95 (64-bit) on OS X El Capitan.

enter image description here

like image 203
Adrian Baran Avatar asked Dec 30 '16 12:12

Adrian Baran


1 Answers

Testing this in Firefox I am seeing it function as you'd expect. Where you can later set x = 2; just fine. Please file a bug on the chromium bug tracker so the Chrome team can triage this and get it working.

Thank you.

firefox-define-ref-error

like image 161
Garbee Avatar answered Oct 13 '22 18:10

Garbee