babel / babel/babel

Nested rest destructuring does not work with parameters

Open
#7,860 4 comments 1 reaction 0 assignees View on GitHub
Dominant language
TypeScript
Stars
44k
Forks
6k
Avg merge
5d 15h
Merged PRs (30d)
23

Description

**Describe the bug**
Nested rest destructuring does not work with parameters.

**Input Code**
(function(...[x]) {})

```js
(function(...[x]) {})
```

### Babel Configuration (.babelrc, package.json, cli command)

Everything is maxed out/turned on/enabled etc.

**Expected behavior/code**
There is no syntax error thrown by Babel.

**Possible Solution**

**Environment**
- Babel version(s): [e.g. v6.0.0, v7.0.0-beta.34]
- Node/npm version: [e.g. Node 8/npm 5]
- OS: [e.g. OSX 10.13.4, Windows 10]
- Monorepo [e.g. yes/no/Lerna]
- How you are using Babel: cli

**Additional context/Screenshots**
Add any other context about the problem here. If applicable, add screenshots to help explain.

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the JavaScript input `(function(...[x]) {})` through Babel's CLI, using the issue's expected behavior as the acceptance check. Trace the parser or transform path that handles nested rest destructuring in parameters; done means Babel accepts this input without a syntax error and the relevant regression coverage passes.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
compilers
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.