Skip to content

chore: remove redundant 'use strict' from test files - #64

Merged
legendecas merged 2 commits into
nodejs:mainfrom
hexbinoct:hexbinoct/remove-redundant-use-strict
Jul 31, 2026
Merged

chore: remove redundant 'use strict' from test files#64
legendecas merged 2 commits into
nodejs:mainfrom
hexbinoct:hexbinoct/remove-redundant-use-strict

Conversation

@hexbinoct

Copy link
Copy Markdown
Contributor

Closes #41.

Test files under tests/ are evaluated as ES modules (package.json sets
"type": "module", and the Node implementor spawns each file with
node --expose-gc --import harness.js <file>), and ES modules are always
strict, so the directive the ports inherited from the upstream CommonJS
sources has no effect.

The issue listed 21 files. There are 37 now, including the four under
tests/harness/, since more ports landed after it was filed. All of them
are covered here.

I also added a sentence to .github/copilot-instructions.md under "Pure
ECMAScript tests", so the directive does not come back with the next port,
which was the second half of the issue. Happy to move that into AGENTS.md
instead if #13 lands first.

Verified on Windows with MSVC: npm run addons:build then npm run node:test
gives 46/46 passing, and npm run lint is clean.

Claude Opus 5 did the sweep across the files and drafted this text; I reviewed
both.

Test files under tests/ are evaluated as ES modules, which are always in
strict mode, so the directive carried over from the upstream CommonJS
sources has no effect.

Records the rule in the porting instructions as well, so it does not come
back with the next port.

Closes nodejs#41

Signed-off-by: hexbinoct <abubakarm@gmail.com>
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@legendecas
legendecas merged commit 9aa4c88 into nodejs:main Jul 31, 2026
13 checks passed
@github-project-automation github-project-automation Bot moved this from Need Triage to Done in Node-API Team Project Jul 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Development

Successfully merging this pull request may close these issues.

Remove redundant "use strict" from ported test files

2 participants