From fc87c009806dcc98867f6b58efe29b042aa01dee Mon Sep 17 00:00:00 2001 From: littleblack111 Date: Mon, 18 May 2026 23:10:59 +0800 Subject: node: update --- .../lib/index.js | 63 ---------------------- .../lib/index.js.map | 1 - 2 files changed, 64 deletions(-) delete mode 100644 node_modules/@babel/plugin-transform-class-static-block/lib/index.js delete mode 100644 node_modules/@babel/plugin-transform-class-static-block/lib/index.js.map (limited to 'node_modules/@babel/plugin-transform-class-static-block/lib') diff --git a/node_modules/@babel/plugin-transform-class-static-block/lib/index.js b/node_modules/@babel/plugin-transform-class-static-block/lib/index.js deleted file mode 100644 index e864648e..00000000 --- a/node_modules/@babel/plugin-transform-class-static-block/lib/index.js +++ /dev/null @@ -1,63 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = void 0; -var _helperPluginUtils = require("@babel/helper-plugin-utils"); -var _helperCreateClassFeaturesPlugin = require("@babel/helper-create-class-features-plugin"); -function generateUid(scope, denyList) { - const name = ""; - let uid; - let i = 1; - do { - uid = `_${name}`; - if (i > 1) uid += i; - i++; - } while (denyList.has(uid)); - return uid; -} -var _default = exports.default = (0, _helperPluginUtils.declare)(({ - types: t, - template, - assertVersion -}) => { - assertVersion("^7.12.0 || >8.0.0-alpha <8.0.0-beta"); - return { - name: "transform-class-static-block", - manipulateOptions: (_, parser) => parser.plugins.push("classStaticBlock"), - pre() { - (0, _helperCreateClassFeaturesPlugin.enableFeature)(this.file, _helperCreateClassFeaturesPlugin.FEATURES.staticBlocks, false); - }, - visitor: { - ClassBody(classBody) { - const { - scope - } = classBody; - const privateNames = new Set(); - const body = classBody.get("body"); - for (const path of body) { - if (path.isPrivate()) { - privateNames.add(path.get("key.id").node.name); - } - } - for (const path of body) { - if (!path.isStaticBlock()) continue; - const staticBlockPrivateId = generateUid(scope, privateNames); - privateNames.add(staticBlockPrivateId); - const staticBlockRef = t.privateName(t.identifier(staticBlockPrivateId)); - let replacement; - const blockBody = path.node.body; - if (blockBody.length === 1 && t.isExpressionStatement(blockBody[0])) { - replacement = t.inheritsComments(blockBody[0].expression, blockBody[0]); - } else { - replacement = template.expression.ast`(() => { ${blockBody} })()`; - } - path.replaceWith(t.classPrivateProperty(staticBlockRef, replacement, [], true)); - } - } - } - }; -}); - -//# sourceMappingURL=index.js.map diff --git a/node_modules/@babel/plugin-transform-class-static-block/lib/index.js.map b/node_modules/@babel/plugin-transform-class-static-block/lib/index.js.map deleted file mode 100644 index 4cc83e50..00000000 --- a/node_modules/@babel/plugin-transform-class-static-block/lib/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"names":["_helperPluginUtils","require","_helperCreateClassFeaturesPlugin","generateUid","scope","denyList","name","uid","i","has","_default","exports","default","declare","types","t","template","assertVersion","manipulateOptions","_","parser","plugins","push","pre","enableFeature","file","FEATURES","staticBlocks","visitor","ClassBody","classBody","privateNames","Set","body","get","path","isPrivate","add","node","isStaticBlock","staticBlockPrivateId","staticBlockRef","privateName","identifier","replacement","blockBody","length","isExpressionStatement","inheritsComments","expression","ast","replaceWith","classPrivateProperty"],"sources":["../src/index.ts"],"sourcesContent":["import { declare } from \"@babel/helper-plugin-utils\";\nimport type { Scope } from \"@babel/core\";\n\nimport {\n enableFeature,\n FEATURES,\n} from \"@babel/helper-create-class-features-plugin\";\n\n/**\n * Generate a uid that is not in `denyList`\n *\n * @param {Scope} scope\n * @param {Set} denyList a deny list that the generated uid should avoid\n * @returns\n */\nfunction generateUid(scope: Scope, denyList: Set) {\n const name = \"\";\n let uid;\n let i = 1;\n do {\n uid = `_${name}`;\n if (i > 1) uid += i;\n i++;\n } while (denyList.has(uid));\n return uid;\n}\n\nexport default declare(({ types: t, template, assertVersion }) => {\n assertVersion(REQUIRED_VERSION(\"^7.12.0\"));\n\n return {\n name: \"transform-class-static-block\",\n manipulateOptions: process.env.BABEL_8_BREAKING\n ? undefined\n : (_, parser) => parser.plugins.push(\"classStaticBlock\"),\n\n pre() {\n // Enable this in @babel/helper-create-class-features-plugin, so that it\n // can be handled by the private fields and methods transform.\n enableFeature(this.file, FEATURES.staticBlocks, /* loose */ false);\n },\n\n visitor: {\n // Run on ClassBody and not on class so that if @babel/helper-create-class-features-plugin\n // is enabled it can generate optimized output without passing from the intermediate\n // private fields representation.\n ClassBody(classBody) {\n const { scope } = classBody;\n const privateNames = new Set();\n const body = classBody.get(\"body\");\n for (const path of body) {\n if (path.isPrivate()) {\n privateNames.add(path.get(\"key.id\").node.name);\n }\n }\n for (const path of body) {\n if (!path.isStaticBlock()) continue;\n const staticBlockPrivateId = generateUid(scope, privateNames);\n privateNames.add(staticBlockPrivateId);\n const staticBlockRef = t.privateName(\n t.identifier(staticBlockPrivateId),\n );\n\n let replacement;\n const blockBody = path.node.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 replacement = t.inheritsComments(\n blockBody[0].expression,\n blockBody[0],\n );\n } else {\n replacement = template.expression.ast`(() => { ${blockBody} })()`;\n }\n\n path.replaceWith(\n t.classPrivateProperty(\n staticBlockRef,\n replacement,\n [],\n /* static */ true,\n ),\n );\n }\n },\n },\n };\n});\n"],"mappings":";;;;;;AAAA,IAAAA,kBAAA,GAAAC,OAAA;AAGA,IAAAC,gCAAA,GAAAD,OAAA;AAYA,SAASE,WAAWA,CAACC,KAAY,EAAEC,QAAqB,EAAE;EACxD,MAAMC,IAAI,GAAG,EAAE;EACf,IAAIC,GAAG;EACP,IAAIC,CAAC,GAAG,CAAC;EACT,GAAG;IACDD,GAAG,GAAG,IAAID,IAAI,EAAE;IAChB,IAAIE,CAAC,GAAG,CAAC,EAAED,GAAG,IAAIC,CAAC;IACnBA,CAAC,EAAE;EACL,CAAC,QAAQH,QAAQ,CAACI,GAAG,CAACF,GAAG,CAAC;EAC1B,OAAOA,GAAG;AACZ;AAAC,IAAAG,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEc,IAAAC,0BAAO,EAAC,CAAC;EAAEC,KAAK,EAAE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