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

string_decoder: refactor encoding validation #54957

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

anonrig
Copy link
Member

@anonrig anonrig commented Sep 15, 2024

As far as I can tell, I couldn't find a valid reason to call normalizeEncoding and isEncoding for the same input. Normalize encoding function returns undefined if the encoding is not valid.

Benchmark ci: https://ci.nodejs.org/view/Node.js%20benchmark/job/benchmark-node-micro-benchmarks/1640/

@nodejs-github-bot nodejs-github-bot added needs-ci PRs that need a full CI run. string_decoder Issues and PRs related to the string_decoder subsystem. util Issues and PRs related to the built-in util module. labels Sep 15, 2024
Copy link

codecov bot commented Sep 15, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 88.03%. Comparing base (291d90a) to head (bf54e83).
Report is 3 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #54957      +/-   ##
==========================================
- Coverage   88.04%   88.03%   -0.01%     
==========================================
  Files         652      652              
  Lines      183764   183747      -17     
  Branches    35862    35861       -1     
==========================================
- Hits       161787   161756      -31     
- Misses      15233    15239       +6     
- Partials     6744     6752       +8     
Files with missing lines Coverage Δ
lib/internal/util.js 96.54% <100.00%> (-0.10%) ⬇️
lib/string_decoder.js 100.00% <100.00%> (+1.80%) ⬆️

... and 19 files with indirect coverage changes

@anonrig anonrig added the needs-citgm PRs that need a CITGM CI run. label Sep 15, 2024
@anonrig
Copy link
Member Author

anonrig commented Sep 15, 2024

Is this a semver-major? @nodejs/tsc

@RedYetiDev
Copy link
Member

RedYetiDev commented Sep 16, 2024

Is this a semver-major? @nodejs/tsc

Why would it be? Isn't it throwing the same errors for the same functions, just in different spots internally?

Edit: Oh I guess cause the monkey-patching

@nodejs-github-bot
Copy link
Collaborator

lib/string_decoder.js Outdated Show resolved Hide resolved
Copy link
Member

@ronag ronag left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this might be semver-major due to the monkey patching comment.

@ronag ronag added the semver-major PRs that contain breaking changes and should be released in the next major version. label Sep 19, 2024
@nodejs-github-bot
Copy link
Collaborator

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-ci PRs that need a full CI run. needs-citgm PRs that need a CITGM CI run. semver-major PRs that contain breaking changes and should be released in the next major version. string_decoder Issues and PRs related to the string_decoder subsystem. util Issues and PRs related to the built-in util module.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants