oven-sh / bun

Incredibly fast JavaScript runtime, bundler, test runner, and package manager – all in one
https://bun.sh
Other
74.36k stars 2.78k forks source link

Fix setTimeout with node:util.promisify #15230

Closed pfgithub closed 3 days ago

pfgithub commented 3 days ago

Fixes #15201, alternative for #15203

This regressed in 1.1.27 (specifically commit https://github.com/oven-sh/bun/commit/76c4145f0e95b27610e37130c3457eff7e2e95fb) and didn't get caught because it still worked if "node:timers" was imported in the same file.

This is still slightly different from node, in node setTimeout[Symbol.for("nodejs.util.promisify.custom")] will return a function without any imports, but with this PR in bun it requires require("util") before the custom promisify is defined on setTimeout.

robobun commented 3 days ago

:x: @pfgithub, your commit ea26bec6b962cd5b958d34aa664a30a27ff97326 has 11 failures in #6336:

  • test/regression/issue/ctrl-c.test.ts - 1 failing on 🐧 3.20 aarch64
  • test/js/node/test/parallel/fs-watch-recursive-linux-parallel-remove.test.js - 1 failing on 🐧 3.20 aarch64
  • test/js/node/test/parallel/fs-watch-recursive-linux-parallel-remove.test.js - 1 failing on 🐧 3.20 x64
  • test/js/node/test/parallel/fs-watch-recursive-linux-parallel-remove.test.js - 1 failing on 🐧 3.20 x64-baseline
  • test/v8/v8.test.ts - 22 failing on 🐧 3.20 aarch64
  • test/v8/v8.test.ts - 22 failing on 🐧 3.20 x64
  • test/v8/v8.test.ts - 22 failing on 🐧 3.20 x64-baseline
  • test/integration/next-pages/test/dev-server.test.ts - 1 failing on 🐧 3.20 x64
  • test/integration/next-pages/test/dev-server.test.ts - 1 failing on 🐧 3.20 x64-baseline
  • test/js/bun/http/serve.test.ts - segmentation fault on 🐧 3.20 aarch64
  • test/js/bun/http/serve.test.ts - segmentation fault on 🐧 3.20 x64
  • test/js/bun/http/serve.test.ts - segmentation fault on 🐧 3.20 x64-baseline
  • test/js/bun/http/serve.test.ts - 1 failing on 🍎 14 x64
  • test/js/bun/http/serve.test.ts - 1 failing on 🍎 13 x64
  • test/js/bun/ffi/cc.test.ts - 1 failing on 🐧 3.20 aarch64
  • test/js/bun/ffi/cc.test.ts - 1 failing on 🐧 3.20 x64
  • test/js/bun/ffi/cc.test.ts - 1 failing on 🐧 3.20 x64-baseline
  • test/js/node/child_process/child_process.test.ts - 1 failing on 🐧 3.20 aarch64
  • test/js/node/child_process/child_process.test.ts - 1 failing on 🐧 3.20 x64
  • test/js/node/child_process/child_process.test.ts - 1 failing on 🐧 3.20 x64-baseline
  • test/cli/install/bun-link.test.ts - 4 failing on 🐧 3.20 aarch64
  • test/cli/install/bun-link.test.ts - 4 failing on 🐧 3.20 x64
  • test/cli/install/bun-link.test.ts - 4 failing on 🐧 3.20 x64-baseline
  • test/js/web/fetch/fetch.stream.test.ts - 1 failing on 🍎 14 aarch64
  • test/js/web/fetch/fetch-preconnect.test.ts - 1 failing on 🍎 14 aarch64
  • test/js/third_party/grpc-js/test-client.test.ts - 1 failing on 🪟 2019 x64-baseline