bublejs / buble

https://buble.surge.sh
MIT License
869 stars 67 forks source link

Wrong variable name in block scope #273

Open zippy84 opened 3 years ago

zippy84 commented 3 years ago

The following code

const pts = [];
{
    const pts = [];
    pts.push(...[1,2,3]);
}

will be transformed into

var pts = [];
{
    var pts$1 = [];
    pts$1.push.apply(pts, [1,2,3]);
}

The first argument of apply is wrong. It should be pts$1.push.apply(pts$1, [1,2,3]);