From 8614c7b814cbfddc7bd996ef19d4a43d0092f981 Mon Sep 17 00:00:00 2001 From: Jann Horn Date: Fri, 14 Oct 2016 19:23:34 +0200 Subject: [PATCH] add mocha test for issue #1299 (uses_arguments) --- test/mocha/arguments.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/test/mocha/arguments.js b/test/mocha/arguments.js index 089826fc..73993a73 100644 --- a/test/mocha/arguments.js +++ b/test/mocha/arguments.js @@ -19,4 +19,12 @@ describe("arguments", function() { 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); + }); }); \ No newline at end of file