@babel/plugin-transform-optional-catch-binding 7.28.6 → 7.29.17

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/index.js CHANGED
@@ -14,8 +14,8 @@ var _default = exports.default = (0, _helperPluginUtils.declare)(api => {
14
14
  CatchClause(path) {
15
15
  if (!path.node.param) {
16
16
  const uid = path.scope.generateUidIdentifier("unused");
17
- const paramPath = path.get("param");
18
- paramPath.replaceWith(uid);
17
+ const [paramPath] = path.get("param").replaceWith(uid);
18
+ path.scope.registerBinding("let", paramPath, path);
19
19
  }
20
20
  }
21
21
  }
package/lib/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"names":["_helperPluginUtils","require","_default","exports","default","declare","api","assertVersion","name","manipulateOptions","_","parser","plugins","push","visitor","CatchClause","path","node","param","uid","scope","generateUidIdentifier","paramPath","get","replaceWith"],"sources":["../src/index.ts"],"sourcesContent":["import { declare } from \"@babel/helper-plugin-utils\";\n\nexport default declare(api => {\n api.assertVersion(REQUIRED_VERSION(\"^7.0.0-0 || ^8.0.0-0\"));\n\n return {\n name: \"transform-optional-catch-binding\",\n manipulateOptions: process.env.BABEL_8_BREAKING\n ? undefined\n : (_, parser) => parser.plugins.push(\"optionalCatchBinding\"),\n\n visitor: {\n CatchClause(path) {\n if (!path.node.param) {\n const uid = path.scope.generateUidIdentifier(\"unused\");\n const paramPath = path.get(\"param\");\n paramPath.replaceWith(uid);\n }\n },\n },\n };\n});\n"],"mappings":";;;;;;AAAA,IAAAA,kBAAA,GAAAC,OAAA;AAAqD,IAAAC,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEtC,IAAAC,0BAAO,EAACC,GAAG,IAAI;EAC5BA,GAAG,CAACC,aAAa,mDAAyC,CAAC;EAE3D,OAAO;IACLC,IAAI,EAAE,kCAAkC;IACxCC,iBAAiB,EAEbA,CAACC,CAAC,EAAEC,MAAM,KAAKA,MAAM,CAACC,OAAO,CAACC,IAAI,CAAC,sBAAsB,CAAC;IAE9DC,OAAO,EAAE;MACPC,WAAWA,CAACC,IAAI,EAAE;QAChB,IAAI,CAACA,IAAI,CAACC,IAAI,CAACC,KAAK,EAAE;UACpB,MAAMC,GAAG,GAAGH,IAAI,CAACI,KAAK,CAACC,qBAAqB,CAAC,QAAQ,CAAC;UACtD,MAAMC,SAAS,GAAGN,IAAI,CAACO,GAAG,CAAC,OAAO,CAAC;UACnCD,SAAS,CAACE,WAAW,CAACL,GAAG,CAAC;QAC5B;MACF;IACF;EACF,CAAC;AACH,CAAC,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["_helperPluginUtils","require","_default","exports","default","declare","api","assertVersion","name","manipulateOptions","_","parser","plugins","push","visitor","CatchClause","path","node","param","uid","scope","generateUidIdentifier","paramPath","get","replaceWith","registerBinding"],"sources":["../src/index.ts"],"sourcesContent":["import { declare } from \"@babel/helper-plugin-utils\";\n\nexport default declare(api => {\n api.assertVersion(REQUIRED_VERSION(\"^7.0.0-0 || ^8.0.0-0\"));\n\n return {\n name: \"transform-optional-catch-binding\",\n manipulateOptions: process.env.BABEL_8_BREAKING\n ? undefined\n : (_, parser) => parser.plugins.push(\"optionalCatchBinding\"),\n\n visitor: {\n CatchClause(path) {\n if (!path.node.param) {\n const uid = path.scope.generateUidIdentifier(\"unused\");\n const [paramPath] = path.get(\"param\").replaceWith(uid);\n path.scope.registerBinding(\"let\", paramPath, path);\n }\n },\n },\n };\n});\n"],"mappings":";;;;;;AAAA,IAAAA,kBAAA,GAAAC,OAAA;AAAqD,IAAAC,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEtC,IAAAC,0BAAO,EAACC,GAAG,IAAI;EAC5BA,GAAG,CAACC,aAAa,mDAAyC,CAAC;EAE3D,OAAO;IACLC,IAAI,EAAE,kCAAkC;IACxCC,iBAAiB,EAEbA,CAACC,CAAC,EAAEC,MAAM,KAAKA,MAAM,CAACC,OAAO,CAACC,IAAI,CAAC,sBAAsB,CAAC;IAE9DC,OAAO,EAAE;MACPC,WAAWA,CAACC,IAAI,EAAE;QAChB,IAAI,CAACA,IAAI,CAACC,IAAI,CAACC,KAAK,EAAE;UACpB,MAAMC,GAAG,GAAGH,IAAI,CAACI,KAAK,CAACC,qBAAqB,CAAC,QAAQ,CAAC;UACtD,MAAM,CAACC,SAAS,CAAC,GAAGN,IAAI,CAACO,GAAG,CAAC,OAAO,CAAC,CAACC,WAAW,CAACL,GAAG,CAAC;UACtDH,IAAI,CAACI,KAAK,CAACK,eAAe,CAAC,KAAK,EAAEH,SAAS,EAAEN,IAAI,CAAC;QACpD;MACF;IACF;EACF,CAAC;AACH,CAAC,CAAC","ignoreList":[]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@babel/plugin-transform-optional-catch-binding",
3
- "version": "7.28.6",
3
+ "version": "7.29.17",
4
4
  "description": "Compile optional catch bindings",
5
5
  "repository": {
6
6
  "type": "git",
@@ -17,14 +17,14 @@
17
17
  "babel-plugin"
18
18
  ],
19
19
  "dependencies": {
20
- "@babel/helper-plugin-utils": "^7.28.6"
20
+ "@babel/helper-plugin-utils": "^7.29.17"
21
21
  },
22
22
  "peerDependencies": {
23
23
  "@babel/core": "^7.0.0-0"
24
24
  },
25
25
  "devDependencies": {
26
- "@babel/core": "^7.28.6",
27
- "@babel/helper-plugin-test-runner": "^7.27.1"
26
+ "@babel/core": "^7.29.17",
27
+ "@babel/helper-plugin-test-runner": "^7.29.17"
28
28
  },
29
29
  "engines": {
30
30
  "node": ">=6.9.0"