Minify: Array destructuring issue

Created on 30 Jun 2017  路  3Comments  路  Source: babel/minify

This is very similar to #151 and is occurring on the current master version.

Input

function foo(arg) {
    const {
        x: [x],
        y: [y],
    } = arg;
    return x;
}

Output

function foo(a){return b}

REPL

Compared with the following correct behaviour:

Input

function foo(arg) {
    const {
        x: [x],
        y: [y],
    } = arg;
    return x + y;
}

Output

function foo(a){const{x:[b],y:[c]}=a;return b+c}

REPL

bug

All 3 comments

Interesting. Thanks. Looks like a bug in DCE. Will try this.

Fixed by #622

Confirmed, my test cases are now working.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

curiousdannii picture curiousdannii  路  3Comments

developit picture developit  路  5Comments

boopathi picture boopathi  路  3Comments

kristianmandrup picture kristianmandrup  路  6Comments

kangax picture kangax  路  4Comments