In DevTools Console, block scoping is applied automatically to statements beginning with {
Reported by
michaels...@gmail.com,
Oct 14 2016
|
|||
Issue description
Chrome Version : 54.0.2840.59
OS Version: OS X 10.11.6 (Applies to all platforms)
URLs (if applicable) :
Other browsers tested:
Add OK or FAIL after other browsers where you have tested this issue:
Safari 5: FAIL
Firefox 48: OK
FF Devl 50: OK
IE 7/8/9: <UNTESTED>
What steps will reproduce the problem?
1. Open the DevTools JavaScript Console
2. Enter:
{ let a = "hello"; a; }
What is the expected result?
The string "hello" to be printed.
What happens instead of that?
VM413:1 Uncaught SyntaxError: Unexpected identifier
Please provide any additional information below. Attach a screenshot if
possible.
A discussion on the Chromium Dev Slack with Jonathan Garbee (@garbee) elaborated that statements issued in the Console beginning with `{` are wrapped in a block scope. A bug filing was suggested.
Note that Firefox, Firefox Developer Edition and the NodeJS REPL (v6) behave "as expected", in that block scoping is not automatically applied.
Chrome and Safari 5 seem to both automatically apply block scoping.
For context, see:
- https://chromiumdev.slack.com/archives/devtools/p1476374281000072
- https://chromiumdev.slack.com/archives/devtools/p1476376011000075
UserAgentString: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/54.0.2840.59 Safari/537.36
,
Oct 14 2016
fixed in issue 603890
,
Oct 14 2016
I cannot reproduce in 56.0.2890.0 (Official Build) canary (64-bit) b2c7e72483b4fa50df162b9f38f0270c3079aad9-refs/heads/master@{#425218} for Windows. So it appears fixed with issue 603890 . Apologies for the red herring; I didn't think to search the bug tracker for "auto params" referenced in 603890. Thank you!
,
Oct 22 2016
Thank you for providing more feedback. Adding requester "jmukthavaram@chromium.org" for another review and adding "Needs-Review" label for tracking. For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
,
Oct 24 2016
As per Comment#3,Closing this issue. Feel free to log a new defect if you still facing the issue. Thanks. |
|||
►
Sign in to add a comment |
|||
Comment 1 by jmukthavaram@chromium.org
, Oct 14 2016Labels: Needs-Feedback
Unable to reproduce this issue on Windows 10,Mac 10.11.4,Linux Ubuntu 14.04 with chrome stable version-54.0.2840.59 and latest canary with the below steps: 1.Opened chrome-Dev Tools-> Console 2. Type { let a = "hello"; a; } 3. Hit enter 4. Observed "hello" printed successfully. Please find the attached screencast for reference & let us know if i miss anything to reproduce this issue. Thanks.2.3 MB
2.3 MB Download