New issue
Advanced search Search tips

Issue 843034 link

Starred by 2 users

Issue metadata

Status: WontFix
Owner: ----
Closed: May 2018
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Linux , Windows , Mac
Pri: 3
Type: Bug



Sign in to add a comment

A block with a function statement inside unexpectedly produces a value in console

Reported by woxxom@gmail.com, May 15 2018

Issue description

Chrome 49 - 68:    FAIL
Firefox:           OK
Internet Explorer: OK

=============================================================

1. open devtools and run the following code in console:
   { function a() {} }

Expected: "undefined"
Observed: "ƒ a() {}"

=============================================================

Bisected to 76da493315bcd0fdf6b2bbecc462d8546e6a4cc0 in V8
"Extend Annex B 3.3 sloppy-mode block-scoped hoisting to scripts, eval"
Landed in 48.0.2528.0 r352275 behind harmony_sloppy_function flag
Enabled in 49.0.2615.0 r367791

=============================================================

Notes:

* The equivalent code { var a = function() {} } produces "undefined" as expected

* eval('{ function a() {} }') produces "undefined" as expected

* If anyone wants to verify it in the old versions of Chrome, 
add /*foo*/ before the code to help devtools recognize {} as a block.
 
Labels: Needs-Milestone
Cc: kkaluri@chromium.org
Labels: M-68 FoundIn-68 Target-68 OS-Linux OS-Mac OS-Windows
Status: Untriaged (was: Unconfirmed)
Able to reproduce the issue on Win 10, Debian Rodette, Mac 10.13.3 with chrome stable #66.0.3359.181, Canary #68.0.3430.0 and also in earlier version M60- #60.0.3072.0

This is a non-regression issue, hence marking it as Untriaged

Attaching the screen-cast for reference
843034.png
60.5 KB View Download
Status: WontFix (was: Untriaged)
This is expected behavior.

Sign in to add a comment