Migrate server.accept() to use argumentsAsArray

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 <noreply@anthropic.com>
This commit is contained in:
Claude Bot
2025-10-16 20:06:52 +00:00
parent ab9a588fd1
commit 33efd885ec
2 changed files with 2 additions and 7 deletions

View File

@@ -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", .{});
}

View File

@@ -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 {