You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
1 lines
70 KiB
1 lines
70 KiB
{"version":3,"names":["buildPrivateNamesMap","props","privateNamesMap","Map","prop","isPrivate","name","node","key","id","update","has","get","scope","generateUidIdentifier","static","method","isProperty","isClassPrivateMethod","kind","getId","setId","methodId","set","buildPrivateNamesNodes","privateFieldsAsProperties","privateFieldsAsSymbols","state","initNodes","value","isStatic","isMethod","isAccessor","t","cloneNode","init","callExpression","addHelper","stringLiteral","identifier","newExpression","annotateAsPure","push","template","statement","ast","privateNameVisitorFactory","visitor","nestedVisitor","traverse","visitors","merge","environmentVisitor","privateNameVisitor","Class","path","body","visiblePrivateNames","redeclared","delete","length","skipKey","PrivateName","noDocumentAll","parentPath","isMemberExpression","property","isOptionalMemberExpression","includes","handle","unshadow","innerBinding","hasBinding","bindingIdentifierEquals","rename","parent","buildCheckInRHS","rhs","file","inRHSIsObject","availableHelper","privateInVisitor","BinaryExpression","operator","left","right","isPrivateName","classRef","replaceWith","expression","privateNameHandlerSpec","memoise","member","count","object","memo","maybeGenerateMemoised","memoiser","receiver","helperName","sequenceExpression","console","warn","boundGet","memberExpression","destructureSet","helper","Error","call","args","optimiseCall","optionalCall","privateNameHandlerLoose","BASE","REF","PROP","simpleSet","optionalCallExpression","transformPrivateNamesUsage","ref","size","handler","memberExpressionToFunctions","buildPrivateFieldInitLoose","buildUndefinedNode","inheritPropComments","buildPrivateInstanceFieldInitSpec","thisExpression","buildPrivateStaticFieldInitSpec","privateName","initAdded","buildPrivateMethodInitLoose","buildPrivateInstanceMethodInitSpec","buildPrivateAccessorInitialization","buildPrivateInstanceMethodInitialization","buildPublicFieldInitLoose","computed","expressionStatement","assignmentExpression","isLiteral","buildPublicFieldInitSpec","buildPrivateStaticMethodInitLoose","buildPrivateMethodDeclaration","getterDeclared","setterDeclared","params","generator","async","isGetter","isSetter","declId","functionDeclaration","thisContextVisitor","ThisExpression","findParent","isTransparentExprWrapper","isUnaryExpression","booleanLiteral","needsClassRef","MetaProperty","meta","isIdentifier","innerReferencesVisitor","ReferencedIdentifier","replaceThisContext","getSuperRef","isStaticBlock","constantSuper","innerBindingRef","replacer","ReplaceSupers","methodPath","refToPreserve","getObjectRef","replace","isNameOrLength","type","inheritLeadingComments","inheritInnerComments","buildFieldsInitNodes","superRef","setPublicClassFields","injectSuperRef","staticNodes","instanceNodes","pureStaticNodes","generateUidIdentifierBasedOnNode","isClassProperty","ts","assertFieldTransformed","isInstance","isPublic","isField","replaced","blockBody","isExpressionStatement","inheritsComments","unshift","filter","Boolean","wrapClass","remove","superClass","isClassExpression"],"sources":["../src/fields.ts"],"sourcesContent":["import { template, traverse, types as t } from \"@babel/core\";\nimport type { File } from \"@babel/core\";\nimport type { NodePath, Visitor, Scope } from \"@babel/traverse\";\nimport ReplaceSupers from \"@babel/helper-replace-supers\";\nimport environmentVisitor from \"@babel/helper-environment-visitor\";\nimport memberExpressionToFunctions from \"@babel/helper-member-expression-to-functions\";\nimport type {\n Handler,\n HandlerState,\n} from \"@babel/helper-member-expression-to-functions\";\nimport optimiseCall from \"@babel/helper-optimise-call-expression\";\nimport annotateAsPure from \"@babel/helper-annotate-as-pure\";\nimport { isTransparentExprWrapper } from \"@babel/helper-skip-transparent-expression-wrappers\";\n\nimport * as ts from \"./typescript\";\n\ninterface PrivateNameMetadata {\n id: t.Identifier;\n static: boolean;\n method: boolean;\n getId?: t.Identifier;\n setId?: t.Identifier;\n methodId?: t.Identifier;\n initAdded?: boolean;\n getterDeclared?: boolean;\n setterDeclared?: boolean;\n}\n\ntype PrivateNamesMap = Map<string, PrivateNameMetadata>;\n\nexport function buildPrivateNamesMap(props: PropPath[]) {\n const privateNamesMap: PrivateNamesMap = new Map();\n for (const prop of props) {\n if (prop.isPrivate()) {\n const { name } = prop.node.key.id;\n const update: PrivateNameMetadata = privateNamesMap.has(name)\n ? privateNamesMap.get(name)\n : {\n id: prop.scope.generateUidIdentifier(name),\n static: prop.node.static,\n method: !prop.isProperty(),\n };\n if (prop.isClassPrivateMethod()) {\n if (prop.node.kind === \"get\") {\n update.getId = prop.scope.generateUidIdentifier(`get_${name}`);\n } else if (prop.node.kind === \"set\") {\n update.setId = prop.scope.generateUidIdentifier(`set_${name}`);\n } else if (prop.node.kind === \"method\") {\n update.methodId = prop.scope.generateUidIdentifier(name);\n }\n }\n privateNamesMap.set(name, update);\n }\n }\n return privateNamesMap;\n}\n\nexport function buildPrivateNamesNodes(\n privateNamesMap: PrivateNamesMap,\n privateFieldsAsProperties: boolean,\n privateFieldsAsSymbols: boolean,\n state: File,\n) {\n const initNodes: t.Statement[] = [];\n\n for (const [name, value] of privateNamesMap) {\n // - When the privateFieldsAsProperties assumption is enabled,\n // both static and instance fields are transpiled using a\n // secret non-enumerable property. Hence, we also need to generate that\n // key (using the classPrivateFieldLooseKey helper).\n // - When the privateFieldsAsSymbols assumption is enabled,\n // both static and instance fields are transpiled using a\n // unique Symbol to define a non-enumerable property.\n // - In spec mode, only instance fields need a \"private name\" initializer\n // because static fields are directly assigned to a variable in the\n // buildPrivateStaticFieldInitSpec function.\n const { static: isStatic, method: isMethod, getId, setId } = value;\n const isAccessor = getId || setId;\n const id = t.cloneNode(value.id);\n\n let init: t.Expression;\n\n if (privateFieldsAsProperties) {\n init = t.callExpression(state.addHelper(\"classPrivateFieldLooseKey\"), [\n t.stringLiteral(name),\n ]);\n } else if (privateFieldsAsSymbols) {\n init = t.callExpression(t.identifier(\"Symbol\"), [t.stringLiteral(name)]);\n } else if (!isStatic) {\n init = t.newExpression(\n t.identifier(!isMethod || isAccessor ? \"WeakMap\" : \"WeakSet\"),\n [],\n );\n }\n\n if (init) {\n annotateAsPure(init);\n initNodes.push(template.statement.ast`var ${id} = ${init}`);\n }\n }\n\n return initNodes;\n}\n\ninterface PrivateNameVisitorState {\n privateNamesMap: PrivateNamesMap;\n privateFieldsAsProperties: boolean;\n redeclared?: string[];\n}\n\n// Traverses the class scope, handling private name references. If an inner\n// class redeclares the same private name, it will hand off traversal to the\n// restricted visitor (which doesn't traverse the inner class's inner scope).\nfunction privateNameVisitorFactory<S>(\n visitor: Visitor<PrivateNameVisitorState & S>,\n) {\n // Traverses the outer portion of a class, without touching the class's inner\n // scope, for private names.\n const nestedVisitor = traverse.visitors.merge([\n {\n ...visitor,\n },\n environmentVisitor,\n ]);\n\n const privateNameVisitor: Visitor<PrivateNameVisitorState & S> = {\n ...visitor,\n\n Class(path) {\n const { privateNamesMap } = this;\n const body = path.get(\"body.body\");\n\n const visiblePrivateNames = new Map(privateNamesMap);\n const redeclared = [];\n for (const prop of body) {\n if (!prop.isPrivate()) continue;\n const { name } = prop.node.key.id;\n visiblePrivateNames.delete(name);\n redeclared.push(name);\n }\n\n // If the class doesn't redeclare any private fields, we can continue with\n // our overall traversal.\n if (!redeclared.length) {\n return;\n }\n\n // This class redeclares some private field. We need to process the outer\n // environment with access to all the outer privates, then we can process\n // the inner environment with only the still-visible outer privates.\n path.get(\"body\").traverse(nestedVisitor, {\n ...this,\n redeclared,\n });\n path.traverse(privateNameVisitor, {\n ...this,\n privateNamesMap: visiblePrivateNames,\n });\n\n // We'll eventually hit this class node again with the overall Class\n // Features visitor, which'll process the redeclared privates.\n path.skipKey(\"body\");\n },\n };\n\n return privateNameVisitor;\n}\n\ninterface PrivateNameState {\n privateNamesMap: PrivateNamesMap;\n classRef: t.Identifier;\n file: File;\n noDocumentAll: boolean;\n innerBinding?: t.Identifier;\n}\n\nconst privateNameVisitor = privateNameVisitorFactory<\n HandlerState<PrivateNameState> & PrivateNameState\n>({\n PrivateName(path, { noDocumentAll }) {\n const { privateNamesMap, redeclared } = this;\n const { node, parentPath } = path;\n\n if (\n !parentPath.isMemberExpression({ property: node }) &&\n !parentPath.isOptionalMemberExpression({ property: node })\n ) {\n return;\n }\n const { name } = node.id;\n if (!privateNamesMap.has(name)) return;\n if (redeclared && redeclared.includes(name)) return;\n\n this.handle(parentPath, noDocumentAll);\n },\n});\n\n// rename all bindings that shadows innerBinding\nfunction unshadow(\n name: string,\n scope: Scope,\n innerBinding: t.Identifier | undefined,\n) {\n // in some cases, scope.getBinding(name) === undefined\n // so we check hasBinding to avoid keeping looping\n // see: https://github.com/babel/babel/pull/13656#discussion_r686030715\n while (\n scope?.hasBinding(name) &&\n !scope.bindingIdentifierEquals(name, innerBinding)\n ) {\n scope.rename(name);\n scope = scope.parent;\n }\n}\n\nexport function buildCheckInRHS(\n rhs: t.Expression,\n file: File,\n inRHSIsObject?: boolean,\n) {\n if (inRHSIsObject || !file.availableHelper?.(\"checkInRHS\")) return rhs;\n return t.callExpression(file.addHelper(\"checkInRHS\"), [rhs]);\n}\n\nconst privateInVisitor = privateNameVisitorFactory<{\n classRef: t.Identifier;\n file: File;\n innerBinding?: t.Identifier;\n}>({\n BinaryExpression(path, { file }) {\n const { operator, left, right } = path.node;\n if (operator !== \"in\") return;\n if (!t.isPrivateName(left)) return;\n\n const { privateFieldsAsProperties, privateNamesMap, redeclared } = this;\n\n const { name } = left.id;\n\n if (!privateNamesMap.has(name)) return;\n if (redeclared && redeclared.includes(name)) return;\n\n // if there are any local variable shadowing classRef, unshadow it\n // see #12960\n unshadow(this.classRef.name, path.scope, this.innerBinding);\n\n if (privateFieldsAsProperties) {\n const { id } = privateNamesMap.get(name);\n path.replaceWith(template.expression.ast`\n Object.prototype.hasOwnProperty.call(${buildCheckInRHS(\n right,\n file,\n )}, ${t.cloneNode(id)})\n `);\n return;\n }\n\n const { id, static: isStatic } = privateNamesMap.get(name);\n\n if (isStatic) {\n path.replaceWith(\n template.expression.ast`${buildCheckInRHS(\n right,\n file,\n )} === ${t.cloneNode(this.classRef)}`,\n );\n return;\n }\n\n path.replaceWith(\n template.expression.ast`${t.cloneNode(id)}.has(${buildCheckInRHS(\n right,\n file,\n )})`,\n );\n },\n});\n\ninterface Receiver {\n receiver(\n this: HandlerState<PrivateNameState> & PrivateNameState,\n member: NodePath<t.MemberExpression | t.OptionalMemberExpression>,\n ): t.Expression;\n}\n\nconst privateNameHandlerSpec: Handler<PrivateNameState & Receiver> & Receiver =\n {\n memoise(member, count) {\n const { scope } = member;\n const { object } = member.node as { object: t.Expression };\n\n const memo = scope.maybeGenerateMemoised(object);\n if (!memo) {\n return;\n }\n\n this.memoiser.set(object, memo, count);\n },\n\n receiver(member) {\n const { object } = member.node as { object: t.Expression };\n\n if (this.memoiser.has(object)) {\n return t.cloneNode(this.memoiser.get(object));\n }\n\n return t.cloneNode(object);\n },\n\n get(member) {\n const { classRef, privateNamesMap, file, innerBinding } = this;\n const { name } = (member.node.property as t.PrivateName).id;\n const {\n id,\n static: isStatic,\n method: isMethod,\n methodId,\n getId,\n setId,\n } = privateNamesMap.get(name);\n const isAccessor = getId || setId;\n\n if (isStatic) {\n const helperName =\n isMethod && !isAccessor\n ? \"classStaticPrivateMethodGet\"\n : \"classStaticPrivateFieldSpecGet\";\n\n // if there are any local variable shadowing classRef, unshadow it\n // see #12960\n unshadow(classRef.name, member.scope, innerBinding);\n\n return t.callExpression(file.addHelper(helperName), [\n this.receiver(member),\n t.cloneNode(classRef),\n t.cloneNode(id),\n ]);\n }\n\n if (isMethod) {\n if (isAccessor) {\n if (!getId && setId) {\n if (file.availableHelper(\"writeOnlyError\")) {\n return t.sequenceExpression([\n this.receiver(member),\n t.callExpression(file.addHelper(\"writeOnlyError\"), [\n t.stringLiteral(`#${name}`),\n ]),\n ]);\n }\n console.warn(\n `@babel/helpers is outdated, update it to silence this warning.`,\n );\n }\n return t.callExpression(file.addHelper(\"classPrivateFieldGet\"), [\n this.receiver(member),\n t.cloneNode(id),\n ]);\n }\n return t.callExpression(file.addHelper(\"classPrivateMethodGet\"), [\n this.receiver(member),\n t.cloneNode(id),\n t.cloneNode(methodId),\n ]);\n }\n return t.callExpression(file.addHelper(\"classPrivateFieldGet\"), [\n this.receiver(member),\n t.cloneNode(id),\n ]);\n },\n\n boundGet(member) {\n this.memoise(member, 1);\n\n return t.callExpression(\n t.memberExpression(this.get(member), t.identifier(\"bind\")),\n [this.receiver(member)],\n );\n },\n\n set(member, value) {\n const { classRef, privateNamesMap, file } = this;\n const { name } = (member.node.property as t.PrivateName).id;\n const {\n id,\n static: isStatic,\n method: isMethod,\n setId,\n getId,\n } = privateNamesMap.get(name);\n const isAccessor = getId || setId;\n\n if (isStatic) {\n const helperName =\n isMethod && !isAccessor\n ? \"classStaticPrivateMethodSet\"\n : \"classStaticPrivateFieldSpecSet\";\n\n return t.callExpression(file.addHelper(helperName), [\n this.receiver(member),\n t.cloneNode(classRef),\n t.cloneNode(id),\n value,\n ]);\n }\n if (isMethod) {\n if (setId) {\n return t.callExpression(file.addHelper(\"classPrivateFieldSet\"), [\n this.receiver(member),\n t.cloneNode(id),\n value,\n ]);\n }\n return t.sequenceExpression([\n this.receiver(member),\n value,\n t.callExpression(file.addHelper(\"readOnlyError\"), [\n t.stringLiteral(`#${name}`),\n ]),\n ]);\n }\n return t.callExpression(file.addHelper(\"classPrivateFieldSet\"), [\n this.receiver(member),\n t.cloneNode(id),\n value,\n ]);\n },\n\n destructureSet(member) {\n const { classRef, privateNamesMap, file } = this;\n const { name } = (member.node.property as t.PrivateName).id;\n const { id, static: isStatic } = privateNamesMap.get(name);\n if (isStatic) {\n try {\n // classStaticPrivateFieldDestructureSet was introduced in 7.13.10\n // eslint-disable-next-line no-var\n var helper = file.addHelper(\"classStaticPrivateFieldDestructureSet\");\n } catch {\n throw new Error(\n \"Babel can not transpile `[C.#p] = [0]` with @babel/helpers < 7.13.10, \\n\" +\n \"please update @babel/helpers to the latest version.\",\n );\n }\n return t.memberExpression(\n t.callExpression(helper, [\n this.receiver(member),\n t.cloneNode(classRef),\n t.cloneNode(id),\n ]),\n t.identifier(\"value\"),\n );\n }\n\n return t.memberExpression(\n t.callExpression(file.addHelper(\"classPrivateFieldDestructureSet\"), [\n this.receiver(member),\n t.cloneNode(id),\n ]),\n t.identifier(\"value\"),\n );\n },\n\n call(member, args: (t.Expression | t.SpreadElement)[]) {\n // The first access (the get) should do the memo assignment.\n this.memoise(member, 1);\n\n return optimiseCall(this.get(member), this.receiver(member), args, false);\n },\n\n optionalCall(member, args: (t.Expression | t.SpreadElement)[]) {\n this.memoise(member, 1);\n\n return optimiseCall(this.get(member), this.receiver(member), args, true);\n },\n };\n\nconst privateNameHandlerLoose: Handler<PrivateNameState> = {\n get(member) {\n const { privateNamesMap, file } = this;\n const { object } = member.node;\n const { name } = (member.node.property as t.PrivateName).id;\n\n return template.expression`BASE(REF, PROP)[PROP]`({\n BASE: file.addHelper(\"classPrivateFieldLooseBase\"),\n REF: t.cloneNode(object),\n PROP: t.cloneNode(privateNamesMap.get(name).id),\n });\n },\n\n set() {\n // noop\n throw new Error(\"private name handler with loose = true don't need set()\");\n },\n\n boundGet(member) {\n return t.callExpression(\n t.memberExpression(this.get(member), t.identifier(\"bind\")),\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion\n [t.cloneNode(member.node.object as t.Expression)],\n );\n },\n\n simpleSet(member) {\n return this.get(member);\n },\n\n destructureSet(member) {\n return this.get(member);\n },\n\n call(member, args) {\n return t.callExpression(this.get(member), args);\n },\n\n optionalCall(member, args) {\n return t.optionalCallExpression(this.get(member), args, true);\n },\n};\n\nexport function transformPrivateNamesUsage(\n ref: t.Identifier,\n path: NodePath<t.Class>,\n privateNamesMap: PrivateNamesMap,\n {\n privateFieldsAsProperties,\n noDocumentAll,\n innerBinding,\n }: {\n privateFieldsAsProperties: boolean;\n noDocumentAll: boolean;\n innerBinding: t.Identifier;\n },\n state: File,\n) {\n if (!privateNamesMap.size) return;\n\n const body = path.get(\"body\");\n const handler = privateFieldsAsProperties\n ? privateNameHandlerLoose\n : privateNameHandlerSpec;\n\n memberExpressionToFunctions<PrivateNameState>(body, privateNameVisitor, {\n privateNamesMap,\n classRef: ref,\n file: state,\n ...handler,\n noDocumentAll,\n innerBinding,\n });\n body.traverse(privateInVisitor, {\n privateNamesMap,\n classRef: ref,\n file: state,\n privateFieldsAsProperties,\n innerBinding,\n });\n}\n\nfunction buildPrivateFieldInitLoose(\n ref: t.Expression,\n prop: NodePath<t.ClassPrivateProperty>,\n privateNamesMap: PrivateNamesMap,\n) {\n const { id } = privateNamesMap.get(prop.node.key.id.name);\n const value = prop.node.value || prop.scope.buildUndefinedNode();\n\n return inheritPropComments(\n template.statement.ast`\n Object.defineProperty(${ref}, ${t.cloneNode(id)}, {\n // configurable is false by default\n // enumerable is false by default\n writable: true,\n value: ${value}\n });\n `,\n prop,\n );\n}\n\nfunction buildPrivateInstanceFieldInitSpec(\n ref: t.Expression,\n prop: NodePath<t.ClassPrivateProperty>,\n privateNamesMap: PrivateNamesMap,\n state: File,\n) {\n const { id } = privateNamesMap.get(prop.node.key.id.name);\n const value = prop.node.value || prop.scope.buildUndefinedNode();\n\n if (!process.env.BABEL_8_BREAKING) {\n if (!state.availableHelper(\"classPrivateFieldInitSpec\")) {\n return inheritPropComments(\n template.statement.ast`${t.cloneNode(id)}.set(${ref}, {\n // configurable is always false for private elements\n // enumerable is always false for private elements\n writable: true,\n value: ${value},\n })`,\n prop,\n );\n }\n }\n\n const helper = state.addHelper(\"classPrivateFieldInitSpec\");\n return inheritPropComments(\n template.statement.ast`${helper}(\n ${t.thisExpression()},\n ${t.cloneNode(id)},\n {\n writable: true,\n value: ${value}\n },\n )`,\n prop,\n );\n}\n\nfunction buildPrivateStaticFieldInitSpec(\n prop: NodePath<t.ClassPrivateProperty>,\n privateNamesMap: PrivateNamesMap,\n) {\n const privateName = privateNamesMap.get(prop.node.key.id.name);\n const { id, getId, setId, initAdded } = privateName;\n const isAccessor = getId || setId;\n\n if (!prop.isProperty() && (initAdded || !isAccessor)) return;\n\n if (isAccessor) {\n privateNamesMap.set(prop.node.key.id.name, {\n ...privateName,\n initAdded: true,\n });\n\n return inheritPropComments(\n template.statement.ast`\n var ${t.cloneNode(id)} = {\n // configurable is false by default\n // enumerable is false by default\n // writable is false by default\n get: ${getId ? getId.name : prop.scope.buildUndefinedNode()},\n set: ${setId ? setId.name : prop.scope.buildUndefinedNode()}\n }\n `,\n prop,\n );\n }\n\n const value = prop.node.value || prop.scope.buildUndefinedNode();\n return inheritPropComments(\n template.statement.ast`\n var ${t.cloneNode(id)} = {\n // configurable is false by default\n // enumerable is false by default\n writable: true,\n value: ${value}\n };\n `,\n prop,\n );\n}\n\nfunction buildPrivateMethodInitLoose(\n ref: t.Expression,\n prop: NodePath<t.ClassPrivateMethod>,\n privateNamesMap: PrivateNamesMap,\n) {\n const privateName = privateNamesMap.get(prop.node.key.id.name);\n const { methodId, id, getId, setId, initAdded } = privateName;\n if (initAdded) return;\n\n if (methodId) {\n return inheritPropComments(\n template.statement.ast`\n Object.defineProperty(${ref}, ${id}, {\n // configurable is false by default\n // enumerable is false by default\n // writable is false by default\n value: ${methodId.name}\n });\n `,\n prop,\n );\n }\n const isAccessor = getId || setId;\n if (isAccessor) {\n privateNamesMap.set(prop.node.key.id.name, {\n ...privateName,\n initAdded: true,\n });\n\n return inheritPropComments(\n template.statement.ast`\n Object.defineProperty(${ref}, ${id}, {\n // configurable is false by default\n // enumerable is false by default\n // writable is false by default\n get: ${getId ? getId.name : prop.scope.buildUndefinedNode()},\n set: ${setId ? setId.name : prop.scope.buildUndefinedNode()}\n });\n `,\n prop,\n );\n }\n}\n\nfunction buildPrivateInstanceMethodInitSpec(\n ref: t.Expression,\n prop: NodePath<t.ClassPrivateMethod>,\n privateNamesMap: PrivateNamesMap,\n state: File,\n) {\n const privateName = privateNamesMap.get(prop.node.key.id.name);\n const { getId, setId, initAdded } = privateName;\n\n if (initAdded) return;\n\n const isAccessor = getId || setId;\n if (isAccessor) {\n return buildPrivateAccessorInitialization(\n ref,\n prop,\n privateNamesMap,\n state,\n );\n }\n\n return buildPrivateInstanceMethodInitialization(\n ref,\n prop,\n privateNamesMap,\n state,\n );\n}\n\nfunction buildPrivateAccessorInitialization(\n ref: t.Expression,\n prop: NodePath<t.ClassPrivateMethod>,\n privateNamesMap: PrivateNamesMap,\n state: File,\n) {\n const privateName = privateNamesMap.get(prop.node.key.id.name);\n const { id, getId, setId } = privateName;\n\n privateNamesMap.set(prop.node.key.id.name, {\n ...privateName,\n initAdded: true,\n });\n\n if (!process.env.BABEL_8_BREAKING) {\n if (!state.availableHelper(\"classPrivateFieldInitSpec\")) {\n return inheritPropComments(\n template.statement.ast`\n ${id}.set(${ref}, {\n get: ${getId ? getId.name : prop.scope.buildUndefinedNode()},\n set: ${setId ? setId.name : prop.scope.buildUndefinedNode()}\n });\n `,\n prop,\n );\n }\n }\n\n const helper = state.addHelper(\"classPrivateFieldInitSpec\");\n return inheritPropComments(\n template.statement.ast`${helper}(\n ${t.thisExpression()},\n ${t.cloneNode(id)},\n {\n get: ${getId ? getId.name : prop.scope.buildUndefinedNode()},\n set: ${setId ? setId.name : prop.scope.buildUndefinedNode()}\n },\n )`,\n prop,\n );\n}\n\nfunction buildPrivateInstanceMethodInitialization(\n ref: t.Expression,\n prop: NodePath<t.ClassPrivateMethod>,\n privateNamesMap: PrivateNamesMap,\n state: File,\n) {\n const privateName = privateNamesMap.get(prop.node.key.id.name);\n const { id } = privateName;\n\n if (!process.env.BABEL_8_BREAKING) {\n if (!state.availableHelper(\"classPrivateMethodInitSpec\")) {\n return inheritPropComments(\n template.statement.ast`${id}.add(${ref})`,\n prop,\n );\n }\n }\n\n const helper = state.addHelper(\"classPrivateMethodInitSpec\");\n return inheritPropComments(\n template.statement.ast`${helper}(\n ${t.thisExpression()},\n ${t.cloneNode(id)}\n )`,\n prop,\n );\n}\n\nfunction buildPublicFieldInitLoose(\n ref: t.Expression,\n prop: NodePath<t.ClassProperty>,\n) {\n const { key, computed } = prop.node;\n const value = prop.node.value || prop.scope.buildUndefinedNode();\n\n return inheritPropComments(\n t.expressionStatement(\n t.assignmentExpression(\n \"=\",\n t.memberExpression(ref, key, computed || t.isLiteral(key)),\n value,\n ),\n ),\n prop,\n );\n}\n\nfunction buildPublicFieldInitSpec(\n ref: t.Expression,\n prop: NodePath<t.ClassProperty>,\n state: File,\n) {\n const { key, computed } = prop.node;\n const value = prop.node.value || prop.scope.buildUndefinedNode();\n\n return inheritPropComments(\n t.expressionStatement(\n t.callExpression(state.addHelper(\"defineProperty\"), [\n ref,\n computed || t.isLiteral(key)\n ? key\n : t.stringLiteral((key as t.Identifier).name),\n value,\n ]),\n ),\n prop,\n );\n}\n\nfunction buildPrivateStaticMethodInitLoose(\n ref: t.Expression,\n prop: NodePath<t.ClassPrivateMethod>,\n state: File,\n privateNamesMap: PrivateNamesMap,\n) {\n const privateName = privateNamesMap.get(prop.node.key.id.name);\n const { id, methodId, getId, setId, initAdded } = privateName;\n\n if (initAdded) return;\n\n const isAccessor = getId || setId;\n if (isAccessor) {\n privateNamesMap.set(prop.node.key.id.name, {\n ...privateName,\n initAdded: true,\n });\n\n return inheritPropComments(\n template.statement.ast`\n Object.defineProperty(${ref}, ${id}, {\n // configurable is false by default\n // enumerable is false by default\n // writable is false by default\n get: ${getId ? getId.name : prop.scope.buildUndefinedNode()},\n set: ${setId ? setId.name : prop.scope.buildUndefinedNode()}\n })\n `,\n prop,\n );\n }\n\n return inheritPropComments(\n template.statement.ast`\n Object.defineProperty(${ref}, ${id}, {\n // configurable is false by default\n // enumerable is false by default\n // writable is false by default\n value: ${methodId.name}\n });\n `,\n prop,\n );\n}\n\nfunction buildPrivateMethodDeclaration(\n prop: NodePath<t.ClassPrivateMethod>,\n privateNamesMap: PrivateNamesMap,\n privateFieldsAsProperties = false,\n) {\n const privateName = privateNamesMap.get(prop.node.key.id.name);\n const {\n id,\n methodId,\n getId,\n setId,\n getterDeclared,\n setterDeclared,\n static: isStatic,\n } = privateName;\n const { params, body, generator, async } = prop.node;\n const isGetter = getId && !getterDeclared && params.length === 0;\n const isSetter = setId && !setterDeclared && params.length > 0;\n\n let declId = methodId;\n\n if (isGetter) {\n privateNamesMap.set(prop.node.key.id.name, {\n ...privateName,\n getterDeclared: true,\n });\n declId = getId;\n } else if (isSetter) {\n privateNamesMap.set(prop.node.key.id.name, {\n ...privateName,\n setterDeclared: true,\n });\n declId = setId;\n } else if (isStatic && !privateFieldsAsProperties) {\n declId = id;\n }\n\n return inheritPropComments(\n t.functionDeclaration(\n t.cloneNode(declId),\n // @ts-expect-error params for ClassMethod has TSParameterProperty\n params,\n body,\n generator,\n async,\n ),\n prop,\n );\n}\n\ntype ReplaceThisState = {\n classRef: t.Identifier;\n needsClassRef: boolean;\n innerBinding: t.Identifier | null;\n};\n\nconst thisContextVisitor = traverse.visitors.merge<ReplaceThisState>([\n {\n ThisExpression(path, state) {\n // Replace `delete this` with `true`\n const parent = path.findParent(\n path => !isTransparentExprWrapper(path.node),\n );\n if (t.isUnaryExpression(parent.node, { operator: \"delete\" })) {\n path.parentPath.replaceWith(t.booleanLiteral(true));\n return;\n }\n\n state.needsClassRef = true;\n path.replaceWith(t.cloneNode(state.classRef));\n },\n MetaProperty(path) {\n const meta = path.get(\"meta\");\n const property = path.get(\"property\");\n const { scope } = path;\n // if there are `new.target` in static field\n // we should replace it with `undefined`\n if (\n meta.isIdentifier({ name: \"new\" }) &&\n property.isIdentifier({ name: \"target\" })\n ) {\n path.replaceWith(scope.buildUndefinedNode());\n }\n },\n },\n environmentVisitor,\n]);\n\nconst innerReferencesVisitor: Visitor<ReplaceThisState> = {\n ReferencedIdentifier(path, state) {\n if (\n path.scope.bindingIdentifierEquals(path.node.name, state.innerBinding)\n ) {\n state.needsClassRef = true;\n path.node.name = state.classRef.name;\n }\n },\n};\n\nfunction replaceThisContext(\n path: PropPath,\n ref: t.Identifier,\n getSuperRef: () => t.Identifier,\n file: File,\n isStaticBlock: boolean,\n constantSuper: boolean,\n innerBindingRef: t.Identifier | null,\n) {\n const state: ReplaceThisState = {\n classRef: ref,\n needsClassRef: false,\n innerBinding: innerBindingRef,\n };\n\n const replacer = new ReplaceSupers({\n methodPath: path,\n constantSuper,\n file,\n refToPreserve: ref,\n getSuperRef,\n getObjectRef() {\n state.needsClassRef = true;\n // @ts-expect-error: TS doesn't infer that path.node is not a StaticBlock\n return t.isStaticBlock?.(path.node) || path.node.static\n ? ref\n : t.memberExpression(ref, t.identifier(\"prototype\"));\n },\n });\n replacer.replace();\n if (isStaticBlock || path.isProperty()) {\n path.traverse(thisContextVisitor, state);\n }\n\n // todo: use innerBinding.referencePaths to avoid full traversal\n if (\n innerBindingRef != null &&\n state.classRef?.name &&\n state.classRef.name !== innerBindingRef?.name\n ) {\n path.traverse(innerReferencesVisitor, state);\n }\n\n return state.needsClassRef;\n}\n\nexport type PropNode =\n | t.ClassProperty\n | t.ClassPrivateMethod\n | t.ClassPrivateProperty\n | t.StaticBlock;\nexport type PropPath = NodePath<PropNode>;\n\nfunction isNameOrLength({ key, computed }: t.ClassProperty) {\n if (key.type === \"Identifier\") {\n return !computed && (key.name === \"name\" || key.name === \"length\");\n }\n if (key.type === \"StringLiteral\") {\n return key.value === \"name\" || key.value === \"length\";\n }\n return false;\n}\n\n/**\n * Inherit comments from class members. This is a reduced version of\n * t.inheritsComments: the trailing comments are not inherited because\n * for most class members except the last one, their trailing comments are\n * the next sibling's leading comments.\n *\n * @template T transformed class member type\n * @param {T} node transformed class member\n * @param {PropPath} prop class member\n * @returns transformed class member type with comments inherited\n */\nfunction inheritPropComments<T extends t.Node>(node: T, prop: PropPath) {\n t.inheritLeadingComments(node, prop.node);\n t.inheritInnerComments(node, prop.node);\n return node;\n}\n\nexport function buildFieldsInitNodes(\n ref: t.Identifier,\n superRef: t.Expression | undefined,\n props: PropPath[],\n privateNamesMap: PrivateNamesMap,\n state: File,\n setPublicClassFields: boolean,\n privateFieldsAsProperties: boolean,\n constantSuper: boolean,\n innerBindingRef: t.Identifier,\n) {\n let needsClassRef = false;\n let injectSuperRef: t.Identifier;\n const staticNodes: t.Statement[] = [];\n const instanceNodes: t.Statement[] = [];\n // These nodes are pure and can be moved to the closest statement position\n const pureStaticNodes: t.FunctionDeclaration[] = [];\n\n const getSuperRef = t.isIdentifier(superRef)\n ? () => superRef\n : () => {\n injectSuperRef ??=\n props[0].scope.generateUidIdentifierBasedOnNode(superRef);\n return injectSuperRef;\n };\n\n for (const prop of props) {\n prop.isClassProperty() && ts.assertFieldTransformed(prop);\n\n // @ts-expect-error: TS doesn't infer that prop.node is not a StaticBlock\n const isStatic = !t.isStaticBlock?.(prop.node) && prop.node.static;\n const isInstance = !isStatic;\n const isPrivate = prop.isPrivate();\n const isPublic = !isPrivate;\n const isField = prop.isProperty();\n const isMethod = !isField;\n const isStaticBlock = prop.isStaticBlock?.();\n\n if (isStatic || (isMethod && isPrivate) || isStaticBlock) {\n const replaced = replaceThisContext(\n prop,\n ref,\n getSuperRef,\n state,\n isStaticBlock,\n constantSuper,\n innerBindingRef,\n );\n needsClassRef = needsClassRef || replaced;\n }\n\n // TODO(ts): there are so many `ts-expect-error` inside cases since\n // ts can not infer type from pre-computed values (or a case test)\n // even change `isStaticBlock` to `t.isStaticBlock(prop)` will not make prop\n // a `NodePath<t.StaticBlock>`\n // this maybe a bug for ts\n switch (true) {\n case isStaticBlock: {\n const blockBody = (prop.node as t.StaticBlock).body;\n // We special-case the single expression case to avoid the iife, since\n // it's common.\n if (blockBody.length === 1 && t.isExpressionStatement(blockBody[0])) {\n staticNodes.push(inheritPropComments(blockBody[0], prop));\n } else {\n staticNodes.push(\n t.inheritsComments(\n template.statement.ast`(() => { ${blockBody} })()`,\n prop.node,\n ),\n );\n }\n break;\n }\n case isStatic && isPrivate && isField && privateFieldsAsProperties:\n needsClassRef = true;\n staticNodes.push(\n // @ts-expect-error checked in switch\n buildPrivateFieldInitLoose(t.cloneNode(ref), prop, privateNamesMap),\n );\n break;\n case isStatic && isPrivate && isField && !privateFieldsAsProperties:\n needsClassRef = true;\n staticNodes.push(\n // @ts-expect-error checked in switch\n buildPrivateStaticFieldInitSpec(prop, privateNamesMap),\n );\n break;\n case isStatic && isPublic && isField && setPublicClassFields:\n // Functions always have non-writable .name and .length properties,\n // so we must always use [[Define]] for them.\n // It might still be possible to a computed static fields whose resulting\n // key is \"name\" or \"length\", but the assumption is telling us that it's\n // not going to happen.\n // @ts-expect-error checked in switch\n if (!isNameOrLength(prop.node)) {\n needsClassRef = true;\n // @ts-expect-error checked in switch\n staticNodes.push(buildPublicFieldInitLoose(t.cloneNode(ref), prop));\n break;\n }\n // falls through\n case isStatic && isPublic && isField && !setPublicClassFields:\n needsClassRef = true;\n staticNodes.push(\n // @ts-expect-error checked in switch\n buildPublicFieldInitSpec(t.cloneNode(ref), prop, state),\n );\n break;\n case isInstance && isPrivate && isField && privateFieldsAsProperties:\n instanceNodes.push(\n // @ts-expect-error checked in switch\n buildPrivateFieldInitLoose(t.thisExpression(), prop, privateNamesMap),\n );\n break;\n case isInstance && isPrivate && isField && !privateFieldsAsProperties:\n instanceNodes.push(\n buildPrivateInstanceFieldInitSpec(\n t.thisExpression(),\n // @ts-expect-error checked in switch\n prop,\n privateNamesMap,\n state,\n ),\n );\n break;\n case isInstance && isPrivate && isMethod && privateFieldsAsProperties:\n instanceNodes.unshift(\n buildPrivateMethodInitLoose(\n t.thisExpression(),\n // @ts-expect-error checked in switch\n prop,\n privateNamesMap,\n ),\n );\n pureStaticNodes.push(\n buildPrivateMethodDeclaration(\n // @ts-expect-error checked in switch\n prop,\n privateNamesMap,\n privateFieldsAsProperties,\n ),\n );\n break;\n case isInstance && isPrivate && isMethod && !privateFieldsAsProperties:\n instanceNodes.unshift(\n buildPrivateInstanceMethodInitSpec(\n t.thisExpression(),\n // @ts-expect-error checked in switch\n prop,\n privateNamesMap,\n state,\n ),\n );\n pureStaticNodes.push(\n buildPrivateMethodDeclaration(\n // @ts-expect-error checked in switch\n prop,\n privateNamesMap,\n privateFieldsAsProperties,\n ),\n );\n break;\n case isStatic && isPrivate && isMethod && !privateFieldsAsProperties:\n needsClassRef = true;\n staticNodes.unshift(\n // @ts-expect-error checked in switch\n buildPrivateStaticFieldInitSpec(prop, privateNamesMap),\n );\n pureStaticNodes.push(\n buildPrivateMethodDeclaration(\n // @ts-expect-error checked in switch\n prop,\n privateNamesMap,\n privateFieldsAsProperties,\n ),\n );\n break;\n case isStatic && isPrivate && isMethod && privateFieldsAsProperties:\n needsClassRef = true;\n staticNodes.unshift(\n buildPrivateStaticMethodInitLoose(\n t.cloneNode(ref),\n // @ts-expect-error checked in switch\n prop,\n state,\n privateNamesMap,\n ),\n );\n pureStaticNodes.push(\n buildPrivateMethodDeclaration(\n // @ts-expect-error checked in switch\n prop,\n privateNamesMap,\n privateFieldsAsProperties,\n ),\n );\n break;\n case isInstance && isPublic && isField && setPublicClassFields:\n // @ts-expect-error checked in switch\n instanceNodes.push(buildPublicFieldInitLoose(t.thisExpression(), prop));\n break;\n case isInstance && isPublic && isField && !setPublicClassFields:\n instanceNodes.push(\n // @ts-expect-error checked in switch\n buildPublicFieldInitSpec(t.thisExpression(), prop, state),\n );\n break;\n default:\n throw new Error(\"Unreachable.\");\n }\n }\n\n return {\n staticNodes: staticNodes.filter(Boolean),\n instanceNodes: instanceNodes.filter(Boolean),\n pureStaticNodes: pureStaticNodes.filter(Boolean),\n wrapClass(path: NodePath<t.Class>) {\n for (const prop of props) {\n prop.remove();\n }\n\n if (injectSuperRef) {\n path.scope.push({ id: t.cloneNode(injectSuperRef) });\n path.set(\n \"superClass\",\n t.assignmentExpression(\"=\", injectSuperRef, path.node.superClass),\n );\n }\n\n if (!needsClassRef) return path;\n\n if (path.isClassExpression()) {\n path.scope.push({ id: ref });\n path.replaceWith(\n t.assignmentExpression(\"=\", t.cloneNode(ref), path.node),\n );\n } else if (!path.node.id) {\n // Anonymous class declaration\n path.node.id = ref;\n }\n\n return path;\n },\n };\n}\n"],"mappings":";;;;;;;;;;AAAA;AAGA;AACA;AACA;AAKA;AACA;AACA;AAEA;AAgBO,SAASA,oBAAoB,CAACC,KAAiB,EAAE;EACtD,MAAMC,eAAgC,GAAG,IAAIC,GAAG,EAAE;EAClD,KAAK,MAAMC,IAAI,IAAIH,KAAK,EAAE;IACxB,IAAIG,IAAI,CAACC,SAAS,EAAE,EAAE;MACpB,MAAM;QAAEC;MAAK,CAAC,GAAGF,IAAI,CAACG,IAAI,CAACC,GAAG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