Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Allow to use `(callback || throw)(error)`. #2909

Closed
alexeypetrushin opened this Issue · 4 comments

5 participants

Alexey Petrushin Michael Ficarra Jeremy Ashkenas René Kooi ven
Alexey Petrushin

Currently it's not compiled.

Michael Ficarra
Collaborator
throws = (e) -> throw e
(cb or throws) error
Jeremy Ashkenas
Owner

Yep, it's a keyword.

Jeremy Ashkenas jashkenas closed this
René Kooi

I think the proposal is for a compilation such as this:

callback(error) || throw(error);

Like in LiveScript

(But that's a bit overkill.)

ven
Collaborator

Please note that callable binary ops in LiveScript are unstable, meant for match (and doesn't apply to throw since it's a keyword).

(a || b) c => a(c) || b(c), which some people might find confusing. (you basically have to do [a || b]0 which is pretty bad; ((a || b)) doesn't work)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.