Skip to content

Conversation

dylan-conway
Copy link
Member

What does this PR do?

Fixes function names with 2 suffix, and adds warning for promisify in put already returning a promise.

Passes:

  • test-util-promisify.js
  • test-util-promisify-custom-names.mjs
  • test-util-types-exists.js

How did you verify your code works?

@robobun
Copy link
Collaborator

robobun commented May 2, 2025

Updated 7:23 PM PT - May 5th, 2025

@dylan-conway, your commit 14bf1db has 1 failures in Build #16138:


🧪   To try this PR locally:

bunx bun-pr 19439

That installs a local version of the PR into your bun-19439 executable, so you can run:

bun-19439 --bun

@dylan-conway dylan-conway requested review from a team, Copilot and nektro and removed request for a team May 2, 2025 20:24
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR addresses issues related to function naming in node:util and adds a warning when promisifying functions that already return a Promise. Key changes include updates to the tests for util.promisify and util/types, modifications to timer promise functions in timers.promises.ts, and improvements to the internal promisify implementation.

Reviewed Changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated no comments.

Show a summary per file
File Description
test/js/node/test/parallel/test-util-types-exists.js Added tests ensuring util.types export consistency.
test/js/node/test/parallel/test-util-promisify.js Added tests for promisify behavior and warning emission; minor naming issue noted.
test/js/node/test/parallel/test-util-promisify-custom-names.mjs Validated correct function naming in custom promisification.
src/js/node/timers.promises.ts Refactored timer promise functions to use globalThis functions.
src/js/node/readline.ts Updated custom promisify assignment block style.
src/js/node/fs.ts Refactored exists[Symbol.for("nodejs.util.promisify.custom")].
src/js/internal/promisify.ts Introduced validateFunction and improved warning emission.
Comments suppressed due to low confidence (1)

test/js/node/test/parallel/test-util-promisify.js:53

  • The function name 'promisifedFn' appears to be misspelled; consider renaming it to 'promisifiedFn' for consistency with other parts of the code.
  function promisifedFn() {}

@dylan-conway dylan-conway requested a review from cirospaciari May 5, 2025 18:20
@Jarred-Sumner Jarred-Sumner merged commit 8deac8b into main May 6, 2025
59 of 60 checks passed
@Jarred-Sumner Jarred-Sumner deleted the dylan/fix-util-tests branch May 6, 2025 02:40
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.

4 participants