Skip to content

Missing error for a destructuring pattern inside a rest binding element / rest parameter #2519

@JsonFreeman

Description

@JsonFreeman

The following is not allowed by the ES6 grammar:

function foo(...[a]) { }
var [...[b, c]] = [0, 1, 2];

The relevant grammar production is:

BindingRestElement[Yield, GeneratorParameter] :
    [+GeneratorParameter] ... BindingIdentifier[Yield]
    [~GeneratorParameter] ... BindingIdentifier[?Yield]

And a BindingIdentifier does not include a binding pattern.

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugA bug in TypeScriptFixedA PR has been merged for this issue

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions