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-plugin-minify-infinity/lib/index.js | |
| parent | 3336b2356ee6152d9c6ae59bd9b87ccbc0958407 (diff) | |
node: updatemain
Diffstat (limited to 'node_modules/babel-plugin-minify-infinity/lib/index.js')
| -rw-r--r-- | node_modules/babel-plugin-minify-infinity/lib/index.js | 44 |
1 files changed, 0 insertions, 44 deletions
diff --git a/node_modules/babel-plugin-minify-infinity/lib/index.js b/node_modules/babel-plugin-minify-infinity/lib/index.js deleted file mode 100644 index b4a87ad5..00000000 --- a/node_modules/babel-plugin-minify-infinity/lib/index.js +++ /dev/null @@ -1,44 +0,0 @@ -"use strict"; - -module.exports = function ({ - types: t -}) { - const INFINITY = t.binaryExpression("/", t.numericLiteral(1), t.numericLiteral(0)); - return { - name: "minify-infinity", - visitor: { - // Infinity -> 1 / 0 - Identifier(path) { - if (path.node.name !== "Infinity") { - return; - } // It's a referenced identifier - - - if (path.scope.getBinding("Infinity")) { - return; - } - - if (path.parentPath.isObjectProperty({ - key: path.node - })) { - return; - } - - if (path.parentPath.isMemberExpression()) { - return; - } - - const bindingIds = path.parentPath.getBindingIdentifierPaths(); - - if (bindingIds["Infinity"] === path && // ObjectProperty is common for ObjectExpression and ObjectPattern and only - // one of them is a Binding, the other is simply a reference - !path.parentPath.parentPath.isObjectExpression()) { - return; - } - - path.replaceWith(INFINITY); - } - - } - }; -};
\ No newline at end of file |
