From efbc2ffe6a1ee5ec38a4396305561d6515d0943e Mon Sep 17 00:00:00 2001 From: littleblack111 Date: Fri, 30 Aug 2024 17:21:18 +0800 Subject: node fixes, updates --- .../@babel/plugin-transform-classes/lib/index.js | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) (limited to 'node_modules/@babel/plugin-transform-classes/lib/index.js') 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, -- cgit v1.2.3