diff options
Diffstat (limited to 'node_modules/@babel/plugin-proposal-optional-catch-binding')
3 files changed, 0 insertions, 129 deletions
diff --git a/node_modules/@babel/plugin-proposal-optional-catch-binding/README.md b/node_modules/@babel/plugin-proposal-optional-catch-binding/README.md deleted file mode 100644 index e06eb65d..00000000 --- a/node_modules/@babel/plugin-proposal-optional-catch-binding/README.md +++ /dev/null @@ -1,60 +0,0 @@ -# @babel/plugin-proposal-optional-catch-binding - -> Optional catch binding enables the catch block to execute whether or not an argument is passed to the catch statement (CatchClause). - - -## Examples - -```js -try { - throw 0; -} catch { - doSomethingWhichDoesntCareAboutTheValueThrown(); -} -``` - -```js -try { - throw 0; -} catch { - doSomethingWhichDoesntCareAboutTheValueThrown(); -} finally { - doSomeCleanup(); -} -``` - - -## Installation - -```sh -npm install --save-dev @babel/plugin-proposal-optional-catch-binding -``` - -## Usage - -### Via `.babelrc` (Recommended) - -**.babelrc** - -```json -{ - "plugins": ["@babel/plugin-proposal-optional-catch-binding"] -} -``` - -### Via CLI - -```sh -babel --plugins @babel/plugin-proposal-optional-catch-binding script.js -``` - -### Via Node API - -```javascript -require("@babel/core").transform("code", { - plugins: ["@babel/plugin-proposal-optional-catch-binding"] -}); -``` - -## References -- [Proposal: Optional Catch Binding for ECMAScript](https://github.com/babel/proposals/issues/7) diff --git a/node_modules/@babel/plugin-proposal-optional-catch-binding/lib/index.js b/node_modules/@babel/plugin-proposal-optional-catch-binding/lib/index.js deleted file mode 100644 index e87c22c4..00000000 --- a/node_modules/@babel/plugin-proposal-optional-catch-binding/lib/index.js +++ /dev/null @@ -1,47 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = void 0; - -function _helperPluginUtils() { - const data = require("@babel/helper-plugin-utils"); - - _helperPluginUtils = function _helperPluginUtils() { - return data; - }; - - return data; -} - -function _pluginSyntaxOptionalCatchBinding() { - const data = _interopRequireDefault(require("@babel/plugin-syntax-optional-catch-binding")); - - _pluginSyntaxOptionalCatchBinding = function _pluginSyntaxOptionalCatchBinding() { - return data; - }; - - return data; -} - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -var _default = (0, _helperPluginUtils().declare)(api => { - api.assertVersion(7); - return { - inherits: _pluginSyntaxOptionalCatchBinding().default, - visitor: { - CatchClause(path) { - if (!path.node.param) { - const uid = path.scope.generateUidIdentifier("unused"); - const paramPath = path.get("param"); - paramPath.replaceWith(uid); - } - } - - } - }; -}); - -exports.default = _default;
\ No newline at end of file diff --git a/node_modules/@babel/plugin-proposal-optional-catch-binding/package.json b/node_modules/@babel/plugin-proposal-optional-catch-binding/package.json deleted file mode 100644 index 9ea865ea..00000000 --- a/node_modules/@babel/plugin-proposal-optional-catch-binding/package.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "name": "@babel/plugin-proposal-optional-catch-binding", - "version": "7.0.0-beta.47", - "description": "Compile optional catch bindings", - "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-proposal-optional-catch-binding", - "license": "MIT", - "main": "lib/index.js", - "keywords": [ - "babel-plugin" - ], - "dependencies": { - "@babel/helper-plugin-utils": "7.0.0-beta.47", - "@babel/plugin-syntax-optional-catch-binding": "7.0.0-beta.47" - }, - "peerDependencies": { - "@babel/core": "7.0.0-beta.47" - }, - "devDependencies": { - "@babel/core": "7.0.0-beta.47", - "@babel/helper-plugin-test-runner": "7.0.0-beta.47" - } -} |
