retrofit AST_BlockStatement as block-scoped (#4177)

This commit is contained in:
Alex Lam S.L
2020-10-04 18:58:50 +01:00
committed by GitHub
parent 58ac5b9bd5
commit f9946767c9
6 changed files with 104 additions and 59 deletions

View File

@@ -17,7 +17,7 @@ describe("With", function() {
var ast = UglifyJS.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);
assert.equal(ast.body[0].expression.scope.resolve().uses_with, true);
assert.equal(ast.body[0].body.body[0].body.expression.scope.resolve().uses_with, true);
});
});