New issue
Advanced search Search tips

Issue 610817 link

Starred by 1 user

Issue metadata

Status: Duplicate
Merged: issue 596061
Owner: ----
Closed: May 2016
Components:
EstimatedDays: ----
NextAction: ----
OS: All
Pri: 3
Type: Bug



Sign in to add a comment

error in let declaration will break it for good

Reported by davidcol...@gmail.com, May 10 2016

Issue description

Chrome Version       : 50.0.2661.94 (64-bit)
URLs (if applicable) : Dev Tools
Other browsers tested:
  Add OK or FAIL, along with the version, after other browsers where you
have tested this issue:
     Safari:
    Firefox:
         IE:

What steps will reproduce the problem?
(1) Open Dev Tools
(2) Go to the Console tab
(3) try the following code:
console.log(foo);
let foo = 1;
It should throw a ReferenceError
(4) ask for foo (declared above)
foo
it throws a RefeenceError, foo isn't defined. In this case, we could say that the whole first action (the log AND the let has been ignored)
(5) Try to declare foo
let foo = 2;
It throws a TypeError, and says that foo HAS already been declared


What is the expected result?
The user should have the chance to declare/define the variable at some point

What happens instead?
After it breaks, the variable is useless in a permanent way

Please provide any additional information below. Attach a screenshot if
possible.

 
Screen Shot 2016-05-10 at 5.17.48 PM.png
27.0 KB View Download
Components: Platform>DevTools
Labels: Needs-Feedback
Tested the issue on Windows 7 using 50.0.2661.94, latest canary 52.0.2730.0 as per steps in comment #0.Observed the behavior as in screenshots.

davidcolacilli@Please find attached screenshots of chrome, firefox and confirm if firefox behavior is the expected one.
610817_chrome.png
94.9 KB View Download
610817_firefox.png
287 KB View Download
Right. foo "is not defined", and foo "can't be defined because is already defined"
Labels: -Needs-Feedback OS-All
Status: Untriaged (was: Unconfirmed)
Able to reproduce the issue on Windows 7 using chrome latest stable M50-50.0.2661.102. Observed same behavior on other browsers as well.

This issue is not specific to chrome and it's seen from past M35-35.0.1849.0 on wards, Hence marking it as untriaged.

Thanks!

Comment 5 by caseq@chromium.org, May 13 2016

Mergedinto: 596061
Status: Duplicate (was: Untriaged)
Confusing as it appears, this is apparently by the spec -- see  issue 596061  for details. This did not appear in earlier versions of chrome because we were using different scopes for each evaluated expression in the console.

Sign in to add a comment