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.
,
May 16 2018
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
,
May 30 2018
This is expected behavior. |
|||
►
Sign in to add a comment |
|||
Comment 1 by viswa.karala@chromium.org
, May 15 2018