{"version":3,"names":["_helperFunctionName","require","_helperReplaceSupers","_helperEnvironmentVisitor","_core","_helperAnnotateAsPure","_inlineCallSuperHelpers","buildConstructor","classRef","constructorBody","node","func","t","functionDeclaration","cloneNode","inherits","transformClass","path","file","builtinClasses","isLoose","assumptions","supportUnicodeId","classState","parent","undefined","scope","classId","superName","superReturns","isDerived","extendsNative","construct","userConstructor","userConstructorPath","hasConstructor","body","superThises","pushedConstructor","pushedInherits","pushedCreateClass","protoAlias","dynamicKeys","Map","methods","instance","hasComputed","list","map","static","setState","newState","Object","assign","findThisesVisitor","traverse","visitors","merge","environmentVisitor","ThisExpression","push","createClassHelper","args","callExpression","addHelper","maybeCreateConstructor","classBodyPath","get","isClassMethod","kind","params","constructor","template","expression","ast","blockStatement","unshiftContainer","classMethod","identifier","buildBody","pushBody","verifyConstructor","pushDescriptors","classBodyPaths","isClassProperty","isClassPrivateProperty","buildCodeFrameError","decorators","isConstructor","replaceSupers","ReplaceSupers","methodPath","objectRef","superRef","constantSuper","refToPreserve","replace","ReturnStatement","getFunctionParent","isArrowFunctionExpression","pushConstructor","pushMethod","pushInheritsToBody","props","placement","length","desc","obj","objectExpression","objectProperty","key","properties","arrayExpression","nullLiteral","lastNonNullIndex","i","isNullLiteral","slice","expressionStatement","wrapSuperCall","bareSuper","thisRef","bareSuperNode","call","superIsCallableConstructor","arguments","unshift","thisExpression","isSpreadElement","isIdentifier","argument","name","callee","memberExpression","logicalExpression","_bareSuperNode$argume","bareSuperNodeArguments","addCallSuperHelper","parentPath","isExpressionStatement","container","assignmentExpression","replaceWith","returnStatement","ref","generateDeclaredUidIdentifier","thisPath","isMemberExpression","object","bareSupers","Super","isCallExpression","guaranteedSuperBeforeFinish","find","isLoop","isConditional","wrapReturn","returnArg","thisExpr","returnParams","bodyPaths","pop","isReturnStatement","pushContainer","returnPath","processMethod","descKey","isNumericLiteral","isBigIntLiteral","stringLiteral","String","value","toComputedKey","fn","toExpression","isStringLiteral","_nameFunction","nameFunction","id","descriptor","has","set","setClassMethods","insertProtoAliasOnce","methodName","computed","isLiteral","functionExpression","generator","async","_nameFunction2","expr","inheritsComments","generateUidIdentifier","classProto","protoDeclaration","variableDeclaration","variableDeclarator","method","directives","pushConstructorToBody","hasInstanceDescriptors","hasStaticDescriptors","extractDynamicKeys","elem","isPure","generateUidIdentifierBasedOnNode","setupClosureParamsArgs","closureParams","closureArgs","arg","annotateAsPure","param","classTransformer","superClass","hasBinding","noClassCalls","isStrict","isInStrictMode","constructorOnly","directive","directiveLiteral","arrowFunctionExpression"],"sources":["../src/transformClass.ts"],"sourcesContent":["import type { NodePath, Scope, Visitor } from \"@babel/traverse\";\nimport nameFunction from \"@babel/helper-function-name\";\nimport ReplaceSupers from \"@babel/helper-replace-supers\";\nimport environmentVisitor from \"@babel/helper-environment-visitor\";\nimport { traverse, template, types as t, type File } from \"@babel/core\";\nimport annotateAsPure from \"@babel/helper-annotate-as-pure\";\n\nimport addCallSuperHelper from \"./inline-callSuper-helpers.ts\";\n\ntype ClassAssumptions = {\n setClassMethods: boolean;\n constantSuper: boolean;\n superIsCallableConstructor: boolean;\n noClassCalls: boolean;\n};\n\ntype ClassConstructor = t.ClassMethod & { kind: \"constructor\" };\n\nfunction buildConstructor(\n classRef: t.Identifier,\n constructorBody: t.BlockStatement,\n node: t.Class,\n) {\n const func = t.functionDeclaration(\n t.cloneNode(classRef),\n [],\n constructorBody,\n );\n t.inherits(func, node);\n return func;\n}\n\ntype Descriptor = {\n key: t.Expression;\n get?: t.Expression | null;\n set?: t.Expression | null;\n value?: t.Expression | null;\n constructor?: t.Expression | null;\n};\n\ntype State = {\n parent: t.Node;\n scope: Scope;\n node: t.Class;\n path: NodePath;\n file: File;\n\n classId: t.Identifier | void;\n classRef: t.Identifier;\n superName: t.Expression | null;\n superReturns: NodePath[];\n isDerived: boolean;\n extendsNative: boolean;\n\n construct: t.FunctionDeclaration;\n constructorBody: t.BlockStatement;\n userConstructor: ClassConstructor;\n userConstructorPath: NodePath;\n hasConstructor: boolean;\n\n body: t.Statement[];\n superThises: NodePath[];\n pushedConstructor: boolean;\n pushedInherits: boolean;\n pushedCreateClass: boolean;\n protoAlias: t.Identifier | null;\n isLoose: boolean;\n\n dynamicKeys: Map;\n\n methods: {\n // 'list' is in the same order as the elements appear in the class body.\n // if there aren't computed keys, we can safely reorder class elements\n // and use 'map' to merge duplicates.\n instance: {\n hasComputed: boolean;\n list: Descriptor[];\n map: Map;\n };\n static: {\n hasComputed: boolean;\n list: Descriptor[];\n map: Map;\n };\n };\n};\n\ntype PropertyInfo = {\n instance: t.ObjectExpression[] | null;\n static: t.ObjectExpression[] | null;\n};\n\nexport default function transformClass(\n path: NodePath,\n file: File,\n builtinClasses: ReadonlySet,\n isLoose: boolean,\n assumptions: ClassAssumptions,\n supportUnicodeId: boolean,\n) {\n const classState: State = {\n parent: undefined,\n scope: undefined,\n node: undefined,\n path: undefined,\n file: undefined,\n\n classId: undefined,\n classRef: undefined,\n superName: null,\n superReturns: [],\n isDerived: false,\n extendsNative: false,\n\n construct: undefined,\n constructorBody: undefined,\n userConstructor: undefined,\n userConstructorPath: undefined,\n hasConstructor: false,\n\n body: [],\n superThises: [],\n pushedConstructor: false,\n pushedInherits: false,\n pushedCreateClass: false,\n protoAlias: null,\n isLoose: false,\n\n dynamicKeys: new Map(),\n\n methods: {\n instance: {\n hasComputed: false,\n list: [],\n map: new Map(),\n },\n static: {\n hasComputed: false,\n list: [],\n map: new Map(),\n },\n },\n };\n\n const setState = (newState: Partial) => {\n Object.assign(classState, newState);\n };\n\n const findThisesVisitor = traverse.visitors.merge([\n environmentVisitor,\n {\n ThisExpression(path) {\n classState.superThises.push(path);\n },\n },\n ]);\n\n function createClassHelper(args: t.Expression[]) {\n return t.callExpression(classState.file.addHelper(\"createClass\"), args);\n }\n\n /**\n * Creates a class constructor or bail out if there is one\n */\n function maybeCreateConstructor() {\n const classBodyPath = classState.path.get(\"body\");\n for (const path of classBodyPath.get(\"body\")) {\n if (path.isClassMethod({ kind: \"constructor\" })) return;\n }\n\n let params: t.FunctionExpression[\"params\"], body;\n\n if (classState.isDerived) {\n const constructor = template.expression.ast`\n (function () {\n super(...arguments);\n })\n ` as t.FunctionExpression;\n params = constructor.params;\n body = constructor.body;\n } else {\n params = [];\n body = t.blockStatement([]);\n }\n\n classBodyPath.unshiftContainer(\n \"body\",\n t.classMethod(\"constructor\", t.identifier(\"constructor\"), params, body),\n );\n }\n\n function buildBody() {\n maybeCreateConstructor();\n pushBody();\n verifyConstructor();\n\n if (classState.userConstructor) {\n const { constructorBody, userConstructor, construct } = classState;\n\n constructorBody.body.push(...userConstructor.body.body);\n t.inherits(construct, userConstructor);\n t.inherits(constructorBody, userConstructor.body);\n }\n\n pushDescriptors();\n }\n\n function pushBody() {\n const classBodyPaths: Array = classState.path.get(\"body.body\");\n\n for (const path of classBodyPaths) {\n const node = path.node;\n\n if (path.isClassProperty() || path.isClassPrivateProperty()) {\n throw path.buildCodeFrameError(\"Missing class properties transform.\");\n }\n\n if (node.decorators) {\n throw path.buildCodeFrameError(\n \"Method has decorators, put the decorator plugin before the classes one.\",\n );\n }\n\n if (t.isClassMethod(node)) {\n const isConstructor = node.kind === \"constructor\";\n\n const replaceSupers = new ReplaceSupers({\n methodPath: path,\n objectRef: classState.classRef,\n superRef: classState.superName,\n constantSuper: assumptions.constantSuper,\n file: classState.file,\n refToPreserve: classState.classRef,\n });\n\n replaceSupers.replace();\n\n const superReturns: NodePath[] = [];\n path.traverse(\n traverse.visitors.merge([\n environmentVisitor,\n {\n ReturnStatement(path) {\n if (!path.getFunctionParent().isArrowFunctionExpression()) {\n superReturns.push(path);\n }\n },\n },\n ]),\n );\n\n if (isConstructor) {\n pushConstructor(superReturns, node as ClassConstructor, path);\n } else {\n pushMethod(node, path);\n }\n }\n }\n }\n\n function pushDescriptors() {\n pushInheritsToBody();\n\n const { body } = classState;\n\n const props: PropertyInfo = {\n instance: null,\n static: null,\n };\n\n for (const placement of [\"static\", \"instance\"] as const) {\n if (classState.methods[placement].list.length) {\n props[placement] = classState.methods[placement].list.map(desc => {\n const obj = t.objectExpression([\n t.objectProperty(t.identifier(\"key\"), desc.key),\n ]);\n\n for (const kind of [\"get\", \"set\", \"value\"] as const) {\n if (desc[kind] != null) {\n obj.properties.push(\n t.objectProperty(t.identifier(kind), desc[kind]),\n );\n }\n }\n\n return obj;\n });\n }\n }\n\n if (props.instance || props.static) {\n let args = [\n t.cloneNode(classState.classRef), // Constructor\n props.instance ? t.arrayExpression(props.instance) : t.nullLiteral(), // instanceDescriptors\n props.static ? t.arrayExpression(props.static) : t.nullLiteral(), // staticDescriptors\n ];\n\n let lastNonNullIndex = 0;\n for (let i = 0; i < args.length; i++) {\n if (!t.isNullLiteral(args[i])) lastNonNullIndex = i;\n }\n args = args.slice(0, lastNonNullIndex + 1);\n\n body.push(t.expressionStatement(createClassHelper(args)));\n classState.pushedCreateClass = true;\n }\n }\n\n function wrapSuperCall(\n bareSuper: NodePath,\n superRef: t.Expression,\n thisRef: () => t.Identifier,\n body: NodePath,\n ) {\n const bareSuperNode = bareSuper.node;\n let call;\n\n if (assumptions.superIsCallableConstructor) {\n bareSuperNode.arguments.unshift(t.thisExpression());\n if (\n bareSuperNode.arguments.length === 2 &&\n t.isSpreadElement(bareSuperNode.arguments[1]) &&\n t.isIdentifier(bareSuperNode.arguments[1].argument, {\n name: \"arguments\",\n })\n ) {\n // special case single arguments spread\n bareSuperNode.arguments[1] = bareSuperNode.arguments[1].argument;\n bareSuperNode.callee = t.memberExpression(\n t.cloneNode(superRef),\n t.identifier(\"apply\"),\n );\n } else {\n bareSuperNode.callee = t.memberExpression(\n t.cloneNode(superRef),\n t.identifier(\"call\"),\n );\n }\n\n call = t.logicalExpression(\"||\", bareSuperNode, t.thisExpression());\n } else {\n const args: t.Expression[] = [\n t.thisExpression(),\n t.cloneNode(classState.classRef),\n ];\n if (bareSuperNode.arguments?.length) {\n const bareSuperNodeArguments = bareSuperNode.arguments as (\n | t.Expression\n | t.SpreadElement\n )[];\n\n /**\n * test262/test/language/expressions/super/call-spread-err-sngl-err-itr-get-get.js\n *\n * var iter = {};\n * Object.defineProperty(iter, Symbol.iterator, {\n * get: function() {\n * throw new Test262Error();\n * }\n * })\n * super(...iter);\n */\n\n if (\n bareSuperNodeArguments.length === 1 &&\n t.isSpreadElement(bareSuperNodeArguments[0]) &&\n t.isIdentifier(bareSuperNodeArguments[0].argument, {\n name: \"arguments\",\n })\n ) {\n args.push(bareSuperNodeArguments[0].argument);\n } else {\n args.push(t.arrayExpression(bareSuperNodeArguments));\n }\n }\n call = t.callExpression(addCallSuperHelper(classState.file), args);\n }\n\n if (\n bareSuper.parentPath.isExpressionStatement() &&\n bareSuper.parentPath.container === body.node.body &&\n body.node.body.length - 1 === bareSuper.parentPath.key\n ) {\n // this super call is the last statement in the body so we can just straight up\n // turn it into a return\n\n if (classState.superThises.length) {\n call = t.assignmentExpression(\"=\", thisRef(), call);\n }\n\n bareSuper.parentPath.replaceWith(t.returnStatement(call));\n } else {\n bareSuper.replaceWith(t.assignmentExpression(\"=\", thisRef(), call));\n }\n }\n\n function verifyConstructor() {\n if (!classState.isDerived) return;\n\n const path = classState.userConstructorPath;\n const body = path.get(\"body\");\n\n path.traverse(findThisesVisitor);\n\n let thisRef = function () {\n const ref = path.scope.generateDeclaredUidIdentifier(\"this\");\n thisRef = () => t.cloneNode(ref);\n return ref;\n };\n\n for (const thisPath of classState.superThises) {\n const { node, parentPath } = thisPath;\n if (parentPath.isMemberExpression({ object: node })) {\n thisPath.replaceWith(thisRef());\n continue;\n }\n thisPath.replaceWith(\n t.callExpression(classState.file.addHelper(\"assertThisInitialized\"), [\n thisRef(),\n ]),\n );\n }\n\n const bareSupers: NodePath[] = [];\n path.traverse(\n traverse.visitors.merge([\n environmentVisitor,\n {\n Super(path) {\n const { node, parentPath } = path;\n if (parentPath.isCallExpression({ callee: node })) {\n bareSupers.unshift(parentPath);\n }\n },\n } as Visitor,\n ]),\n );\n\n let guaranteedSuperBeforeFinish = !!bareSupers.length;\n\n for (const bareSuper of bareSupers) {\n wrapSuperCall(bareSuper, classState.superName, thisRef, body);\n\n if (guaranteedSuperBeforeFinish) {\n bareSuper.find(function (parentPath) {\n // hit top so short circuit\n if (parentPath === path) {\n return true;\n }\n\n if (\n parentPath.isLoop() ||\n parentPath.isConditional() ||\n parentPath.isArrowFunctionExpression()\n ) {\n guaranteedSuperBeforeFinish = false;\n return true;\n }\n });\n }\n }\n\n let wrapReturn;\n\n if (classState.isLoose) {\n wrapReturn = (returnArg: t.Expression | void) => {\n const thisExpr = t.callExpression(\n classState.file.addHelper(\"assertThisInitialized\"),\n [thisRef()],\n );\n return returnArg\n ? t.logicalExpression(\"||\", returnArg, thisExpr)\n : thisExpr;\n };\n } else {\n wrapReturn = (returnArg: t.Expression | undefined) => {\n const returnParams: t.Expression[] = [thisRef()];\n if (returnArg != null) {\n returnParams.push(returnArg);\n }\n return t.callExpression(\n classState.file.addHelper(\"possibleConstructorReturn\"),\n returnParams,\n );\n };\n }\n\n // if we have a return as the last node in the body then we've already caught that\n // return\n const bodyPaths = body.get(\"body\");\n if (!bodyPaths.length || !bodyPaths.pop().isReturnStatement()) {\n body.pushContainer(\n \"body\",\n t.returnStatement(\n guaranteedSuperBeforeFinish ? thisRef() : wrapReturn(),\n ),\n );\n }\n\n for (const returnPath of classState.superReturns) {\n returnPath\n .get(\"argument\")\n .replaceWith(wrapReturn(returnPath.node.argument));\n }\n }\n\n /**\n * Push a method to its respective mutatorMap.\n */\n function pushMethod(node: t.ClassMethod, path?: NodePath) {\n const scope = path ? path.scope : classState.scope;\n\n if (node.kind === \"method\") {\n if (processMethod(node, scope)) return;\n }\n\n const placement = node.static ? \"static\" : \"instance\";\n const methods = classState.methods[placement];\n\n const descKey = node.kind === \"method\" ? \"value\" : node.kind;\n const key =\n t.isNumericLiteral(node.key) || t.isBigIntLiteral(node.key)\n ? t.stringLiteral(String(node.key.value))\n : t.toComputedKey(node);\n\n let fn: t.Expression = t.toExpression(node);\n\n if (t.isStringLiteral(key)) {\n // infer function name\n if (node.kind === \"method\") {\n // @ts-expect-error Fixme: we are passing a ClassMethod to nameFunction, but nameFunction\n // does not seem to support it\n fn =\n nameFunction(\n // @ts-expect-error Fixme: we are passing a ClassMethod to nameFunction, but nameFunction\n // does not seem to support it\n { id: key, node: node, scope },\n undefined,\n supportUnicodeId,\n ) ?? fn;\n }\n } else {\n // todo(flow->ts) find a way to avoid \"key as t.StringLiteral\" below which relies on this assignment\n methods.hasComputed = true;\n }\n\n let descriptor: Descriptor;\n if (\n !methods.hasComputed &&\n methods.map.has((key as t.StringLiteral).value)\n ) {\n descriptor = methods.map.get((key as t.StringLiteral).value);\n descriptor[descKey] = fn;\n\n if (descKey === \"value\") {\n descriptor.get = null;\n descriptor.set = null;\n } else {\n descriptor.value = null;\n }\n } else {\n descriptor = {\n key:\n // private name has been handled in class-properties transform\n key as t.Expression,\n [descKey]: fn,\n } as Descriptor;\n methods.list.push(descriptor);\n\n if (!methods.hasComputed) {\n methods.map.set((key as t.StringLiteral).value, descriptor);\n }\n }\n }\n\n function processMethod(node: t.ClassMethod, scope: Scope) {\n if (assumptions.setClassMethods && !node.decorators) {\n // use assignments instead of define properties for loose classes\n let { classRef } = classState;\n if (!node.static) {\n insertProtoAliasOnce();\n classRef = classState.protoAlias;\n }\n const methodName = t.memberExpression(\n t.cloneNode(classRef),\n node.key,\n node.computed || t.isLiteral(node.key),\n );\n\n let func: t.Expression = t.functionExpression(\n null,\n // @ts-expect-error Fixme: should throw when we see TSParameterProperty\n node.params,\n node.body,\n node.generator,\n node.async,\n );\n t.inherits(func, node);\n\n const key = t.toComputedKey(node, node.key);\n if (t.isStringLiteral(key)) {\n // @ts-expect-error: requires strictNullCheck\n func =\n nameFunction(\n {\n node: func,\n id: key,\n scope,\n },\n undefined,\n supportUnicodeId,\n ) ?? func;\n }\n\n const expr = t.expressionStatement(\n t.assignmentExpression(\"=\", methodName, func),\n );\n t.inheritsComments(expr, node);\n classState.body.push(expr);\n return true;\n }\n\n return false;\n }\n\n function insertProtoAliasOnce() {\n if (classState.protoAlias === null) {\n setState({ protoAlias: classState.scope.generateUidIdentifier(\"proto\") });\n const classProto = t.memberExpression(\n classState.classRef,\n t.identifier(\"prototype\"),\n );\n const protoDeclaration = t.variableDeclaration(\"var\", [\n t.variableDeclarator(classState.protoAlias, classProto),\n ]);\n\n classState.body.push(protoDeclaration);\n }\n }\n\n /**\n * Replace the constructor body of our class.\n */\n function pushConstructor(\n superReturns: NodePath[],\n method: ClassConstructor,\n path: NodePath,\n ) {\n setState({\n userConstructorPath: path,\n userConstructor: method,\n hasConstructor: true,\n superReturns,\n });\n\n const { construct } = classState;\n\n t.inheritsComments(construct, method);\n\n // @ts-expect-error Fixme: should throw when we see TSParameterProperty\n construct.params = method.params;\n\n t.inherits(construct.body, method.body);\n construct.body.directives = method.body.directives;\n\n pushConstructorToBody();\n }\n\n function pushConstructorToBody() {\n if (classState.pushedConstructor) return;\n classState.pushedConstructor = true;\n\n // we haven't pushed any descriptors yet\n // @ts-expect-error todo(flow->ts) maybe remove this block - properties from condition are not used anywhere else\n if (classState.hasInstanceDescriptors || classState.hasStaticDescriptors) {\n pushDescriptors();\n }\n\n classState.body.push(classState.construct);\n\n pushInheritsToBody();\n }\n\n /**\n * Push inherits helper to body.\n */\n function pushInheritsToBody() {\n if (!classState.isDerived || classState.pushedInherits) return;\n\n classState.pushedInherits = true;\n\n // Unshift to ensure that the constructor inheritance is set up before\n // any properties can be assigned to the prototype.\n\n classState.body.unshift(\n t.expressionStatement(\n t.callExpression(\n classState.file.addHelper(\n classState.isLoose ? \"inheritsLoose\" : \"inherits\",\n ),\n [t.cloneNode(classState.classRef), t.cloneNode(classState.superName)],\n ),\n ),\n );\n }\n\n function extractDynamicKeys() {\n const { dynamicKeys, node, scope } = classState;\n\n for (const elem of node.body.body) {\n if (!t.isClassMethod(elem) || !elem.computed) continue;\n if (scope.isPure(elem.key, /* constants only*/ true)) continue;\n\n const id = scope.generateUidIdentifierBasedOnNode(elem.key);\n dynamicKeys.set(id.name, elem.key);\n\n elem.key = id;\n }\n }\n\n function setupClosureParamsArgs() {\n const { superName, dynamicKeys } = classState;\n const closureParams = [];\n const closureArgs = [];\n\n if (classState.isDerived) {\n let arg = t.cloneNode(superName);\n if (classState.extendsNative) {\n arg = t.callExpression(classState.file.addHelper(\"wrapNativeSuper\"), [\n arg,\n ]);\n annotateAsPure(arg);\n }\n\n const param =\n classState.scope.generateUidIdentifierBasedOnNode(superName);\n\n closureParams.push(param);\n closureArgs.push(arg);\n\n setState({ superName: t.cloneNode(param) });\n }\n\n for (const [name, value] of dynamicKeys) {\n closureParams.push(t.identifier(name));\n closureArgs.push(value);\n }\n\n return { closureParams, closureArgs };\n }\n\n function classTransformer(\n path: NodePath,\n file: File,\n builtinClasses: ReadonlySet,\n isLoose: boolean,\n ) {\n setState({\n parent: path.parent,\n scope: path.scope,\n node: path.node,\n path,\n file,\n isLoose,\n });\n\n setState({\n classId: classState.node.id,\n // this is the name of the binding that will **always** reference the class we've constructed\n classRef: classState.node.id\n ? t.identifier(classState.node.id.name)\n : classState.scope.generateUidIdentifier(\"class\"),\n superName: classState.node.superClass,\n isDerived: !!classState.node.superClass,\n constructorBody: t.blockStatement([]),\n });\n\n setState({\n extendsNative:\n t.isIdentifier(classState.superName) &&\n builtinClasses.has(classState.superName.name) &&\n !classState.scope.hasBinding(\n classState.superName.name,\n /* noGlobals */ true,\n ),\n });\n\n const { classRef, node, constructorBody } = classState;\n\n setState({\n construct: buildConstructor(classRef, constructorBody, node),\n });\n\n extractDynamicKeys();\n\n const { body } = classState;\n const { closureParams, closureArgs } = setupClosureParamsArgs();\n\n buildBody();\n\n // make sure this class isn't directly called (with A() instead new A())\n if (!assumptions.noClassCalls) {\n constructorBody.body.unshift(\n t.expressionStatement(\n t.callExpression(classState.file.addHelper(\"classCallCheck\"), [\n t.thisExpression(),\n t.cloneNode(classState.classRef),\n ]),\n ),\n );\n }\n\n const isStrict = path.isInStrictMode();\n let constructorOnly = classState.classId && body.length === 1;\n if (constructorOnly && !isStrict) {\n for (const param of classState.construct.params) {\n // It's illegal to put a use strict directive into the body of a function\n // with non-simple parameters for some reason. So, we have to use a strict\n // wrapper function.\n if (!t.isIdentifier(param)) {\n constructorOnly = false;\n break;\n }\n }\n }\n\n const directives = constructorOnly\n ? (body[0] as t.FunctionExpression | t.FunctionDeclaration).body\n .directives\n : [];\n if (!isStrict) {\n directives.push(t.directive(t.directiveLiteral(\"use strict\")));\n }\n\n if (constructorOnly) {\n // named class with only a constructor\n const expr = t.toExpression(\n body[0] as t.FunctionExpression | t.FunctionDeclaration,\n );\n return classState.isLoose ? expr : createClassHelper([expr]);\n }\n\n let returnArg: t.Expression = t.cloneNode(classState.classRef);\n if (!classState.pushedCreateClass && !classState.isLoose) {\n returnArg = createClassHelper([returnArg]);\n }\n\n body.push(t.returnStatement(returnArg));\n const container = t.arrowFunctionExpression(\n closureParams,\n t.blockStatement(body, directives),\n );\n return t.callExpression(container, closureArgs);\n }\n\n return classTransformer(path, file, builtinClasses, isLoose);\n}\n"],"mappings":";;;;;;AACA,IAAAA,mBAAA,GAAAC,OAAA;AACA,IAAAC,oBAAA,GAAAD,OAAA;AACA,IAAAE,yBAAA,GAAAF,OAAA;AACA,IAAAG,KAAA,GAAAH,OAAA;AACA,IAAAI,qBAAA,GAAAJ,OAAA;AAEA,IAAAK,uBAAA,GAAAL,OAAA;AAWA,SAASM,gBAAgBA,CACvBC,QAAsB,EACtBC,eAAiC,EACjCC,IAAa,EACb;EACA,MAAMC,IAAI,GAAGC,WAAC,CAACC,mBAAmB,CAChCD,WAAC,CAACE,SAAS,CAACN,QAAQ,CAAC,EACrB,EAAE,EACFC,eACF,CAAC;EACDG,WAAC,CAACG,QAAQ,CAACJ,IAAI,EAAED,IAAI,CAAC;EACtB,OAAOC,IAAI;AACb;AA8De,SAASK,cAAcA,CACpCC,IAAuB,EACvBC,IAAU,EACVC,cAAmC,EACnCC,OAAgB,EAChBC,WAA6B,EAC7BC,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