use block scoped variables in es6.blockScoping transformer

This commit is contained in:
Sebastian McKenzie 2015-05-09 01:25:36 +01:00
parent a75af0a5d2
commit 9b949e574f

View File

@ -468,18 +468,17 @@ class BlockScoping {
var block = this.block;
var declarators = block._letDeclarators || [];
var declar;
//
for (let i = 0; i < declarators.length; i++) {
declar = declarators[i];
let declar = declarators[i];
extend(this.outsideLetReferences, t.getBindingIdentifiers(declar));
}
//
if (block.body) {
for (let i = 0; i < block.body.length; i++) {
declar = block.body[i];
let declar = block.body[i];
if (isLet(declar, block)) {
declarators = declarators.concat(declar.declarations);
}
@ -488,7 +487,7 @@ class BlockScoping {
//
for (let i = 0; i < declarators.length; i++) {
declar = declarators[i];
let declar = declarators[i];
var keys = t.getBindingIdentifiers(declar);
extend(this.letReferences, keys);
this.hasLetReferences = true;