Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

--use-strict does not work since node 10 #39996

Closed
skittles1412 opened this issue Sep 5, 2021 · 1 comment
Closed

--use-strict does not work since node 10 #39996

skittles1412 opened this issue Sep 5, 2021 · 1 comment
Labels
duplicate Issues and PRs that are duplicates of other issues or PRs.

Comments

@skittles1412
Copy link

Version

v10.24.1

Platform

Linux LAPTOP 5.11.0-27-generic #29~20.04.1-Ubuntu SMP Wed Aug 11 15:58:17 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux

Subsystem

No response

What steps will reproduce the bug?

$ cat file.js
a = 0;
console.log("strict mode not enabled");

$ node --use-strict file.js
strict mode not enabled

How often does it reproduce? Is there a required condition?

Reproduces for latest node releases for versions 10, 12, 14, 16

node/10.24.1
node/12.22.6
node/14.17.6
node/16.8.0

Works fine for node v8.17.0

What is the expected behavior?

ReferenceError: a is not defined should be thrown

What do you see instead?

The file is not run in strict mode.

Additional information

No response

@mscdex
Copy link
Contributor

mscdex commented Sep 5, 2021

Duplicate of #30039.

@mscdex mscdex closed this as completed Sep 5, 2021
@mscdex mscdex added the duplicate Issues and PRs that are duplicates of other issues or PRs. label Sep 5, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate Issues and PRs that are duplicates of other issues or PRs.
Projects
None yet
Development

No branches or pull requests

2 participants