hexo/node_modules/@babel/helper-create-class-feature.../lib/index.js.map

1 line
20 KiB
Plaintext
Raw Normal View History

2023-09-25 15:58:56 +08:00
{"version":3,"names":["_core","require","_helperFunctionName","_helperSplitExportDeclaration","_fields","_decorators","_misc","_features","_typescript","version","split","reduce","v","x","versionKey","createClassFeaturePlugin","name","feature","loose","manipulateOptions","api","assumption","inherits","setPublicClassFields","privateFieldsAsSymbols","privateFieldsAsProperties","constantSuper","noDocumentAll","Error","privateFieldsAsSymbolsOrProperties","explicit","undefined","push","length","console","warn","join","pre","file","enableFeature","get","set","visitor","Class","path","shouldTransform","isClassDeclaration","assertFieldTransformed","isLoose","constructor","isDecorated","hasDecorators","node","props","elements","computedPaths","privateNames","Set","body","isClassProperty","isClassMethod","computed","isPrivate","key","id","getName","setName","isClassPrivateMethod","kind","has","buildCodeFrameError","add","isProperty","isStaticBlock","innerBinding","ref","isClassExpression","nameFunction","scope","generateUidIdentifier","t","cloneNode","privateNamesMap","buildPrivateNamesMap","privateNamesNodes","buildPrivateNamesNodes","transformPrivateNamesUsage","keysNodes","staticNodes","instanceNodes","pureStaticNodes","wrapClass","buildDecoratedClass","extractComputedKeys","buildFieldsInitNodes","superClass","injectInitialization","referenceVisitor","state","prop","static","traverse","wrappedPath","insertBefore","insertAfter","find","parent","isStatement","isDeclaration","ExportDefaultDeclaration","decl","splitExportDeclaration","type"],"sources":["../src/index.ts"],"sourcesContent":["import { types as t } from \"@babel/core\";\nimport type { PluginAPI, PluginObject } from \"@babel/core\";\nimport type { NodePath } from \"@babel/traverse\";\nimport nameFunction from \"@babel/helper-function-name\";\nimport splitExportDeclaration from \"@babel/helper-split-export-declaration\";\nimport {\n buildPrivateNamesNodes,\n buildPrivateNamesMap,\n transformPrivateNamesUsage,\n buildFieldsInitNodes,\n buildCheckInRHS,\n} from \"./fields\";\nimport type { PropPath } from \"./fields\";\nimport { buildDecoratedClass, hasDecorators } from \"./decorators\";\nimport { injectInitialization, extractComputedKeys } from \"./misc\";\nimport { enableFeature, FEATURES, isLoose, shouldTransform } from \"./features\";\nimport { assertFieldTransformed } from \"./typescript\";\n\nexport { FEATURES, enableFeature, injectInitialization, buildCheckInRHS };\n\ndeclare const PACKAGE_JSON: { name: string; version: string };\n\n// Note: Versions are represented as an integer. e.g. 7.1.5 is represented\n// as 70000100005. This method is easier than using a semver-parsing\n// package, but it breaks if we release x.y.z where x, y or z are\n// greater than 99_999.\nconst version = PACKAGE_JSON.version\n .split(\".\")\n .reduce((v, x) => v * 1e5 + +x, 0);\nconst versionKey = \"@babel/plugin-class-features/version\";\n\ninterface Options {\n name: string;\n feature: number;\n loose?: boolean;\n inherits?: PluginObject[\"inherits\"];\n manipulateOptions?: PluginObject[\"manipulateOptions\"];\n api?: PluginAPI;\n}\n\nexport function createClassFeaturePlugin({\n name,\n feature,\n loose,\n manipulateOptions,\n // @ts-ignore(Babel 7 vs Babel 8) TODO(Babel 8): Remove the default value\n api = { assumption: () => void 0 },\n inherits,\n}: Options): PluginObject {\n const setPublicClassFields = api.assumption(\"setPublicClassFields\");\n const privateFieldsAsSymbols = api.assumption(\"privateFieldsAsSymbols\");\n const privateFieldsAsProperties = api.assumption(\"privateFieldsAsProperties\");\n const constantSuper = api.assumption(\"constantSuper\");\n const noDocumentAll = api.assumption(\"noDocumentAll\");\n\n if (privateFieldsAsProperties && privateFieldsAsSymbols) {\n throw new Error(\n `Cannot enable both the \"privateFieldsAsProperties\" and ` +\n `\"privateFieldsAsSymbols\" assumptions as the same time.`,\n );\n }\n const privateFieldsAsSymbolsOrProperties =\n privateFieldsAsProperties || privateFiel