bublejs / buble

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

Fix/null init forstatement #226

Closed vitorveiga closed 4 years ago

vitorveiga commented 4 years ago

Exception transpiling the following snippet

for (; idx < sw.tabs.length;) {
    let t = sw.tabs[idx];
    if (!newTabs.find(nt => nt._id === t._id)) {
        updateWindowFromBg({action: 'tabRemoved', tid: t._id, wid: sw._id, id: ++eventId});
    } else {
        idx++;
    }
}

Error TypeError: Cannot read property 'type' of null

vitorveiga commented 4 years ago

Hi @vitorveiga, thanks a lot for the fix with tests! Could you please rebase the PR so that it only contains the change in the title (other changes are in another PR)?

Sure!