@babel/plugin-transform-destructuring
Advanced tools
Comparing version
@@ -461,5 +461,5 @@ 'use strict'; | ||
function variableDeclarationHasPattern(node) { | ||
function variableDeclarationHasDestructuringPattern(node) { | ||
for (const declar of node.declarations) { | ||
if (core.types.isPattern(declar.id)) { | ||
if (core.types.isPattern(declar.id) && declar.id.type !== "VoidPattern") { | ||
return true; | ||
@@ -485,3 +485,3 @@ } | ||
if (!declaration.isVariableDeclaration()) return; | ||
if (!variableDeclarationHasPattern(declaration.node)) return; | ||
if (!variableDeclarationHasDestructuringPattern(declaration.node)) return; | ||
{ | ||
@@ -515,3 +515,3 @@ var _path$splitExportDecl; | ||
const pattern = left.declarations[0].id; | ||
if (!core.types.isPattern(pattern)) return; | ||
if (!core.types.isPattern(pattern) || pattern.type === "VoidPattern") return; | ||
const key = scope.generateUidIdentifier("ref"); | ||
@@ -568,3 +568,3 @@ node.left = core.types.variableDeclaration(left.kind, [core.types.variableDeclarator(key, null)]); | ||
if (!parent || !path.container) return; | ||
if (!variableDeclarationHasPattern(node)) return; | ||
if (!variableDeclarationHasDestructuringPattern(node)) return; | ||
convertVariableDeclaration(path, name => state.addHelper(name), arrayLikeIsIterable, iterableIsArray, objectRestNoSymbols, useBuiltIns); | ||
@@ -571,0 +571,0 @@ } |
{ | ||
"name": "@babel/plugin-transform-destructuring", | ||
"version": "7.27.7", | ||
"version": "7.28.0", | ||
"description": "Compile ES2015 destructuring to ES5", | ||
@@ -21,3 +21,3 @@ "repository": { | ||
"@babel/helper-plugin-utils": "^7.27.1", | ||
"@babel/traverse": "^7.27.7" | ||
"@babel/traverse": "^7.28.0" | ||
}, | ||
@@ -28,3 +28,3 @@ "peerDependencies": { | ||
"devDependencies": { | ||
"@babel/core": "^7.27.7", | ||
"@babel/core": "^7.28.0", | ||
"@babel/helper-plugin-test-runner": "^7.27.1" | ||
@@ -31,0 +31,0 @@ }, |
Sorry, the diff of this file is not supported yet
85735
0.63%2
-33.33%4
-20%13
-7.14%Updated