index.js.map 49 KB

1
  1. {"version":3,"file":"index.js","sources":["../src/util.ts","../src/index.ts"],"sourcesContent":["import { types as t } from \"@babel/core\";\nimport type { File } from \"@babel/core\";\nimport type { Scope, NodePath } from \"@babel/traverse\";\nimport type { TraversalAncestors } from \"@babel/types\";\n\n/**\n * Test if an ArrayPattern's elements contain any RestElements.\n */\n\nfunction hasArrayRest(pattern: t.ArrayPattern) {\n return pattern.elements.some(elem => t.isRestElement(elem));\n}\n\n/**\n * Test if an ObjectPattern's properties contain any RestElements.\n */\n\nfunction hasObjectRest(pattern: t.ObjectPattern) {\n return pattern.properties.some(prop => t.isRestElement(prop));\n}\n\ninterface UnpackableArrayExpression extends t.ArrayExpression {\n elements: (null | t.Expression)[];\n}\n\nconst STOP_TRAVERSAL = {};\n\ninterface ArrayUnpackVisitorState {\n deopt: boolean;\n bindings: Record<string, t.Identifier>;\n}\n\n// NOTE: This visitor is meant to be used via t.traverse\nconst arrayUnpackVisitor = (\n node: t.Node,\n ancestors: TraversalAncestors,\n state: ArrayUnpackVisitorState,\n) => {\n if (!ancestors.length) {\n // Top-level node: this is the array literal.\n return;\n }\n\n if (\n t.isIdentifier(node) &&\n t.isReferenced(node, ancestors[ancestors.length - 1].node) &&\n state.bindings[node.name]\n ) {\n state.deopt = true;\n throw STOP_TRAVERSAL;\n }\n};\n\ntype DestructuringTransformerNode =\n | t.VariableDeclaration\n | t.ExpressionStatement\n | t.ReturnStatement;\n\ninterface DestructuringTransformerOption {\n blockHoist?: number;\n operator?: t.AssignmentExpression[\"operator\"];\n nodes?: DestructuringTransformerNode[];\n kind?: t.VariableDeclaration[\"kind\"];\n scope: Scope;\n arrayLikeIsIterable: boolean;\n iterableIsArray: boolean;\n objectRestNoSymbols: boolean;\n useBuiltIns: boolean;\n addHelper: File[\"addHelper\"];\n}\nexport class DestructuringTransformer {\n private blockHoist: number;\n private operator: t.AssignmentExpression[\"operator\"];\n arrayRefSet: Set<string>;\n private nodes: DestructuringTransformerNode[];\n private scope: Scope;\n private kind: t.VariableDeclaration[\"kind\"];\n private iterableIsArray: boolean;\n private arrayLikeIsIterable: boolean;\n private objectRestNoSymbols: boolean;\n private useBuiltIns: boolean;\n private addHelper: File[\"addHelper\"];\n constructor(opts: DestructuringTransformerOption) {\n this.blockHoist = opts.blockHoist;\n this.operator = opts.operator;\n this.arrayRefSet = new Set();\n this.nodes = opts.nodes || [];\n this.scope = opts.scope;\n this.kind = opts.kind;\n this.iterableIsArray = opts.iterableIsArray;\n this.arrayLikeIsIterable = opts.arrayLikeIsIterable;\n this.objectRestNoSymbols = opts.objectRestNoSymbols;\n this.useBuiltIns = opts.useBuiltIns;\n this.addHelper = opts.addHelper;\n }\n\n getExtendsHelper() {\n return this.useBuiltIns\n ? t.memberExpression(t.identifier(\"Object\"), t.identifier(\"assign\"))\n : this.addHelper(\"extends\");\n }\n\n buildVariableAssignment(\n id:\n | t.Identifier\n | t.MemberExpression\n | t.RestElement\n | t.TSParameterProperty,\n init: t.Expression,\n ) {\n let op = this.operator;\n if (t.isMemberExpression(id)) op = \"=\";\n\n let node: t.ExpressionStatement | t.VariableDeclaration;\n\n if (op) {\n node = t.expressionStatement(\n t.assignmentExpression(\n op,\n id,\n t.cloneNode(init) || this.scope.buildUndefinedNode(),\n ),\n );\n } else {\n let nodeInit: t.Expression;\n\n if (this.kind === \"const\" && init === null) {\n nodeInit = this.scope.buildUndefinedNode();\n } else {\n nodeInit = t.cloneNode(init);\n }\n\n node = t.variableDeclaration(this.kind, [\n t.variableDeclarator(id, nodeInit),\n ]);\n }\n\n //@ts-expect-error(todo): document block hoist property\n node._blockHoist = this.blockHoist;\n\n return node;\n }\n\n buildVariableDeclaration(id: t.Identifier, init: t.Expression) {\n const declar = t.variableDeclaration(\"var\", [\n t.variableDeclarator(t.cloneNode(id), t.cloneNode(init)),\n ]);\n // @ts-expect-error todo(flow->ts): avoid mutations\n declar._blockHoist = this.blockHoist;\n return declar;\n }\n\n push(id: t.LVal, _init: t.Expression | null) {\n const init = t.cloneNode(_init);\n if (t.isObjectPattern(id)) {\n this.pushObjectPattern(id, init);\n } else if (t.isArrayPattern(id)) {\n this.pushArrayPattern(id, init);\n } else if (t.isAssignmentPattern(id)) {\n this.pushAssignmentPattern(id, init);\n } else {\n this.nodes.push(this.buildVariableAssignment(id, init));\n }\n }\n\n toArray(node: t.Expression, count?: boolean | number) {\n if (\n this.iterableIsArray ||\n (t.isIdentifier(node) && this.arrayRefSet.has(node.name))\n ) {\n return node;\n } else {\n return this.scope.toArray(node, count, this.arrayLikeIsIterable);\n }\n }\n\n pushAssignmentPattern(\n { left, right }: t.AssignmentPattern,\n valueRef: t.Expression | null,\n ) {\n // handle array init hole\n // const [x = 42] = [,];\n // -> const x = 42;\n if (valueRef === null) {\n this.push(left, right);\n return;\n }\n\n // we need to assign the current value of the assignment to avoid evaluating\n // it more than once\n const tempId = this.scope.generateUidIdentifierBasedOnNode(valueRef);\n\n this.nodes.push(this.buildVariableDeclaration(tempId, valueRef));\n\n const tempConditional = t.conditionalExpression(\n t.binaryExpression(\n \"===\",\n t.cloneNode(tempId),\n this.scope.buildUndefinedNode(),\n ),\n right,\n t.cloneNode(tempId),\n );\n\n if (t.isPattern(left)) {\n let patternId;\n let node;\n\n if (this.kind === \"const\" || this.kind === \"let\") {\n patternId = this.scope.generateUidIdentifier(tempId.name);\n node = this.buildVariableDeclaration(patternId, tempConditional);\n } else {\n patternId = tempId;\n\n node = t.expressionStatement(\n t.assignmentExpression(\"=\", t.cloneNode(tempId), tempConditional),\n );\n }\n\n this.nodes.push(node);\n this.push(left, patternId);\n } else {\n this.nodes.push(this.buildVariableAssignment(left, tempConditional));\n }\n }\n\n pushObjectRest(\n pattern: t.ObjectPattern,\n objRef: t.Expression,\n spreadProp: t.RestElement,\n spreadPropIndex: number,\n ) {\n const value = buildObjectExcludingKeys(\n pattern.properties.slice(0, spreadPropIndex) as t.ObjectProperty[],\n objRef,\n this.scope,\n name => this.addHelper(name),\n this.objectRestNoSymbols,\n this.useBuiltIns,\n );\n // @ts-expect-error: The argument of a RestElement in ObjectPattern must not be an ArrayPattern\n this.nodes.push(this.buildVariableAssignment(spreadProp.argument, value));\n }\n\n pushObjectProperty(prop: t.ObjectProperty, propRef: t.Expression) {\n if (t.isLiteral(prop.key)) prop.computed = true;\n\n const pattern = prop.value as t.LVal;\n const objRef = t.memberExpression(\n t.cloneNode(propRef),\n prop.key,\n prop.computed,\n );\n\n if (t.isPattern(pattern)) {\n this.push(pattern, objRef);\n } else {\n this.nodes.push(this.buildVariableAssignment(pattern, objRef));\n }\n }\n\n pushObjectPattern(pattern: t.ObjectPattern, objRef: t.Expression | null) {\n // https://github.com/babel/babel/issues/681\n\n if (!pattern.properties.length || objRef === null) {\n this.nodes.push(\n t.expressionStatement(\n t.callExpression(\n this.addHelper(\"objectDestructuringEmpty\"),\n objRef !== null ? [objRef] : [],\n ),\n ),\n );\n return;\n }\n\n // if we have more than one properties in this pattern and the objectRef is a\n // member expression then we need to assign it to a temporary variable so it's\n // only evaluated once\n\n if (pattern.properties.length > 1 && !this.scope.isStatic(objRef)) {\n const temp = this.scope.generateUidIdentifierBasedOnNode(objRef);\n this.nodes.push(this.buildVariableDeclaration(temp, objRef));\n objRef = temp;\n }\n\n // Replace impure computed key expressions if we have a rest parameter\n if (hasObjectRest(pattern)) {\n let copiedPattern;\n for (let i = 0; i < pattern.properties.length; i++) {\n const prop = pattern.properties[i];\n if (t.isRestElement(prop)) {\n break;\n }\n const key = prop.key;\n if (prop.computed && !this.scope.isPure(key)) {\n const name = this.scope.generateUidIdentifierBasedOnNode(key);\n this.nodes.push(this.buildVariableDeclaration(name, key));\n if (!copiedPattern) {\n copiedPattern = pattern = {\n ...pattern,\n properties: pattern.properties.slice(),\n };\n }\n copiedPattern.properties[i] = {\n ...copiedPattern.properties[i],\n key: name,\n };\n }\n }\n }\n //\n\n for (let i = 0; i < pattern.properties.length; i++) {\n const prop = pattern.properties[i];\n if (t.isRestElement(prop)) {\n this.pushObjectRest(pattern, objRef, prop, i);\n } else {\n this.pushObjectProperty(prop, objRef);\n }\n }\n }\n\n canUnpackArrayPattern(\n pattern: t.ArrayPattern,\n arr: t.Expression,\n ): arr is UnpackableArrayExpression {\n // not an array so there's no way we can deal with this\n if (!t.isArrayExpression(arr)) return false;\n\n // pattern has less elements than the array and doesn't have a rest so some\n // elements wont be evaluated\n if (pattern.elements.length > arr.elements.length) return;\n if (\n pattern.elements.length < arr.elements.length &&\n !hasArrayRest(pattern)\n ) {\n return false;\n }\n\n for (const elem of pattern.elements) {\n // deopt on holes\n if (!elem) return false;\n\n // deopt on member expressions as they may be included in the RHS\n if (t.isMemberExpression(elem)) return false;\n }\n\n for (const elem of arr.elements) {\n // deopt on spread elements\n if (t.isSpreadElement(elem)) return false;\n\n // deopt call expressions as they might change values of LHS variables\n if (t.isCallExpression(elem)) return false;\n\n // deopt on member expressions as they may be getter/setters and have side-effects\n if (t.isMemberExpression(elem)) return false;\n }\n\n // deopt on reference to left side identifiers\n const bindings = t.getBindingIdentifiers(pattern);\n const state: ArrayUnpackVisitorState = { deopt: false, bindings };\n\n try {\n t.traverse(arr, arrayUnpackVisitor, state);\n } catch (e) {\n if (e !== STOP_TRAVERSAL) throw e;\n }\n\n return !state.deopt;\n }\n\n pushUnpackedArrayPattern(\n pattern: t.ArrayPattern,\n arr: UnpackableArrayExpression,\n ) {\n for (let i = 0; i < pattern.elements.length; i++) {\n const elem = pattern.elements[i];\n if (t.isRestElement(elem)) {\n this.push(elem.argument, t.arrayExpression(arr.elements.slice(i)));\n } else {\n this.push(elem, arr.elements[i]);\n }\n }\n }\n\n pushArrayPattern(pattern: t.ArrayPattern, arrayRef: t.Expression | null) {\n if (arrayRef === null) {\n this.nodes.push(\n t.expressionStatement(\n t.callExpression(this.addHelper(\"objectDestructuringEmpty\"), []),\n ),\n );\n return;\n }\n if (!pattern.elements) return;\n\n // optimise basic array destructuring of an array expression\n //\n // we can't do this to a pattern of unequal size to it's right hand\n // array expression as then there will be values that wont be evaluated\n //\n // eg: let [a, b] = [1, 2];\n\n if (this.canUnpackArrayPattern(pattern, arrayRef)) {\n return this.pushUnpackedArrayPattern(pattern, arrayRef);\n }\n\n // if we have a rest then we need all the elements so don't tell\n // `scope.toArray` to only get a certain amount\n\n const count = !hasArrayRest(pattern) && pattern.elements.length;\n\n // so we need to ensure that the `arrayRef` is an array, `scope.toArray` will\n // return a locally bound identifier if it's been inferred to be an array,\n // otherwise it'll be a call to a helper that will ensure it's one\n\n const toArray = this.toArray(arrayRef, count);\n\n if (t.isIdentifier(toArray)) {\n // we've been given an identifier so it must have been inferred to be an\n // array\n arrayRef = toArray;\n } else {\n arrayRef = this.scope.generateUidIdentifierBasedOnNode(arrayRef);\n this.arrayRefSet.add(arrayRef.name);\n this.nodes.push(this.buildVariableDeclaration(arrayRef, toArray));\n }\n\n //\n\n for (let i = 0; i < pattern.elements.length; i++) {\n const elem = pattern.elements[i];\n\n // hole\n if (!elem) continue;\n\n let elemRef;\n\n if (t.isRestElement(elem)) {\n elemRef = this.toArray(arrayRef);\n elemRef = t.callExpression(\n t.memberExpression(elemRef, t.identifier(\"slice\")),\n [t.numericLiteral(i)],\n );\n\n // set the element to the rest element argument since we've dealt with it\n // being a rest already\n this.push(elem.argument, elemRef);\n } else {\n elemRef = t.memberExpression(arrayRef, t.numericLiteral(i), true);\n this.push(elem, elemRef);\n }\n }\n }\n\n init(pattern: t.LVal, ref: t.Expression) {\n // trying to destructure a value that we can't evaluate more than once so we\n // need to save it to a variable\n\n if (!t.isArrayExpression(ref) && !t.isMemberExpression(ref)) {\n const memo = this.scope.maybeGenerateMemoised(ref, true);\n if (memo) {\n this.nodes.push(this.buildVariableDeclaration(memo, t.cloneNode(ref)));\n ref = memo;\n }\n }\n\n //\n\n this.push(pattern, ref);\n\n return this.nodes;\n }\n}\n\ninterface ExcludingKey {\n key: t.Expression | t.PrivateName;\n computed: boolean;\n}\n\nexport function buildObjectExcludingKeys<T extends ExcludingKey>(\n excludedKeys: T[],\n objRef: t.Expression,\n scope: Scope,\n addHelper: File[\"addHelper\"],\n objectRestNoSymbols: boolean,\n useBuiltIns: boolean,\n): t.CallExpression {\n // get all the keys that appear in this object before the current spread\n\n const keys = [];\n let allLiteral = true;\n let hasTemplateLiteral = false;\n for (let i = 0; i < excludedKeys.length; i++) {\n const prop = excludedKeys[i];\n const key = prop.key;\n if (t.isIdentifier(key) && !prop.computed) {\n keys.push(t.stringLiteral(key.name));\n } else if (t.isTemplateLiteral(key)) {\n keys.push(t.cloneNode(key));\n hasTemplateLiteral = true;\n } else if (t.isLiteral(key)) {\n // @ts-expect-error todo(flow->ts) NullLiteral\n keys.push(t.stringLiteral(String(key.value)));\n } else if (t.isPrivateName(key)) {\n // private key is not enumerable\n } else {\n keys.push(t.cloneNode(key));\n allLiteral = false;\n }\n }\n\n let value;\n if (keys.length === 0) {\n const extendsHelper = useBuiltIns\n ? t.memberExpression(t.identifier(\"Object\"), t.identifier(\"assign\"))\n : addHelper(\"extends\");\n value = t.callExpression(extendsHelper, [\n t.objectExpression([]),\n t.cloneNode(objRef),\n ]);\n } else {\n let keyExpression: t.Expression = t.arrayExpression(keys);\n\n if (!allLiteral) {\n keyExpression = t.callExpression(\n t.memberExpression(keyExpression, t.identifier(\"map\")),\n [addHelper(\"toPropertyKey\")],\n );\n } else if (!hasTemplateLiteral && !t.isProgram(scope.block)) {\n // Hoist definition of excluded keys, so that it's not created each time.\n const programScope = scope.getProgramParent();\n const id = programScope.generateUidIdentifier(\"excluded\");\n\n programScope.push({\n id,\n init: keyExpression,\n kind: \"const\",\n });\n\n keyExpression = t.cloneNode(id);\n }\n\n value = t.callExpression(\n addHelper(`objectWithoutProperties${objectRestNoSymbols ? \"Loose\" : \"\"}`),\n [t.cloneNode(objRef), keyExpression],\n );\n }\n return value;\n}\n\nexport function convertVariableDeclaration(\n path: NodePath<t.VariableDeclaration>,\n addHelper: File[\"addHelper\"],\n arrayLikeIsIterable: boolean,\n iterableIsArray: boolean,\n objectRestNoSymbols: boolean,\n useBuiltIns: boolean,\n) {\n const { node, scope } = path;\n\n const nodeKind = node.kind;\n const nodeLoc = node.loc;\n const nodes = [];\n\n for (let i = 0; i < node.declarations.length; i++) {\n const declar = node.declarations[i];\n\n const patternId = declar.init;\n const pattern = declar.id;\n\n const destructuring = new DestructuringTransformer({\n // @ts-expect-error(todo): avoid internal properties access\n blockHoist: node._blockHoist,\n nodes: nodes,\n scope: scope,\n kind: node.kind,\n iterableIsArray,\n arrayLikeIsIterable,\n useBuiltIns,\n objectRestNoSymbols,\n addHelper,\n });\n\n if (t.isPattern(pattern)) {\n destructuring.init(pattern, patternId);\n\n if (+i !== node.declarations.length - 1) {\n // we aren't the last declarator so let's just make the\n // last transformed node inherit from us\n t.inherits(nodes[nodes.length - 1], declar);\n }\n } else {\n nodes.push(\n t.inherits(\n destructuring.buildVariableAssignment(pattern, patternId),\n declar,\n ),\n );\n }\n }\n\n let tail: t.VariableDeclaration | null = null;\n const nodesOut = [];\n for (const node of nodes) {\n if (tail !== null && t.isVariableDeclaration(node)) {\n // Create a single compound declarations\n tail.declarations.push(...node.declarations);\n } else {\n // Make sure the original node kind is used for each compound declaration\n node.kind = nodeKind;\n // Propagate the original declaration node's location\n if (!node.loc) {\n node.loc = nodeLoc;\n }\n nodesOut.push(node);\n tail = t.isVariableDeclaration(node) ? node : null;\n }\n }\n\n // Need to unmark the current binding to this var as a param, or other hoists\n // could be placed above this ref.\n // https://github.com/babel/babel/issues/4516\n for (const nodeOut of nodesOut) {\n if (!nodeOut.declarations) continue;\n for (const declaration of nodeOut.declarations) {\n const { name } = declaration.id;\n if (scope.bindings[name]) {\n scope.bindings[name].kind = nodeOut.kind;\n }\n }\n }\n\n if (nodesOut.length === 1) {\n path.replaceWith(nodesOut[0]);\n } else {\n path.replaceWithMultiple(nodesOut);\n }\n}\n\nexport function convertAssignmentExpression(\n path: NodePath<t.AssignmentExpression>,\n addHelper: File[\"addHelper\"],\n arrayLikeIsIterable: boolean,\n iterableIsArray: boolean,\n objectRestNoSymbols: boolean,\n useBuiltIns: boolean,\n) {\n const { node, scope } = path;\n\n const nodes = [];\n\n const destructuring = new DestructuringTransformer({\n operator: node.operator,\n scope: scope,\n nodes: nodes,\n arrayLikeIsIterable,\n iterableIsArray,\n objectRestNoSymbols,\n useBuiltIns,\n addHelper,\n });\n\n let ref: t.Identifier | void;\n if (path.isCompletionRecord() || !path.parentPath.isExpressionStatement()) {\n ref = scope.generateUidIdentifierBasedOnNode(node.right, \"ref\");\n\n nodes.push(\n t.variableDeclaration(\"var\", [t.variableDeclarator(ref, node.right)]),\n );\n\n if (t.isArrayExpression(node.right)) {\n destructuring.arrayRefSet.add(ref.name);\n }\n }\n\n destructuring.init(node.left, ref || node.right);\n\n if (ref) {\n if (path.parentPath.isArrowFunctionExpression()) {\n path.replaceWith(t.blockStatement([]));\n nodes.push(t.returnStatement(t.cloneNode(ref)));\n } else {\n nodes.push(t.expressionStatement(t.cloneNode(ref)));\n }\n }\n\n path.replaceWithMultiple(nodes);\n path.scope.crawl();\n}\n","import { declare } from \"@babel/helper-plugin-utils\";\nimport { types as t } from \"@babel/core\";\nimport {\n DestructuringTransformer,\n convertVariableDeclaration,\n convertAssignmentExpression,\n} from \"./util\";\nimport type { PluginPass } from \"@babel/core\";\nimport type { Visitor } from \"@babel/traverse\";\n\n/**\n * Test if a VariableDeclaration's declarations contains any Patterns.\n */\n\nfunction variableDeclarationHasPattern(node: t.VariableDeclaration) {\n for (const declar of node.declarations) {\n if (t.isPattern(declar.id)) {\n return true;\n }\n }\n return false;\n}\n\nexport default declare((api, options) => {\n api.assertVersion(7);\n\n const { useBuiltIns = false } = options;\n\n const iterableIsArray = api.assumption(\"iterableIsArray\") ?? options.loose;\n const arrayLikeIsIterable =\n options.allowArrayLike ?? api.assumption(\"arrayLikeIsIterable\");\n const objectRestNoSymbols =\n api.assumption(\"objectRestNoSymbols\") ?? options.loose;\n\n return {\n name: \"transform-destructuring\",\n\n visitor: {\n ExportNamedDeclaration(path) {\n const declaration = path.get(\"declaration\");\n if (!declaration.isVariableDeclaration()) return;\n if (!variableDeclarationHasPattern(declaration.node)) return;\n\n const specifiers = [];\n\n for (const name of Object.keys(path.getOuterBindingIdentifiers())) {\n specifiers.push(\n t.exportSpecifier(t.identifier(name), t.identifier(name)),\n );\n }\n\n // Split the declaration and export list into two declarations so that the variable\n // declaration can be split up later without needing to worry about not being a\n // top-level statement.\n path.replaceWith(declaration.node);\n path.insertAfter(t.exportNamedDeclaration(null, specifiers));\n },\n\n ForXStatement(path) {\n const { node, scope } = path;\n const left = node.left;\n\n if (t.isPattern(left)) {\n // for ({ length: k } in { abc: 3 });\n\n const temp = scope.generateUidIdentifier(\"ref\");\n\n node.left = t.variableDeclaration(\"var\", [\n t.variableDeclarator(temp),\n ]);\n\n path.ensureBlock();\n const statementBody = (node.body as t.BlockStatement).body;\n\n if (statementBody.length === 0 && path.isCompletionRecord()) {\n statementBody.unshift(\n t.expressionStatement(scope.buildUndefinedNode()),\n );\n }\n\n statementBody.unshift(\n t.expressionStatement(t.assignmentExpression(\"=\", left, temp)),\n );\n\n return;\n }\n\n if (!t.isVariableDeclaration(left)) return;\n\n const pattern = left.declarations[0].id;\n if (!t.isPattern(pattern)) return;\n\n const key = scope.generateUidIdentifier(\"ref\");\n node.left = t.variableDeclaration(left.kind, [\n t.variableDeclarator(key, null),\n ]);\n\n const nodes = [];\n\n const destructuring = new DestructuringTransformer({\n kind: left.kind,\n scope: scope,\n nodes: nodes,\n arrayLikeIsIterable,\n iterableIsArray,\n objectRestNoSymbols,\n useBuiltIns,\n addHelper: name => this.addHelper(name),\n });\n\n destructuring.init(pattern, key);\n\n path.ensureBlock();\n\n const block = node.body;\n // @ts-expect-error: ensureBlock ensures that node.body is a BlockStatement\n block.body = nodes.concat(block.body);\n },\n\n CatchClause({ node, scope }) {\n const pattern = node.param;\n if (!t.isPattern(pattern)) return;\n\n const ref = scope.generateUidIdentifier(\"ref\");\n node.param = ref;\n\n const nodes = [];\n\n const destructuring = new DestructuringTransformer({\n kind: \"let\",\n scope: scope,\n nodes: nodes,\n arrayLikeIsIterable,\n iterableIsArray,\n objectRestNoSymbols,\n useBuiltIns,\n addHelper: name => this.addHelper(name),\n });\n destructuring.init(pattern, ref);\n\n node.body.body = nodes.concat(node.body.body);\n },\n\n AssignmentExpression(path, state) {\n if (!t.isPattern(path.node.left)) return;\n convertAssignmentExpression(\n path,\n name => state.addHelper(name),\n arrayLikeIsIterable,\n iterableIsArray,\n objectRestNoSymbols,\n useBuiltIns,\n );\n },\n\n VariableDeclaration(path, state) {\n const { node, parent } = path;\n if (t.isForXStatement(parent)) return;\n if (!parent || !path.container) return; // i don't know why this is necessary - TODO\n if (!variableDeclarationHasPattern(node)) return;\n convertVariableDeclaration(\n path,\n name => state.addHelper(name),\n arrayLikeIsIterable,\n iterableIsArray,\n objectRestNoSymbols,\n useBuiltIns,\n );\n },\n } as Visitor<PluginPass>,\n };\n});\n"],"names":["hasArrayRest","pattern","elements","some","elem","t","isRestElement","hasObjectRest","properties","prop","STOP_TRAVERSAL","arrayUnpackVisitor","node","ancestors","state","length","isIdentifier","isReferenced","bindings","name","deopt","DestructuringTransformer","constructor","opts","blockHoist","operator","arrayRefSet","nodes","scope","kind","iterableIsArray","arrayLikeIsIterable","objectRestNoSymbols","useBuiltIns","addHelper","Set","getExtendsHelper","memberExpression","identifier","buildVariableAssignment","id","init","op","isMemberExpression","expressionStatement","assignmentExpression","cloneNode","buildUndefinedNode","nodeInit","variableDeclaration","variableDeclarator","_blockHoist","buildVariableDeclaration","declar","push","_init","isObjectPattern","pushObjectPattern","isArrayPattern","pushArrayPattern","isAssignmentPattern","pushAssignmentPattern","toArray","count","has","left","right","valueRef","tempId","generateUidIdentifierBasedOnNode","tempConditional","conditionalExpression","binaryExpression","isPattern","patternId","generateUidIdentifier","pushObjectRest","objRef","spreadProp","spreadPropIndex","value","buildObjectExcludingKeys","slice","argument","pushObjectProperty","propRef","isLiteral","key","computed","callExpression","isStatic","temp","copiedPattern","i","isPure","canUnpackArrayPattern","arr","isArrayExpression","isSpreadElement","isCallExpression","getBindingIdentifiers","traverse","e","pushUnpackedArrayPattern","arrayExpression","arrayRef","add","elemRef","numericLiteral","ref","memo","maybeGenerateMemoised","excludedKeys","keys","allLiteral","hasTemplateLiteral","stringLiteral","isTemplateLiteral","String","isPrivateName","extendsHelper","objectExpression","keyExpression","isProgram","block","programScope","getProgramParent","convertVariableDeclaration","path","nodeKind","nodeLoc","loc","declarations","destructuring","inherits","tail","nodesOut","isVariableDeclaration","nodeOut","declaration","replaceWith","replaceWithMultiple","convertAssignmentExpression","isCompletionRecord","parentPath","isExpressionStatement","isArrowFunctionExpression","blockStatement","returnStatement","crawl","variableDeclarationHasPattern","declare","api","options","assertVersion","assumption","loose","allowArrayLike","visitor","ExportNamedDeclaration","get","specifiers","Object","getOuterBindingIdentifiers","exportSpecifier","insertAfter","exportNamedDeclaration","ForXStatement","ensureBlock","statementBody","body","unshift","concat","CatchClause","param","AssignmentExpression","VariableDeclaration","parent","isForXStatement","container"],"mappings":";;;;;;;AASA,SAASA,YAAT,CAAsBC,OAAtB,EAA+C;AAC7C,SAAOA,OAAO,CAACC,QAAR,CAAiBC,IAAjB,CAAsBC,IAAI,IAAIC,UAAC,CAACC,aAAF,CAAgBF,IAAhB,CAA9B,CAAP;AACD;;AAMD,SAASG,aAAT,CAAuBN,OAAvB,EAAiD;AAC/C,SAAOA,OAAO,CAACO,UAAR,CAAmBL,IAAnB,CAAwBM,IAAI,IAAIJ,UAAC,CAACC,aAAF,CAAgBG,IAAhB,CAAhC,CAAP;AACD;;AAMD,MAAMC,cAAc,GAAG,EAAvB;;AAQA,MAAMC,kBAAkB,GAAG,CACzBC,IADyB,EAEzBC,SAFyB,EAGzBC,KAHyB,KAItB;AACH,MAAI,CAACD,SAAS,CAACE,MAAf,EAAuB;AAErB;AACD;;AAED,MACEV,UAAC,CAACW,YAAF,CAAeJ,IAAf,KACAP,UAAC,CAACY,YAAF,CAAeL,IAAf,EAAqBC,SAAS,C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