From f5c04bda5a4462678ae6996f6cd4557a9953bbdf Mon Sep 17 00:00:00 2001 From: XhmikosR Date: Tue, 2 Jun 2026 16:32:17 +0300 Subject: [PATCH 1/4] Update utils.js --- test/utils.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/utils.js b/test/utils.js index a99f346..e2b31df 100644 --- a/test/utils.js +++ b/test/utils.js @@ -3,7 +3,7 @@ import Walker from 'node-source-walk'; // Checks whether or not the checker succeeds on // a node in the AST of the given source code function check(code, checker, harmony) { - const walker = new Walker({ esprimaHarmony: Boolean(harmony) }); + const walker = new Walker(); let found = false; walker.walk(code, node => { From 53964da9edca1db8c740fdd57a3868fe21743fd7 Mon Sep 17 00:00:00 2001 From: XhmikosR Date: Thu, 13 Aug 2026 22:36:23 +0300 Subject: [PATCH 2/4] Update utils.js --- test/utils.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/utils.js b/test/utils.js index e2b31df..8beb6cc 100644 --- a/test/utils.js +++ b/test/utils.js @@ -2,7 +2,7 @@ import Walker from 'node-source-walk'; // Checks whether or not the checker succeeds on // a node in the AST of the given source code -function check(code, checker, harmony) { +function check(code, checker) { const walker = new Walker(); let found = false; From 792d7733838102c92eb48256b3ae6be19105082b Mon Sep 17 00:00:00 2001 From: XhmikosR Date: Thu, 13 Aug 2026 22:39:55 +0300 Subject: [PATCH 3/4] Update is-require.test.js --- test/is-require.test.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/is-require.test.js b/test/is-require.test.js index 9cf4bc5..0b69d0e 100644 --- a/test/is-require.test.js +++ b/test/is-require.test.js @@ -21,7 +21,7 @@ testSuite('detects top-level (i.e., top of file) require function calls', () => testSuite('does not fail on es6', () => { assert.not.throws(() => { - check('import require from "mylib"; \nrequire();', isTopLevelRequire, true); + check('import require from "mylib"; \nrequire();', isTopLevelRequire); }); }); From 3ab8d881e3c4fe4b14d21940046a4a038da7add6 Mon Sep 17 00:00:00 2001 From: XhmikosR Date: Thu, 13 Aug 2026 22:40:15 +0300 Subject: [PATCH 4/4] Update es6.test.js --- test/es6.test.js | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/test/es6.test.js b/test/es6.test.js index b49c204..a0ceaeb 100644 --- a/test/es6.test.js +++ b/test/es6.test.js @@ -6,24 +6,24 @@ import check from './utils.js'; const testSuite = suite('module-types'); testSuite('detects es6 imports', () => { - assert.ok(check('import {foo, bar} from "mylib";', isES6Import, true)); - assert.ok(check('import * as foo from "mod.js";', isES6Import, true)); - assert.ok(check('import "mylib2";', isES6Import, true)); - assert.ok(check('import foo from "mod.js";', isES6Import, true)); - assert.ok(check('import("foo");', isES6Import, true)); + assert.ok(check('import {foo, bar} from "mylib";', isES6Import)); + assert.ok(check('import * as foo from "mod.js";', isES6Import)); + assert.ok(check('import "mylib2";', isES6Import)); + assert.ok(check('import foo from "mod.js";', isES6Import)); + assert.ok(check('import("foo");', isES6Import)); }); testSuite('detects es6 exports', () => { - assert.ok(check('export default 123;', isES6Export, true)); - assert.ok(check('export {foo, bar}; function foo() {} function bar() {}', isES6Export, true)); - assert.ok(check('export { D as default }; class D {}', isES6Export, true)); - assert.ok(check('export function inc() { counter++; }', isES6Export, true)); - assert.ok(check('export * from "mod";', isES6Export, true)); + assert.ok(check('export default 123;', isES6Export)); + assert.ok(check('export {foo, bar}; function foo() {} function bar() {}', isES6Export)); + assert.ok(check('export { D as default }; class D {}', isES6Export)); + assert.ok(check('export function inc() { counter++; }', isES6Export)); + assert.ok(check('export * from "mod";', isES6Export)); }); testSuite('detects dynamic imports', () => { - assert.ok(check('import("./bar");', isDynamicImport, true)); - assert.ok(check('function foo() { import("./bar"); }', isDynamicImport, true)); + assert.ok(check('import("./bar");', isDynamicImport)); + assert.ok(check('function foo() { import("./bar"); }', isDynamicImport)); }); testSuite.run();