Skip to content

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

Open
hexbinoct wants to merge 1 commit into
nodejs:mainfrom
hexbinoct:hexbinoct/remove-redundant-use-strict
Open

chore: remove redundant 'use strict' from test files#64
hexbinoct wants to merge 1 commit into
nodejs:mainfrom
hexbinoct:hexbinoct/remove-redundant-use-strict

Conversation

@hexbinoct

Copy link
Copy Markdown

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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Need Triage

Development

Successfully merging this pull request may close these issues.

Remove redundant "use strict" from ported test files

1 participant