Sha256: 0e97c66bade3f362fa7fb02bec381d9299a7b720dbe51fa69bd8c952a86f2fec

Contents?: true

Size: 1000 Bytes

Versions: 1

Compression:

Stored size: 1000 Bytes

Contents

# @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)

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
condenser-0.0.4 lib/condenser/processors/node_modules/@babel/plugin-proposal-optional-catch-binding/README.md