the-forest/client/node_modules/@babel/traverse/lib/path/conversion.js.map
2024-09-17 20:35:18 -04:00

1 line
58 KiB
Plaintext

{"version":3,"names":["_t","require","_template","_visitors","_context","arrowFunctionExpression","assignmentExpression","binaryExpression","blockStatement","callExpression","conditionalExpression","expressionStatement","identifier","isIdentifier","jsxIdentifier","logicalExpression","LOGICAL_OPERATORS","memberExpression","metaProperty","numericLiteral","objectExpression","restElement","returnStatement","sequenceExpression","spreadElement","stringLiteral","super","_super","thisExpression","toExpression","unaryExpression","toBindingIdentifierName","isFunction","isAssignmentPattern","isRestElement","getFunctionName","cloneNode","variableDeclaration","variableDeclarator","exportNamedDeclaration","exportSpecifier","inherits","toComputedKey","key","isMemberExpression","node","property","isProperty","isMethod","ReferenceError","computed","name","ensureBlock","body","get","bodyNode","Array","isArray","Error","isBlockStatement","statements","stringPath","listKey","isStatement","push","parentPath","setup","call","exports","arrowFunctionToShadowed","isArrowFunctionExpression","arrowFunctionToExpression","unwrapFunctionEnvironment","isFunctionExpression","isFunctionDeclaration","buildCodeFrameError","hoistFunctionEnvironment","setType","path","type","allowInsertArrow","allowInsertArrowWithRest","noNewArrows","_arguments$","arguments","specCompliant","self","_self$ensureFunctionN","ensureFunctionName","thisBinding","fnPath","fn","checkBinding","scope","generateUidIdentifier","id","init","unshiftContainer","hub","addHelper","replaceWith","getSuperCallsVisitor","environmentVisitor","CallExpression","child","allSuperCalls","isSuper","arrowParent","thisEnvFn","findParent","p","_arrowParent","isProgram","isClassProperty","static","isClassPrivateProperty","inConstructor","isClassMethod","kind","thisPaths","argumentsPaths","newTargetPaths","superProps","superCalls","getScopeInformation","length","traverse","superBinding","getSuperBinding","forEach","superCall","callee","loc","argumentsBinding","getBinding","args","buildUndefinedNode","argumentsChild","argsRef","newTargetBinding","targetChild","targetRef","flatSuperProps","reduce","acc","superProp","concat","standardizeSuperProperty","superParentPath","isAssignment","isAssignmentExpression","left","isCall","isCallExpression","isTaggedTemplate","isTaggedTemplateExpression","tag","getSuperPropBinding","value","right","getThisBinding","hasSuperClass","thisChild","thisRef","isJSX","isLogicalOp","op","includes","operator","assignmentPath","slice","isLogicalAssignment","tmp","generateDeclaredUidIdentifier","object","rightExpression","isUpdateExpression","updateExpr","computedKey","parts","prefix","superClass","assignSuperThisVisitor","supers","has","add","replaceWithMultiple","WeakSet","argsBinding","propName","argsList","fnBody","method","unshift","valueIdent","cacheKey","data","getData","setData","getScopeInformationVisitor","ThisExpression","JSXIdentifier","isJSXMemberExpression","isJSXOpeningElement","MemberExpression","Identifier","isReferencedIdentifier","curr","hasOwnBinding","rename","parent","MetaProperty","splitExportDeclaration","isExportDeclaration","isExportAllDeclaration","isExportNamedDeclaration","declaration","isExportDefaultDeclaration","standaloneDeclaration","isClassDeclaration","exportExpr","isClassExpression","isScope","needBindingRegistration","hasBinding","updatedDeclaration","updatedExportDeclaration","insertAfter","registerDeclaration","bindingIdentifiers","getOuterBindingIdentifiers","specifiers","Object","keys","map","aliasDeclar","refersOuterBindingVisitor","ReferencedIdentifier|BindingIdentifier","state","needsRename","stop","Scope","skip","supportUnicodeId","res","test","startsWith","replace","originalNode","binding","getOwnBinding","hasGlobal","getProgramParent","references","params","i","len","getFunctionArity","template","expression","ast","count","findIndex","param"],"sources":["../../src/path/conversion.ts"],"sourcesContent":["// This file contains methods that convert the path node into another node or some other type of data.\n\nimport {\n arrowFunctionExpression,\n assignmentExpression,\n binaryExpression,\n blockStatement,\n callExpression,\n conditionalExpression,\n expressionStatement,\n identifier,\n isIdentifier,\n jsxIdentifier,\n logicalExpression,\n LOGICAL_OPERATORS,\n memberExpression,\n metaProperty,\n numericLiteral,\n objectExpression,\n restElement,\n returnStatement,\n sequenceExpression,\n spreadElement,\n stringLiteral,\n super as _super,\n thisExpression,\n toExpression,\n unaryExpression,\n toBindingIdentifierName,\n isFunction,\n isAssignmentPattern,\n isRestElement,\n getFunctionName,\n cloneNode,\n variableDeclaration,\n variableDeclarator,\n exportNamedDeclaration,\n exportSpecifier,\n inherits,\n} from \"@babel/types\";\nimport type * as t from \"@babel/types\";\nimport template from \"@babel/template\";\nimport { environmentVisitor } from \"../visitors.ts\";\nimport type NodePath from \"./index.ts\";\nimport type { Visitor } from \"../types.ts\";\nimport { setup } from \"./context.ts\";\n\nexport function toComputedKey(this: NodePath) {\n let key;\n if (this.isMemberExpression()) {\n key = this.node.property;\n } else if (this.isProperty() || this.isMethod()) {\n key = this.node.key;\n } else {\n throw new ReferenceError(\"todo\");\n }\n\n // @ts-expect-error todo(flow->ts) computed does not exist in ClassPrivateProperty\n if (!this.node.computed) {\n if (isIdentifier(key)) key = stringLiteral(key.name);\n }\n\n return key;\n}\n\nexport function ensureBlock(\n this: NodePath<\n t.Loop | t.WithStatement | t.Function | t.LabeledStatement | t.CatchClause\n >,\n): void {\n const body = this.get(\"body\");\n const bodyNode = body.node;\n\n if (Array.isArray(body)) {\n throw new Error(\"Can't convert array path to a block statement\");\n }\n if (!bodyNode) {\n throw new Error(\"Can't convert node without a body\");\n }\n\n if (body.isBlockStatement()) {\n // @ts-expect-error TS throws because ensureBlock returns the body node path\n // however, we don't use the return value and treat it as a transform and\n // assertion utilities. For better type inference we annotate it as an\n // assertion method\n // TODO: Unify the implementation with the type definition\n return bodyNode;\n }\n\n const statements: Array<t.Statement> = [];\n\n let stringPath = \"body\";\n let key;\n let listKey;\n if (body.isStatement()) {\n listKey = \"body\";\n key = 0;\n statements.push(body.node);\n } else {\n stringPath += \".body.0\";\n if (this.isFunction()) {\n key = \"argument\";\n statements.push(returnStatement(body.node as t.Expression));\n } else {\n key = \"expression\";\n statements.push(expressionStatement(body.node as t.Expression));\n }\n }\n\n this.node.body = blockStatement(statements);\n const parentPath = this.get(stringPath) as NodePath;\n setup.call(\n body,\n parentPath,\n listKey\n ? // @ts-expect-error listKey must present in parent path\n parentPath.node[listKey]\n : parentPath.node,\n listKey,\n key,\n );\n\n // @ts-expect-error TS throws because ensureBlock returns the body node path\n // however, we don't use the return value and treat it as a transform and\n // assertion utilities. For better type inference we annotate it as an\n // assertion method\n // TODO: Unify the implementation with the type definition\n return this.node;\n}\n\nif (!process.env.BABEL_8_BREAKING && !USE_ESM) {\n /**\n * Keeping this for backward-compatibility. You should use arrowFunctionToExpression() for >=7.x.\n */\n // eslint-disable-next-line no-restricted-globals\n exports.arrowFunctionToShadowed = function (this: NodePath) {\n if (!this.isArrowFunctionExpression()) return;\n\n this.arrowFunctionToExpression();\n };\n}\n\n/**\n * Given an arbitrary function, process its content as if it were an arrow function, moving references\n * to \"this\", \"arguments\", \"super\", and such into the function's parent scope. This method is useful if\n * you have wrapped some set of items in an IIFE or other function, but want \"this\", \"arguments\", and super\"\n * to continue behaving as expected.\n */\nexport function unwrapFunctionEnvironment(this: NodePath) {\n if (\n !this.isArrowFunctionExpression() &&\n !this.isFunctionExpression() &&\n !this.isFunctionDeclaration()\n ) {\n throw this.buildCodeFrameError(\n \"Can only unwrap the environment of a function.\",\n );\n }\n\n hoistFunctionEnvironment(this);\n}\n\nfunction setType<N extends t.Node, T extends N[\"type\"]>(\n path: NodePath<N>,\n type: T,\n): asserts path is NodePath<Extract<N, { type: T }>> {\n path.node.type = type;\n}\n\n/**\n * Convert a given arrow function into a normal ES5 function expression.\n */\nexport function arrowFunctionToExpression(\n this: NodePath<t.ArrowFunctionExpression>,\n {\n allowInsertArrow = true,\n allowInsertArrowWithRest = allowInsertArrow,\n noNewArrows = process.env.BABEL_8_BREAKING\n ? // TODO(Babel 8): Consider defaulting to `false` for spec compliance\n true\n : !arguments[0]?.specCompliant,\n }: {\n allowInsertArrow?: boolean | void;\n allowInsertArrowWithRest?: boolean | void;\n noNewArrows?: boolean;\n } = {},\n): NodePath<\n Exclude<t.Function, t.Method | t.ArrowFunctionExpression> | t.CallExpression\n> {\n if (!this.isArrowFunctionExpression()) {\n throw (this as NodePath).buildCodeFrameError(\n \"Cannot convert non-arrow function to a function expression.\",\n );\n }\n\n let self = this;\n if (!noNewArrows) {\n // @ts-expect-error This is technicallynot valid on arrow functions\n // because it adds an .id property, but we are going to convert it\n // to a function expression anyway\n self = self.ensureFunctionName(false) ?? self;\n }\n\n const { thisBinding, fnPath: fn } = hoistFunctionEnvironment(\n self,\n noNewArrows,\n allowInsertArrow,\n allowInsertArrowWithRest,\n );\n\n fn.ensureBlock();\n setType(fn, \"FunctionExpression\");\n\n if (!noNewArrows) {\n const checkBinding = thisBinding\n ? null\n : fn.scope.generateUidIdentifier(\"arrowCheckId\");\n if (checkBinding) {\n fn.parentPath.scope.push({\n id: checkBinding,\n init: objectExpression([]),\n });\n }\n\n fn.get(\"body\").unshiftContainer(\n \"body\",\n expressionStatement(\n callExpression(this.hub.addHelper(\"newArrowCheck\"), [\n thisExpression(),\n checkBinding\n ? identifier(checkBinding.name)\n : identifier(thisBinding),\n ]),\n ),\n );\n\n fn.replaceWith(\n callExpression(memberExpression(fn.node, identifier(\"bind\")), [\n checkBinding ? identifier(checkBinding.name) : thisExpression(),\n ]),\n );\n\n return fn.get(\"callee.object\");\n }\n\n return fn;\n}\n\nconst getSuperCallsVisitor = environmentVisitor<{\n allSuperCalls: NodePath<t.CallExpression>[];\n}>({\n CallExpression(child, { allSuperCalls }) {\n if (!child.get(\"callee\").isSuper()) return;\n allSuperCalls.push(child);\n },\n});\n\n/**\n * Given a function, traverse its contents, and if there are references to \"this\", \"arguments\", \"super\",\n * or \"new.target\", ensure that these references reference the parent environment around this function.\n *\n * @returns `thisBinding`: the name of the injected reference to `this`; for example \"_this\"\n * @returns `fnPath`: the new path to the function node. This is different from the fnPath\n * parameter when the function node is wrapped in another node.\n */\nfunction hoistFunctionEnvironment(\n fnPath: NodePath<t.Function>,\n // TODO(Babel 8): Consider defaulting to `false` for spec compliance\n noNewArrows: boolean | void = true,\n allowInsertArrow: boolean | void = true,\n allowInsertArrowWithRest: boolean | void = true,\n): { thisBinding: string; fnPath: NodePath<t.Function> } {\n let arrowParent;\n let thisEnvFn: NodePath<t.Function> = fnPath.findParent(p => {\n if (p.isArrowFunctionExpression()) {\n arrowParent ??= p;\n return false;\n }\n return (\n p.isFunction() ||\n p.isProgram() ||\n p.isClassProperty({ static: false }) ||\n p.isClassPrivateProperty({ static: false })\n );\n }) as NodePath<t.Function>;\n const inConstructor = thisEnvFn.isClassMethod({ kind: \"constructor\" });\n\n if (thisEnvFn.isClassProperty() || thisEnvFn.isClassPrivateProperty()) {\n if (arrowParent) {\n thisEnvFn = arrowParent;\n } else if (allowInsertArrow) {\n // It's safe to wrap this function in another and not hoist to the\n // top level because the 'this' binding is constant in class\n // properties (since 'super()' has already been called), so we don't\n // need to capture/reassign it at the top level.\n fnPath.replaceWith(\n callExpression(\n arrowFunctionExpression([], toExpression(fnPath.node)),\n [],\n ),\n );\n thisEnvFn = fnPath.get(\"callee\") as NodePath<t.ArrowFunctionExpression>;\n fnPath = thisEnvFn.get(\"body\") as NodePath<t.FunctionExpression>;\n } else {\n throw fnPath.buildCodeFrameError(\n \"Unable to transform arrow inside class property\",\n );\n }\n }\n\n const { thisPaths, argumentsPaths, newTargetPaths, superProps, superCalls } =\n getScopeInformation(fnPath);\n\n // Convert all super() calls in the constructor, if super is used in an arrow.\n if (inConstructor && superCalls.length > 0) {\n if (!allowInsertArrow) {\n throw superCalls[0].buildCodeFrameError(\n \"When using '@babel/plugin-transform-arrow-functions', \" +\n \"it's not possible to compile `super()` in an arrow function without compiling classes.\\n\" +\n \"Please add '@babel/plugin-transform-classes' to your Babel configuration.\",\n );\n }\n if (!allowInsertArrowWithRest) {\n // preset-env with target `since 2017` enables `transform-parameters` without `transform-classes`.\n throw superCalls[0].buildCodeFrameError(\n \"When using '@babel/plugin-transform-parameters', \" +\n \"it's not possible to compile `super()` in an arrow function with default or rest parameters without compiling classes.\\n\" +\n \"Please add '@babel/plugin-transform-classes' to your Babel configuration.\",\n );\n }\n const allSuperCalls: NodePath<t.CallExpression>[] = [];\n thisEnvFn.traverse(getSuperCallsVisitor, { allSuperCalls });\n const superBinding = getSuperBinding(thisEnvFn);\n allSuperCalls.forEach(superCall => {\n const callee = identifier(superBinding);\n callee.loc = superCall.node.callee.loc;\n\n superCall.get(\"callee\").replaceWith(callee);\n });\n }\n\n // Convert all \"arguments\" references in the arrow to point at the alias.\n if (argumentsPaths.length > 0) {\n const argumentsBinding = getBinding(thisEnvFn, \"arguments\", () => {\n const args = () => identifier(\"arguments\");\n if (thisEnvFn.scope.path.isProgram()) {\n return conditionalExpression(\n binaryExpression(\n \"===\",\n unaryExpression(\"typeof\", args()),\n stringLiteral(\"undefined\"),\n ),\n thisEnvFn.scope.buildUndefinedNode(),\n args(),\n );\n } else {\n return args();\n }\n });\n\n argumentsPaths.forEach(argumentsChild => {\n const argsRef = identifier(argumentsBinding);\n argsRef.loc = argumentsChild.node.loc;\n\n argumentsChild.replaceWith(argsRef);\n });\n }\n\n // Convert all \"new.target\" references in the arrow to point at the alias.\n if (newTargetPaths.length > 0) {\n const newTargetBinding = getBinding(thisEnvFn, \"newtarget\", () =>\n metaProperty(identifier(\"new\"), identifier(\"target\")),\n );\n\n newTargetPaths.forEach(targetChild => {\n const targetRef = identifier(newTargetBinding);\n targetRef.loc = targetChild.node.loc;\n\n targetChild.replaceWith(targetRef);\n });\n }\n\n // Convert all \"super.prop\" references to point at aliases.\n if (superProps.length > 0) {\n if (!allowInsertArrow) {\n throw superProps[0].buildCodeFrameError(\n \"When using '@babel/plugin-transform-arrow-functions', \" +\n \"it's not possible to compile `super.prop` in an arrow function without compiling classes.\\n\" +\n \"Please add '@babel/plugin-transform-classes' to your Babel configuration.\",\n );\n }\n\n const flatSuperProps: NodePath<t.MemberExpression>[] = superProps.reduce(\n (acc, superProp) => acc.concat(standardizeSuperProperty(superProp)),\n [],\n );\n\n flatSuperProps.forEach(superProp => {\n const key = superProp.node.computed\n ? \"\"\n : // @ts-expect-error super property must not contain private name\n superProp.get(\"property\").node.name;\n\n const superParentPath = superProp.parentPath;\n\n const isAssignment = superParentPath.isAssignmentExpression({\n left: superProp.node,\n });\n const isCall = superParentPath.isCallExpression({\n callee: superProp.node,\n });\n const isTaggedTemplate = superParentPath.isTaggedTemplateExpression({\n tag: superProp.node,\n });\n const superBinding = getSuperPropBinding(thisEnvFn, isAssignment, key);\n\n const args: t.Expression[] = [];\n if (superProp.node.computed) {\n // SuperProperty must not be a private name\n args.push(superProp.get(\"property\").node as t.Expression);\n }\n\n if (isAssignment) {\n const value = superParentPath.node.right;\n args.push(value);\n }\n\n const call = callExpression(identifier(superBinding), args);\n\n if (isCall) {\n superParentPath.unshiftContainer(\"arguments\", thisExpression());\n superProp.replaceWith(memberExpression(call, identifier(\"call\")));\n\n thisPaths.push(\n superParentPath.get(\"arguments.0\") as NodePath<t.ThisExpression>,\n );\n } else if (isAssignment) {\n // Replace not only the super.prop, but the whole assignment\n superParentPath.replaceWith(call);\n } else if (isTaggedTemplate) {\n superProp.replaceWith(\n callExpression(memberExpression(call, identifier(\"bind\"), false), [\n thisExpression(),\n ]),\n );\n\n thisPaths.push(\n superProp.get(\"arguments.0\") as NodePath<t.ThisExpression>,\n );\n } else {\n superProp.replaceWith(call);\n }\n });\n }\n\n // Convert all \"this\" references in the arrow to point at the alias.\n let thisBinding: string | null;\n if (thisPaths.length > 0 || !noNewArrows) {\n thisBinding = getThisBinding(thisEnvFn, inConstructor);\n\n if (\n noNewArrows ||\n // In subclass constructors, still need to rewrite because \"this\" can't be bound in spec mode\n // because it might not have been initialized yet.\n (inConstructor && hasSuperClass(thisEnvFn))\n ) {\n thisPaths.forEach(thisChild => {\n const thisRef = thisChild.isJSX()\n ? jsxIdentifier(thisBinding)\n : identifier(thisBinding);\n\n thisRef.loc = thisChild.node.loc;\n thisChild.replaceWith(thisRef);\n });\n\n if (!noNewArrows) thisBinding = null;\n }\n }\n\n return { thisBinding, fnPath };\n}\n\ntype LogicalOp = Parameters<typeof logicalExpression>[0];\ntype BinaryOp = Parameters<typeof binaryExpression>[0];\n\nfunction isLogicalOp(op: string): op is LogicalOp {\n return LOGICAL_OPERATORS.includes(op);\n}\n\nfunction standardizeSuperProperty(\n superProp: NodePath<t.MemberExpression>,\n):\n | [NodePath<t.MemberExpression>]\n | [NodePath<t.MemberExpression>, NodePath<t.MemberExpression>] {\n if (\n superProp.parentPath.isAssignmentExpression() &&\n superProp.parentPath.node.operator !== \"=\"\n ) {\n const assignmentPath = superProp.parentPath;\n\n const op = assignmentPath.node.operator.slice(0, -1) as\n | LogicalOp\n | BinaryOp;\n\n const value = assignmentPath.node.right;\n\n const isLogicalAssignment = isLogicalOp(op);\n\n if (superProp.node.computed) {\n // from: super[foo] **= 4;\n // to: super[tmp = foo] = super[tmp] ** 4;\n\n // from: super[foo] ??= 4;\n // to: super[tmp = foo] ?? super[tmp] = 4;\n\n const tmp = superProp.scope.generateDeclaredUidIdentifier(\"tmp\");\n\n const object = superProp.node.object;\n const property = superProp.node.property as t.Expression;\n\n assignmentPath\n .get(\"left\")\n .replaceWith(\n memberExpression(\n object,\n assignmentExpression(\"=\", tmp, property),\n true /* computed */,\n ),\n );\n\n assignmentPath\n .get(\"right\")\n .replaceWith(\n rightExpression(\n isLogicalAssignment ? \"=\" : op,\n memberExpression(object, identifier(tmp.name), true /* computed */),\n value,\n ),\n );\n } else {\n // from: super.foo **= 4;\n // to: super.foo = super.foo ** 4;\n\n // from: super.foo ??= 4;\n // to: super.foo ?? super.foo = 4;\n\n const object = superProp.node.object;\n const property = superProp.node.property as t.Identifier;\n\n assignmentPath\n .get(\"left\")\n .replaceWith(memberExpression(object, property));\n\n assignmentPath\n .get(\"right\")\n .replaceWith(\n rightExpression(\n isLogicalAssignment ? \"=\" : op,\n memberExpression(object, identifier(property.name)),\n value,\n ),\n );\n }\n\n if (isLogicalAssignment) {\n assignmentPath.replaceWith(\n logicalExpression(\n op,\n assignmentPath.node.left as t.MemberExpression,\n assignmentPath.node.right,\n ),\n );\n } else {\n assignmentPath.node.operator = \"=\";\n }\n\n return [\n assignmentPath.get(\"left\") as NodePath<t.MemberExpression>,\n assignmentPath.get(\"right\").get(\"left\") as NodePath<t.MemberExpression>,\n ];\n } else if (superProp.parentPath.isUpdateExpression()) {\n const updateExpr = superProp.parentPath;\n\n const tmp = superProp.scope.generateDeclaredUidIdentifier(\"tmp\");\n const computedKey = superProp.node.computed\n ? superProp.scope.generateDeclaredUidIdentifier(\"prop\")\n : null;\n\n const parts: t.Expression[] = [\n assignmentExpression(\n \"=\",\n tmp,\n memberExpression(\n superProp.node.object,\n computedKey\n ? assignmentExpression(\n \"=\",\n computedKey,\n superProp.node.property as t.Expression,\n )\n : superProp.node.property,\n superProp.node.computed,\n ),\n ),\n assignmentExpression(\n \"=\",\n memberExpression(\n superProp.node.object,\n computedKey ? identifier(computedKey.name) : superProp.node.property,\n superProp.node.computed,\n ),\n binaryExpression(\n // map `++` to `+`, and `--` to `-`\n superProp.parentPath.node.operator[0] as \"+\" | \"-\",\n identifier(tmp.name),\n numericLiteral(1),\n ),\n ),\n ];\n\n if (!superProp.parentPath.node.prefix) {\n parts.push(identifier(tmp.name));\n }\n\n updateExpr.replaceWith(sequenceExpression(parts));\n\n const left = updateExpr.get(\n \"expressions.0.right\",\n ) as NodePath<t.MemberExpression>;\n const right = updateExpr.get(\n \"expressions.1.left\",\n ) as NodePath<t.MemberExpression>;\n return [left, right];\n }\n\n return [superProp];\n\n function rightExpression(\n op: BinaryOp | \"=\",\n left: t.MemberExpression,\n right: t.Expression,\n ) {\n if (op === \"=\") {\n return assignmentExpression(\"=\", left, right);\n } else {\n return binaryExpression(op, left, right);\n }\n }\n}\n\nfunction hasSuperClass(thisEnvFn: NodePath<t.Function>) {\n return (\n thisEnvFn.isClassMethod() &&\n !!(thisEnvFn.parentPath.parentPath.node as t.Class).superClass\n );\n}\n\nconst assignSuperThisVisitor = environmentVisitor<{\n supers: WeakSet<t.CallExpression>;\n thisBinding: string;\n}>({\n CallExpression(child, { supers, thisBinding }) {\n if (!child.get(\"callee\").isSuper()) return;\n if (supers.has(child.node)) return;\n supers.add(child.node);\n\n child.replaceWithMultiple([\n child.node,\n assignmentExpression(\"=\", identifier(thisBinding), identifier(\"this\")),\n ]);\n },\n});\n\n// Create a binding that evaluates to the \"this\" of the given function.\nfunction getThisBinding(\n thisEnvFn: NodePath<t.Function>,\n inConstructor: boolean,\n) {\n return getBinding(thisEnvFn, \"this\", thisBinding => {\n if (!inConstructor || !hasSuperClass(thisEnvFn)) return thisExpression();\n\n thisEnvFn.traverse(assignSuperThisVisitor, {\n supers: new WeakSet(),\n thisBinding,\n });\n });\n}\n\n// Create a binding for a function that will call \"super()\" with arguments passed through.\nfunction getSuperBinding(thisEnvFn: NodePath<t.Function>) {\n return getBinding(thisEnvFn, \"supercall\", () => {\n const argsBinding = thisEnvFn.scope.generateUidIdentifier(\"args\");\n return arrowFunctionExpression(\n [restElement(argsBinding)],\n callExpression(_super(), [spreadElement(identifier(argsBinding.name))]),\n );\n });\n}\n\n// Create a binding for a function that will call \"super.foo\" or \"super[foo]\".\nfunction getSuperPropBinding(\n thisEnvFn: NodePath<t.Function>,\n isAssignment: boolean,\n propName: string,\n) {\n const op = isAssignment ? \"set\" : \"get\";\n\n return getBinding(thisEnvFn, `superprop_${op}:${propName || \"\"}`, () => {\n const argsList = [];\n\n let fnBody;\n if (propName) {\n // () => super.foo\n fnBody = memberExpression(_super(), identifier(propName));\n } else {\n const method = thisEnvFn.scope.generateUidIdentifier(\"prop\");\n // (method) => super[method]\n argsList.unshift(method);\n fnBody = memberExpression(\n _super(),\n identifier(method.name),\n true /* computed */,\n );\n }\n\n if (isAssignment) {\n const valueIdent = thisEnvFn.scope.generateUidIdentifier(\"value\");\n argsList.push(valueIdent);\n\n fnBody = assignmentExpression(\"=\", fnBody, identifier(valueIdent.name));\n }\n\n return arrowFunctionExpression(argsList, fnBody);\n });\n}\n\nfunction getBinding(\n thisEnvFn: NodePath,\n key: string,\n init: (name: string) => t.Expression,\n) {\n const cacheKey = \"binding:\" + key;\n let data: string | undefined = thisEnvFn.getData(cacheKey);\n if (!data) {\n const id = thisEnvFn.scope.generateUidIdentifier(key);\n data = id.name;\n thisEnvFn.setData(cacheKey, data);\n\n thisEnvFn.scope.push({\n id: id,\n init: init(data),\n });\n }\n\n return data;\n}\n\ntype ScopeInfo = {\n thisPaths: NodePath<t.ThisExpression | t.JSXIdentifier>[];\n superCalls: NodePath<t.CallExpression>[];\n superProps: NodePath<t.MemberExpression>[];\n argumentsPaths: NodePath<t.Identifier | t.JSXIdentifier>[];\n newTargetPaths: NodePath<t.MetaProperty>[];\n};\n\nconst getScopeInformationVisitor = environmentVisitor<ScopeInfo>({\n ThisExpression(child, { thisPaths }) {\n thisPaths.push(child);\n },\n JSXIdentifier(child, { thisPaths }) {\n if (child.node.name !== \"this\") return;\n if (\n !child.parentPath.isJSXMemberExpression({ object: child.node }) &&\n !child.parentPath.isJSXOpeningElement({ name: child.node })\n ) {\n return;\n }\n\n thisPaths.push(child);\n },\n CallExpression(child, { superCalls }) {\n if (child.get(\"callee\").isSuper()) superCalls.push(child);\n },\n MemberExpression(child, { superProps }) {\n if (child.get(\"object\").isSuper()) superProps.push(child);\n },\n Identifier(child, { argumentsPaths }) {\n if (!child.isReferencedIdentifier({ name: \"arguments\" })) return;\n\n let curr = child.scope;\n do {\n if (curr.hasOwnBinding(\"arguments\")) {\n curr.rename(\"arguments\");\n return;\n }\n if (curr.path.isFunction() && !curr.path.isArrowFunctionExpression()) {\n break;\n }\n } while ((curr = curr.parent));\n\n argumentsPaths.push(child);\n },\n MetaProperty(child, { newTargetPaths }) {\n if (!child.get(\"meta\").isIdentifier({ name: \"new\" })) return;\n if (!child.get(\"property\").isIdentifier({ name: \"target\" })) return;\n\n newTargetPaths.push(child);\n },\n});\n\nfunction getScopeInformation(fnPath: NodePath) {\n const thisPaths: ScopeInfo[\"thisPaths\"] = [];\n const argumentsPaths: ScopeInfo[\"argumentsPaths\"] = [];\n const newTargetPaths: ScopeInfo[\"newTargetPaths\"] = [];\n const superProps: ScopeInfo[\"superProps\"] = [];\n const superCalls: ScopeInfo[\"superCalls\"] = [];\n\n fnPath.traverse(getScopeInformationVisitor, {\n thisPaths,\n argumentsPaths,\n newTargetPaths,\n superProps,\n superCalls,\n });\n\n return {\n thisPaths,\n argumentsPaths,\n newTargetPaths,\n superProps,\n superCalls,\n };\n}\n\nexport function splitExportDeclaration(\n this: NodePath<t.ExportDefaultDeclaration | t.ExportNamedDeclaration>,\n): NodePath<t.Declaration> {\n if (!this.isExportDeclaration() || this.isExportAllDeclaration()) {\n throw new Error(\"Only default and named export declarations can be split.\");\n }\n if (this.isExportNamedDeclaration() && this.get(\"specifiers\").length > 0) {\n throw new Error(\"It doesn't make sense to split exported specifiers.\");\n }\n\n const declaration = this.get(\"declaration\");\n\n if (this.isExportDefaultDeclaration()) {\n const standaloneDeclaration =\n declaration.isFunctionDeclaration() || declaration.isClassDeclaration();\n const exportExpr =\n declaration.isFunctionExpression() || declaration.isClassExpression();\n\n const scope = declaration.isScope()\n ? declaration.scope.parent\n : declaration.scope;\n\n // @ts-expect-error id is not defined in expressions other than function/class\n let id = declaration.node.id;\n let needBindingRegistration = false;\n\n if (!id) {\n needBindingRegistration = true;\n\n id = scope.generateUidIdentifier(\"default\");\n\n if (standaloneDeclaration || exportExpr) {\n declaration.node.id = cloneNode(id);\n }\n } else if (exportExpr && scope.hasBinding(id.name)) {\n needBindingRegistration = true;\n\n id = scope.generateUidIdentifier(id.name);\n }\n\n const updatedDeclaration = standaloneDeclaration\n ? declaration.node\n : variableDeclaration(\"var\", [\n variableDeclarator(\n cloneNode(id),\n // @ts-expect-error When `standaloneDeclaration` is false, declaration must not be a Function/ClassDeclaration\n declaration.node,\n ),\n ]);\n\n const updatedExportDeclaration = exportNamedDeclaration(null, [\n exportSpecifier(cloneNode(id), identifier(\"default\")),\n ]);\n\n this.insertAfter(updatedExportDeclaration);\n this.replaceWith(updatedDeclaration);\n\n if (needBindingRegistration) {\n scope.registerDeclaration(this);\n }\n\n return this;\n } else if (this.get(\"specifiers\").length > 0) {\n throw new Error(\"It doesn't make sense to split exported specifiers.\");\n }\n\n const bindingIdentifiers = declaration.getOuterBindingIdentifiers();\n\n const specifiers = Object.keys(bindingIdentifiers).map(name => {\n return exportSpecifier(identifier(name), identifier(name));\n });\n\n const aliasDeclar = exportNamedDeclaration(null, specifiers);\n\n this.insertAfter(aliasDeclar);\n this.replaceWith(declaration.node);\n return this;\n}\n\nconst refersOuterBindingVisitor: Visitor<{\n needsRename: boolean;\n name: string;\n}> = {\n \"ReferencedIdentifier|BindingIdentifier\"(\n path: NodePath<t.Identifier>,\n state,\n ) {\n // check if this node matches our function id\n if (path.node.name !== state.name) return;\n state.needsRename = true;\n path.stop();\n },\n Scope(path, state) {\n if (path.scope.hasOwnBinding(state.name)) {\n path.skip();\n }\n },\n};\n\nexport function ensureFunctionName<\n N extends t.FunctionExpression | t.ClassExpression,\n>(this: NodePath<N>, supportUnicodeId: boolean): null | NodePath<N> {\n if (this.node.id) return this;\n\n const res = getFunctionName(this.node, this.parent);\n if (res == null) return this;\n let { name } = res;\n\n if (!supportUnicodeId && /[\\uD800-\\uDFFF]/.test(name)) {\n return null;\n }\n\n if (name.startsWith(\"get \") || name.startsWith(\"set \")) {\n // TODO: Remove this to support naming getters and setters\n return null;\n }\n\n name = toBindingIdentifierName(name.replace(/[/ ]/g, \"_\"));\n const id = identifier(name);\n inherits(id, res.originalNode);\n\n const state = { needsRename: false, name };\n\n // check to see if we have a local binding of the id we're setting inside of\n // the function, this is important as there are caveats associated\n\n const { scope } = this;\n const binding = scope.getOwnBinding(name);\n if (binding) {\n if (binding.kind === \"param\") {\n // safari will blow up in strict mode with code like:\n //\n // let t = function t(t) {};\n //\n // with the error:\n //\n // Cannot declare a parameter named 't' as it shadows the name of a\n // strict mode function.\n //\n // this isn't to the spec and they've invented this behaviour which is\n // **extremely** annoying so we avoid setting the name if it has a param\n // with the same id\n state.needsRename = true;\n } else {\n // otherwise it's defined somewhere in scope like:\n //\n // let t = function () {\n // let t = 2;\n // };\n //\n // so we can safely just set the id and move along as it shadows the\n // bound function id\n }\n } else if (scope.parent.hasBinding(name) || scope.hasGlobal(name)) {\n this.traverse(refersOuterBindingVisitor, state);\n }\n\n if (!state.needsRename) {\n this.node.id = id;\n scope.getProgramParent().references[id.name] = true;\n return this;\n }\n\n if (scope.hasBinding(id.name) && !scope.hasGlobal(id.name)) {\n // we can just munge the local binding\n scope.rename(id.name);\n this.node.id = id;\n scope.getProgramParent().references[id.name] = true;\n return this;\n }\n\n // TODO: we don't currently support wrapping class expressions\n if (!isFunction(this.node)) return null;\n\n // need to add a wrapper since we can't change the references\n\n const key = scope.generateUidIdentifier(id.name);\n // shim in dummy params to retain function arity, if you try to read the\n // source then you'll get the original since it's proxied so it's all good\n const params = [];\n for (let i = 0, len = getFunctionArity(this.node); i < len; i++) {\n params.push(scope.generateUidIdentifier(\"x\"));\n }\n const call = template.expression.ast`\n (function (${key}) {\n function ${id}(${params}) {\n return ${cloneNode(key)}.apply(this, arguments);\n }\n\n ${cloneNode(id)}.toString = function () {\n return ${cloneNode(key)}.toString();\n }\n\n return ${cloneNode(id)};\n })(${toExpression(this.node)})\n ` as t.CallExpression;\n\n return this.replaceWith(call)[0].get(\"arguments.0\") as NodePath<N>;\n}\n\nfunction getFunctionArity(node: t.Function): number {\n const count = node.params.findIndex(\n param => isAssignmentPattern(param) || isRestElement(param),\n );\n return count === -1 ? node.params.length : count;\n}\n"],"mappings":";;;;;;;;;;;AAEA,IAAAA,EAAA,GAAAC,OAAA;AAuCA,IAAAC,SAAA,GAAAD,OAAA;AACA,IAAAE,SAAA,GAAAF,OAAA;AAGA,IAAAG,QAAA,GAAAH,OAAA;AAAqC;EA1CnCI,uBAAuB;EACvBC,oBAAoB;EACpBC,gBAAgB;EAChBC,cAAc;EACdC,cAAc;EACdC,qBAAqB;EACrBC,mBAAmB;EACnBC,UAAU;EACVC,YAAY;EACZC,aAAa;EACbC,iBAAiB;EACjBC,iBAAiB;EACjBC,gBAAgB;EAChBC,YAAY;EACZC,cAAc;EACdC,gBAAgB;EAChBC,WAAW;EACXC,eAAe;EACfC,kBAAkB;EAClBC,aAAa;EACbC,aAAa;E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