-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
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
Support for throw expressions #6605
Comments
|
const a = true ? throw 'true' : throw Error('false') causes the same issue. |
Sorry. My bad! I thought you were just mistaking throw statements and was really confused why you added this to the ES2015 & 2016 meta-issue. |
Not sure if that's the same issue, but I come upon the same error message when using this (I don't believe that being in a constructor has any effect on it, probably any context would be the same, but it's how I encounter it):
I use this because I find it nice, and because I want to prevent an object from being instantiated if some values are not present in the environment. There are more verbose ways to achieve that that do not throw flow off, but I would find it neat to keep it that way! |
causes
Unexpected token throw
.https://github.com/tc39/proposal-throw-expressions (stage 2)
The text was updated successfully, but these errors were encountered: