Skip to content

[Bug]: rest args and deconstruction, error. #14156

@zhangenming

Description

@zhangenming

💻

  • Would you like to work on a fix?

How are you using Babel?

Other (Next.js, Gatsby, vue-cli, ...)

Input code

function foo(...[x]) {
 var x = 1
}

/repl.js: Duplicate declaration "x"

Configuration file name

No response

Configuration

https://babeljs.io/repl#?browsers=chrome%2033&build=&builtIns=false&corejs=3.6&spec=false&loose=false&code_lz=GYVwdgxgLglg9mABMOcAUA6LBtAHgXQEpEBvAKEQDcBDAJ0V0QF5EBGMgXyA&debug=false&forceAllTransforms=false&shippedProposals=false&circleciRepo=&evaluate=false&fileSize=false&timeTravel=false&sourceType=module&lineWrap=true&presets=env&prettier=false&targets=&version=7.16.9&externalPlugins=&assumptions=%7B%7D

Current and expected behavior

Current :error
expected : no error

Environment

.

Possible solution

No response

Additional context

.

Metadata

Metadata

Labels

i: needs triageoutdatedA closed issue/PR that is archived due to age. Recommended to make a new issue

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions