Skip to content

Destructuring function array argument fails when skipping array arg #1247

Closed
@puiutucutu

Description

@puiutucutu

Even though both following code samples are valid ES6 javascript and are interpreted by babel the same way, we have different behaviour.

  • What version of documentation.js are you using?: ^11.0.0
  • How are you running documentation.js (on the CLI, Node.js API, Grunt, other?): Node.js

Good

The following code is accepted by documentation.js.

// tail.js
const tail = ([x, ...xs]) => xs;

export { tail };

Bad

The following causes documentation.js to throw an error of the sort TypeError: Cannot read property 'start' of undefined.

// tail.js
const tail = ([, ...xs]) => xs;

export { tail };

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions