Skip to content

util: preserve length of deprecated functions #57806

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

Merged

Conversation

LiviaMedeiros
Copy link
Member

More radical (and probably breaking some existing tests) solution would be wrapping original function in Proxy instead of separate deprecated() function.

@nodejs-github-bot nodejs-github-bot added needs-ci PRs that need a full CI run. util Issues and PRs related to the built-in util module. labels Apr 9, 2025
Copy link
Member

@ljharb ljharb left a comment

Choose a reason for hiding this comment

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

definitely shouldn't ever do a proxy :-) this is great tho

Copy link

codecov bot commented Apr 9, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 90.21%. Comparing base (ada4abf) to head (782cee8).
Report is 11 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main   #57806   +/-   ##
=======================================
  Coverage   90.21%   90.21%           
=======================================
  Files         630      630           
  Lines      185518   185535   +17     
  Branches    36383    36378    -5     
=======================================
+ Hits       167360   167376   +16     
- Misses      11033    11048   +15     
+ Partials     7125     7111   -14     
Files with missing lines Coverage Δ
lib/internal/util.js 95.74% <100.00%> (-0.06%) ⬇️

... and 28 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@LiviaMedeiros LiviaMedeiros added the request-ci Add this label to start a Jenkins CI on a PR. label Apr 9, 2025
@github-actions github-actions bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Apr 9, 2025
@nodejs-github-bot
Copy link
Collaborator

@nodejs-github-bot
Copy link
Collaborator

@nodejs-github-bot
Copy link
Collaborator

@LiviaMedeiros LiviaMedeiros added the author ready PRs that have at least one approval, no pending requests for changes, and a CI started. label Apr 10, 2025
@aduh95 aduh95 added the commit-queue Add this label to land a pull request using GitHub Actions. label Apr 10, 2025
@nodejs-github-bot nodejs-github-bot added commit-queue-failed An error occurred while landing this pull request using GitHub Actions. and removed commit-queue Add this label to land a pull request using GitHub Actions. labels Apr 11, 2025
@nodejs-github-bot
Copy link
Collaborator

Commit Queue failed
- Loading data for nodejs/node/pull/57806
✔  Done loading data for nodejs/node/pull/57806
----------------------------------- PR info ------------------------------------
Title      util: preserve `length` of deprecated functions (#57806)
Author     Livia Medeiros <[email protected]> (@LiviaMedeiros)
Branch     LiviaMedeiros:util-deprecate-preserve-length -> nodejs:main
Labels     util, author ready, needs-ci
Commits    2
 - util: preserve `length` of deprecated functions
 - squash: mitigate prototype pollution
Committers 1
 - LiviaMedeiros <[email protected]>
PR-URL: https://github.com/nodejs/node/pull/57806
Reviewed-By: Jordan Harband <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: Antoine du Hamel <[email protected]>
Reviewed-By: Ruben Bridgewater <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Marco Ippolito <[email protected]>
------------------------------ Generated metadata ------------------------------
PR-URL: https://github.com/nodejs/node/pull/57806
Reviewed-By: Jordan Harband <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: Antoine du Hamel <[email protected]>
Reviewed-By: Ruben Bridgewater <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Marco Ippolito <[email protected]>
--------------------------------------------------------------------------------
   ℹ  This PR was created on Wed, 09 Apr 2025 16:07:02 GMT
   ✔  Approvals: 6
   ✔  - Jordan Harband (@ljharb): https://github.com/nodejs/node/pull/57806#pullrequestreview-2754128591
   ✔  - Luigi Pinca (@lpinca): https://github.com/nodejs/node/pull/57806#pullrequestreview-2757725368
   ✔  - Antoine du Hamel (@aduh95) (TSC): https://github.com/nodejs/node/pull/57806#pullrequestreview-2758333132
   ✔  - Ruben Bridgewater (@BridgeAR) (TSC): https://github.com/nodejs/node/pull/57806#pullrequestreview-2758600034
   ✔  - James M Snell (@jasnell) (TSC): https://github.com/nodejs/node/pull/57806#pullrequestreview-2758723356
   ✔  - Marco Ippolito (@marco-ippolito) (TSC): https://github.com/nodejs/node/pull/57806#pullrequestreview-2760421642
   ✔  Last GitHub CI successful
   ℹ  Last Full PR CI on 2025-04-10T01:42:16Z: https://ci.nodejs.org/job/node-test-pull-request/66180/
- Querying data for job/node-test-pull-request/66180/
   ✔  Last Jenkins CI successful
--------------------------------------------------------------------------------
   ✔  No git cherry-pick in progress
   ✔  No git am in progress
   ✔  No git rebase in progress
--------------------------------------------------------------------------------
- Bringing origin/main up to date...
From https://github.com/nodejs/node
 * branch                  main       -> FETCH_HEAD
✔  origin/main is now up-to-date
- Downloading patch for 57806
From https://github.com/nodejs/node
 * branch                  refs/pull/57806/merge -> FETCH_HEAD
✔  Fetched commits as 795dd8eb7988..782cee8be4a5
--------------------------------------------------------------------------------
[main 6a41eac7a6] util: preserve `length` of deprecated functions
 Author: LiviaMedeiros <[email protected]>
 Date: Wed Apr 9 23:46:59 2025 +0800
 2 files changed, 22 insertions(+)
[main 8da3941862] squash: mitigate prototype pollution
 Author: LiviaMedeiros <[email protected]>
 Date: Thu Apr 10 00:42:57 2025 +0800
 1 file changed, 10 insertions(+), 2 deletions(-)
   ✔  Patches applied
There are 2 commits in the PR. Attempting autorebase.
Rebasing (2/4)
Executing: git node land --amend --yes
--------------------------------- New Message ----------------------------------
util: preserve `length` of deprecated functions

PR-URL: #57806
Reviewed-By: Jordan Harband <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: Antoine du Hamel <[email protected]>
Reviewed-By: Ruben Bridgewater <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Marco Ippolito <[email protected]>

[detached HEAD 0bf2d0ba07] util: preserve length of deprecated functions
Author: LiviaMedeiros <[email protected]>
Date: Wed Apr 9 23:46:59 2025 +0800
2 files changed, 22 insertions(+)
Rebasing (3/4)
Rebasing (4/4)
Executing: git node land --amend --yes
--------------------------------- New Message ----------------------------------
squash: mitigate prototype pollution

PR-URL: #57806
Reviewed-By: Jordan Harband <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: Antoine du Hamel <[email protected]>
Reviewed-By: Ruben Bridgewater <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Marco Ippolito <[email protected]>

[detached HEAD f94ec3727e] squash: mitigate prototype pollution
Author: LiviaMedeiros <[email protected]>
Date: Thu Apr 10 00:42:57 2025 +0800
1 file changed, 10 insertions(+), 2 deletions(-)
Successfully rebased and updated refs/heads/main.

ℹ Add commit-queue-squash label to land the PR as one commit, or commit-queue-rebase to land as separate commits.

https://github.com/nodejs/node/actions/runs/14407403600

@LiviaMedeiros LiviaMedeiros added commit-queue Add this label to land a pull request using GitHub Actions. commit-queue-squash Add this label to instruct the Commit Queue to squash all the PR commits into the first one. and removed commit-queue-failed An error occurred while landing this pull request using GitHub Actions. labels Apr 11, 2025
@nodejs-github-bot nodejs-github-bot removed the commit-queue Add this label to land a pull request using GitHub Actions. label Apr 11, 2025
@nodejs-github-bot nodejs-github-bot merged commit 86f86a2 into nodejs:main Apr 11, 2025
75 checks passed
@nodejs-github-bot
Copy link
Collaborator

Landed in 86f86a2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
author ready PRs that have at least one approval, no pending requests for changes, and a CI started. commit-queue-squash Add this label to instruct the Commit Queue to squash all the PR commits into the first one. needs-ci PRs that need a full CI run. util Issues and PRs related to the built-in util module.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants