Bug 162358
Summary: | Disallow trailing commas in arrow function arguments, e.g. (X,)=>1 | ||
---|---|---|---|
Product: | WebKit | Reporter: | John Wilander <wilander> |
Component: | JavaScriptCore | Assignee: | Nobody <webkit-unassigned> |
Status: | RESOLVED FIXED | ||
Severity: | Normal | CC: | ddkilzer, gskachkov, saam, webkit-bug-importer, ysuzuki |
Priority: | P2 | Keywords: | InRadar |
Version: | WebKit Nightly Build | ||
Hardware: | Unspecified | ||
OS: | Unspecified |
John Wilander
Reported here:
"(X,)=>1//safari ios10"
https://twitter.com/garethheyes/status/778685893506850828
Chrome and Firefox don't allow it and according to the reporter Edge doesn't either.
Attachments | ||
---|---|---|
Add attachment proposed patch, testcase, etc. |
Radar WebKit Bug Importer
<rdar://problem/29464660>
Saam Barati
I'm pretty sure this is part of ES2017 spec
Saam Barati
http://www.2ality.com/2015/11/trailing-comma-parameters.html?m=1
GSkachkov
He he.
It is not bug it is a feature of ECMA 2017
Before proposal of this syntax was on stage 3, at beginning of November it was merged to master https://github.com/tc39/ecma262/pull/711
In spec https://tc39.github.io/ecma262/#prod-FormalParameters can be found:
FormalParameters can be:
FormalParameterList[?Yield, ?Await],
Actually both Chrome Canary (57.0.2939.0 canary (64-bit)) and FireFox Nightly (52.0a1 (2016-10-15) (64-bit)) support this syntax now
Saam Barati
Closing this since it's the spec.