From 4b5269a9145c1a29a0153e4eea5a56fdb24e7d46 Mon Sep 17 00:00:00 2001 From: Shai Mendel Date: Sun, 26 Apr 2020 11:57:17 +0300 Subject: [PATCH] test: update test fixture to match acorn@5.7.2 according to https://github.com/acornjs/acorn/commit/3ffe903587b3cf10ef919e78c68324d938561f22 and https://github.com/acornjs/acorn/commit/2cd1d9af47eaeadca4e7428c66dd87fe43d7f4f2 funtop-level functions are now considered as "lexical", so we cannot have vars with the same name --- test/method-detection.test.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/test/method-detection.test.js b/test/method-detection.test.js index 3f71b40..b84d77b 100644 --- a/test/method-detection.test.js +++ b/test/method-detection.test.js @@ -27,7 +27,9 @@ 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']; @@ -35,7 +37,7 @@ function foo() { 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(); });