summaryrefslogtreecommitdiff
path: root/node_modules/@babel/plugin-transform-classes/lib/index.js
diff options
context:
space:
mode:
authorlittleblack111 <littleblack11111@gmail.com>2024-08-30 17:21:18 +0800
committerlittleblack111 <littleblack11111@gmail.com>2024-08-30 17:21:18 +0800
commitefbc2ffe6a1ee5ec38a4396305561d6515d0943e (patch)
tree2b4c94f18f2c792dfda813050755d5c0273fae22 /node_modules/@babel/plugin-transform-classes/lib/index.js
parent43acceb75957c880a5ba5a31aae221394a36d5f6 (diff)
node fixes, updates
Diffstat (limited to 'node_modules/@babel/plugin-transform-classes/lib/index.js')
-rw-r--r--node_modules/@babel/plugin-transform-classes/lib/index.js17
1 files changed, 10 insertions, 7 deletions
diff --git a/node_modules/@babel/plugin-transform-classes/lib/index.js b/node_modules/@babel/plugin-transform-classes/lib/index.js
index 3513f3ac..56d1b7d7 100644
--- a/node_modules/@babel/plugin-transform-classes/lib/index.js
+++ b/node_modules/@babel/plugin-transform-classes/lib/index.js
@@ -7,8 +7,6 @@ exports.default = void 0;
var _helperPluginUtils = require("@babel/helper-plugin-utils");
var _helperCompilationTargets = require("@babel/helper-compilation-targets");
var _helperAnnotateAsPure = require("@babel/helper-annotate-as-pure");
-var _helperFunctionName = require("@babel/helper-function-name");
-var _helperSplitExportDeclaration = require("@babel/helper-split-export-declaration");
var _core = require("@babel/core");
var _globals = require("globals");
var _transformClass = require("./transformClass.js");
@@ -31,7 +29,11 @@ var _default = exports.default = (0, _helperPluginUtils.declare)((api, options)
visitor: {
ExportDefaultDeclaration(path) {
if (!path.get("declaration").isClassDeclaration()) return;
- (0, _helperSplitExportDeclaration.default)(path);
+ {
+ var _path$splitExportDecl;
+ (_path$splitExportDecl = path.splitExportDeclaration) != null ? _path$splitExportDecl : path.splitExportDeclaration = require("@babel/traverse").NodePath.prototype.splitExportDeclaration;
+ }
+ path.splitExportDeclaration();
},
ClassDeclaration(path) {
const {
@@ -45,11 +47,12 @@ var _default = exports.default = (0, _helperPluginUtils.declare)((api, options)
node
} = path;
if (VISITED.has(node)) return;
- const inferred = (0, _helperFunctionName.default)(path, undefined, supportUnicodeId);
- if (inferred && inferred !== node) {
- path.replaceWith(inferred);
- return;
+ {
+ var _path$ensureFunctionN;
+ (_path$ensureFunctionN = path.ensureFunctionName) != null ? _path$ensureFunctionN : path.ensureFunctionName = require("@babel/traverse").NodePath.prototype.ensureFunctionName;
}
+ const replacement = path.ensureFunctionName(supportUnicodeId);
+ if (replacement && replacement.node !== node) return;
VISITED.add(node);
const [replacedPath] = path.replaceWith((0, _transformClass.default)(path, state.file, builtinClasses, loose, {
setClassMethods,