Bug 162358 - Disallow trailing commas in arrow function arguments, e.g. (X,)=>1
Summary: Disallow trailing commas in arrow function arguments, e.g. (X,)=>1
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2016-09-21 13:49 PDT by John Wilander
Modified: 2016-12-12 17:34 PST (History)
5 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description John Wilander 2016-09-21 13:49:35 PDT
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.
Comment 1 Radar WebKit Bug Importer 2016-12-01 12:38:07 PST
<rdar://problem/29464660>
Comment 2 Saam Barati 2016-12-02 12:25:09 PST
I'm pretty sure this is part of ES2017 spec
Comment 4 GSkachkov 2016-12-03 03:09:32 PST
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
Comment 5 Saam Barati 2016-12-12 17:34:11 PST
Closing this since it's the spec.