diff options
| author | littleblack111 <littleblack11111@gmail.com> | 2026-05-18 23:10:59 +0800 |
|---|---|---|
| committer | littleblack111 <littleblack11111@gmail.com> | 2026-05-18 23:41:44 +0800 |
| commit | fc87c009806dcc98867f6b58efe29b042aa01dee (patch) | |
| tree | 8f59b3f4a5b66e9dfef2d40c8d318e258a521228 /node_modules/@babel/helper-define-polyfill-provider/lib/visitors | |
| parent | 3336b2356ee6152d9c6ae59bd9b87ccbc0958407 (diff) | |
node: updatemain
Diffstat (limited to 'node_modules/@babel/helper-define-polyfill-provider/lib/visitors')
3 files changed, 0 insertions, 164 deletions
diff --git a/node_modules/@babel/helper-define-polyfill-provider/lib/visitors/entry.js b/node_modules/@babel/helper-define-polyfill-provider/lib/visitors/entry.js deleted file mode 100644 index e8b09030..00000000 --- a/node_modules/@babel/helper-define-polyfill-provider/lib/visitors/entry.js +++ /dev/null @@ -1,26 +0,0 @@ -"use strict"; - -exports.__esModule = true; -exports.default = void 0; -var _utils = require("../utils"); -var _default = callProvider => ({ - ImportDeclaration(path) { - const source = (0, _utils.getImportSource)(path); - if (!source) return; - callProvider({ - kind: "import", - source - }, path); - }, - Program(path) { - path.get("body").forEach(bodyPath => { - const source = (0, _utils.getRequireSource)(bodyPath); - if (!source) return; - callProvider({ - kind: "import", - source - }, bodyPath); - }); - } -}); -exports.default = _default;
\ No newline at end of file diff --git a/node_modules/@babel/helper-define-polyfill-provider/lib/visitors/index.js b/node_modules/@babel/helper-define-polyfill-provider/lib/visitors/index.js deleted file mode 100644 index 056559b9..00000000 --- a/node_modules/@babel/helper-define-polyfill-provider/lib/visitors/index.js +++ /dev/null @@ -1,9 +0,0 @@ -"use strict"; - -exports.__esModule = true; -exports.usage = exports.entry = void 0; -var _usage = _interopRequireDefault(require("./usage")); -exports.usage = _usage.default; -var _entry = _interopRequireDefault(require("./entry")); -exports.entry = _entry.default; -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
\ No newline at end of file diff --git a/node_modules/@babel/helper-define-polyfill-provider/lib/visitors/usage.js b/node_modules/@babel/helper-define-polyfill-provider/lib/visitors/usage.js deleted file mode 100644 index 77def9f8..00000000 --- a/node_modules/@babel/helper-define-polyfill-provider/lib/visitors/usage.js +++ /dev/null @@ -1,129 +0,0 @@ -"use strict"; - -exports.__esModule = true; -exports.default = void 0; -var _utils = require("../utils"); -function isRemoved(path) { - if (path.removed) return true; - if (!path.parentPath) return false; - if (path.listKey) { - var _path$parentPath$node; - if (!((_path$parentPath$node = path.parentPath.node) != null && (_path$parentPath$node = _path$parentPath$node[path.listKey]) != null && _path$parentPath$node.includes(path.node))) return true; - } else { - if (path.parentPath.node[path.key] !== path.node) return true; - } - return isRemoved(path.parentPath); -} -var _default = callProvider => { - function property(object, key, placement, path) { - return callProvider({ - kind: "property", - object, - key, - placement - }, path); - } - function handleReferencedIdentifier(path) { - const { - node: { - name - }, - scope - } = path; - if (scope.getBindingIdentifier(name)) return; - callProvider({ - kind: "global", - name - }, path); - } - function analyzeMemberExpression(path) { - const key = (0, _utils.resolveKey)(path.get("property"), path.node.computed); - return { - key, - handleAsMemberExpression: !!key && key !== "prototype" - }; - } - return { - // Symbol(), new Promise - ReferencedIdentifier(path) { - const { - parentPath - } = path; - if (parentPath.isMemberExpression({ - object: path.node - }) && analyzeMemberExpression(parentPath).handleAsMemberExpression) { - return; - } - handleReferencedIdentifier(path); - }, - MemberExpression(path) { - const { - key, - handleAsMemberExpression - } = analyzeMemberExpression(path); - if (!handleAsMemberExpression) return; - const object = path.get("object"); - let objectIsGlobalIdentifier = object.isIdentifier(); - if (objectIsGlobalIdentifier) { - const binding = object.scope.getBinding(object.node.name); - if (binding) { - if (binding.path.isImportNamespaceSpecifier()) return; - objectIsGlobalIdentifier = false; - } - } - const source = (0, _utils.resolveSource)(object); - let skipObject = property(source.id, key, source.placement, path); - skipObject || (skipObject = !objectIsGlobalIdentifier || path.shouldSkip || object.shouldSkip || isRemoved(object)); - if (!skipObject) handleReferencedIdentifier(object); - }, - ObjectPattern(path) { - const { - parentPath, - parent - } = path; - let obj; - - // const { keys, values } = Object - if (parentPath.isVariableDeclarator()) { - obj = parentPath.get("init"); - // ({ keys, values } = Object) - } else if (parentPath.isAssignmentExpression()) { - obj = parentPath.get("right"); - // !function ({ keys, values }) {...} (Object) - // resolution does not work after properties transform :-( - } else if (parentPath.isFunction()) { - const grand = parentPath.parentPath; - if (grand.isCallExpression() || grand.isNewExpression()) { - if (grand.node.callee === parent) { - obj = grand.get("arguments")[path.key]; - } - } - } - let id = null; - let placement = null; - if (obj) ({ - id, - placement - } = (0, _utils.resolveSource)(obj)); - for (const prop of path.get("properties")) { - if (prop.isObjectProperty()) { - const key = (0, _utils.resolveKey)(prop.get("key")); - if (key) property(id, key, placement, prop); - } - } - }, - BinaryExpression(path) { - if (path.node.operator !== "in") return; - const source = (0, _utils.resolveSource)(path.get("right")); - const key = (0, _utils.resolveKey)(path.get("left"), true); - if (!key) return; - callProvider({ - kind: "in", - object: source.id, - key, - placement: source.placement - }, path); - } - }; -}; -exports.default = _default;
\ No newline at end of file |
