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

fix: remove logical assignment operator #1318

Merged
merged 2 commits into from Apr 1, 2022
Merged

fix: remove logical assignment operator #1318

merged 2 commits into from Apr 1, 2022

Conversation

n1ru4l
Copy link
Contributor

@n1ru4l n1ru4l commented Mar 31, 2022

Hey, a user of one of our libraries reported an unexpected syntax error on Node.js 14, which I tracked down to this line.

The package.json of this project lists "node": ">=12.18" in the engines.

Logical Assignment is only supported since Node.js 15.14.

To me, it seems like this usage here got added unexpectedly.


We would love to prevent such things in the future by setting up a GitHub action that runs eslint with the following rule: https://github.com/weiran-zsd/eslint-plugin-node/blob/HEAD/docs/rules/no-unsupported-features/es-syntax.md

Would that be something you are interested in?

@codecov-commenter
Copy link

codecov-commenter commented Mar 31, 2022

Codecov Report

Merging #1318 (dab5f36) into main (8b1dcd4) will not change coverage.
The diff coverage is 100.00%.

@@           Coverage Diff           @@
##             main    #1318   +/-   ##
=======================================
  Coverage   94.18%   94.18%           
=======================================
  Files          45       45           
  Lines        4125     4125           
=======================================
  Hits         3885     3885           
  Misses        240      240           
Impacted Files Coverage Δ
lib/fetch/index.js 80.29% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 8b1dcd4...dab5f36. Read the comment docs.

@ronag
Copy link
Member

ronag commented Apr 1, 2022

Thanks!

@ronag ronag merged commit 18da7a7 into nodejs:main Apr 1, 2022
@n1ru4l n1ru4l deleted the patch-1 branch April 1, 2022 07:06
@dotansimha
Copy link

@ronag any planned release soon with this fix?

@matthewlilley
Copy link

088518a

@dominykas
Copy link
Member

Are you sure this is the only issue? Right now, the fetch tests are explicitly disabled - and just enabling them does not make them run in Node.js 14 - I'm getting a bunch of errors, starting with require('util/types') (only require('util').types is available in node 14), then cimplaints about AbortController (experimental in 14), etc

@ronag
Copy link
Member

ronag commented May 3, 2022

Fetch does not work on node 14. This is expected.

KhafraDev pushed a commit to KhafraDev/undici that referenced this pull request Jun 23, 2022
* fix: remove logical assignment operator

* chore: please the linter
metcoder95 pushed a commit to metcoder95/undici that referenced this pull request Dec 26, 2022
* fix: remove logical assignment operator

* chore: please the linter
crysmags pushed a commit to crysmags/undici that referenced this pull request Feb 27, 2024
* fix: remove logical assignment operator

* chore: please the linter
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants