add mocha test for issue #1299 (uses_arguments)

This commit is contained in:
Jann Horn 2016-10-14 19:23:34 +02:00
parent 83b124f0d6
commit 8614c7b814

View File

@ -19,4 +19,12 @@ describe("arguments", function() {
value // Select function as scope value // Select function as scope
); );
}); });
it("Should recognize when a function uses arguments", function() {
var ast = UglifyJS.parse("function a(){function b(){function c(){}; return arguments[0];}}");
ast.figure_out_scope();
assert.strictEqual(ast.body[0].uses_arguments, false);
assert.strictEqual(ast.body[0].body[0].uses_arguments, true);
assert.strictEqual(ast.body[0].body[0].body[0].uses_arguments, false);
});
}); });