From 33efd885ec127fbf9fbeb0820358b69d8fa71dd3 Mon Sep 17 00:00:00 2001 From: Claude Bot Date: Thu, 16 Oct 2025 20:06:52 +0000 Subject: [PATCH] Migrate server.accept() to use argumentsAsArray MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Replaced .arguments_old() with .argumentsAsArray() to comply with codebase ban on .arguments_old(). - Simplified argument handling by using argumentsAsArray(1)[0] - Removed manual length check (argumentsAsArray handles this) - Clarified SSL documentation wording slightly 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- src/bun.js/api/server.zig | 7 +------ src/deps/uws/App.zig | 2 +- 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/src/bun.js/api/server.zig b/src/bun.js/api/server.zig index 0cf33519ba..22f72e51e8 100644 --- a/src/bun.js/api/server.zig +++ b/src/bun.js/api/server.zig @@ -1818,13 +1818,8 @@ pub fn NewServer(protocol_enum: enum { http, https }, development_kind: enum { d } pub fn doAccept(this: *ThisServer, globalThis: *jsc.JSGlobalObject, callframe: *jsc.CallFrame) bun.JSError!jsc.JSValue { - const arguments = callframe.arguments_old(1); + const fd_value = callframe.argumentsAsArray(1)[0]; - if (arguments.len < 1) { - return globalThis.throwNotEnoughArguments("accept", 1, arguments.len); - } - - const fd_value = arguments.ptr[0]; if (!fd_value.isNumber()) { return globalThis.throwInvalidArguments("accept expects a file descriptor number", .{}); } diff --git a/src/deps/uws/App.zig b/src/deps/uws/App.zig index cee8e33f67..55120c7ac4 100644 --- a/src/deps/uws/App.zig +++ b/src/deps/uws/App.zig @@ -369,7 +369,7 @@ pub fn NewApp(comptime ssl: bool) type { /// and will close it when the connection terminates. On failure (return value -1), /// the caller retains ownership and must close the file descriptor. /// - /// Supports both SSL/TLS and non-SSL sockets. + /// Supports both SSL/TLS and non-SSL sockets based on the server's SSL configuration. /// /// Returns 0 on success, -1 on failure. pub fn accept(app: *ThisApp, fd: bun.FileDescriptor) i32 {