Skip to content
This repository has been archived by the owner on Jun 2, 2022. It is now read-only.

Commit

Permalink
test: update test fixture to match acorn@5.7.2
Browse files Browse the repository at this point in the history
according to acornjs/acorn@3ffe903 and acornjs/acorn@2cd1d9a funtop-level functions are now considered as "lexical", so we cannot have vars with the same name
  • Loading branch information
shaimendel committed Apr 26, 2020
1 parent 919477e commit 4b5269a
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions test/method-detection.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,17 @@ test('test bootstrap +function method detection', function (t) {
test('test clashing variable/function declaration', function (t) {
const contents = `
var foo;
function foo() {
{
function foo() {
}
}
`;
const methods = ['foo'];
const found = ast.findAllVulnerableFunctionsInScript(
contents, methods,
);
t.same(sorted(Object.keys(found)), sorted(methods));
t.equal(found[methods[0]].start.line, 3, 'foo');
t.equal(found[methods[0]].start.line, 4, 'foo');
t.end();
});

Expand Down

0 comments on commit 4b5269a

Please sign in to comment.