You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I guess the function declaration is converted to function expression which unlike the declaration requires semicolon. However, everything works fine with 5; function f(){} f().
Also, this code works in REPL: function f(){}, a=9, but it shouldn't.
Activity
[-]Function declatarion throws in REPL[/-][+]Function declaration throws in REPL[/+]Fishrock123 commentedon Jan 22, 2017
So, I get these results on
master:To me, I think all variations of
function f(){} f()are incorrect, butfunction f(){}, a=9sounds how commas are "supposed" to work.Note: I'm no spec expert on what is and isn't valid.
bnoordhuis commentedon Jan 22, 2017
It's caused by bb9eabe, which is a fix/workaround for #548 and scheduled to be removed when we upgrade to V8 5.5, see #9618.
I don't think we'll be able to fix this in in v7.x and older without reintroducing the issue that bb9eabe was supposed to address.
EDIT: For posterity: bb9eabe is from #7624; the commit log is missing the PR-URL tag.
targos commentedon Jan 26, 2017
This is fixed on master now.
joyeecheung commentedon Jan 28, 2017
Closing according to #10950 (comment), feel free to reopen if the issue persists