Skip to content

Commit

Permalink
fix Incorrect destructuring compilation of `for (let [[x] = [1… (#11360)
Browse files Browse the repository at this point in the history
  • Loading branch information
Zzzen committed Apr 7, 2020
1 parent e3ad798 commit ca096c5
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion packages/babel-plugin-transform-destructuring/src/index.js
Expand Up @@ -166,7 +166,7 @@ export default declare((api, options) => {
let patternId;
let node;

if (this.kind === "const") {
if (this.kind === "const" || this.kind === "let") {
patternId = this.scope.generateUidIdentifier(tempId.name);
node = this.buildVariableDeclaration(patternId, tempConditional);
} else {
Expand Down
@@ -0,0 +1,2 @@
for (let [[x] = [1]] = []; ; ) {
}

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit ca096c5

Please sign in to comment.