Skip to content

Destructuring function array argument fails when skipping array arg #1247

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
puiutucutu opened this issue May 31, 2019 · 0 comments · Fixed by #1266
Closed

Destructuring function array argument fails when skipping array arg #1247

puiutucutu opened this issue May 31, 2019 · 0 comments · Fixed by #1266
Labels

Comments

@puiutucutu
Copy link

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 };
@puiutucutu puiutucutu changed the title Destructuring function array argument fails when skipping optional array arg Destructuring function array argument fails when skipping array arg May 31, 2019
@tmcw tmcw added the bug label Jul 22, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants