fix uses_arguments handling (broken since 6605d15783)
Using the symbol declaration tracking of UglifyJS doesn't make sense here anyway, `arguments` always comes from something in the current scope. fixes #1299
This commit is contained in:
committed by
Richard van Velzen
parent
e51c6ba380
commit
266ddd9639
@@ -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);
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user