-
Notifications
You must be signed in to change notification settings - Fork 2k
Feature Request: Self-Executing Anonymous Functions (with variable aliasing) #2235
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
Labels
Comments
Nope. do ($ = jQuery, exports = window) ->
# doing random stuff here |
FYI, that code won't work. |
@jashkenas: what do you mean by that? It works. Compile it. |
do ($ = jQuery, exports = window) ->
#stuff compiled is (function($, exports) {
if ($ == null) $ = jQuery;
if (exports == null) exports = window;
})($, exports); |
Not for me...
|
Oh, lovely -- it's improved on master then, and'll go out with the next release. |
Sweet! feature request achieved! :P |
See #960 for this change. It's one of the earlier commits in the set of commits since the last release. |
Closed
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I have been looking around to see if it already exists, but I can't find anything. I was hoping for some syntactic sugar for self-executing anonymous functions with variable aliasing.
Right now, to get this:
We have to do this:
This seems like extra work given that functions have been reduced to
->
and self-executing functions todo ->
The text was updated successfully, but these errors were encountered: