hexo/node_modules/@babel/plugin-transform-classes/lib/transformClass.js.map

1 line
46 KiB
Plaintext

{"version":3,"names":["buildConstructor","classRef","constructorBody","node","func","t","functionDeclaration","cloneNode","inherits","transformClass","path","file","builtinClasses","isLoose","assumptions","supportUnicodeId","classState","parent","undefined","scope","classId","superFnId","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","paths","get","equals","params","constructor","template","expression","ast","blockStatement","unshiftContainer","classMethod","identifier","buildBody","pushBody","verifyConstructor","pushDescriptors","classBodyPaths","isClassProperty","buildCodeFrameError","decorators","isClassMethod","isConstructor","kind","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","optimiseCall","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","id","descriptor","has","set","setClassMethods","insertProtoAliasOnce","methodName","computed","isLiteral","functionExpression","generator","async","expr","inheritsComments","generateUidIdentifier","classProto","protoDeclaration","variableDeclaration","variableDeclarator","method","directives","pushConstructorToBody","hasInstanceDescriptors","hasStaticDescriptors","addCreateSuperHelper","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 optimiseCall from \"@babel/helper-optimise-call-expression\";\nimport { traverse, template, types as t, type File } from \"@babel/core\";\nimport annotateAsPure from \"@babel/helper-annotate-as-pure\";\n\nimport addCreateSuperHelper from \"./inline-createSuper-helpers\";\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<t.Class>;\n file: File;\n\n classId: t.Identifier | void;\n classRef: t.Identifier;\n superFnId: t.Identifier;\n superName: t.Expression | null;\n superReturns: NodePath<t.ReturnStatement>[];\n isDerived: boolean;\n extendsNative: boolean;\n\n construct: t.FunctionDeclaration;\n constructorBody: t.BlockStatement;\n userConstructor: ClassConstructor;\n userConstructorPath: NodePath<ClassConstructor>;\n hasConstructor: boolean;\n\n body: t.Statement[];\n superThises: NodePath<t.ThisExpression>[];\n pushedConstructor: boolean;\n pushedInherits: boolean;\n pushedCreateClass: boolean;\n protoAlias: t.Identifier | null;\n isLoose: boolean;\n\n dynamicKeys: Map<string, t.Expression>;\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<string, Descriptor>;\n };\n static: {\n hasComputed: boolean;\n list: Descriptor[];\n map: Map<string, Descriptor>;\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<t.Class>,\n file: File,\n builtinClasses: ReadonlySet<string>,\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 superFnId: 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<State>) => {\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 none\n */\n function maybeCreateConstructor() {\n let hasConstructor = false;\n const paths = classState.path.get(\"body.body\");\n for (const path of paths) {\n // @ts-expect-error: StaticBlock does not have `kind` property\n hasConstructor = path.equals(\"kind\", \"constructor\");\n if (hasConstructor) break;\n }\n if (hasConstructor) return;\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 classState.path\n .get(\"body\")\n .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<any> = classState.path.get(\"body.body\");\n\n for (const path of classBodyPaths) {\n const node = path.node;\n\n if (path.isClassProperty()) {\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<t.ReturnStatement>[] = [];\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<t.CallExpression>,\n superRef: t.Expression,\n thisRef: () => t.Identifier,\n body: NodePath<t.BlockStatement>,\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 call = optimiseCall(\n t.cloneNode(classState.superFnId),\n t.thisExpression(),\n bareSuperNode.arguments,\n false,\n );\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<t.CallExpression>[] = [];\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<t.ReturnStatement>[],\n method: ClassConstructor,\n path: NodePath<ClassConstructor>,\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 const superFnId = path.scope.generateUidIdentifier(\"super\");\n\n setState({ pushedInherits: true, superFnId });\n\n // Unshift to ensure that the constructor inheritance is set up before\n // any properties can be assigned to the prototype.\n\n if (!assumptions.superIsCallableConstructor) {\n classState.body.unshift(\n t.variableDeclaration(\"var\", [\n t.variableDeclarator(\n superFnId,\n t.callExpression(addCreateSuperHelper(classState.file), [\n t.cloneNode(classState.classRef),\n ]),\n ),\n ]),\n );\n }\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<t.Class>,\n file: File,\n builtinClasses: ReadonlySet<string>,\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;AACA;AACA;AACA;AACA;AACA;AAEA;AAWA,SAASA,gBAAgB,CACvBC,QAAsB,EACtBC,eAAiC,EACjCC,IAAa,EACb;EACA,MAAMC,IAAI,GAAGC,WAAC,CAACC,mBAAmB,CAChCD,WAAC,CAACE,SAAS,CAACN,QAAQ,CAAC,EACrB,EAAE,EACFC,eAAe,CAChB;EACDG,WAAC,CAACG,QAAQ,CAACJ,IAAI,EAAED,IAAI,CAAC;EACtB,OAAOC,IAAI;AACb;AA+De,SAASK,cAAc,CACpCC,IAAuB,EACvBC,IAAU,EACVC,cAAmC,EACnCC,OAAgB,EAChBC,WAA6B,EAC7BC,gBAAyB,EACzB;EACA,MAAMC,UAAiB,GAAG;IACxBC,MAAM,EAAEC,SAAS;IACjBC,KAAK,EAAED,SAAS;IAChBf,IAAI,EAAEe,SAAS;IACfR,IAAI,EAAEQ,SAAS;IACfP,IAAI,EAAEO,SAAS;IA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