Skip to content

babili made variable lose #412

@lin-chao

Description

@lin-chao

Babili 0.0.11

Input:

let tabs = [1,2,3,4,5]
let tabIdx = 0

for (let i = 0; i < tabs.length; i++) {
  // do something
}

console.log({
  tabIdx: tabIdx
})

Output:

"use strict";
for (var tabs = [1, 2, 3, 4, 5], i = 0; i < tabs.length; i++);
console.log({
  tabIdx: tabIdx
});

can not find variable: tabIdx

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugConfirmed bugwith es2015The bug is caused when used with es2015-block-scoping plugin

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions