diff options
| author | littleblack111 <littleblack11111@gmail.com> | 2024-08-30 17:21:18 +0800 |
|---|---|---|
| committer | littleblack111 <littleblack11111@gmail.com> | 2024-08-30 17:21:18 +0800 |
| commit | efbc2ffe6a1ee5ec38a4396305561d6515d0943e (patch) | |
| tree | 2b4c94f18f2c792dfda813050755d5c0273fae22 /node_modules/@babel/plugin-transform-function-name/lib/index.js | |
| parent | 43acceb75957c880a5ba5a31aae221394a36d5f6 (diff) | |
node fixes, updates
Diffstat (limited to 'node_modules/@babel/plugin-transform-function-name/lib/index.js')
| -rw-r--r-- | node_modules/@babel/plugin-transform-function-name/lib/index.js | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/node_modules/@babel/plugin-transform-function-name/lib/index.js b/node_modules/@babel/plugin-transform-function-name/lib/index.js index 16df763b..40e29f96 100644 --- a/node_modules/@babel/plugin-transform-function-name/lib/index.js +++ b/node_modules/@babel/plugin-transform-function-name/lib/index.js @@ -6,7 +6,6 @@ Object.defineProperty(exports, "__esModule", { exports.default = void 0; var _helperCompilationTargets = require("@babel/helper-compilation-targets"); var _helperPluginUtils = require("@babel/helper-plugin-utils"); -var _helperFunctionName = require("@babel/helper-function-name"); var _default = exports.default = (0, _helperPluginUtils.declare)(api => { api.assertVersion(7); const supportUnicodeId = !(0, _helperCompilationTargets.isRequired)("transform-unicode-escapes", api.targets()); @@ -16,16 +15,22 @@ var _default = exports.default = (0, _helperPluginUtils.declare)(api => { FunctionExpression: { exit(path) { if (path.key !== "value" && !path.parentPath.isObjectProperty()) { - const replacement = (0, _helperFunctionName.default)(path); - if (replacement) path.replaceWith(replacement); + { + var _path$ensureFunctionN; + (_path$ensureFunctionN = path.ensureFunctionName) != null ? _path$ensureFunctionN : path.ensureFunctionName = require("@babel/traverse").NodePath.prototype.ensureFunctionName; + } + path.ensureFunctionName(supportUnicodeId); } } }, ObjectProperty(path) { const value = path.get("value"); if (value.isFunction()) { - const newNode = (0, _helperFunctionName.default)(value, false, supportUnicodeId); - if (newNode) value.replaceWith(newNode); + { + var _value$ensureFunction; + (_value$ensureFunction = value.ensureFunctionName) != null ? _value$ensureFunction : value.ensureFunctionName = require("@babel/traverse").NodePath.prototype.ensureFunctionName; + } + value.ensureFunctionName(supportUnicodeId); } } } |
