New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 619483 link

Starred by 5 users

Issue metadata

Status: WontFix
Owner: ----
Closed: Jul 2016
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: All
Pri: 2
Type: Bug



Sign in to add a comment

variable name unusable after Uncaught TypeError

Reported by aivier...@gmail.com, Jun 13 2016

Issue description

UserAgent: Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.63 Safari/537.36 OPR/38.0.2220.29

Steps to reproduce the problem:
1. Open F12 Developer Tool
2. Type 'let ws = WeakSet()', you will see "Uncaught TypeError: Constructor WeakSet requires 'new'(…)"
3. Then, try modify code and run it again, type 'let ws = new WeakSet()', But you will get "Uncaught TypeError: Identifier 'ws' has already been declared(…)"
4.Already been declared? Try this: 'ws = new WeakSet()', unfortunately, you will get "Uncaught ReferenceError: ws is not defined(…)"
5.What? Why it say already been declared just now? Try: 'window.hasOwnProperty('ws')' get 'false'

What is the expected behavior?
Variable name can use after throw error

What went wrong?
Variable name can't use again, V8 throw already been declared, but can't assign any thing to it, and get false from hasOwnProperty

Did this work before? N/A 

Chrome version: 53.0.2766.0  Channel: canary
OS Version: 10.0
Flash Version: Shockwave Flash 21.0 r0
 
2016-06-13 15_45_47.png
15.9 KB View Download

Comment 1 by aivier...@gmail.com, Jun 13 2016

Well... Just ignore my user-agent, i have tested this issue on Chrome Canary and Chromium Snapshot 53.0.2767.0
Protip: don't use let/const in the Console.

See https://bugzilla.mozilla.org/show_bug.cgi?id=1233734#c1

Comment 3 by mkwst@chromium.org, Jun 13 2016

Cc: littledan@chromium.org pfeldman@chromium.org
Components: -Blink Blink>JavaScript Platform>DevTools
Labels: -OS-Windows OS-All
Status: Available (was: Unconfirmed)
It looks like Firefox has the same issue, and the first comment in the bug from comment #2 makes it sound like this is an expected consequence of the language.

CCing relevant folks to see if there's something we can/should do about it.
Cc: gsat...@chromium.org
As mkwst says, this is an expected consequence of the language, unfortunately. There have been several bugs reported by users to several browsers about this issue. I'd rather not introduce separate language modes like Firefox has, and instead address this at TC39 if we think it is something that should be pursued.
Status: WontFix (was: Available)
closing as per comment #5

Sign in to add a comment