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

"a?b():c()" should be "(a?b:c)()" #519

Open
wants to merge 25 commits into
base: master
Choose a base branch
from
Open

"a?b():c()" should be "(a?b:c)()" #519

wants to merge 25 commits into from

Conversation

KSXGitHub
Copy link

Here's an example:
The origin:

    function test(condition, func1, func2, arg1, arg2) {
        if (condition) {
            return func1(arg1, arg2);
        } else {
            return func2(arg1, arg2);
        }
    }

What I expect is:

    function test(a,b,c,d,e){return(a?b:c)(d,e)}

But what the tool gives me is ((t,u) is uneccessary repeated 2 times):

   function main(n,i,r,t,u){return n?i(t,u):r(t,u)}

@zhanhb
Copy link

zhanhb commented Sep 8, 2015

I guess uglify won't fix this.

@rvanvelzen
Copy link
Contributor

Sorry, I can't really see what this should do. Please rebase onto master and send in a new PR.

(Edit: disregard that, this project is no longer maintained)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants