Fix uses_with/uses_eval/directives state in block scope

This commit is contained in:
Anthony Van de Gejuchte
2016-07-01 15:36:38 +02:00
parent fb2f8d1a51
commit d8d4e71b9e
2 changed files with 13 additions and 1 deletions

View File

@@ -13,4 +13,11 @@ describe("With", function() {
}
assert.throws(test, error);
});
});
it("Should set uses_with for scopes involving With statements", function() {
var ast = uglify.parse("with(e) {f(1, 2)}");
ast.figure_out_scope();
assert.equal(ast.uses_with, true);
assert.equal(ast.body[0].expression.scope.uses_with, true);
assert.equal(ast.body[0].body.body[0].body.expression.scope.uses_with, true);
});
});