Package Exports
- @babel/plugin-proposal-optional-catch-binding
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@babel/plugin-proposal-optional-catch-binding) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
@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
try {
throw 0;
} catch {
doSomethingWhichDoesntCareAboutTheValueThrown();
}
try {
throw 0;
} catch {
doSomethingWhichDoesntCareAboutTheValueThrown();
} finally {
doSomeCleanup();
}
Installation
npm install --save-dev @babel/plugin-proposal-optional-catch-binding
Usage
Via .babelrc
(Recommended)
.babelrc
{
"plugins": ["@babel/plugin-proposal-optional-catch-binding"]
}
Via CLI
babel --plugins @babel/plugin-proposal-optional-catch-binding script.js
Via Node API
require("@babel/core").transform("code", {
plugins: ["@babel/plugin-proposal-optional-catch-binding"]
});