From fc87c009806dcc98867f6b58efe29b042aa01dee Mon Sep 17 00:00:00 2001 From: littleblack111 Date: Mon, 18 May 2026 23:10:59 +0800 Subject: node: update --- .../transform-safari-for-shadowing/index.js | 42 ---------------------- 1 file changed, 42 deletions(-) delete mode 100644 node_modules/@babel/preset-modules/lib/plugins/transform-safari-for-shadowing/index.js (limited to 'node_modules/@babel/preset-modules/lib/plugins/transform-safari-for-shadowing') diff --git a/node_modules/@babel/preset-modules/lib/plugins/transform-safari-for-shadowing/index.js b/node_modules/@babel/preset-modules/lib/plugins/transform-safari-for-shadowing/index.js deleted file mode 100644 index 43c33e5b..00000000 --- a/node_modules/@babel/preset-modules/lib/plugins/transform-safari-for-shadowing/index.js +++ /dev/null @@ -1,42 +0,0 @@ -"use strict"; - -exports.__esModule = true; -exports.default = void 0; - -/** - * Safari ~11 has an issue where variable declarations in a For statement throw if they shadow parameters. - * This is fixed by renaming any declarations in the left/init part of a For* statement so they don't shadow. - * @see https://bugs.webkit.org/show_bug.cgi?id=171041 - * - * @example - * e => { for (let e of []) e } // throws - * e => { for (let _e of []) _e } // works - */ -function handle(declaration) { - if (!declaration.isVariableDeclaration()) return; - const fn = declaration.getFunctionParent(); - const { - name - } = declaration.node.declarations[0].id; // check if there is a shadowed binding coming from a parameter - - if (fn && fn.scope.hasOwnBinding(name) && fn.scope.getOwnBinding(name).kind === "param") { - declaration.scope.rename(name); - } -} - -var _default = () => ({ - name: "transform-safari-for-shadowing", - visitor: { - ForXStatement(path) { - handle(path.get("left")); - }, - - ForStatement(path) { - handle(path.get("init")); - } - - } -}); - -exports.default = _default; -module.exports = exports.default; \ No newline at end of file -- cgit v1.2.3