Files
bun.sh/src
Claude Bot fef57b9b79 Fix getConnections to match Node.js behavior - validate callback and use process.nextTick
This improves the getConnections() implementation to match Node.js:

1. **Validate callback argument**: Now throws ERR_INVALID_ARG_TYPE if
   callback is not a function, matching Node.js behavior

2. **Async callback**: Uses process.nextTick to call the callback
   asynchronously, matching Node.js behavior. In Node.js, this is
   necessary because it needs to poll worker processes in cluster mode.

3. **Better comments**: Explained why it's async (cluster/worker polling)
   and why it can't error in Bun (no workers yet)

Applied the same fix to both:
- http.Server.getConnections (src/js/node/_http_server.ts:290-296)
- net.Server.getConnections (src/js/node/net.ts:2170-2176)

Added test for validation behavior to ensure:
- Throws for undefined callback
- Throws for null callback
- Throws for non-function values

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-10 23:34:50 +00:00
..
2025-10-16 21:52:22 -04:00
2025-07-21 13:26:47 -07:00
2025-10-04 02:17:55 -07:00
2025-07-29 19:35:46 -07:00
2025-07-21 13:26:47 -07:00
2025-07-21 13:26:47 -07:00
2025-09-09 20:41:10 -07:00
2025-10-23 17:52:13 -07:00
2025-09-11 23:29:53 -07:00
2025-10-25 00:05:28 -07:00
2025-09-09 20:41:10 -07:00
2025-07-21 13:26:47 -07:00
2025-07-21 13:26:47 -07:00
2025-07-21 13:26:47 -07:00