Skip to content

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

Open
KSXGitHub wants to merge 25 commits into
masterfrom
macros
Open

"a?b():c()" should be "(a?b:c)()"#519
KSXGitHub wants to merge 25 commits into
masterfrom
macros

Conversation

@KSXGitHub

Copy link
Copy Markdown

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

zhanhb commented Sep 8, 2015

Copy link
Copy Markdown

I guess uglify won't fix this.

@rvanvelzen

Copy link
Copy Markdown
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