support all loops when adding declarations - #779

This commit is contained in:
Sebastian McKenzie
2015-02-15 10:27:56 +11:00
parent 2d3b595a8b
commit e05aed0394

View File

@@ -526,7 +526,7 @@ Scope.prototype.crawl = function () {
Scope.prototype.push = function (opts) {
var block = this.block;
if (t.isFor(block) || t.isCatchClause(block) || t.isFunction(block)) {
if (t.isLoop(block) || t.isCatchClause(block) || t.isFunction(block)) {
t.ensureBlock(block);
block = block.body;
}