Skip to content
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

Catch 22 #749

Closed
jescalan opened this issue Jan 17, 2017 · 1 comment

Comments

@jescalan
Copy link

commented Jan 17, 2017

If you run the following code:

true ? 'hello' : (function () { return 'hi' }).call()

Standard will warn you that you have "Gratuitous parentheses around expression". However, if you remove the parens, it will warn you to "Wrap an immediate function invocation in parentheses".

Is there any way out of this?

While the code example is silly, it was meant to be for simplification. I am actually running an expression like this with real code, promise.

@feross

This comment has been minimized.

Copy link
Member

commented Jan 18, 2017

This works:

true ? 'hello' : (function () { return 'hi' }.call())

@feross feross closed this Jan 18, 2017

@dcousens dcousens added the question label Jan 18, 2017

@lock lock bot locked as resolved and limited conversation to collaborators May 10, 2018

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
3 participants
You can’t perform that action at this time.