Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,9 @@ pub(super) const NET_EVENTS_ROWS: &[NativeModSig] = &[
method: "connect",
class_filter: Some("Socket"),
runtime: "js_net_socket_method_connect",
args: &[NA_F64, NA_STR],
// Keep every slot raw so port/host, options, and path overloads reach
// the runtime without callback-to-string coercion.
args: &[NA_F64, NA_F64, NA_F64],
ret: NR_VOID,
},
NativeModSig {
Expand Down
8 changes: 5 additions & 3 deletions crates/perry-ext-net/src/dispatch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -232,9 +232,11 @@ unsafe fn socket_method(handle: i64, method: &str, args: &[f64]) -> Option<f64>
crate::js_net_socket_on(handle, unbox_to_i64(args[0]), unbox_to_i64(args[1]));
nanbox_handle(handle)
}
"connect" if args.len() >= 2 => {
crate::js_net_socket_method_connect(handle, args[0], unbox_to_i64(args[1]));
undefined()
"connect" if !args.is_empty() => {
let arg2 = args.get(1).copied().unwrap_or_else(undefined);
let arg3 = args.get(2).copied().unwrap_or_else(undefined);
crate::js_ext_net_socket_method_connect(handle, args[0], arg2, arg3);
nanbox_handle(handle)
}
"upgradeToTLS" if !args.is_empty() => {
let verify = args.get(1).copied().unwrap_or(1.0);
Expand Down
Loading
Loading