We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
try..catch
Feature request
Remove exception value in try..catch, if it's not used.
function isValidJSON(text) { try { JSON.parse(text); return true; - } catch (error) { + } catch { return false; } }
The text was updated successfully, but these errors were encountered:
Good idea :) Optional catch binding is an ES2019 feature, so would need to be gated behind ecma: 2019 or higher: https://compat-table.github.io/compat-table/es2016plus/ https://caniuse.com/mdn-javascript_statements_try_catch_optional_catch_binding
ecma: 2019
Sorry, something went wrong.
The ecma option is poorly understood, so I believe it could catch some people by surprise. I think a new option is needed, defaulted to false.
ecma
catch
No branches or pull requests
Feature request
Remove exception value in
try..catch
, if it's not used.The text was updated successfully, but these errors were encountered: