New issue
Advanced search Search tips

Issue 777545 link

Starred by 1 user

Issue metadata

Status: WontFix
Owner: ----
Closed: Oct 2017
Components:
EstimatedDays: ----
NextAction: ----
OS: Mac
Pri: 2
Type: Bug



Sign in to add a comment

Undefined variable goes and looks for html elements with id equal to variable instead of being undefined.

Reported by dav...@nuts.com, Oct 23 2017

Issue description

UserAgent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/61.0.3163.100 Safari/537.36

Steps to reproduce the problem:
1.  Add div element with id = "blah"
2.  Console.log(blah) without quotes
3.  View in inspector for results

What is the expected behavior?
Should just be undefined right?

What went wrong?
I have not yet dug into why this is happening, but will shortly.

Did this work before? N/A 

Chrome version: 61.0.3163.100  Channel: stable
OS Version: OS X 10.12.6
Flash Version: 

To my best knowledge, undefined variables have always been undefined.
 
Status: WontFix (was: Unconfirmed)
Sadly, this is a specified behavior and something that we browser folk would love to remove one day, but can't. Believe it or not, there's actual web content that depends on this behavior and will break if we do.

https://html.spec.whatwg.org/#named-access-on-the-window-object

Comment 2 Deleted

Comment 3 by dav...@nuts.com, Oct 23 2017

Whoa, very interesting that it was designed in such a way. if (var !== undefined) could potential be a false positive.

Sign in to add a comment