• jwolfe's avatar
    Allow trailing commas in function parameter lists · 1ac09655
    jwolfe authored
    Add a flag harmony_trailing_commas_in_parameters that allows trailing
    commas in function parameter declaration lists and function call
    parameter lists. Trailing commas are allowed in parenthetical lists like
    `(a, b, c,)` only if the next token is `=>`, thereby making it an arrow
    function declaration. Only 1 trailing comma is allowed, not `(a,,)`. A
    trailing comma must follow a non-rest parameter, so `(,)` and `(...a,)`
    are still SyntaxErrors. However, a trailing comma is allowed after a
    spread parameter, e.g. `a(...b,);`.
    
    Add parser tests for all of the above.
    
    BUG=v8:5051
    LOG=y
    
    Review-Url: https://codereview.chromium.org/2094463002
    Cr-Commit-Position: refs/heads/master@{#37355}
    1ac09655
Name
Last commit
Last update
..
OWNERS Loading commit data...
expression-classifier.h Loading commit data...
func-name-inferrer.cc Loading commit data...
func-name-inferrer.h Loading commit data...
parameter-initializer-rewriter.cc Loading commit data...
parameter-initializer-rewriter.h Loading commit data...
parser-base.h Loading commit data...
parser.cc Loading commit data...
parser.h Loading commit data...
pattern-rewriter.cc Loading commit data...
preparse-data-format.h Loading commit data...
preparse-data.cc Loading commit data...
preparse-data.h Loading commit data...
preparser.cc Loading commit data...
preparser.h Loading commit data...
rewriter.cc Loading commit data...
rewriter.h Loading commit data...
scanner-character-streams.cc Loading commit data...
scanner-character-streams.h Loading commit data...
scanner.cc Loading commit data...
scanner.h Loading commit data...
token.cc Loading commit data...
token.h Loading commit data...