-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Threat throw
same as function.
#3347
Comments
because |
To elaborate, |
There seems to be a difference between # Both lines compile.
foo throw bar, 42
baz or throw qux
# Neither of these lines compile.
foo return bar, 42
baz or return qux Given that that difference exists, couldn't we compile: (@onError or throw) new Error msg to: (this.onError || function(e) {
throw e;
})(new Error(msg)); ? And, would it make sense to do so? |
Then people will ask us to support |
@epidemian: I actually didn't know about that. I'm going to have to add that to CoffeeScriptRedux. |
Yes, right now throw is like a half expression, would be nice to make it as a plain expression. |
Throw in CS threat somehow similar to function, but this
(@onError|throw) new Error(msg)
doesn't compile, while
(@onError|@somethingOther) new Error(msg)
does.
The text was updated successfully, but these errors were encountered: