aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGravatar Ciro Spaciari <ciro.spaciari@gmail.com> 2023-07-17 23:39:09 -0300
committerGravatar GitHub <noreply@github.com> 2023-07-17 19:39:09 -0700
commit13b54fbdb8cc36bbe027238654360f159ecaefbb (patch)
tree9f905b3520a01ba64cf10df0eefe2fe35c196648 /src
parent9273e29f0eba9c9d185a602d30def5a6b981ad55 (diff)
downloadbun-13b54fbdb8cc36bbe027238654360f159ecaefbb.tar.gz
bun-13b54fbdb8cc36bbe027238654360f159ecaefbb.tar.zst
bun-13b54fbdb8cc36bbe027238654360f159ecaefbb.zip
[tls] General compatibility improvements (#3596)
* wip * subjectaltname * more progress * bindings * fmt * getCert/getPeerCertificate * fix checkServerIdentity * fix checkServerIdentity * add a lot of TLSSocket functions * getEphemeralKeyInfo fix and comment * add alternative for getEphemeralKeyInfo * add get session and set session * fix isSessionReused * get back the raw data for MSSQL * fixeup * fixup getSession + tests * fix doc + fmt * getFinished/getPeerFinished * codegen * fixup * revert webkit * more fixes * ssl helper + revert test oops * asserts
Diffstat (limited to 'src')
-rw-r--r--src/bun.js/api/bun/socket.zig679
-rw-r--r--src/bun.js/api/bun/x509.zig560
-rw-r--r--src/bun.js/api/sockets.classes.ts53
-rw-r--r--src/bun.js/bindings/JSSink.cpp2
-rw-r--r--src/bun.js/bindings/JSSink.h2
-rw-r--r--src/bun.js/bindings/JSSinkLookupTable.h2
-rw-r--r--src/bun.js/bindings/ZigGeneratedClasses.cpp806
-rw-r--r--src/bun.js/bindings/bindings.cpp8
-rw-r--r--src/bun.js/bindings/bindings.zig5
-rw-r--r--src/bun.js/bindings/generated_classes.zig78
-rw-r--r--src/bun.js/bindings/headers.h1
-rw-r--r--src/bun.js/bindings/headers.zig1
-rw-r--r--src/deps/boringssl.translated.zig115
-rw-r--r--src/deps/uws.zig19
-rw-r--r--src/js/node/net.js86
-rw-r--r--src/js/node/tls.js135
-rw-r--r--src/js/out/WebCoreJSBuiltins.cpp316
-rw-r--r--src/js/out/modules/node/net.js54
-rw-r--r--src/js/out/modules/node/tls.js111
-rw-r--r--src/sync.zig2
20 files changed, 2739 insertions, 296 deletions
diff --git a/src/bun.js/api/bun/socket.zig b/src/bun.js/api/bun/socket.zig
index 1d85c705c..0a18dd015 100644
--- a/src/bun.js/api/bun/socket.zig
+++ b/src/bun.js/api/bun/socket.zig
@@ -16,6 +16,8 @@ const Which = @import("../../../which.zig");
const uws = @import("root").bun.uws;
const ZigString = JSC.ZigString;
const BoringSSL = bun.BoringSSL;
+const X509 = @import("./x509.zig");
+
// const Corker = struct {
// ptr: ?*[16384]u8 = null,
// holder: ?*anyopaque = null,
@@ -56,6 +58,79 @@ const BoringSSL = bun.BoringSSL;
// }
// };
+noinline fn getSSLException(globalThis: *JSC.JSGlobalObject, defaultMessage: []const u8) JSValue {
+ var zig_str: ZigString = ZigString.init("");
+ var output_buf: [4096]u8 = undefined;
+
+ output_buf[0] = 0;
+ var written: usize = 0;
+ var ssl_error = BoringSSL.ERR_get_error();
+ while (ssl_error != 0 and written < output_buf.len) : (ssl_error = BoringSSL.ERR_get_error()) {
+ if (written > 0) {
+ output_buf[written] = '\n';
+ written += 1;
+ }
+
+ if (BoringSSL.ERR_reason_error_string(
+ ssl_error,
+ )) |reason_ptr| {
+ const reason = std.mem.span(reason_ptr);
+ if (reason.len == 0) {
+ break;
+ }
+ @memcpy(output_buf[written..][0..reason.len], reason);
+ written += reason.len;
+ }
+
+ if (BoringSSL.ERR_func_error_string(
+ ssl_error,
+ )) |reason_ptr| {
+ const reason = std.mem.span(reason_ptr);
+ if (reason.len > 0) {
+ output_buf[written..][0.." via ".len].* = " via ".*;
+ written += " via ".len;
+ @memcpy(output_buf[written..][0..reason.len], reason);
+ written += reason.len;
+ }
+ }
+
+ if (BoringSSL.ERR_lib_error_string(
+ ssl_error,
+ )) |reason_ptr| {
+ const reason = std.mem.span(reason_ptr);
+ if (reason.len > 0) {
+ output_buf[written..][0] = ' ';
+ written += 1;
+ @memcpy(output_buf[written..][0..reason.len], reason);
+ written += reason.len;
+ }
+ }
+ }
+
+ if (written > 0) {
+ var message = output_buf[0..written];
+ zig_str = ZigString.init(std.fmt.allocPrint(bun.default_allocator, "OpenSSL {s}", .{message}) catch unreachable);
+ var encoded_str = zig_str.withEncoding();
+ encoded_str.mark();
+
+ // We shouldn't *need* to do this but it's not entirely clear.
+ BoringSSL.ERR_clear_error();
+ }
+
+ if (zig_str.len == 0) {
+ zig_str = ZigString.init(defaultMessage);
+ }
+
+ // store the exception in here
+ // toErrorInstance clones the string
+ const exception = zig_str.toErrorInstance(globalThis);
+
+ // reference it in stack memory
+ exception.ensureStillAlive();
+
+ return exception;
+}
+
fn normalizeHost(input: anytype) @TypeOf(input) {
if (input.len == 0) {
return "localhost";
@@ -66,7 +141,6 @@ fn normalizeHost(input: anytype) @TypeOf(input) {
return input;
}
-
const BinaryType = JSC.BinaryType;
const WrappedType = enum {
@@ -1175,7 +1249,7 @@ fn NewSocket(comptime ssl: bool) type {
// Add SNI support for TLS (mongodb and others requires this)
if (comptime ssl) {
- var ssl_ptr: *BoringSSL.SSL = @ptrCast(*BoringSSL.SSL, socket.getNativeHandle());
+ var ssl_ptr = this.socket.ssl();
if (!ssl_ptr.isInitFinished()) {
if (this.server_name) |server_name| {
const host = normalizeHost(server_name);
@@ -1880,6 +1954,107 @@ fn NewSocket(comptime ssl: bool) type {
return JSValue.jsUndefined();
}
+ pub fn getTLSTicket(
+ this: *This,
+ globalObject: *JSC.JSGlobalObject,
+ _: *JSC.CallFrame,
+ ) callconv(.C) JSValue {
+ if (comptime ssl == false) {
+ return JSValue.jsUndefined();
+ }
+
+ if (this.detached) {
+ return JSValue.jsUndefined();
+ }
+
+ var ssl_ptr = this.socket.ssl();
+ const session = BoringSSL.SSL_get_session(ssl_ptr) orelse return JSValue.jsUndefined();
+ var ticket: [*c]const u8 = undefined;
+ var length: usize = 0;
+ //The pointer is only valid while the connection is in use so we need to copy it
+ BoringSSL.SSL_SESSION_get0_ticket(session, @ptrCast([*c][*c]const u8, &ticket), &length);
+
+ if (ticket == null or length == 0) {
+ return JSValue.jsUndefined();
+ }
+
+ return JSC.ArrayBuffer.createBuffer(globalObject, ticket[0..length]);
+ }
+
+ pub fn setSession(
+ this: *This,
+ globalObject: *JSC.JSGlobalObject,
+ callframe: *JSC.CallFrame,
+ ) callconv(.C) JSValue {
+ if (comptime ssl == false) {
+ return JSValue.jsUndefined();
+ }
+
+ if (this.detached) {
+ return JSValue.jsUndefined();
+ }
+
+ const args = callframe.arguments(1);
+
+ if (args.len < 1) {
+ globalObject.throw("Expected session to be a string, Buffer or TypedArray", .{});
+ return .zero;
+ }
+
+ const session_arg = args.ptr[0];
+ var arena: bun.ArenaAllocator = bun.ArenaAllocator.init(bun.default_allocator);
+ defer arena.deinit();
+
+ var exception_ref = [_]JSC.C.JSValueRef{null};
+ var exception: JSC.C.ExceptionRef = &exception_ref;
+ if (JSC.Node.StringOrBuffer.fromJS(globalObject, arena.allocator(), session_arg, exception)) |sb| {
+ var session_slice = sb.slice();
+ var ssl_ptr = this.socket.ssl();
+ var tmp = @ptrCast([*c]const u8, session_slice.ptr);
+ const session = BoringSSL.d2i_SSL_SESSION(null, &tmp, @intCast(c_long, session_slice.len)) orelse return JSValue.jsUndefined();
+ if (BoringSSL.SSL_set_session(ssl_ptr, session) != 1) {
+ globalObject.throwValue(getSSLException(globalObject, "SSL_set_session error"));
+ return .zero;
+ }
+ return JSValue.jsUndefined();
+ } else if (exception.* != null) {
+ globalObject.throwValue(JSC.JSValue.c(exception.*));
+ return .zero;
+ } else {
+ globalObject.throw("Expected session to be a string, Buffer or TypedArray", .{});
+ return .zero;
+ }
+ }
+
+ pub fn getSession(
+ this: *This,
+ globalObject: *JSC.JSGlobalObject,
+ _: *JSC.CallFrame,
+ ) callconv(.C) JSValue {
+ if (comptime ssl == false) {
+ return JSValue.jsUndefined();
+ }
+
+ if (this.detached) {
+ return JSValue.jsUndefined();
+ }
+
+ var ssl_ptr = this.socket.ssl();
+ const session = BoringSSL.SSL_get_session(ssl_ptr) orelse return JSValue.jsUndefined();
+ const size = BoringSSL.i2d_SSL_SESSION(session, null);
+ if (size <= 0) {
+ return JSValue.jsUndefined();
+ }
+
+ const buffer_size = @intCast(usize, size);
+ var buffer = JSValue.createBufferFromLength(globalObject, buffer_size);
+ var buffer_ptr = @ptrCast([*c]u8, buffer.asArrayBuffer(globalObject).?.ptr);
+
+ const result_size = BoringSSL.i2d_SSL_SESSION(session, &buffer_ptr);
+ std.debug.assert(result_size == size);
+ return buffer;
+ }
+
pub fn getALPNProtocol(
this: *This,
globalObject: *JSC.JSGlobalObject,
@@ -1895,7 +2070,7 @@ fn NewSocket(comptime ssl: bool) type {
var alpn_proto: [*c]const u8 = null;
var alpn_proto_len: u32 = 0;
- var ssl_ptr: *BoringSSL.SSL = @ptrCast(*BoringSSL.SSL, this.socket.getNativeHandle());
+ var ssl_ptr = this.socket.ssl();
BoringSSL.SSL_get0_alpn_selected(ssl_ptr, &alpn_proto, &alpn_proto_len);
if (alpn_proto == null or alpn_proto_len == 0) {
return JSValue.jsBoolean(false);
@@ -1910,7 +2085,502 @@ fn NewSocket(comptime ssl: bool) type {
}
return ZigString.fromUTF8(slice).toValueGC(globalObject);
}
+ pub fn exportKeyingMaterial(
+ this: *This,
+ globalObject: *JSC.JSGlobalObject,
+ callframe: *JSC.CallFrame,
+ ) callconv(.C) JSValue {
+ if (comptime ssl == false) {
+ return JSValue.jsUndefined();
+ }
+
+ if (this.detached) {
+ return JSValue.jsUndefined();
+ }
+
+ const args = callframe.arguments(3);
+ if (args.len < 2) {
+ globalObject.throw("Expected length and label to be provided", .{});
+ return .zero;
+ }
+ const length_arg = args.ptr[0];
+ if (!length_arg.isNumber()) {
+ globalObject.throw("Expected length to be a number", .{});
+ return .zero;
+ }
+
+ const length = length_arg.coerceToInt64(globalObject);
+ if (length < 0) {
+ globalObject.throw("Expected length to be a positive number", .{});
+ return .zero;
+ }
+
+ const label_arg = args.ptr[1];
+ if (!label_arg.isString()) {
+ globalObject.throw("Expected label to be a string", .{});
+ return .zero;
+ }
+
+ var label = label_arg.toSliceOrNull(globalObject) orelse {
+ globalObject.throw("Expected label to be a string", .{});
+ return .zero;
+ };
+
+ defer label.deinit();
+ const label_slice = label.slice();
+ const ssl_ptr = @ptrCast(*BoringSSL.SSL, this.socket.getNativeHandle());
+
+ if (args.len > 2) {
+ const context_arg = args.ptr[2];
+
+ var arena: bun.ArenaAllocator = bun.ArenaAllocator.init(bun.default_allocator);
+ defer arena.deinit();
+
+ var exception_ref = [_]JSC.C.JSValueRef{null};
+ var exception: JSC.C.ExceptionRef = &exception_ref;
+ if (JSC.Node.StringOrBuffer.fromJS(globalObject, arena.allocator(), context_arg, exception)) |sb| {
+ const context_slice = sb.slice();
+
+ const buffer_size = @intCast(usize, length);
+ var buffer = JSValue.createBufferFromLength(globalObject, buffer_size);
+ var buffer_ptr = @ptrCast([*c]u8, buffer.asArrayBuffer(globalObject).?.ptr);
+
+ const result = BoringSSL.SSL_export_keying_material(ssl_ptr, buffer_ptr, buffer_size, @ptrCast([*c]const u8, label_slice.ptr), label_slice.len, @ptrCast([*c]const u8, context_slice.ptr), context_slice.len, 1);
+ if (result != 1) {
+ globalObject.throwValue(getSSLException(globalObject, "Failed to export keying material"));
+ return .zero;
+ }
+ return buffer;
+ } else if (exception.* != null) {
+ globalObject.throwValue(JSC.JSValue.c(exception.*));
+ return .zero;
+ } else {
+ globalObject.throw("Expected context to be a string, Buffer or TypedArray", .{});
+ return .zero;
+ }
+ } else {
+ const buffer_size = @intCast(usize, length);
+ var buffer = JSValue.createBufferFromLength(globalObject, buffer_size);
+ var buffer_ptr = @ptrCast([*c]u8, buffer.asArrayBuffer(globalObject).?.ptr);
+
+ const result = BoringSSL.SSL_export_keying_material(ssl_ptr, buffer_ptr, buffer_size, @ptrCast([*c]const u8, label_slice.ptr), label_slice.len, null, 0, 0);
+ if (result != 1) {
+ globalObject.throwValue(getSSLException(globalObject, "Failed to export keying material"));
+ return .zero;
+ }
+ return buffer;
+ }
+ }
+
+ pub fn getEphemeralKeyInfo(
+ this: *This,
+ globalObject: *JSC.JSGlobalObject,
+ _: *JSC.CallFrame,
+ ) callconv(.C) JSValue {
+ if (comptime ssl == false) {
+ return JSValue.jsNull();
+ }
+
+ if (this.detached) {
+ return JSValue.jsNull();
+ }
+
+ // only available for clients
+ if (this.handlers.is_server) {
+ return JSValue.jsNull();
+ }
+ var result = JSValue.createEmptyObject(globalObject, 3);
+
+ const ssl_ptr = @ptrCast(*BoringSSL.SSL, this.socket.getNativeHandle());
+ // TODO: investigate better option or compatible way to get the key
+ // this implementation follows nodejs but for BoringSSL SSL_get_server_tmp_key will always return 0
+ // wich will result in a empty object
+ // var raw_key: [*c]BoringSSL.EVP_PKEY = undefined;
+ // if (BoringSSL.SSL_get_server_tmp_key(ssl_ptr, @ptrCast([*c][*c]BoringSSL.EVP_PKEY, &raw_key)) == 0) {
+ // return result;
+ // }
+ var raw_key: [*c]BoringSSL.EVP_PKEY = BoringSSL.SSL_get_privatekey(ssl_ptr);
+ if (raw_key == null) {
+ return result;
+ }
+
+ const kid = BoringSSL.EVP_PKEY_id(raw_key);
+ const bits = BoringSSL.EVP_PKEY_bits(raw_key);
+
+ switch (kid) {
+ BoringSSL.EVP_PKEY_DH => {
+ result.put(globalObject, ZigString.static("type"), ZigString.static("DH").toValue(globalObject));
+ result.put(globalObject, ZigString.static("size"), JSValue.jsNumber(bits));
+ },
+
+ BoringSSL.EVP_PKEY_EC, BoringSSL.EVP_PKEY_X25519, BoringSSL.EVP_PKEY_X448 => {
+ var curve_name: []const u8 = undefined;
+ if (kid == BoringSSL.EVP_PKEY_EC) {
+ const ec = BoringSSL.EVP_PKEY_get1_EC_KEY(raw_key);
+ const nid = BoringSSL.EC_GROUP_get_curve_name(BoringSSL.EC_KEY_get0_group(ec));
+ const nid_str = BoringSSL.OBJ_nid2sn(nid);
+ if (nid_str != null) {
+ curve_name = nid_str[0..bun.len(nid_str)];
+ } else {
+ curve_name = "";
+ }
+ } else {
+ const kid_str = BoringSSL.OBJ_nid2sn(kid);
+ if (kid_str != null) {
+ curve_name = kid_str[0..bun.len(kid_str)];
+ } else {
+ curve_name = "";
+ }
+ }
+ result.put(globalObject, ZigString.static("type"), ZigString.static("ECDH").toValue(globalObject));
+ result.put(globalObject, ZigString.static("name"), ZigString.fromUTF8(curve_name).toValueGC(globalObject));
+ result.put(globalObject, ZigString.static("size"), JSValue.jsNumber(bits));
+ },
+ else => {},
+ }
+ return result;
+ }
+
+ pub fn getCipher(
+ this: *This,
+ globalObject: *JSC.JSGlobalObject,
+ _: *JSC.CallFrame,
+ ) callconv(.C) JSValue {
+ if (comptime ssl == false) {
+ return JSValue.jsUndefined();
+ }
+ if (this.detached) {
+ return JSValue.jsUndefined();
+ }
+ var result = JSValue.createEmptyObject(globalObject, 3);
+
+ const ssl_ptr = @ptrCast(*BoringSSL.SSL, this.socket.getNativeHandle());
+ const cipher = BoringSSL.SSL_get_current_cipher(ssl_ptr);
+ if (cipher == null) {
+ result.put(globalObject, ZigString.static("name"), JSValue.jsNull());
+ result.put(globalObject, ZigString.static("standardName"), JSValue.jsNull());
+ result.put(globalObject, ZigString.static("version"), JSValue.jsNull());
+ return result;
+ }
+
+ const name = BoringSSL.SSL_CIPHER_get_name(cipher);
+ if (name == null) {
+ result.put(globalObject, ZigString.static("name"), JSValue.jsNull());
+ } else {
+ result.put(globalObject, ZigString.static("name"), ZigString.fromUTF8(name[0..bun.len(name)]).toValueGC(globalObject));
+ }
+
+ const standard_name = BoringSSL.SSL_CIPHER_standard_name(cipher);
+ if (standard_name == null) {
+ result.put(globalObject, ZigString.static("standardName"), JSValue.jsNull());
+ } else {
+ result.put(globalObject, ZigString.static("standardName"), ZigString.fromUTF8(standard_name[0..bun.len(standard_name)]).toValueGC(globalObject));
+ }
+
+ const version = BoringSSL.SSL_CIPHER_get_version(cipher);
+ if (version == null) {
+ result.put(globalObject, ZigString.static("version"), JSValue.jsNull());
+ } else {
+ result.put(globalObject, ZigString.static("version"), ZigString.fromUTF8(version[0..bun.len(version)]).toValueGC(globalObject));
+ }
+
+ return result;
+ }
+
+ pub fn getTLSPeerFinishedMessage(
+ this: *This,
+ globalObject: *JSC.JSGlobalObject,
+ _: *JSC.CallFrame,
+ ) callconv(.C) JSValue {
+ if (comptime ssl == false) {
+ return JSValue.jsUndefined();
+ }
+
+ if (this.detached) {
+ return JSValue.jsUndefined();
+ }
+
+ const ssl_ptr = @ptrCast(*BoringSSL.SSL, this.socket.getNativeHandle());
+ // We cannot just pass nullptr to SSL_get_peer_finished()
+ // because it would further be propagated to memcpy(),
+ // where the standard requirements as described in ISO/IEC 9899:2011
+ // sections 7.21.2.1, 7.21.1.2, and 7.1.4, would be violated.
+ // Thus, we use a dummy byte.
+ var dummy: [1]u8 = undefined;
+ const size = BoringSSL.SSL_get_peer_finished(ssl_ptr, @ptrCast(*anyopaque, &dummy), @sizeOf(@TypeOf(dummy)));
+ if (size == 0) return JSValue.jsUndefined();
+
+ const buffer_size = @intCast(usize, size);
+ var buffer = JSValue.createBufferFromLength(globalObject, buffer_size);
+ var buffer_ptr = @ptrCast(*anyopaque, buffer.asArrayBuffer(globalObject).?.ptr);
+
+ const result_size = BoringSSL.SSL_get_peer_finished(ssl_ptr, buffer_ptr, buffer_size);
+ std.debug.assert(result_size == size);
+ return buffer;
+ }
+
+ pub fn getTLSFinishedMessage(
+ this: *This,
+ globalObject: *JSC.JSGlobalObject,
+ _: *JSC.CallFrame,
+ ) callconv(.C) JSValue {
+ if (comptime ssl == false) {
+ return JSValue.jsUndefined();
+ }
+
+ if (this.detached) {
+ return JSValue.jsUndefined();
+ }
+
+ const ssl_ptr = @ptrCast(*BoringSSL.SSL, this.socket.getNativeHandle());
+ // We cannot just pass nullptr to SSL_get_finished()
+ // because it would further be propagated to memcpy(),
+ // where the standard requirements as described in ISO/IEC 9899:2011
+ // sections 7.21.2.1, 7.21.1.2, and 7.1.4, would be violated.
+ // Thus, we use a dummy byte.
+ var dummy: [1]u8 = undefined;
+ const size = BoringSSL.SSL_get_finished(ssl_ptr, @ptrCast(*anyopaque, &dummy), @sizeOf(@TypeOf(dummy)));
+ if (size == 0) return JSValue.jsUndefined();
+
+ const buffer_size = @intCast(usize, size);
+ var buffer = JSValue.createBufferFromLength(globalObject, buffer_size);
+ var buffer_ptr = @ptrCast(*anyopaque, buffer.asArrayBuffer(globalObject).?.ptr);
+
+ const result_size = BoringSSL.SSL_get_finished(ssl_ptr, buffer_ptr, buffer_size);
+ std.debug.assert(result_size == size);
+ return buffer;
+ }
+
+ pub fn getSharedSigalgs(
+ this: *This,
+ globalObject: *JSC.JSGlobalObject,
+ _: *JSC.CallFrame,
+ ) callconv(.C) JSValue {
+ JSC.markBinding(@src());
+ if (comptime ssl == false) {
+ return JSValue.jsNull();
+ }
+
+ if (this.detached) {
+ return JSValue.jsNull();
+ }
+ const ssl_ptr = @ptrCast(*BoringSSL.SSL, this.socket.getNativeHandle());
+
+ const nsig = BoringSSL.SSL_get_shared_sigalgs(ssl_ptr, 0, null, null, null, null, null);
+
+ const array = JSC.JSValue.createEmptyArray(globalObject, @intCast(usize, nsig));
+
+ for (0..@intCast(usize, nsig)) |i| {
+ var hash_nid: c_int = 0;
+ var sign_nid: c_int = 0;
+ var sig_with_md: []const u8 = "";
+
+ _ = BoringSSL.SSL_get_shared_sigalgs(ssl_ptr, @intCast(c_int, i), &sign_nid, &hash_nid, null, null, null);
+ switch (sign_nid) {
+ BoringSSL.EVP_PKEY_RSA => {
+ sig_with_md = "RSA";
+ },
+ BoringSSL.EVP_PKEY_RSA_PSS => {
+ sig_with_md = "RSA-PSS";
+ },
+
+ BoringSSL.EVP_PKEY_DSA => {
+ sig_with_md = "DSA";
+ },
+
+ BoringSSL.EVP_PKEY_EC => {
+ sig_with_md = "ECDSA";
+ },
+
+ BoringSSL.NID_ED25519 => {
+ sig_with_md = "Ed25519";
+ },
+
+ BoringSSL.NID_ED448 => {
+ sig_with_md = "Ed448";
+ },
+ BoringSSL.NID_id_GostR3410_2001 => {
+ sig_with_md = "gost2001";
+ },
+
+ BoringSSL.NID_id_GostR3410_2012_256 => {
+ sig_with_md = "gost2012_256";
+ },
+ BoringSSL.NID_id_GostR3410_2012_512 => {
+ sig_with_md = "gost2012_512";
+ },
+ else => {
+ const sn_str = BoringSSL.OBJ_nid2sn(sign_nid);
+ if (sn_str != null) {
+ sig_with_md = sn_str[0..bun.len(sn_str)];
+ } else {
+ sig_with_md = "UNDEF";
+ }
+ },
+ }
+
+ const hash_str = BoringSSL.OBJ_nid2sn(hash_nid);
+ if (hash_str != null) {
+ const hash_str_len = bun.len(hash_str);
+ const hash_slice = hash_str[0..hash_str_len];
+ const buffer = bun.default_allocator.alloc(u8, sig_with_md.len + hash_str_len + 1) catch unreachable;
+ defer bun.default_allocator.free(buffer);
+
+ bun.copy(u8, buffer, sig_with_md);
+ buffer[sig_with_md.len] = '+';
+ bun.copy(u8, buffer[sig_with_md.len + 1 ..], hash_slice);
+ array.putIndex(globalObject, @intCast(u32, i), JSC.ZigString.fromUTF8(buffer).toValueGC(globalObject));
+ } else {
+ const buffer = bun.default_allocator.alloc(u8, sig_with_md.len + 6) catch unreachable;
+ defer bun.default_allocator.free(buffer);
+
+ bun.copy(u8, buffer, sig_with_md);
+ bun.copy(u8, buffer[sig_with_md.len..], "+UNDEF");
+ array.putIndex(globalObject, @intCast(u32, i), JSC.ZigString.fromUTF8(buffer).toValueGC(globalObject));
+ }
+ }
+ return array;
+ }
+
+ pub fn getTLSVersion(
+ this: *This,
+ globalObject: *JSC.JSGlobalObject,
+ _: *JSC.CallFrame,
+ ) callconv(.C) JSValue {
+ JSC.markBinding(@src());
+ if (comptime ssl == false) {
+ return JSValue.jsNull();
+ }
+
+ if (this.detached) {
+ return JSValue.jsNull();
+ }
+
+ const ssl_ptr = @ptrCast(*BoringSSL.SSL, this.socket.getNativeHandle());
+ const version = BoringSSL.SSL_get_version(ssl_ptr);
+ if (version == null) return JSValue.jsNull();
+ const version_len = bun.len(version);
+ if (version_len == 0) return JSValue.jsNull();
+ const slice = version[0..version_len];
+ return ZigString.fromUTF8(slice).toValueGC(globalObject);
+ }
+
+ pub fn setMaxSendFragment(
+ this: *This,
+ globalObject: *JSC.JSGlobalObject,
+ callframe: *JSC.CallFrame,
+ ) callconv(.C) JSValue {
+ JSC.markBinding(@src());
+ if (comptime ssl == false) {
+ return JSValue.jsBoolean(false);
+ }
+
+ if (this.detached) {
+ return JSValue.jsBoolean(false);
+ }
+
+ const args = callframe.arguments(1);
+
+ if (args.len < 1) {
+ globalObject.throw("Expected size to be a number", .{});
+ return .zero;
+ }
+
+ const arg = args.ptr[0];
+ if (!arg.isNumber()) {
+ globalObject.throw("Expected size to be a number", .{});
+ return .zero;
+ }
+ const size = args.ptr[0].coerceToInt64(globalObject);
+ if (size < 1) {
+ globalObject.throw("Expected size to be greater than 1", .{});
+ return .zero;
+ }
+ if (size > 16384) {
+ globalObject.throw("Expected size to be less than 16385", .{});
+ return .zero;
+ }
+
+ const ssl_ptr = @ptrCast(*BoringSSL.SSL, this.socket.getNativeHandle());
+ return JSValue.jsBoolean(BoringSSL.SSL_set_max_send_fragment(ssl_ptr, @intCast(usize, size)) == 1);
+ }
+ pub fn getPeerCertificate(
+ this: *This,
+ globalObject: *JSC.JSGlobalObject,
+ callframe: *JSC.CallFrame,
+ ) callconv(.C) JSValue {
+ JSC.markBinding(@src());
+ if (comptime ssl == false) {
+ return JSValue.jsUndefined();
+ }
+
+ if (this.detached) {
+ return JSValue.jsUndefined();
+ }
+
+ const args = callframe.arguments(1);
+ var abbreviated: bool = true;
+ if (args.len > 0) {
+ const arg = args.ptr[0];
+ if (!arg.isBoolean()) {
+ globalObject.throw("Expected abbreviated to be a boolean", .{});
+ return .zero;
+ }
+ abbreviated = arg.toBoolean();
+ }
+
+ const ssl_ptr = @ptrCast(*BoringSSL.SSL, this.socket.getNativeHandle());
+
+ if (abbreviated) {
+ if (this.handlers.is_server) {
+ const cert = BoringSSL.SSL_get_peer_certificate(ssl_ptr);
+ if (cert) |x509| {
+ return X509.toJS(x509, globalObject);
+ }
+ }
+
+ const cert_chain = BoringSSL.SSL_get_peer_cert_chain(ssl_ptr) orelse return JSValue.jsUndefined();
+ const cert = BoringSSL.sk_X509_value(cert_chain, 0) orelse return JSValue.jsUndefined();
+ return X509.toJS(cert, globalObject);
+ }
+ var cert: ?*BoringSSL.X509 = null;
+ if (this.handlers.is_server) {
+ cert = BoringSSL.SSL_get_peer_certificate(ssl_ptr);
+ }
+
+ const cert_chain = BoringSSL.SSL_get_peer_cert_chain(ssl_ptr);
+ const first_cert = if (cert) |c| c else if (cert_chain) |cc| BoringSSL.sk_X509_value(cc, 0) else null;
+
+ if (first_cert == null) {
+ return JSValue.jsUndefined();
+ }
+
+ // TODO: we need to support the non abbreviated version of this
+ return JSValue.jsUndefined();
+ }
+
+ pub fn getCertificate(
+ this: *This,
+ globalObject: *JSC.JSGlobalObject,
+ _: *JSC.CallFrame,
+ ) callconv(.C) JSValue {
+ if (comptime ssl == false) {
+ return JSValue.jsUndefined();
+ }
+
+ if (this.detached) {
+ return JSValue.jsUndefined();
+ }
+
+ const ssl_ptr = @ptrCast(*BoringSSL.SSL, this.socket.getNativeHandle());
+ const cert = BoringSSL.SSL_get_certificate(ssl_ptr);
+
+ if (cert) |x509| {
+ return X509.toJS(x509, globalObject);
+ }
+ return JSValue.jsUndefined();
+ }
pub fn setServername(
this: *This,
globalObject: *JSC.JSGlobalObject,
@@ -1952,7 +2622,7 @@ fn NewSocket(comptime ssl: bool) type {
const host = normalizeHost(@as([]const u8, slice));
if (host.len > 0) {
- var ssl_ptr: *BoringSSL.SSL = @ptrCast(*BoringSSL.SSL, this.socket.getNativeHandle());
+ var ssl_ptr = this.socket.ssl();
if (ssl_ptr.isInitFinished()) {
// match node.js exceptions
globalObject.throw("Already started.", .{});
@@ -2222,6 +2892,7 @@ pub fn NewWrappedHandler(comptime tls: bool) type {
if (comptime tls) {
TLSSocket.onData(this.tls, socket, data);
} else {
+ // tedius use this
TLSSocket.onData(this.tcp, socket, data);
}
}
diff --git a/src/bun.js/api/bun/x509.zig b/src/bun.js/api/bun/x509.zig
new file mode 100644
index 000000000..707009936
--- /dev/null
+++ b/src/bun.js/api/bun/x509.zig
@@ -0,0 +1,560 @@
+const BoringSSL = bun.BoringSSL;
+const bun = @import("root").bun;
+const ZigString = JSC.ZigString;
+const std = @import("std");
+const JSC = @import("root").bun.JSC;
+const JSValue = JSC.JSValue;
+const JSGlobalObject = JSC.JSGlobalObject;
+
+fn x509GetNameObject(globalObject: *JSGlobalObject, name: ?*BoringSSL.X509_NAME) JSValue {
+ const cnt = BoringSSL.X509_NAME_entry_count(name);
+ if (cnt <= 0) {
+ return JSValue.jsUndefined();
+ }
+ var result = JSValue.createEmptyObject(globalObject, 1);
+
+ for (0..@intCast(usize, cnt)) |i| {
+ const entry = BoringSSL.X509_NAME_get_entry(name, @intCast(c_int, i)) orelse continue;
+ // We intentionally ignore the value of X509_NAME_ENTRY_set because the
+ // representation as an object does not allow grouping entries into sets
+ // anyway, and multi-value RDNs are rare, i.e., the vast majority of
+ // Relative Distinguished Names contains a single type-value pair only.
+ const type_ = BoringSSL.X509_NAME_ENTRY_get_object(entry);
+
+ // If BoringSSL knows the type, use the short name of the type as the key, and
+ // the numeric representation of the type's OID otherwise.
+ const type_nid = BoringSSL.OBJ_obj2nid(type_);
+ var type_buf: [80]u8 = undefined;
+ var name_slice: []const u8 = undefined;
+ if (type_nid != BoringSSL.NID_undef) {
+ const type_str = BoringSSL.OBJ_nid2sn(type_nid);
+ if (type_str == null) {
+ continue;
+ }
+ name_slice = type_str[0..bun.len(type_str)];
+ } else {
+ const length = BoringSSL.OBJ_obj2txt(&type_buf, @sizeOf(@TypeOf(type_buf)), type_, 1);
+ if (length <= 0) {
+ continue;
+ }
+ name_slice = type_buf[0..@intCast(usize, length)];
+ }
+
+ const value_data = BoringSSL.X509_NAME_ENTRY_get_data(entry);
+
+ var value_str: [*c]u8 = undefined;
+ const value_str_len = BoringSSL.ASN1_STRING_to_UTF8(&value_str, value_data);
+ if (value_str_len < 0) {
+ continue;
+ }
+ const value_slice = value_str[0..@intCast(usize, value_str_len)];
+ defer BoringSSL.OPENSSL_free(value_str);
+ // For backward compatibility, we only create arrays if multiple values
+ // exist for the same key. That is not great but there is not much we can
+ // change here without breaking things. Note that this creates nested data
+ // structures, yet still does not allow representing Distinguished Names
+ // accurately.
+ if (result.getTruthy(globalObject, name_slice)) |value| {
+ if (value.jsType().isArray()) {
+ value.push(globalObject, JSC.ZigString.fromUTF8(value_slice).toValueGC(globalObject));
+ } else {
+ const prop_name = JSC.ZigString.fromUTF8(name_slice);
+ const array = JSValue.createEmptyArray(globalObject, 2);
+ array.putIndex(globalObject, 0, value);
+ array.putIndex(globalObject, 1, JSC.ZigString.fromUTF8(value_slice).toValueGC(globalObject));
+ result.put(globalObject, &prop_name, array);
+ }
+ } else {
+ const prop_name = JSC.ZigString.fromUTF8(name_slice);
+ result.put(globalObject, &prop_name, JSC.ZigString.fromUTF8(value_slice).toValueGC(globalObject));
+ }
+ }
+ return result;
+}
+
+inline fn isSafeAltName(name: []const u8, utf8: bool) bool {
+ for (name) |c| {
+ switch (c) {
+ '"',
+ '\\',
+ // These mess with encoding rules.
+ // Fall through.
+ ',',
+ // Commas make it impossible to split the list of subject alternative
+ // names unambiguously, which is why we have to escape.
+ // Fall through.
+ '\'',
+ => {
+ // Single quotes are unlikely to appear in any legitimate values, but they
+ // could be used to make a value look like it was escaped (i.e., enclosed
+ // in single/double quotes).
+ return false;
+ },
+ else => {
+ if (utf8) {
+ // In UTF8 strings, we require escaping for any ASCII control character,
+ // but NOT for non-ASCII characters. Note that all bytes of any code
+ // point that consists of more than a single byte have their MSB set.
+ if (c < ' ' or c == '\x7f') {
+ return false;
+ }
+ } else {
+ // Check if the char is a control character or non-ASCII character. Note
+ // that char may or may not be a signed type. Regardless, non-ASCII
+ // values will always be outside of this range.
+ if (c < ' ' or c > '~') {
+ return false;
+ }
+ }
+ },
+ }
+ }
+ return true;
+}
+
+inline fn printAltName(out: *BoringSSL.BIO, name: []const u8, utf8: bool, safe_prefix: ?[*]const u8) void {
+ if (isSafeAltName(name, utf8)) {
+ // For backward-compatibility, append "safe" names without any
+ // modifications.
+ if (safe_prefix) |prefix| {
+ _ = BoringSSL.BIO_printf(out, "%s:", prefix);
+ }
+ _ = BoringSSL.BIO_write(out, @ptrCast([*]const u8, name.ptr), @intCast(c_int, name.len));
+ } else {
+ // If a name is not "safe", we cannot embed it without special
+ // encoding. This does not usually happen, but we don't want to hide
+ // it from the user either. We use JSON compatible escaping here.
+ _ = BoringSSL.BIO_write(out, "\"", 1);
+ if (safe_prefix) |prefix| {
+ _ = BoringSSL.BIO_printf(out, "%s:", prefix);
+ }
+ for (name) |c| {
+ if (c == '\\') {
+ _ = BoringSSL.BIO_write(out, "\\\\", 2);
+ } else if (c == '"') {
+ _ = BoringSSL.BIO_write(out, "\\\"", 2);
+ } else if ((c >= ' ' and c != ',' and c <= '~') or (utf8 and (c & 0x80) != 0)) {
+ // Note that the above condition explicitly excludes commas, which means
+ // that those are encoded as Unicode escape sequences in the "else"
+ // block. That is not strictly necessary, and Node.js itself would parse
+ // it correctly either way. We only do this to account for third-party
+ // code that might be splitting the string at commas (as Node.js itself
+ // used to do).
+ _ = BoringSSL.BIO_write(out, bun.cast([*]const u8, &c), 1);
+ } else {
+ // Control character or non-ASCII character. We treat everything as
+ // Latin-1, which corresponds to the first 255 Unicode code points.
+ const hex = "0123456789abcdef";
+ const u = [_]u8{ '\\', 'u', '0', '0', hex[(c & 0xf0) >> 4], hex[c & 0x0f] };
+ _ = BoringSSL.BIO_write(out, &u, @sizeOf(@TypeOf(u)));
+ }
+ }
+ _ = BoringSSL.BIO_write(out, "\"", 1);
+ }
+}
+
+inline fn printLatin1AltName(out: *BoringSSL.BIO, name: *BoringSSL.ASN1_IA5STRING, safe_prefix: ?[*]const u8) void {
+ printAltName(out, name.data[0..@intCast(usize, name.length)], false, safe_prefix);
+}
+
+inline fn printUTF8AltName(out: *BoringSSL.BIO, name: *BoringSSL.ASN1_UTF8STRING, safe_prefix: ?[*]const u8) void {
+ printAltName(out, name.data[0..@intCast(usize, name.length)], true, safe_prefix);
+}
+
+pub const kX509NameFlagsRFC2253WithinUtf8JSON = BoringSSL.XN_FLAG_RFC2253 & ~BoringSSL.ASN1_STRFLGS_ESC_MSB & ~BoringSSL.ASN1_STRFLGS_ESC_CTRL;
+
+// This function emulates the behavior of i2v_GENERAL_NAME in a safer and less
+// ambiguous way. "othername:" entries use the GENERAL_NAME_print format.
+fn x509PrintGeneralName(out: *BoringSSL.BIO, name: *BoringSSL.GENERAL_NAME) bool {
+ if (name.name_type == .GEN_DNS) {
+ _ = BoringSSL.BIO_write(out, "DNS:", 4);
+ // Note that the preferred name syntax (see RFCs 5280 and 1034) with
+ // wildcards is a subset of what we consider "safe", so spec-compliant DNS
+ // names will never need to be escaped.
+ printLatin1AltName(out, name.d.dNSName, null);
+ } else if (name.name_type == .GEN_EMAIL) {
+ _ = BoringSSL.BIO_write(out, "email:", 6);
+ printLatin1AltName(out, name.d.rfc822Name, null);
+ } else if (name.name_type == .GEN_URI) {
+ _ = BoringSSL.BIO_write(out, "URI:", 4);
+ // The set of "safe" names was designed to include just about any URI,
+ // with a few exceptions, most notably URIs that contains commas (see
+ // RFC 2396). In other words, most legitimate URIs will not require
+ // escaping.
+ printLatin1AltName(out, name.d.uniformResourceIdentifier, null);
+ } else if (name.name_type == .GEN_DIRNAME) {
+ // Earlier versions of Node.js used X509_NAME_oneline to print the X509_NAME
+ // object. The format was non standard and should be avoided. The use of
+ // X509_NAME_oneline is discouraged by OpenSSL but was required for backward
+ // compatibility. Conveniently, X509_NAME_oneline produced ASCII and the
+ // output was unlikely to contains commas or other characters that would
+ // require escaping. However, it SHOULD NOT produce ASCII output since an
+ // RFC5280 AttributeValue may be a UTF8String.
+ // Newer versions of Node.js have since switched to X509_NAME_print_ex to
+ // produce a better format at the cost of backward compatibility. The new
+ // format may contain Unicode characters and it is likely to contain commas,
+ // which require escaping. Fortunately, the recently safeguarded function
+ // printAltName handles all of that safely.
+ _ = BoringSSL.BIO_printf(out, "DirName:");
+
+ const tmp = BoringSSL.BIO_new(BoringSSL.BIO_s_mem()) orelse return false;
+
+ if (BoringSSL.X509_NAME_print_ex(tmp, name.d.dirn, 0, kX509NameFlagsRFC2253WithinUtf8JSON) < 0) {
+ return false;
+ }
+ var oline: [*]const u8 = undefined;
+ const n_bytes = BoringSSL.BIO_get_mem_data(tmp, @ptrCast([*c][*c]u8, &oline));
+ if (n_bytes <= 0) return false;
+ printAltName(out, oline[0..@intCast(usize, n_bytes)], true, null);
+ } else if (name.name_type == .GEN_OTHERNAME) {
+ // The format that is used here is based on OpenSSL's implementation of
+ // GENERAL_NAME_print (as of OpenSSL 3.0.1). Earlier versions of Node.js
+ // instead produced the same format as i2v_GENERAL_NAME, which was somewhat
+ // awkward, especially when passed to translatePeerCertificate.
+ var unicode: bool = true;
+ var prefix: ?[*]const u8 = null;
+
+ const nid = BoringSSL.OBJ_obj2nid(name.d.otherName.type_id);
+ switch (nid) {
+ BoringSSL.NID_id_on_SmtpUTF8Mailbox => {
+ prefix = "SmtpUTF8Mailbox";
+ },
+ BoringSSL.NID_XmppAddr => {
+ prefix = "XmppAddr";
+ },
+ BoringSSL.NID_SRVName => {
+ prefix = "SRVName";
+ unicode = false;
+ },
+ BoringSSL.NID_ms_upn => {
+ prefix = "UPN";
+ },
+ BoringSSL.NID_NAIRealm => {
+ prefix = "NAIRealm";
+ },
+ else => {
+ prefix = null;
+ },
+ }
+ if (name.d.otherName.value) |v| {
+ const val_type = v.type;
+ if (prefix == null or
+ (unicode and val_type != BoringSSL.V_ASN1_UTF8STRING) or
+ (!unicode and val_type != BoringSSL.V_ASN1_IA5STRING))
+ {
+ _ = BoringSSL.BIO_printf(out, "othername:<unsupported>");
+ } else {
+ _ = BoringSSL.BIO_printf(out, "othername:");
+ if (unicode) {
+ printUTF8AltName(out, v.value.utf8string, prefix);
+ } else {
+ printLatin1AltName(out, v.value.ia5string, prefix);
+ }
+ }
+ } else {
+ _ = BoringSSL.BIO_printf(out, "othername:<unsupported>");
+ }
+ } else if (name.name_type == .GEN_IPADD) {
+ _ = BoringSSL.BIO_printf(out, "IP Address:");
+ const ip = name.d.ip;
+ const b = ip.data;
+ if (ip.length == 4) {
+ _ = BoringSSL.BIO_printf(out, "%d.%d.%d.%d", b[0], b[1], b[2], b[3]);
+ } else if (ip.length == 16) {
+ for (0..8) |j| {
+ const pair: u16 = (@intCast(u16, b[2 * j]) << 8) | @intCast(u16, b[2 * j + 1]);
+ _ = BoringSSL.BIO_printf(out, if (j == 0) "%X" else ":%X", pair);
+ }
+ } else {
+ _ = BoringSSL.BIO_printf(out, "<invalid length=%d>", ip.length);
+ }
+ } else if (name.name_type == .GEN_RID) {
+ // Unlike OpenSSL's default implementation, never print the OID as text and
+ // instead always print its numeric representation.
+ var oline: [256]u8 = undefined;
+ _ = BoringSSL.OBJ_obj2txt(&oline, @sizeOf(@TypeOf(oline)), name.d.rid, 1);
+ _ = BoringSSL.BIO_printf(out, "Registered ID:%s", &oline);
+ } else if (name.name_type == .GEN_X400) {
+ _ = BoringSSL.BIO_printf(out, "X400Name:<unsupported>");
+ } else if (name.name_type == .GEN_EDIPARTY) {
+ _ = BoringSSL.BIO_printf(out, "EdiPartyName:<unsupported>");
+ } else {
+ return false;
+ }
+ return true;
+}
+
+fn x509InfoAccessPrint(out: *BoringSSL.BIO, ext: *BoringSSL.X509_EXTENSION) bool {
+ const method = BoringSSL.X509V3_EXT_get(ext);
+ if (method != BoringSSL.X509V3_EXT_get_nid(BoringSSL.NID_info_access)) {
+ return false;
+ }
+
+ if (BoringSSL.X509V3_EXT_d2i(ext)) |descs_| {
+ const descs: *BoringSSL.AUTHORITY_INFO_ACCESS = bun.cast(*BoringSSL.AUTHORITY_INFO_ACCESS, descs_);
+ defer BoringSSL.sk_ACCESS_DESCRIPTION_pop_free(descs, BoringSSL.sk_ACCESS_DESCRIPTION_free);
+ for (0..BoringSSL.sk_ACCESS_DESCRIPTION_num(descs)) |i| {
+ const gen = BoringSSL.sk_ACCESS_DESCRIPTION_value(descs, i);
+ if (gen) |desc| {
+ if (i != 0) {
+ _ = BoringSSL.BIO_write(out, "\n", 1);
+ }
+ var tmp: [80]u8 = undefined;
+ _ = BoringSSL.i2t_ASN1_OBJECT(&tmp, @sizeOf(@TypeOf(tmp)), desc.method);
+ _ = BoringSSL.BIO_printf(out, "%s - ", &tmp);
+
+ if (!x509PrintGeneralName(out, desc.location)) {
+ return false;
+ }
+ }
+ }
+ return true;
+ }
+ return false;
+}
+fn x509SubjectAltNamePrint(out: *BoringSSL.BIO, ext: *BoringSSL.X509_EXTENSION) bool {
+ const method = BoringSSL.X509V3_EXT_get(ext);
+ if (method != BoringSSL.X509V3_EXT_get_nid(BoringSSL.NID_subject_alt_name)) {
+ return false;
+ }
+
+ if (BoringSSL.X509V3_EXT_d2i(ext)) |names_| {
+ const names: *BoringSSL.struct_stack_st_GENERAL_NAME = bun.cast(*BoringSSL.struct_stack_st_GENERAL_NAME, names_);
+ defer BoringSSL.sk_GENERAL_NAME_pop_free(names, BoringSSL.sk_GENERAL_NAME_free);
+ for (0..BoringSSL.sk_GENERAL_NAME_num(names)) |i| {
+ const gen = BoringSSL.sk_GENERAL_NAME_value(names, i);
+ if (gen) |gen_name| {
+ if (i != 0) {
+ _ = BoringSSL.BIO_write(out, ", ", 2);
+ }
+
+ if (!x509PrintGeneralName(out, gen_name)) {
+ return false;
+ }
+ }
+ }
+
+ return true;
+ }
+ return false;
+}
+
+fn x509GetSubjectAltNameString(globalObject: *JSGlobalObject, bio: *BoringSSL.BIO, cert: *BoringSSL.X509) JSValue {
+ const index = BoringSSL.X509_get_ext_by_NID(cert, BoringSSL.NID_subject_alt_name, -1);
+ if (index < 0)
+ return JSValue.jsUndefined();
+
+ defer _ = BoringSSL.BIO_reset(bio);
+
+ const ext = BoringSSL.X509_get_ext(cert, index) orelse return JSValue.jsUndefined();
+
+ if (!x509SubjectAltNamePrint(bio, ext)) {
+ return JSValue.jsNull();
+ }
+
+ return JSC.ZigString.fromUTF8(bio.slice()).toValueGC(globalObject);
+}
+
+fn x509GetInfoAccessString(globalObject: *JSGlobalObject, bio: *BoringSSL.BIO, cert: *BoringSSL.X509) JSValue {
+ const index = BoringSSL.X509_get_ext_by_NID(cert, BoringSSL.NID_info_access, -1);
+ if (index < 0)
+ return JSValue.jsUndefined();
+ defer _ = BoringSSL.BIO_reset(bio);
+ const ext = BoringSSL.X509_get_ext(cert, index) orelse return JSValue.jsUndefined();
+
+ if (!x509InfoAccessPrint(bio, ext)) {
+ return JSValue.jsNull();
+ }
+
+ return JSC.ZigString.fromUTF8(bio.slice()).toValueGC(globalObject);
+}
+
+fn addFingerprintDigest(md: []const u8, mdSize: c_uint, fingerprint: []u8) usize {
+ const hex: []const u8 = "0123456789ABCDEF";
+ var idx: usize = 0;
+
+ const slice = md[0..@intCast(usize, mdSize)];
+ for (slice) |byte| {
+ fingerprint[idx] = hex[(byte & 0xF0) >> 4];
+ fingerprint[idx + 1] = hex[byte & 0x0F];
+ fingerprint[idx + 2] = ':';
+ idx += 3;
+ }
+ const length = if (idx > 0) (idx - 1) else 0;
+ fingerprint[length] = 0;
+ return length;
+}
+
+fn getFingerprintDigest(cert: *BoringSSL.X509, method: *const BoringSSL.EVP_MD, globalObject: *JSGlobalObject) JSValue {
+ var md: [BoringSSL.EVP_MAX_MD_SIZE]u8 = undefined;
+ var md_size: c_uint = 0;
+ var fingerprint: [BoringSSL.EVP_MAX_MD_SIZE * 3]u8 = undefined;
+
+ if (BoringSSL.X509_digest(cert, method, @ptrCast([*c]u8, &md), &md_size) != 0) {
+ const length = addFingerprintDigest(&md, md_size, &fingerprint);
+ return JSC.ZigString.fromUTF8(fingerprint[0..length]).toValueGC(globalObject);
+ }
+ return JSValue.jsUndefined();
+}
+
+fn getSerialNumber(cert: *BoringSSL.X509, globalObject: *JSGlobalObject) JSValue {
+ const serial_number = BoringSSL.X509_get_serialNumber(cert);
+ if (serial_number != null) {
+ const bignum = BoringSSL.ASN1_INTEGER_to_BN(serial_number, null);
+ if (bignum != null) {
+ const data = BoringSSL.BN_bn2hex(bignum);
+ if (data != null) {
+ const slice = data[0..bun.len(data)];
+ // BoringSSL prints the hex value of the serialNumber in lower case, but we need upper case
+ toUpper(slice);
+ return JSC.ZigString.fromUTF8(slice).toValueGC(globalObject);
+ }
+ }
+ }
+ return JSValue.jsUndefined();
+}
+
+fn getRawDERCertificate(cert: *BoringSSL.X509, globalObject: *JSGlobalObject) JSValue {
+ const size = BoringSSL.i2d_X509(cert, null);
+ var buffer = JSValue.createBufferFromLength(globalObject, @intCast(usize, size));
+ var buffer_ptr = @ptrCast([*c]u8, buffer.asArrayBuffer(globalObject).?.ptr);
+ const result_size = BoringSSL.i2d_X509(cert, &buffer_ptr);
+ std.debug.assert(result_size == size);
+ return buffer;
+}
+
+fn toUpper(slice: []u8) void {
+ for (0..slice.len) |i| {
+ const c = slice[i];
+ if (c >= 'a' and c <= 'z') {
+ slice[i] &= 223;
+ }
+ }
+}
+
+pub fn toJS(cert: *BoringSSL.X509, globalObject: *JSGlobalObject) JSValue {
+ const bio = BoringSSL.BIO_new(BoringSSL.BIO_s_mem()) orelse {
+ globalObject.throw("Failed to create BIO", .{});
+ return .zero;
+ };
+ defer _ = BoringSSL.BIO_free(bio);
+ var result = JSValue.createEmptyObject(globalObject, 8);
+ // X509_check_ca() returns a range of values. Only 1 means "is a CA"
+ const is_ca = BoringSSL.X509_check_ca(cert) == 1;
+ const subject = BoringSSL.X509_get_subject_name(cert);
+ result.put(globalObject, ZigString.static("subject"), x509GetNameObject(globalObject, subject));
+ const issuer = BoringSSL.X509_get_issuer_name(cert);
+ result.put(globalObject, ZigString.static("issuer"), x509GetNameObject(globalObject, issuer));
+ result.put(globalObject, ZigString.static("subjectaltname"), x509GetSubjectAltNameString(globalObject, bio, cert));
+ result.put(globalObject, ZigString.static("infoAccess"), x509GetInfoAccessString(globalObject, bio, cert));
+ result.put(globalObject, ZigString.static("ca"), JSValue.jsBoolean(is_ca));
+
+ const pkey = BoringSSL.X509_get_pubkey(cert);
+
+ switch (BoringSSL.EVP_PKEY_id(pkey)) {
+ BoringSSL.EVP_PKEY_RSA => {
+ const rsa_key = BoringSSL.EVP_PKEY_get1_RSA(pkey);
+ if (rsa_key) |rsa| {
+ var n: [*c]const BoringSSL.BIGNUM = undefined;
+ var e: [*c]const BoringSSL.BIGNUM = undefined;
+ BoringSSL.RSA_get0_key(rsa, @ptrCast([*c][*c]const BoringSSL.BIGNUM, &n), @ptrCast([*c][*c]const BoringSSL.BIGNUM, &e), null);
+ _ = BoringSSL.BN_print(bio, n);
+
+ var bits = JSValue.jsUndefined();
+
+ const bits_value = BoringSSL.BN_num_bits(n);
+ if (bits_value > 0) {
+ bits = JSValue.jsNumber(bits_value);
+ }
+
+ result.put(globalObject, ZigString.static("bits"), bits);
+ const slice = bio.slice();
+ // BoringSSL prints the hex value of the modulus in lower case, but we need upper case
+ toUpper(slice);
+ const modulus = JSC.ZigString.fromUTF8(slice).toValueGC(globalObject);
+ _ = BoringSSL.BIO_reset(bio);
+ result.put(globalObject, ZigString.static("modulus"), modulus);
+
+ const exponent_word = BoringSSL.BN_get_word(e);
+ _ = BoringSSL.BIO_printf(bio, "0x" ++ BoringSSL.BN_HEX_FMT1, exponent_word);
+ const exponent = JSC.ZigString.fromUTF8(bio.slice()).toValueGC(globalObject);
+ _ = BoringSSL.BIO_reset(bio);
+ result.put(globalObject, ZigString.static("exponent"), exponent);
+
+ const size = BoringSSL.i2d_RSA_PUBKEY(rsa, null);
+ if (size <= 0) {
+ globalObject.throw("Failed to get public key length", .{});
+ return .zero;
+ }
+
+ var buffer = JSValue.createBufferFromLength(globalObject, @intCast(usize, size));
+ var buffer_ptr = @ptrCast([*c]u8, buffer.asArrayBuffer(globalObject).?.ptr);
+
+ _ = BoringSSL.i2d_RSA_PUBKEY(rsa, &buffer_ptr);
+
+ result.put(globalObject, ZigString.static("pubkey"), buffer);
+ }
+ },
+ BoringSSL.EVP_PKEY_EC => {
+ const ec_key = BoringSSL.EVP_PKEY_get1_EC_KEY(pkey);
+ if (ec_key) |ec| {
+ const group = BoringSSL.EC_KEY_get0_group(ec);
+ var bits = JSValue.jsUndefined();
+ if (group) |g| {
+ const bits_value = BoringSSL.EC_GROUP_order_bits(g);
+ if (bits_value > 0) {
+ bits = JSValue.jsNumber(bits_value);
+ }
+ }
+ result.put(globalObject, ZigString.static("bits"), bits);
+
+ const ec_pubkey = BoringSSL.EC_KEY_get0_public_key(ec);
+ if (ec_pubkey) |point| {
+ const form = BoringSSL.EC_KEY_get_conv_form(ec);
+ const size = BoringSSL.EC_POINT_point2oct(group, point, form, null, 0, null);
+ if (size <= 0) {
+ globalObject.throw("Failed to get public key length", .{});
+ return .zero;
+ }
+
+ var buffer = JSValue.createBufferFromLength(globalObject, @intCast(usize, size));
+ var buffer_ptr = @ptrCast([*c]u8, buffer.asArrayBuffer(globalObject).?.ptr);
+
+ const result_size = BoringSSL.EC_POINT_point2oct(group, point, form, buffer_ptr, size, null);
+ std.debug.assert(result_size == size);
+ result.put(globalObject, ZigString.static("pubkey"), buffer);
+ } else {
+ result.put(globalObject, ZigString.static("pubkey"), JSValue.jsUndefined());
+ }
+ const nid = BoringSSL.EC_GROUP_get_curve_name(group);
+
+ if (nid != 0) {
+ // Curve is well-known, get its OID and NIST nick-name (if it has one).
+ const asn1Curve_str = BoringSSL.OBJ_nid2sn(nid);
+ if (asn1Curve_str != null) {
+ result.put(globalObject, ZigString.static("asn1Curve"), JSC.ZigString.fromUTF8(asn1Curve_str[0..bun.len(asn1Curve_str)]).toValueGC(globalObject));
+ }
+ const nistCurve_str = BoringSSL.EC_curve_nid2nist(nid);
+ if (nistCurve_str != null) {
+ result.put(globalObject, ZigString.static("nistCurve"), JSC.ZigString.fromUTF8(nistCurve_str[0..bun.len(nistCurve_str)]).toValueGC(globalObject));
+ }
+ }
+ }
+ },
+ else => {},
+ }
+ _ = BoringSSL.ASN1_TIME_print(bio, BoringSSL.X509_get0_notBefore(cert));
+ result.put(globalObject, ZigString.static("valid_from"), JSC.ZigString.fromUTF8(bio.slice()).toValueGC(globalObject));
+ _ = BoringSSL.BIO_reset(bio);
+
+ _ = BoringSSL.ASN1_TIME_print(bio, BoringSSL.X509_get0_notAfter(cert));
+ result.put(globalObject, ZigString.static("valid_to"), JSC.ZigString.fromUTF8(bio.slice()).toValueGC(globalObject));
+ _ = BoringSSL.BIO_reset(bio);
+
+ result.put(globalObject, ZigString.static("fingerprint"), getFingerprintDigest(cert, BoringSSL.EVP_sha1(), globalObject));
+ result.put(globalObject, ZigString.static("fingerprint256"), getFingerprintDigest(cert, BoringSSL.EVP_sha256(), globalObject));
+ result.put(globalObject, ZigString.static("fingerprint512"), getFingerprintDigest(cert, BoringSSL.EVP_sha512(), globalObject));
+ result.put(globalObject, ZigString.static("serialNumber"), getSerialNumber(cert, globalObject));
+ result.put(globalObject, ZigString.static("raw"), getRawDERCertificate(cert, globalObject));
+ return result;
+}
diff --git a/src/bun.js/api/sockets.classes.ts b/src/bun.js/api/sockets.classes.ts
index 5bd073b9f..2a17ca39d 100644
--- a/src/bun.js/api/sockets.classes.ts
+++ b/src/bun.js/api/sockets.classes.ts
@@ -12,6 +12,59 @@ function generate(ssl) {
fn: "getAuthorizationError",
length: 0,
},
+
+ getTLSFinishedMessage: {
+ fn: "getTLSFinishedMessage",
+ length: 0,
+ },
+ getTLSPeerFinishedMessage: {
+ fn: "getTLSPeerFinishedMessage",
+ length: 0,
+ },
+ getEphemeralKeyInfo: {
+ fn: "getEphemeralKeyInfo",
+ length: 0,
+ },
+ getCipher: {
+ fn: "getCipher",
+ length: 0,
+ },
+ getSession: {
+ fn: "getSession",
+ length: 0,
+ },
+ setSession: {
+ fn: "setSession",
+ length: 0,
+ },
+ getTLSTicket: {
+ fn: "getTLSTicket",
+ length: 0,
+ },
+ exportKeyingMaterial: {
+ fn: "exportKeyingMaterial",
+ length: 3,
+ },
+ setMaxSendFragment: {
+ fn: "setMaxSendFragment",
+ length: 1,
+ },
+ getSharedSigalgs: {
+ fn: "getSharedSigalgs",
+ length: 0,
+ },
+ getTLSVersion: {
+ fn: "getTLSVersion",
+ length: 0,
+ },
+ getPeerCertificate: {
+ fn: "getPeerCertificate",
+ length: 1,
+ },
+ getCertificate: {
+ fn: "getCertificate",
+ length: 0,
+ },
authorized: {
getter: "getAuthorized",
},
diff --git a/src/bun.js/bindings/JSSink.cpp b/src/bun.js/bindings/JSSink.cpp
index 8be4fe95b..09a5a396c 100644
--- a/src/bun.js/bindings/JSSink.cpp
+++ b/src/bun.js/bindings/JSSink.cpp
@@ -1,6 +1,6 @@
// AUTO-GENERATED FILE. DO NOT EDIT.
-// Generated by 'make generate-sink' at 2023-07-09T17:58:51.559Z
+// Generated by 'make generate-sink' at 2023-07-17T20:32:20.223Z
// To regenerate this file, run:
//
// make generate-sink
diff --git a/src/bun.js/bindings/JSSink.h b/src/bun.js/bindings/JSSink.h
index 3826ef696..46111a0a2 100644
--- a/src/bun.js/bindings/JSSink.h
+++ b/src/bun.js/bindings/JSSink.h
@@ -1,6 +1,6 @@
// AUTO-GENERATED FILE. DO NOT EDIT.
-// Generated by 'make generate-sink' at 2023-07-09T17:58:51.558Z
+// Generated by 'make generate-sink' at 2023-07-17T20:32:20.222Z
//
#pragma once
diff --git a/src/bun.js/bindings/JSSinkLookupTable.h b/src/bun.js/bindings/JSSinkLookupTable.h
index 7ff4c3f9c..e4ed81629 100644
--- a/src/bun.js/bindings/JSSinkLookupTable.h
+++ b/src/bun.js/bindings/JSSinkLookupTable.h
@@ -1,4 +1,4 @@
-// Automatically generated from src/bun.js/bindings/JSSink.cpp using /Users/ashcon/Desktop/code/bun/src/bun.js/WebKit/Source/JavaScriptCore/create_hash_table. DO NOT EDIT!
+// Automatically generated from src/bun.js/bindings/JSSink.cpp using /home/cirospaciari/Repos/bun/src/bun.js/WebKit/Source/JavaScriptCore/create_hash_table. DO NOT EDIT!
diff --git a/src/bun.js/bindings/ZigGeneratedClasses.cpp b/src/bun.js/bindings/ZigGeneratedClasses.cpp
index c11766926..245010158 100644
--- a/src/bun.js/bindings/ZigGeneratedClasses.cpp
+++ b/src/bun.js/bindings/ZigGeneratedClasses.cpp
@@ -17008,12 +17008,45 @@ JSC_DECLARE_CUSTOM_SETTER(TCPSocketPrototype__dataSetterWrap);
extern "C" EncodedJSValue TCPSocketPrototype__end(void* ptr, JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame);
JSC_DECLARE_HOST_FUNCTION(TCPSocketPrototype__endCallback);
+extern "C" EncodedJSValue TCPSocketPrototype__exportKeyingMaterial(void* ptr, JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame);
+JSC_DECLARE_HOST_FUNCTION(TCPSocketPrototype__exportKeyingMaterialCallback);
+
extern "C" EncodedJSValue TCPSocketPrototype__flush(void* ptr, JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame);
JSC_DECLARE_HOST_FUNCTION(TCPSocketPrototype__flushCallback);
extern "C" EncodedJSValue TCPSocketPrototype__getAuthorizationError(void* ptr, JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame);
JSC_DECLARE_HOST_FUNCTION(TCPSocketPrototype__getAuthorizationErrorCallback);
+extern "C" EncodedJSValue TCPSocketPrototype__getCertificate(void* ptr, JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame);
+JSC_DECLARE_HOST_FUNCTION(TCPSocketPrototype__getCertificateCallback);
+
+extern "C" EncodedJSValue TCPSocketPrototype__getCipher(void* ptr, JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame);
+JSC_DECLARE_HOST_FUNCTION(TCPSocketPrototype__getCipherCallback);
+
+extern "C" EncodedJSValue TCPSocketPrototype__getEphemeralKeyInfo(void* ptr, JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame);
+JSC_DECLARE_HOST_FUNCTION(TCPSocketPrototype__getEphemeralKeyInfoCallback);
+
+extern "C" EncodedJSValue TCPSocketPrototype__getPeerCertificate(void* ptr, JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame);
+JSC_DECLARE_HOST_FUNCTION(TCPSocketPrototype__getPeerCertificateCallback);
+
+extern "C" EncodedJSValue TCPSocketPrototype__getSession(void* ptr, JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame);
+JSC_DECLARE_HOST_FUNCTION(TCPSocketPrototype__getSessionCallback);
+
+extern "C" EncodedJSValue TCPSocketPrototype__getSharedSigalgs(void* ptr, JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame);
+JSC_DECLARE_HOST_FUNCTION(TCPSocketPrototype__getSharedSigalgsCallback);
+
+extern "C" EncodedJSValue TCPSocketPrototype__getTLSFinishedMessage(void* ptr, JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame);
+JSC_DECLARE_HOST_FUNCTION(TCPSocketPrototype__getTLSFinishedMessageCallback);
+
+extern "C" EncodedJSValue TCPSocketPrototype__getTLSPeerFinishedMessage(void* ptr, JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame);
+JSC_DECLARE_HOST_FUNCTION(TCPSocketPrototype__getTLSPeerFinishedMessageCallback);
+
+extern "C" EncodedJSValue TCPSocketPrototype__getTLSTicket(void* ptr, JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame);
+JSC_DECLARE_HOST_FUNCTION(TCPSocketPrototype__getTLSTicketCallback);
+
+extern "C" EncodedJSValue TCPSocketPrototype__getTLSVersion(void* ptr, JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame);
+JSC_DECLARE_HOST_FUNCTION(TCPSocketPrototype__getTLSVersionCallback);
+
extern "C" JSC::EncodedJSValue TCPSocketPrototype__getListener(void* ptr, JSC::JSGlobalObject* lexicalGlobalObject);
JSC_DECLARE_CUSTOM_GETTER(TCPSocketPrototype__listenerGetterWrap);
@@ -17032,9 +17065,15 @@ JSC_DECLARE_HOST_FUNCTION(TCPSocketPrototype__reloadCallback);
extern "C" JSC::EncodedJSValue TCPSocketPrototype__getRemoteAddress(void* ptr, JSC::JSGlobalObject* lexicalGlobalObject);
JSC_DECLARE_CUSTOM_GETTER(TCPSocketPrototype__remoteAddressGetterWrap);
+extern "C" EncodedJSValue TCPSocketPrototype__setMaxSendFragment(void* ptr, JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame);
+JSC_DECLARE_HOST_FUNCTION(TCPSocketPrototype__setMaxSendFragmentCallback);
+
extern "C" EncodedJSValue TCPSocketPrototype__setServername(void* ptr, JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame);
JSC_DECLARE_HOST_FUNCTION(TCPSocketPrototype__setServernameCallback);
+extern "C" EncodedJSValue TCPSocketPrototype__setSession(void* ptr, JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame);
+JSC_DECLARE_HOST_FUNCTION(TCPSocketPrototype__setSessionCallback);
+
extern "C" EncodedJSValue TCPSocketPrototype__shutdown(void* ptr, JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame);
JSC_DECLARE_HOST_FUNCTION(TCPSocketPrototype__shutdownCallback);
@@ -17057,15 +17096,28 @@ static const HashTableValue JSTCPSocketPrototypeTableValues[] = {
{ "authorized"_s, static_cast<unsigned>(JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute | PropertyAttribute::DontDelete), NoIntrinsic, { HashTableValue::GetterSetterType, TCPSocketPrototype__authorizedGetterWrap, 0 } },
{ "data"_s, static_cast<unsigned>(JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute | PropertyAttribute::DontDelete), NoIntrinsic, { HashTableValue::GetterSetterType, TCPSocketPrototype__dataGetterWrap, TCPSocketPrototype__dataSetterWrap } },
{ "end"_s, static_cast<unsigned>(JSC::PropertyAttribute::Function | PropertyAttribute::DontDelete), NoIntrinsic, { HashTableValue::NativeFunctionType, TCPSocketPrototype__endCallback, 3 } },
+ { "exportKeyingMaterial"_s, static_cast<unsigned>(JSC::PropertyAttribute::Function | PropertyAttribute::DontDelete), NoIntrinsic, { HashTableValue::NativeFunctionType, TCPSocketPrototype__exportKeyingMaterialCallback, 3 } },
{ "flush"_s, static_cast<unsigned>(JSC::PropertyAttribute::Function | PropertyAttribute::DontDelete), NoIntrinsic, { HashTableValue::NativeFunctionType, TCPSocketPrototype__flushCallback, 0 } },
{ "getAuthorizationError"_s, static_cast<unsigned>(JSC::PropertyAttribute::Function | PropertyAttribute::DontDelete), NoIntrinsic, { HashTableValue::NativeFunctionType, TCPSocketPrototype__getAuthorizationErrorCallback, 0 } },
+ { "getCertificate"_s, static_cast<unsigned>(JSC::PropertyAttribute::Function | PropertyAttribute::DontDelete), NoIntrinsic, { HashTableValue::NativeFunctionType, TCPSocketPrototype__getCertificateCallback, 0 } },
+ { "getCipher"_s, static_cast<unsigned>(JSC::PropertyAttribute::Function | PropertyAttribute::DontDelete), NoIntrinsic, { HashTableValue::NativeFunctionType, TCPSocketPrototype__getCipherCallback, 0 } },
+ { "getEphemeralKeyInfo"_s, static_cast<unsigned>(JSC::PropertyAttribute::Function | PropertyAttribute::DontDelete), NoIntrinsic, { HashTableValue::NativeFunctionType, TCPSocketPrototype__getEphemeralKeyInfoCallback, 0 } },
+ { "getPeerCertificate"_s, static_cast<unsigned>(JSC::PropertyAttribute::Function | PropertyAttribute::DontDelete), NoIntrinsic, { HashTableValue::NativeFunctionType, TCPSocketPrototype__getPeerCertificateCallback, 1 } },
+ { "getSession"_s, static_cast<unsigned>(JSC::PropertyAttribute::Function | PropertyAttribute::DontDelete), NoIntrinsic, { HashTableValue::NativeFunctionType, TCPSocketPrototype__getSessionCallback, 0 } },
+ { "getSharedSigalgs"_s, static_cast<unsigned>(JSC::PropertyAttribute::Function | PropertyAttribute::DontDelete), NoIntrinsic, { HashTableValue::NativeFunctionType, TCPSocketPrototype__getSharedSigalgsCallback, 0 } },
+ { "getTLSFinishedMessage"_s, static_cast<unsigned>(JSC::PropertyAttribute::Function | PropertyAttribute::DontDelete), NoIntrinsic, { HashTableValue::NativeFunctionType, TCPSocketPrototype__getTLSFinishedMessageCallback, 0 } },
+ { "getTLSPeerFinishedMessage"_s, static_cast<unsigned>(JSC::PropertyAttribute::Function | PropertyAttribute::DontDelete), NoIntrinsic, { HashTableValue::NativeFunctionType, TCPSocketPrototype__getTLSPeerFinishedMessageCallback, 0 } },
+ { "getTLSTicket"_s, static_cast<unsigned>(JSC::PropertyAttribute::Function | PropertyAttribute::DontDelete), NoIntrinsic, { HashTableValue::NativeFunctionType, TCPSocketPrototype__getTLSTicketCallback, 0 } },
+ { "getTLSVersion"_s, static_cast<unsigned>(JSC::PropertyAttribute::Function | PropertyAttribute::DontDelete), NoIntrinsic, { HashTableValue::NativeFunctionType, TCPSocketPrototype__getTLSVersionCallback, 0 } },
{ "listener"_s, static_cast<unsigned>(JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute | PropertyAttribute::DontDelete), NoIntrinsic, { HashTableValue::GetterSetterType, TCPSocketPrototype__listenerGetterWrap, 0 } },
{ "localPort"_s, static_cast<unsigned>(JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute | PropertyAttribute::DontDelete), NoIntrinsic, { HashTableValue::GetterSetterType, TCPSocketPrototype__localPortGetterWrap, 0 } },
{ "readyState"_s, static_cast<unsigned>(JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute | PropertyAttribute::DontDelete), NoIntrinsic, { HashTableValue::GetterSetterType, TCPSocketPrototype__readyStateGetterWrap, 0 } },
{ "ref"_s, static_cast<unsigned>(JSC::PropertyAttribute::Function | PropertyAttribute::DontDelete), NoIntrinsic, { HashTableValue::NativeFunctionType, TCPSocketPrototype__refCallback, 0 } },
{ "reload"_s, static_cast<unsigned>(JSC::PropertyAttribute::Function | PropertyAttribute::DontDelete), NoIntrinsic, { HashTableValue::NativeFunctionType, TCPSocketPrototype__reloadCallback, 1 } },
{ "remoteAddress"_s, static_cast<unsigned>(JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute | PropertyAttribute::DontDelete), NoIntrinsic, { HashTableValue::GetterSetterType, TCPSocketPrototype__remoteAddressGetterWrap, 0 } },
+ { "setMaxSendFragment"_s, static_cast<unsigned>(JSC::PropertyAttribute::Function | PropertyAttribute::DontDelete), NoIntrinsic, { HashTableValue::NativeFunctionType, TCPSocketPrototype__setMaxSendFragmentCallback, 1 } },
{ "setServername"_s, static_cast<unsigned>(JSC::PropertyAttribute::Function | PropertyAttribute::DontDelete), NoIntrinsic, { HashTableValue::NativeFunctionType, TCPSocketPrototype__setServernameCallback, 1 } },
+ { "setSession"_s, static_cast<unsigned>(JSC::PropertyAttribute::Function | PropertyAttribute::DontDelete), NoIntrinsic, { HashTableValue::NativeFunctionType, TCPSocketPrototype__setSessionCallback, 0 } },
{ "shutdown"_s, static_cast<unsigned>(JSC::PropertyAttribute::Function | PropertyAttribute::DontDelete), NoIntrinsic, { HashTableValue::NativeFunctionType, TCPSocketPrototype__shutdownCallback, 1 } },
{ "timeout"_s, static_cast<unsigned>(JSC::PropertyAttribute::Function | PropertyAttribute::DontDelete), NoIntrinsic, { HashTableValue::NativeFunctionType, TCPSocketPrototype__timeoutCallback, 1 } },
{ "unref"_s, static_cast<unsigned>(JSC::PropertyAttribute::Function | PropertyAttribute::DontDelete), NoIntrinsic, { HashTableValue::NativeFunctionType, TCPSocketPrototype__unrefCallback, 0 } },
@@ -17180,6 +17232,33 @@ JSC_DEFINE_HOST_FUNCTION(TCPSocketPrototype__endCallback, (JSGlobalObject * lexi
return TCPSocketPrototype__end(thisObject->wrapped(), lexicalGlobalObject, callFrame);
}
+JSC_DEFINE_HOST_FUNCTION(TCPSocketPrototype__exportKeyingMaterialCallback, (JSGlobalObject * lexicalGlobalObject, CallFrame* callFrame))
+{
+ auto& vm = lexicalGlobalObject->vm();
+
+ JSTCPSocket* thisObject = jsDynamicCast<JSTCPSocket*>(callFrame->thisValue());
+
+ if (UNLIKELY(!thisObject)) {
+ auto throwScope = DECLARE_THROW_SCOPE(vm);
+ return throwVMTypeError(lexicalGlobalObject, throwScope);
+ }
+
+ JSC::EnsureStillAliveScope thisArg = JSC::EnsureStillAliveScope(thisObject);
+
+#ifdef BUN_DEBUG
+ /** View the file name of the JS file that called this function
+ * from a debugger */
+ SourceOrigin sourceOrigin = callFrame->callerSourceOrigin(vm);
+ const char* fileName = sourceOrigin.string().utf8().data();
+ static const char* lastFileName = nullptr;
+ if (lastFileName != fileName) {
+ lastFileName = fileName;
+ }
+#endif
+
+ return TCPSocketPrototype__exportKeyingMaterial(thisObject->wrapped(), lexicalGlobalObject, callFrame);
+}
+
JSC_DEFINE_HOST_FUNCTION(TCPSocketPrototype__flushCallback, (JSGlobalObject * lexicalGlobalObject, CallFrame* callFrame))
{
auto& vm = lexicalGlobalObject->vm();
@@ -17234,6 +17313,276 @@ JSC_DEFINE_HOST_FUNCTION(TCPSocketPrototype__getAuthorizationErrorCallback, (JSG
return TCPSocketPrototype__getAuthorizationError(thisObject->wrapped(), lexicalGlobalObject, callFrame);
}
+JSC_DEFINE_HOST_FUNCTION(TCPSocketPrototype__getCertificateCallback, (JSGlobalObject * lexicalGlobalObject, CallFrame* callFrame))
+{
+ auto& vm = lexicalGlobalObject->vm();
+
+ JSTCPSocket* thisObject = jsDynamicCast<JSTCPSocket*>(callFrame->thisValue());
+
+ if (UNLIKELY(!thisObject)) {
+ auto throwScope = DECLARE_THROW_SCOPE(vm);
+ return throwVMTypeError(lexicalGlobalObject, throwScope);
+ }
+
+ JSC::EnsureStillAliveScope thisArg = JSC::EnsureStillAliveScope(thisObject);
+
+#ifdef BUN_DEBUG
+ /** View the file name of the JS file that called this function
+ * from a debugger */
+ SourceOrigin sourceOrigin = callFrame->callerSourceOrigin(vm);
+ const char* fileName = sourceOrigin.string().utf8().data();
+ static const char* lastFileName = nullptr;
+ if (lastFileName != fileName) {
+ lastFileName = fileName;
+ }
+#endif
+
+ return TCPSocketPrototype__getCertificate(thisObject->wrapped(), lexicalGlobalObject, callFrame);
+}
+
+JSC_DEFINE_HOST_FUNCTION(TCPSocketPrototype__getCipherCallback, (JSGlobalObject * lexicalGlobalObject, CallFrame* callFrame))
+{
+ auto& vm = lexicalGlobalObject->vm();
+
+ JSTCPSocket* thisObject = jsDynamicCast<JSTCPSocket*>(callFrame->thisValue());
+
+ if (UNLIKELY(!thisObject)) {
+ auto throwScope = DECLARE_THROW_SCOPE(vm);
+ return throwVMTypeError(lexicalGlobalObject, throwScope);
+ }
+
+ JSC::EnsureStillAliveScope thisArg = JSC::EnsureStillAliveScope(thisObject);
+
+#ifdef BUN_DEBUG
+ /** View the file name of the JS file that called this function
+ * from a debugger */
+ SourceOrigin sourceOrigin = callFrame->callerSourceOrigin(vm);
+ const char* fileName = sourceOrigin.string().utf8().data();
+ static const char* lastFileName = nullptr;
+ if (lastFileName != fileName) {
+ lastFileName = fileName;
+ }
+#endif
+
+ return TCPSocketPrototype__getCipher(thisObject->wrapped(), lexicalGlobalObject, callFrame);
+}
+
+JSC_DEFINE_HOST_FUNCTION(TCPSocketPrototype__getEphemeralKeyInfoCallback, (JSGlobalObject * lexicalGlobalObject, CallFrame* callFrame))
+{
+ auto& vm = lexicalGlobalObject->vm();
+
+ JSTCPSocket* thisObject = jsDynamicCast<JSTCPSocket*>(callFrame->thisValue());
+
+ if (UNLIKELY(!thisObject)) {
+ auto throwScope = DECLARE_THROW_SCOPE(vm);
+ return throwVMTypeError(lexicalGlobalObject, throwScope);
+ }
+
+ JSC::EnsureStillAliveScope thisArg = JSC::EnsureStillAliveScope(thisObject);
+
+#ifdef BUN_DEBUG
+ /** View the file name of the JS file that called this function
+ * from a debugger */
+ SourceOrigin sourceOrigin = callFrame->callerSourceOrigin(vm);
+ const char* fileName = sourceOrigin.string().utf8().data();
+ static const char* lastFileName = nullptr;
+ if (lastFileName != fileName) {
+ lastFileName = fileName;
+ }
+#endif
+
+ return TCPSocketPrototype__getEphemeralKeyInfo(thisObject->wrapped(), lexicalGlobalObject, callFrame);
+}
+
+JSC_DEFINE_HOST_FUNCTION(TCPSocketPrototype__getPeerCertificateCallback, (JSGlobalObject * lexicalGlobalObject, CallFrame* callFrame))
+{
+ auto& vm = lexicalGlobalObject->vm();
+
+ JSTCPSocket* thisObject = jsDynamicCast<JSTCPSocket*>(callFrame->thisValue());
+
+ if (UNLIKELY(!thisObject)) {
+ auto throwScope = DECLARE_THROW_SCOPE(vm);
+ return throwVMTypeError(lexicalGlobalObject, throwScope);
+ }
+
+ JSC::EnsureStillAliveScope thisArg = JSC::EnsureStillAliveScope(thisObject);
+
+#ifdef BUN_DEBUG
+ /** View the file name of the JS file that called this function
+ * from a debugger */
+ SourceOrigin sourceOrigin = callFrame->callerSourceOrigin(vm);
+ const char* fileName = sourceOrigin.string().utf8().data();
+ static const char* lastFileName = nullptr;
+ if (lastFileName != fileName) {
+ lastFileName = fileName;
+ }
+#endif
+
+ return TCPSocketPrototype__getPeerCertificate(thisObject->wrapped(), lexicalGlobalObject, callFrame);
+}
+
+JSC_DEFINE_HOST_FUNCTION(TCPSocketPrototype__getSessionCallback, (JSGlobalObject * lexicalGlobalObject, CallFrame* callFrame))
+{
+ auto& vm = lexicalGlobalObject->vm();
+
+ JSTCPSocket* thisObject = jsDynamicCast<JSTCPSocket*>(callFrame->thisValue());
+
+ if (UNLIKELY(!thisObject)) {
+ auto throwScope = DECLARE_THROW_SCOPE(vm);
+ return throwVMTypeError(lexicalGlobalObject, throwScope);
+ }
+
+ JSC::EnsureStillAliveScope thisArg = JSC::EnsureStillAliveScope(thisObject);
+
+#ifdef BUN_DEBUG
+ /** View the file name of the JS file that called this function
+ * from a debugger */
+ SourceOrigin sourceOrigin = callFrame->callerSourceOrigin(vm);
+ const char* fileName = sourceOrigin.string().utf8().data();
+ static const char* lastFileName = nullptr;
+ if (lastFileName != fileName) {
+ lastFileName = fileName;
+ }
+#endif
+
+ return TCPSocketPrototype__getSession(thisObject->wrapped(), lexicalGlobalObject, callFrame);
+}
+
+JSC_DEFINE_HOST_FUNCTION(TCPSocketPrototype__getSharedSigalgsCallback, (JSGlobalObject * lexicalGlobalObject, CallFrame* callFrame))
+{
+ auto& vm = lexicalGlobalObject->vm();
+
+ JSTCPSocket* thisObject = jsDynamicCast<JSTCPSocket*>(callFrame->thisValue());
+
+ if (UNLIKELY(!thisObject)) {
+ auto throwScope = DECLARE_THROW_SCOPE(vm);
+ return throwVMTypeError(lexicalGlobalObject, throwScope);
+ }
+
+ JSC::EnsureStillAliveScope thisArg = JSC::EnsureStillAliveScope(thisObject);
+
+#ifdef BUN_DEBUG
+ /** View the file name of the JS file that called this function
+ * from a debugger */
+ SourceOrigin sourceOrigin = callFrame->callerSourceOrigin(vm);
+ const char* fileName = sourceOrigin.string().utf8().data();
+ static const char* lastFileName = nullptr;
+ if (lastFileName != fileName) {
+ lastFileName = fileName;
+ }
+#endif
+
+ return TCPSocketPrototype__getSharedSigalgs(thisObject->wrapped(), lexicalGlobalObject, callFrame);
+}
+
+JSC_DEFINE_HOST_FUNCTION(TCPSocketPrototype__getTLSFinishedMessageCallback, (JSGlobalObject * lexicalGlobalObject, CallFrame* callFrame))
+{
+ auto& vm = lexicalGlobalObject->vm();
+
+ JSTCPSocket* thisObject = jsDynamicCast<JSTCPSocket*>(callFrame->thisValue());
+
+ if (UNLIKELY(!thisObject)) {
+ auto throwScope = DECLARE_THROW_SCOPE(vm);
+ return throwVMTypeError(lexicalGlobalObject, throwScope);
+ }
+
+ JSC::EnsureStillAliveScope thisArg = JSC::EnsureStillAliveScope(thisObject);
+
+#ifdef BUN_DEBUG
+ /** View the file name of the JS file that called this function
+ * from a debugger */
+ SourceOrigin sourceOrigin = callFrame->callerSourceOrigin(vm);
+ const char* fileName = sourceOrigin.string().utf8().data();
+ static const char* lastFileName = nullptr;
+ if (lastFileName != fileName) {
+ lastFileName = fileName;
+ }
+#endif
+
+ return TCPSocketPrototype__getTLSFinishedMessage(thisObject->wrapped(), lexicalGlobalObject, callFrame);
+}
+
+JSC_DEFINE_HOST_FUNCTION(TCPSocketPrototype__getTLSPeerFinishedMessageCallback, (JSGlobalObject * lexicalGlobalObject, CallFrame* callFrame))
+{
+ auto& vm = lexicalGlobalObject->vm();
+
+ JSTCPSocket* thisObject = jsDynamicCast<JSTCPSocket*>(callFrame->thisValue());
+
+ if (UNLIKELY(!thisObject)) {
+ auto throwScope = DECLARE_THROW_SCOPE(vm);
+ return throwVMTypeError(lexicalGlobalObject, throwScope);
+ }
+
+ JSC::EnsureStillAliveScope thisArg = JSC::EnsureStillAliveScope(thisObject);
+
+#ifdef BUN_DEBUG
+ /** View the file name of the JS file that called this function
+ * from a debugger */
+ SourceOrigin sourceOrigin = callFrame->callerSourceOrigin(vm);
+ const char* fileName = sourceOrigin.string().utf8().data();
+ static const char* lastFileName = nullptr;
+ if (lastFileName != fileName) {
+ lastFileName = fileName;
+ }
+#endif
+
+ return TCPSocketPrototype__getTLSPeerFinishedMessage(thisObject->wrapped(), lexicalGlobalObject, callFrame);
+}
+
+JSC_DEFINE_HOST_FUNCTION(TCPSocketPrototype__getTLSTicketCallback, (JSGlobalObject * lexicalGlobalObject, CallFrame* callFrame))
+{
+ auto& vm = lexicalGlobalObject->vm();
+
+ JSTCPSocket* thisObject = jsDynamicCast<JSTCPSocket*>(callFrame->thisValue());
+
+ if (UNLIKELY(!thisObject)) {
+ auto throwScope = DECLARE_THROW_SCOPE(vm);
+ return throwVMTypeError(lexicalGlobalObject, throwScope);
+ }
+
+ JSC::EnsureStillAliveScope thisArg = JSC::EnsureStillAliveScope(thisObject);
+
+#ifdef BUN_DEBUG
+ /** View the file name of the JS file that called this function
+ * from a debugger */
+ SourceOrigin sourceOrigin = callFrame->callerSourceOrigin(vm);
+ const char* fileName = sourceOrigin.string().utf8().data();
+ static const char* lastFileName = nullptr;
+ if (lastFileName != fileName) {
+ lastFileName = fileName;
+ }
+#endif
+
+ return TCPSocketPrototype__getTLSTicket(thisObject->wrapped(), lexicalGlobalObject, callFrame);
+}
+
+JSC_DEFINE_HOST_FUNCTION(TCPSocketPrototype__getTLSVersionCallback, (JSGlobalObject * lexicalGlobalObject, CallFrame* callFrame))
+{
+ auto& vm = lexicalGlobalObject->vm();
+
+ JSTCPSocket* thisObject = jsDynamicCast<JSTCPSocket*>(callFrame->thisValue());
+
+ if (UNLIKELY(!thisObject)) {
+ auto throwScope = DECLARE_THROW_SCOPE(vm);
+ return throwVMTypeError(lexicalGlobalObject, throwScope);
+ }
+
+ JSC::EnsureStillAliveScope thisArg = JSC::EnsureStillAliveScope(thisObject);
+
+#ifdef BUN_DEBUG
+ /** View the file name of the JS file that called this function
+ * from a debugger */
+ SourceOrigin sourceOrigin = callFrame->callerSourceOrigin(vm);
+ const char* fileName = sourceOrigin.string().utf8().data();
+ static const char* lastFileName = nullptr;
+ if (lastFileName != fileName) {
+ lastFileName = fileName;
+ }
+#endif
+
+ return TCPSocketPrototype__getTLSVersion(thisObject->wrapped(), lexicalGlobalObject, callFrame);
+}
+
JSC_DEFINE_CUSTOM_GETTER(TCPSocketPrototype__listenerGetterWrap, (JSGlobalObject * lexicalGlobalObject, EncodedJSValue thisValue, PropertyName attributeName))
{
auto& vm = lexicalGlobalObject->vm();
@@ -17355,6 +17704,33 @@ extern "C" EncodedJSValue TCPSocketPrototype__remoteAddressGetCachedValue(JSC::E
return JSValue::encode(thisObject->m_remoteAddress.get());
}
+JSC_DEFINE_HOST_FUNCTION(TCPSocketPrototype__setMaxSendFragmentCallback, (JSGlobalObject * lexicalGlobalObject, CallFrame* callFrame))
+{
+ auto& vm = lexicalGlobalObject->vm();
+
+ JSTCPSocket* thisObject = jsDynamicCast<JSTCPSocket*>(callFrame->thisValue());
+
+ if (UNLIKELY(!thisObject)) {
+ auto throwScope = DECLARE_THROW_SCOPE(vm);
+ return throwVMTypeError(lexicalGlobalObject, throwScope);
+ }
+
+ JSC::EnsureStillAliveScope thisArg = JSC::EnsureStillAliveScope(thisObject);
+
+#ifdef BUN_DEBUG
+ /** View the file name of the JS file that called this function
+ * from a debugger */
+ SourceOrigin sourceOrigin = callFrame->callerSourceOrigin(vm);
+ const char* fileName = sourceOrigin.string().utf8().data();
+ static const char* lastFileName = nullptr;
+ if (lastFileName != fileName) {
+ lastFileName = fileName;
+ }
+#endif
+
+ return TCPSocketPrototype__setMaxSendFragment(thisObject->wrapped(), lexicalGlobalObject, callFrame);
+}
+
JSC_DEFINE_HOST_FUNCTION(TCPSocketPrototype__setServernameCallback, (JSGlobalObject * lexicalGlobalObject, CallFrame* callFrame))
{
auto& vm = lexicalGlobalObject->vm();
@@ -17382,6 +17758,33 @@ JSC_DEFINE_HOST_FUNCTION(TCPSocketPrototype__setServernameCallback, (JSGlobalObj
return TCPSocketPrototype__setServername(thisObject->wrapped(), lexicalGlobalObject, callFrame);
}
+JSC_DEFINE_HOST_FUNCTION(TCPSocketPrototype__setSessionCallback, (JSGlobalObject * lexicalGlobalObject, CallFrame* callFrame))
+{
+ auto& vm = lexicalGlobalObject->vm();
+
+ JSTCPSocket* thisObject = jsDynamicCast<JSTCPSocket*>(callFrame->thisValue());
+
+ if (UNLIKELY(!thisObject)) {
+ auto throwScope = DECLARE_THROW_SCOPE(vm);
+ return throwVMTypeError(lexicalGlobalObject, throwScope);
+ }
+
+ JSC::EnsureStillAliveScope thisArg = JSC::EnsureStillAliveScope(thisObject);
+
+#ifdef BUN_DEBUG
+ /** View the file name of the JS file that called this function
+ * from a debugger */
+ SourceOrigin sourceOrigin = callFrame->callerSourceOrigin(vm);
+ const char* fileName = sourceOrigin.string().utf8().data();
+ static const char* lastFileName = nullptr;
+ if (lastFileName != fileName) {
+ lastFileName = fileName;
+ }
+#endif
+
+ return TCPSocketPrototype__setSession(thisObject->wrapped(), lexicalGlobalObject, callFrame);
+}
+
JSC_DEFINE_HOST_FUNCTION(TCPSocketPrototype__shutdownCallback, (JSGlobalObject * lexicalGlobalObject, CallFrame* callFrame))
{
auto& vm = lexicalGlobalObject->vm();
@@ -17694,12 +18097,45 @@ JSC_DECLARE_CUSTOM_SETTER(TLSSocketPrototype__dataSetterWrap);
extern "C" EncodedJSValue TLSSocketPrototype__end(void* ptr, JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame);
JSC_DECLARE_HOST_FUNCTION(TLSSocketPrototype__endCallback);
+extern "C" EncodedJSValue TLSSocketPrototype__exportKeyingMaterial(void* ptr, JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame);
+JSC_DECLARE_HOST_FUNCTION(TLSSocketPrototype__exportKeyingMaterialCallback);
+
extern "C" EncodedJSValue TLSSocketPrototype__flush(void* ptr, JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame);
JSC_DECLARE_HOST_FUNCTION(TLSSocketPrototype__flushCallback);
extern "C" EncodedJSValue TLSSocketPrototype__getAuthorizationError(void* ptr, JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame);
JSC_DECLARE_HOST_FUNCTION(TLSSocketPrototype__getAuthorizationErrorCallback);
+extern "C" EncodedJSValue TLSSocketPrototype__getCertificate(void* ptr, JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame);
+JSC_DECLARE_HOST_FUNCTION(TLSSocketPrototype__getCertificateCallback);
+
+extern "C" EncodedJSValue TLSSocketPrototype__getCipher(void* ptr, JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame);
+JSC_DECLARE_HOST_FUNCTION(TLSSocketPrototype__getCipherCallback);
+
+extern "C" EncodedJSValue TLSSocketPrototype__getEphemeralKeyInfo(void* ptr, JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame);
+JSC_DECLARE_HOST_FUNCTION(TLSSocketPrototype__getEphemeralKeyInfoCallback);
+
+extern "C" EncodedJSValue TLSSocketPrototype__getPeerCertificate(void* ptr, JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame);
+JSC_DECLARE_HOST_FUNCTION(TLSSocketPrototype__getPeerCertificateCallback);
+
+extern "C" EncodedJSValue TLSSocketPrototype__getSession(void* ptr, JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame);
+JSC_DECLARE_HOST_FUNCTION(TLSSocketPrototype__getSessionCallback);
+
+extern "C" EncodedJSValue TLSSocketPrototype__getSharedSigalgs(void* ptr, JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame);
+JSC_DECLARE_HOST_FUNCTION(TLSSocketPrototype__getSharedSigalgsCallback);
+
+extern "C" EncodedJSValue TLSSocketPrototype__getTLSFinishedMessage(void* ptr, JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame);
+JSC_DECLARE_HOST_FUNCTION(TLSSocketPrototype__getTLSFinishedMessageCallback);
+
+extern "C" EncodedJSValue TLSSocketPrototype__getTLSPeerFinishedMessage(void* ptr, JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame);
+JSC_DECLARE_HOST_FUNCTION(TLSSocketPrototype__getTLSPeerFinishedMessageCallback);
+
+extern "C" EncodedJSValue TLSSocketPrototype__getTLSTicket(void* ptr, JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame);
+JSC_DECLARE_HOST_FUNCTION(TLSSocketPrototype__getTLSTicketCallback);
+
+extern "C" EncodedJSValue TLSSocketPrototype__getTLSVersion(void* ptr, JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame);
+JSC_DECLARE_HOST_FUNCTION(TLSSocketPrototype__getTLSVersionCallback);
+
extern "C" JSC::EncodedJSValue TLSSocketPrototype__getListener(void* ptr, JSC::JSGlobalObject* lexicalGlobalObject);
JSC_DECLARE_CUSTOM_GETTER(TLSSocketPrototype__listenerGetterWrap);
@@ -17718,9 +18154,15 @@ JSC_DECLARE_HOST_FUNCTION(TLSSocketPrototype__reloadCallback);
extern "C" JSC::EncodedJSValue TLSSocketPrototype__getRemoteAddress(void* ptr, JSC::JSGlobalObject* lexicalGlobalObject);
JSC_DECLARE_CUSTOM_GETTER(TLSSocketPrototype__remoteAddressGetterWrap);
+extern "C" EncodedJSValue TLSSocketPrototype__setMaxSendFragment(void* ptr, JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame);
+JSC_DECLARE_HOST_FUNCTION(TLSSocketPrototype__setMaxSendFragmentCallback);
+
extern "C" EncodedJSValue TLSSocketPrototype__setServername(void* ptr, JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame);
JSC_DECLARE_HOST_FUNCTION(TLSSocketPrototype__setServernameCallback);
+extern "C" EncodedJSValue TLSSocketPrototype__setSession(void* ptr, JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame);
+JSC_DECLARE_HOST_FUNCTION(TLSSocketPrototype__setSessionCallback);
+
extern "C" EncodedJSValue TLSSocketPrototype__shutdown(void* ptr, JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame);
JSC_DECLARE_HOST_FUNCTION(TLSSocketPrototype__shutdownCallback);
@@ -17743,15 +18185,28 @@ static const HashTableValue JSTLSSocketPrototypeTableValues[] = {
{ "authorized"_s, static_cast<unsigned>(JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute | PropertyAttribute::DontDelete), NoIntrinsic, { HashTableValue::GetterSetterType, TLSSocketPrototype__authorizedGetterWrap, 0 } },
{ "data"_s, static_cast<unsigned>(JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute | PropertyAttribute::DontDelete), NoIntrinsic, { HashTableValue::GetterSetterType, TLSSocketPrototype__dataGetterWrap, TLSSocketPrototype__dataSetterWrap } },
{ "end"_s, static_cast<unsigned>(JSC::PropertyAttribute::Function | PropertyAttribute::DontDelete), NoIntrinsic, { HashTableValue::NativeFunctionType, TLSSocketPrototype__endCallback, 3 } },
+ { "exportKeyingMaterial"_s, static_cast<unsigned>(JSC::PropertyAttribute::Function | PropertyAttribute::DontDelete), NoIntrinsic, { HashTableValue::NativeFunctionType, TLSSocketPrototype__exportKeyingMaterialCallback, 3 } },
{ "flush"_s, static_cast<unsigned>(JSC::PropertyAttribute::Function | PropertyAttribute::DontDelete), NoIntrinsic, { HashTableValue::NativeFunctionType, TLSSocketPrototype__flushCallback, 0 } },
{ "getAuthorizationError"_s, static_cast<unsigned>(JSC::PropertyAttribute::Function | PropertyAttribute::DontDelete), NoIntrinsic, { HashTableValue::NativeFunctionType, TLSSocketPrototype__getAuthorizationErrorCallback, 0 } },
+ { "getCertificate"_s, static_cast<unsigned>(JSC::PropertyAttribute::Function | PropertyAttribute::DontDelete), NoIntrinsic, { HashTableValue::NativeFunctionType, TLSSocketPrototype__getCertificateCallback, 0 } },
+ { "getCipher"_s, static_cast<unsigned>(JSC::PropertyAttribute::Function | PropertyAttribute::DontDelete), NoIntrinsic, { HashTableValue::NativeFunctionType, TLSSocketPrototype__getCipherCallback, 0 } },
+ { "getEphemeralKeyInfo"_s, static_cast<unsigned>(JSC::PropertyAttribute::Function | PropertyAttribute::DontDelete), NoIntrinsic, { HashTableValue::NativeFunctionType, TLSSocketPrototype__getEphemeralKeyInfoCallback, 0 } },
+ { "getPeerCertificate"_s, static_cast<unsigned>(JSC::PropertyAttribute::Function | PropertyAttribute::DontDelete), NoIntrinsic, { HashTableValue::NativeFunctionType, TLSSocketPrototype__getPeerCertificateCallback, 1 } },
+ { "getSession"_s, static_cast<unsigned>(JSC::PropertyAttribute::Function | PropertyAttribute::DontDelete), NoIntrinsic, { HashTableValue::NativeFunctionType, TLSSocketPrototype__getSessionCallback, 0 } },
+ { "getSharedSigalgs"_s, static_cast<unsigned>(JSC::PropertyAttribute::Function | PropertyAttribute::DontDelete), NoIntrinsic, { HashTableValue::NativeFunctionType, TLSSocketPrototype__getSharedSigalgsCallback, 0 } },
+ { "getTLSFinishedMessage"_s, static_cast<unsigned>(JSC::PropertyAttribute::Function | PropertyAttribute::DontDelete), NoIntrinsic, { HashTableValue::NativeFunctionType, TLSSocketPrototype__getTLSFinishedMessageCallback, 0 } },
+ { "getTLSPeerFinishedMessage"_s, static_cast<unsigned>(JSC::PropertyAttribute::Function | PropertyAttribute::DontDelete), NoIntrinsic, { HashTableValue::NativeFunctionType, TLSSocketPrototype__getTLSPeerFinishedMessageCallback, 0 } },
+ { "getTLSTicket"_s, static_cast<unsigned>(JSC::PropertyAttribute::Function | PropertyAttribute::DontDelete), NoIntrinsic, { HashTableValue::NativeFunctionType, TLSSocketPrototype__getTLSTicketCallback, 0 } },
+ { "getTLSVersion"_s, static_cast<unsigned>(JSC::PropertyAttribute::Function | PropertyAttribute::DontDelete), NoIntrinsic, { HashTableValue::NativeFunctionType, TLSSocketPrototype__getTLSVersionCallback, 0 } },
{ "listener"_s, static_cast<unsigned>(JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute | PropertyAttribute::DontDelete), NoIntrinsic, { HashTableValue::GetterSetterType, TLSSocketPrototype__listenerGetterWrap, 0 } },
{ "localPort"_s, static_cast<unsigned>(JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute | PropertyAttribute::DontDelete), NoIntrinsic, { HashTableValue::GetterSetterType, TLSSocketPrototype__localPortGetterWrap, 0 } },
{ "readyState"_s, static_cast<unsigned>(JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute | PropertyAttribute::DontDelete), NoIntrinsic, { HashTableValue::GetterSetterType, TLSSocketPrototype__readyStateGetterWrap, 0 } },
{ "ref"_s, static_cast<unsigned>(JSC::PropertyAttribute::Function | PropertyAttribute::DontDelete), NoIntrinsic, { HashTableValue::NativeFunctionType, TLSSocketPrototype__refCallback, 0 } },
{ "reload"_s, static_cast<unsigned>(JSC::PropertyAttribute::Function | PropertyAttribute::DontDelete), NoIntrinsic, { HashTableValue::NativeFunctionType, TLSSocketPrototype__reloadCallback, 1 } },
{ "remoteAddress"_s, static_cast<unsigned>(JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute | PropertyAttribute::DontDelete), NoIntrinsic, { HashTableValue::GetterSetterType, TLSSocketPrototype__remoteAddressGetterWrap, 0 } },
+ { "setMaxSendFragment"_s, static_cast<unsigned>(JSC::PropertyAttribute::Function | PropertyAttribute::DontDelete), NoIntrinsic, { HashTableValue::NativeFunctionType, TLSSocketPrototype__setMaxSendFragmentCallback, 1 } },
{ "setServername"_s, static_cast<unsigned>(JSC::PropertyAttribute::Function | PropertyAttribute::DontDelete), NoIntrinsic, { HashTableValue::NativeFunctionType, TLSSocketPrototype__setServernameCallback, 1 } },
+ { "setSession"_s, static_cast<unsigned>(JSC::PropertyAttribute::Function | PropertyAttribute::DontDelete), NoIntrinsic, { HashTableValue::NativeFunctionType, TLSSocketPrototype__setSessionCallback, 0 } },
{ "shutdown"_s, static_cast<unsigned>(JSC::PropertyAttribute::Function | PropertyAttribute::DontDelete), NoIntrinsic, { HashTableValue::NativeFunctionType, TLSSocketPrototype__shutdownCallback, 1 } },
{ "timeout"_s, static_cast<unsigned>(JSC::PropertyAttribute::Function | PropertyAttribute::DontDelete), NoIntrinsic, { HashTableValue::NativeFunctionType, TLSSocketPrototype__timeoutCallback, 1 } },
{ "unref"_s, static_cast<unsigned>(JSC::PropertyAttribute::Function | PropertyAttribute::DontDelete), NoIntrinsic, { HashTableValue::NativeFunctionType, TLSSocketPrototype__unrefCallback, 0 } },
@@ -17866,6 +18321,33 @@ JSC_DEFINE_HOST_FUNCTION(TLSSocketPrototype__endCallback, (JSGlobalObject * lexi
return TLSSocketPrototype__end(thisObject->wrapped(), lexicalGlobalObject, callFrame);
}
+JSC_DEFINE_HOST_FUNCTION(TLSSocketPrototype__exportKeyingMaterialCallback, (JSGlobalObject * lexicalGlobalObject, CallFrame* callFrame))
+{
+ auto& vm = lexicalGlobalObject->vm();
+
+ JSTLSSocket* thisObject = jsDynamicCast<JSTLSSocket*>(callFrame->thisValue());
+
+ if (UNLIKELY(!thisObject)) {
+ auto throwScope = DECLARE_THROW_SCOPE(vm);
+ return throwVMTypeError(lexicalGlobalObject, throwScope);
+ }
+
+ JSC::EnsureStillAliveScope thisArg = JSC::EnsureStillAliveScope(thisObject);
+
+#ifdef BUN_DEBUG
+ /** View the file name of the JS file that called this function
+ * from a debugger */
+ SourceOrigin sourceOrigin = callFrame->callerSourceOrigin(vm);
+ const char* fileName = sourceOrigin.string().utf8().data();
+ static const char* lastFileName = nullptr;
+ if (lastFileName != fileName) {
+ lastFileName = fileName;
+ }
+#endif
+
+ return TLSSocketPrototype__exportKeyingMaterial(thisObject->wrapped(), lexicalGlobalObject, callFrame);
+}
+
JSC_DEFINE_HOST_FUNCTION(TLSSocketPrototype__flushCallback, (JSGlobalObject * lexicalGlobalObject, CallFrame* callFrame))
{
auto& vm = lexicalGlobalObject->vm();
@@ -17920,6 +18402,276 @@ JSC_DEFINE_HOST_FUNCTION(TLSSocketPrototype__getAuthorizationErrorCallback, (JSG
return TLSSocketPrototype__getAuthorizationError(thisObject->wrapped(), lexicalGlobalObject, callFrame);
}
+JSC_DEFINE_HOST_FUNCTION(TLSSocketPrototype__getCertificateCallback, (JSGlobalObject * lexicalGlobalObject, CallFrame* callFrame))
+{
+ auto& vm = lexicalGlobalObject->vm();
+
+ JSTLSSocket* thisObject = jsDynamicCast<JSTLSSocket*>(callFrame->thisValue());
+
+ if (UNLIKELY(!thisObject)) {
+ auto throwScope = DECLARE_THROW_SCOPE(vm);
+ return throwVMTypeError(lexicalGlobalObject, throwScope);
+ }
+
+ JSC::EnsureStillAliveScope thisArg = JSC::EnsureStillAliveScope(thisObject);
+
+#ifdef BUN_DEBUG
+ /** View the file name of the JS file that called this function
+ * from a debugger */
+ SourceOrigin sourceOrigin = callFrame->callerSourceOrigin(vm);
+ const char* fileName = sourceOrigin.string().utf8().data();
+ static const char* lastFileName = nullptr;
+ if (lastFileName != fileName) {
+ lastFileName = fileName;
+ }
+#endif
+
+ return TLSSocketPrototype__getCertificate(thisObject->wrapped(), lexicalGlobalObject, callFrame);
+}
+
+JSC_DEFINE_HOST_FUNCTION(TLSSocketPrototype__getCipherCallback, (JSGlobalObject * lexicalGlobalObject, CallFrame* callFrame))
+{
+ auto& vm = lexicalGlobalObject->vm();
+
+ JSTLSSocket* thisObject = jsDynamicCast<JSTLSSocket*>(callFrame->thisValue());
+
+ if (UNLIKELY(!thisObject)) {
+ auto throwScope = DECLARE_THROW_SCOPE(vm);
+ return throwVMTypeError(lexicalGlobalObject, throwScope);
+ }
+
+ JSC::EnsureStillAliveScope thisArg = JSC::EnsureStillAliveScope(thisObject);
+
+#ifdef BUN_DEBUG
+ /** View the file name of the JS file that called this function
+ * from a debugger */
+ SourceOrigin sourceOrigin = callFrame->callerSourceOrigin(vm);
+ const char* fileName = sourceOrigin.string().utf8().data();
+ static const char* lastFileName = nullptr;
+ if (lastFileName != fileName) {
+ lastFileName = fileName;
+ }
+#endif
+
+ return TLSSocketPrototype__getCipher(thisObject->wrapped(), lexicalGlobalObject, callFrame);
+}
+
+JSC_DEFINE_HOST_FUNCTION(TLSSocketPrototype__getEphemeralKeyInfoCallback, (JSGlobalObject * lexicalGlobalObject, CallFrame* callFrame))
+{
+ auto& vm = lexicalGlobalObject->vm();
+
+ JSTLSSocket* thisObject = jsDynamicCast<JSTLSSocket*>(callFrame->thisValue());
+
+ if (UNLIKELY(!thisObject)) {
+ auto throwScope = DECLARE_THROW_SCOPE(vm);
+ return throwVMTypeError(lexicalGlobalObject, throwScope);
+ }
+
+ JSC::EnsureStillAliveScope thisArg = JSC::EnsureStillAliveScope(thisObject);
+
+#ifdef BUN_DEBUG
+ /** View the file name of the JS file that called this function
+ * from a debugger */
+ SourceOrigin sourceOrigin = callFrame->callerSourceOrigin(vm);
+ const char* fileName = sourceOrigin.string().utf8().data();
+ static const char* lastFileName = nullptr;
+ if (lastFileName != fileName) {
+ lastFileName = fileName;
+ }
+#endif
+
+ return TLSSocketPrototype__getEphemeralKeyInfo(thisObject->wrapped(), lexicalGlobalObject, callFrame);
+}
+
+JSC_DEFINE_HOST_FUNCTION(TLSSocketPrototype__getPeerCertificateCallback, (JSGlobalObject * lexicalGlobalObject, CallFrame* callFrame))
+{
+ auto& vm = lexicalGlobalObject->vm();
+
+ JSTLSSocket* thisObject = jsDynamicCast<JSTLSSocket*>(callFrame->thisValue());
+
+ if (UNLIKELY(!thisObject)) {
+ auto throwScope = DECLARE_THROW_SCOPE(vm);
+ return throwVMTypeError(lexicalGlobalObject, throwScope);
+ }
+
+ JSC::EnsureStillAliveScope thisArg = JSC::EnsureStillAliveScope(thisObject);
+
+#ifdef BUN_DEBUG
+ /** View the file name of the JS file that called this function
+ * from a debugger */
+ SourceOrigin sourceOrigin = callFrame->callerSourceOrigin(vm);
+ const char* fileName = sourceOrigin.string().utf8().data();
+ static const char* lastFileName = nullptr;
+ if (lastFileName != fileName) {
+ lastFileName = fileName;
+ }
+#endif
+
+ return TLSSocketPrototype__getPeerCertificate(thisObject->wrapped(), lexicalGlobalObject, callFrame);
+}
+
+JSC_DEFINE_HOST_FUNCTION(TLSSocketPrototype__getSessionCallback, (JSGlobalObject * lexicalGlobalObject, CallFrame* callFrame))
+{
+ auto& vm = lexicalGlobalObject->vm();
+
+ JSTLSSocket* thisObject = jsDynamicCast<JSTLSSocket*>(callFrame->thisValue());
+
+ if (UNLIKELY(!thisObject)) {
+ auto throwScope = DECLARE_THROW_SCOPE(vm);
+ return throwVMTypeError(lexicalGlobalObject, throwScope);
+ }
+
+ JSC::EnsureStillAliveScope thisArg = JSC::EnsureStillAliveScope(thisObject);
+
+#ifdef BUN_DEBUG
+ /** View the file name of the JS file that called this function
+ * from a debugger */
+ SourceOrigin sourceOrigin = callFrame->callerSourceOrigin(vm);
+ const char* fileName = sourceOrigin.string().utf8().data();
+ static const char* lastFileName = nullptr;
+ if (lastFileName != fileName) {
+ lastFileName = fileName;
+ }
+#endif
+
+ return TLSSocketPrototype__getSession(thisObject->wrapped(), lexicalGlobalObject, callFrame);
+}
+
+JSC_DEFINE_HOST_FUNCTION(TLSSocketPrototype__getSharedSigalgsCallback, (JSGlobalObject * lexicalGlobalObject, CallFrame* callFrame))
+{
+ auto& vm = lexicalGlobalObject->vm();
+
+ JSTLSSocket* thisObject = jsDynamicCast<JSTLSSocket*>(callFrame->thisValue());
+
+ if (UNLIKELY(!thisObject)) {
+ auto throwScope = DECLARE_THROW_SCOPE(vm);
+ return throwVMTypeError(lexicalGlobalObject, throwScope);
+ }
+
+ JSC::EnsureStillAliveScope thisArg = JSC::EnsureStillAliveScope(thisObject);
+
+#ifdef BUN_DEBUG
+ /** View the file name of the JS file that called this function
+ * from a debugger */
+ SourceOrigin sourceOrigin = callFrame->callerSourceOrigin(vm);
+ const char* fileName = sourceOrigin.string().utf8().data();
+ static const char* lastFileName = nullptr;
+ if (lastFileName != fileName) {
+ lastFileName = fileName;
+ }
+#endif
+
+ return TLSSocketPrototype__getSharedSigalgs(thisObject->wrapped(), lexicalGlobalObject, callFrame);
+}
+
+JSC_DEFINE_HOST_FUNCTION(TLSSocketPrototype__getTLSFinishedMessageCallback, (JSGlobalObject * lexicalGlobalObject, CallFrame* callFrame))
+{
+ auto& vm = lexicalGlobalObject->vm();
+
+ JSTLSSocket* thisObject = jsDynamicCast<JSTLSSocket*>(callFrame->thisValue());
+
+ if (UNLIKELY(!thisObject)) {
+ auto throwScope = DECLARE_THROW_SCOPE(vm);
+ return throwVMTypeError(lexicalGlobalObject, throwScope);
+ }
+
+ JSC::EnsureStillAliveScope thisArg = JSC::EnsureStillAliveScope(thisObject);
+
+#ifdef BUN_DEBUG
+ /** View the file name of the JS file that called this function
+ * from a debugger */
+ SourceOrigin sourceOrigin = callFrame->callerSourceOrigin(vm);
+ const char* fileName = sourceOrigin.string().utf8().data();
+ static const char* lastFileName = nullptr;
+ if (lastFileName != fileName) {
+ lastFileName = fileName;
+ }
+#endif
+
+ return TLSSocketPrototype__getTLSFinishedMessage(thisObject->wrapped(), lexicalGlobalObject, callFrame);
+}
+
+JSC_DEFINE_HOST_FUNCTION(TLSSocketPrototype__getTLSPeerFinishedMessageCallback, (JSGlobalObject * lexicalGlobalObject, CallFrame* callFrame))
+{
+ auto& vm = lexicalGlobalObject->vm();
+
+ JSTLSSocket* thisObject = jsDynamicCast<JSTLSSocket*>(callFrame->thisValue());
+
+ if (UNLIKELY(!thisObject)) {
+ auto throwScope = DECLARE_THROW_SCOPE(vm);
+ return throwVMTypeError(lexicalGlobalObject, throwScope);
+ }
+
+ JSC::EnsureStillAliveScope thisArg = JSC::EnsureStillAliveScope(thisObject);
+
+#ifdef BUN_DEBUG
+ /** View the file name of the JS file that called this function
+ * from a debugger */
+ SourceOrigin sourceOrigin = callFrame->callerSourceOrigin(vm);
+ const char* fileName = sourceOrigin.string().utf8().data();
+ static const char* lastFileName = nullptr;
+ if (lastFileName != fileName) {
+ lastFileName = fileName;
+ }
+#endif
+
+ return TLSSocketPrototype__getTLSPeerFinishedMessage(thisObject->wrapped(), lexicalGlobalObject, callFrame);
+}
+
+JSC_DEFINE_HOST_FUNCTION(TLSSocketPrototype__getTLSTicketCallback, (JSGlobalObject * lexicalGlobalObject, CallFrame* callFrame))
+{
+ auto& vm = lexicalGlobalObject->vm();
+
+ JSTLSSocket* thisObject = jsDynamicCast<JSTLSSocket*>(callFrame->thisValue());
+
+ if (UNLIKELY(!thisObject)) {
+ auto throwScope = DECLARE_THROW_SCOPE(vm);
+ return throwVMTypeError(lexicalGlobalObject, throwScope);
+ }
+
+ JSC::EnsureStillAliveScope thisArg = JSC::EnsureStillAliveScope(thisObject);
+
+#ifdef BUN_DEBUG
+ /** View the file name of the JS file that called this function
+ * from a debugger */
+ SourceOrigin sourceOrigin = callFrame->callerSourceOrigin(vm);
+ const char* fileName = sourceOrigin.string().utf8().data();
+ static const char* lastFileName = nullptr;
+ if (lastFileName != fileName) {
+ lastFileName = fileName;
+ }
+#endif
+
+ return TLSSocketPrototype__getTLSTicket(thisObject->wrapped(), lexicalGlobalObject, callFrame);
+}
+
+JSC_DEFINE_HOST_FUNCTION(TLSSocketPrototype__getTLSVersionCallback, (JSGlobalObject * lexicalGlobalObject, CallFrame* callFrame))
+{
+ auto& vm = lexicalGlobalObject->vm();
+
+ JSTLSSocket* thisObject = jsDynamicCast<JSTLSSocket*>(callFrame->thisValue());
+
+ if (UNLIKELY(!thisObject)) {
+ auto throwScope = DECLARE_THROW_SCOPE(vm);
+ return throwVMTypeError(lexicalGlobalObject, throwScope);
+ }
+
+ JSC::EnsureStillAliveScope thisArg = JSC::EnsureStillAliveScope(thisObject);
+
+#ifdef BUN_DEBUG
+ /** View the file name of the JS file that called this function
+ * from a debugger */
+ SourceOrigin sourceOrigin = callFrame->callerSourceOrigin(vm);
+ const char* fileName = sourceOrigin.string().utf8().data();
+ static const char* lastFileName = nullptr;
+ if (lastFileName != fileName) {
+ lastFileName = fileName;
+ }
+#endif
+
+ return TLSSocketPrototype__getTLSVersion(thisObject->wrapped(), lexicalGlobalObject, callFrame);
+}
+
JSC_DEFINE_CUSTOM_GETTER(TLSSocketPrototype__listenerGetterWrap, (JSGlobalObject * lexicalGlobalObject, EncodedJSValue thisValue, PropertyName attributeName))
{
auto& vm = lexicalGlobalObject->vm();
@@ -18041,6 +18793,33 @@ extern "C" EncodedJSValue TLSSocketPrototype__remoteAddressGetCachedValue(JSC::E
return JSValue::encode(thisObject->m_remoteAddress.get());
}
+JSC_DEFINE_HOST_FUNCTION(TLSSocketPrototype__setMaxSendFragmentCallback, (JSGlobalObject * lexicalGlobalObject, CallFrame* callFrame))
+{
+ auto& vm = lexicalGlobalObject->vm();
+
+ JSTLSSocket* thisObject = jsDynamicCast<JSTLSSocket*>(callFrame->thisValue());
+
+ if (UNLIKELY(!thisObject)) {
+ auto throwScope = DECLARE_THROW_SCOPE(vm);
+ return throwVMTypeError(lexicalGlobalObject, throwScope);
+ }
+
+ JSC::EnsureStillAliveScope thisArg = JSC::EnsureStillAliveScope(thisObject);
+
+#ifdef BUN_DEBUG
+ /** View the file name of the JS file that called this function
+ * from a debugger */
+ SourceOrigin sourceOrigin = callFrame->callerSourceOrigin(vm);
+ const char* fileName = sourceOrigin.string().utf8().data();
+ static const char* lastFileName = nullptr;
+ if (lastFileName != fileName) {
+ lastFileName = fileName;
+ }
+#endif
+
+ return TLSSocketPrototype__setMaxSendFragment(thisObject->wrapped(), lexicalGlobalObject, callFrame);
+}
+
JSC_DEFINE_HOST_FUNCTION(TLSSocketPrototype__setServernameCallback, (JSGlobalObject * lexicalGlobalObject, CallFrame* callFrame))
{
auto& vm = lexicalGlobalObject->vm();
@@ -18068,6 +18847,33 @@ JSC_DEFINE_HOST_FUNCTION(TLSSocketPrototype__setServernameCallback, (JSGlobalObj
return TLSSocketPrototype__setServername(thisObject->wrapped(), lexicalGlobalObject, callFrame);
}
+JSC_DEFINE_HOST_FUNCTION(TLSSocketPrototype__setSessionCallback, (JSGlobalObject * lexicalGlobalObject, CallFrame* callFrame))
+{
+ auto& vm = lexicalGlobalObject->vm();
+
+ JSTLSSocket* thisObject = jsDynamicCast<JSTLSSocket*>(callFrame->thisValue());
+
+ if (UNLIKELY(!thisObject)) {
+ auto throwScope = DECLARE_THROW_SCOPE(vm);
+ return throwVMTypeError(lexicalGlobalObject, throwScope);
+ }
+
+ JSC::EnsureStillAliveScope thisArg = JSC::EnsureStillAliveScope(thisObject);
+
+#ifdef BUN_DEBUG
+ /** View the file name of the JS file that called this function
+ * from a debugger */
+ SourceOrigin sourceOrigin = callFrame->callerSourceOrigin(vm);
+ const char* fileName = sourceOrigin.string().utf8().data();
+ static const char* lastFileName = nullptr;
+ if (lastFileName != fileName) {
+ lastFileName = fileName;
+ }
+#endif
+
+ return TLSSocketPrototype__setSession(thisObject->wrapped(), lexicalGlobalObject, callFrame);
+}
+
JSC_DEFINE_HOST_FUNCTION(TLSSocketPrototype__shutdownCallback, (JSGlobalObject * lexicalGlobalObject, CallFrame* callFrame))
{
auto& vm = lexicalGlobalObject->vm();
diff --git a/src/bun.js/bindings/bindings.cpp b/src/bun.js/bindings/bindings.cpp
index 552da4009..1c97a57a4 100644
--- a/src/bun.js/bindings/bindings.cpp
+++ b/src/bun.js/bindings/bindings.cpp
@@ -2190,6 +2190,14 @@ CPP_DECL void JSC__JSValue__putIndex(JSC__JSValue JSValue0, JSC__JSGlobalObject*
array->putDirectIndex(arg1, arg2, value2);
}
+CPP_DECL void JSC__JSValue__push(JSC__JSValue JSValue0, JSC__JSGlobalObject* arg1, JSC__JSValue JSValue3)
+{
+ JSC::JSValue value = JSC::JSValue::decode(JSValue0);
+ JSC::JSValue value2 = JSC::JSValue::decode(JSValue3);
+ JSC::JSArray* array = JSC::jsCast<JSC::JSArray*>(value);
+ array->push(arg1, value2);
+}
+
JSC__JSValue JSC__JSValue__createStringArray(JSC__JSGlobalObject* globalObject, const ZigString* arg1,
size_t arg2, bool clone)
{
diff --git a/src/bun.js/bindings/bindings.zig b/src/bun.js/bindings/bindings.zig
index a28bb4297..5b627552b 100644
--- a/src/bun.js/bindings/bindings.zig
+++ b/src/bun.js/bindings/bindings.zig
@@ -3527,6 +3527,10 @@ pub const JSValue = enum(JSValueReprInt) {
cppFn("putIndex", .{ value, globalObject, i, out });
}
+ pub fn push(value: JSValue, globalObject: *JSGlobalObject, out: JSValue) void {
+ cppFn("push", .{ value, globalObject, out });
+ }
+
pub fn as(value: JSValue, comptime ZigType: type) ?*ZigType {
if (value.isEmptyOrUndefinedOrNull())
return null;
@@ -4843,6 +4847,7 @@ pub const JSValue = enum(JSValueReprInt) {
"put",
"putDirect",
"putIndex",
+ "push",
"putRecord",
"strictDeepEquals",
"symbolFor",
diff --git a/src/bun.js/bindings/generated_classes.zig b/src/bun.js/bindings/generated_classes.zig
index 10aec1865..947be7a51 100644
--- a/src/bun.js/bindings/generated_classes.zig
+++ b/src/bun.js/bindings/generated_classes.zig
@@ -4458,10 +4458,32 @@ pub const JSTCPSocket = struct {
@compileLog("Expected TCPSocket.setData to be a setter");
if (@TypeOf(TCPSocket.end) != CallbackType)
@compileLog("Expected TCPSocket.end to be a callback but received " ++ @typeName(@TypeOf(TCPSocket.end)));
+ if (@TypeOf(TCPSocket.exportKeyingMaterial) != CallbackType)
+ @compileLog("Expected TCPSocket.exportKeyingMaterial to be a callback but received " ++ @typeName(@TypeOf(TCPSocket.exportKeyingMaterial)));
if (@TypeOf(TCPSocket.flush) != CallbackType)
@compileLog("Expected TCPSocket.flush to be a callback but received " ++ @typeName(@TypeOf(TCPSocket.flush)));
if (@TypeOf(TCPSocket.getAuthorizationError) != CallbackType)
@compileLog("Expected TCPSocket.getAuthorizationError to be a callback but received " ++ @typeName(@TypeOf(TCPSocket.getAuthorizationError)));
+ if (@TypeOf(TCPSocket.getCertificate) != CallbackType)
+ @compileLog("Expected TCPSocket.getCertificate to be a callback but received " ++ @typeName(@TypeOf(TCPSocket.getCertificate)));
+ if (@TypeOf(TCPSocket.getCipher) != CallbackType)
+ @compileLog("Expected TCPSocket.getCipher to be a callback but received " ++ @typeName(@TypeOf(TCPSocket.getCipher)));
+ if (@TypeOf(TCPSocket.getEphemeralKeyInfo) != CallbackType)
+ @compileLog("Expected TCPSocket.getEphemeralKeyInfo to be a callback but received " ++ @typeName(@TypeOf(TCPSocket.getEphemeralKeyInfo)));
+ if (@TypeOf(TCPSocket.getPeerCertificate) != CallbackType)
+ @compileLog("Expected TCPSocket.getPeerCertificate to be a callback but received " ++ @typeName(@TypeOf(TCPSocket.getPeerCertificate)));
+ if (@TypeOf(TCPSocket.getSession) != CallbackType)
+ @compileLog("Expected TCPSocket.getSession to be a callback but received " ++ @typeName(@TypeOf(TCPSocket.getSession)));
+ if (@TypeOf(TCPSocket.getSharedSigalgs) != CallbackType)
+ @compileLog("Expected TCPSocket.getSharedSigalgs to be a callback but received " ++ @typeName(@TypeOf(TCPSocket.getSharedSigalgs)));
+ if (@TypeOf(TCPSocket.getTLSFinishedMessage) != CallbackType)
+ @compileLog("Expected TCPSocket.getTLSFinishedMessage to be a callback but received " ++ @typeName(@TypeOf(TCPSocket.getTLSFinishedMessage)));
+ if (@TypeOf(TCPSocket.getTLSPeerFinishedMessage) != CallbackType)
+ @compileLog("Expected TCPSocket.getTLSPeerFinishedMessage to be a callback but received " ++ @typeName(@TypeOf(TCPSocket.getTLSPeerFinishedMessage)));
+ if (@TypeOf(TCPSocket.getTLSTicket) != CallbackType)
+ @compileLog("Expected TCPSocket.getTLSTicket to be a callback but received " ++ @typeName(@TypeOf(TCPSocket.getTLSTicket)));
+ if (@TypeOf(TCPSocket.getTLSVersion) != CallbackType)
+ @compileLog("Expected TCPSocket.getTLSVersion to be a callback but received " ++ @typeName(@TypeOf(TCPSocket.getTLSVersion)));
if (@TypeOf(TCPSocket.getListener) != GetterType)
@compileLog("Expected TCPSocket.getListener to be a getter");
@@ -4478,8 +4500,12 @@ pub const JSTCPSocket = struct {
if (@TypeOf(TCPSocket.getRemoteAddress) != GetterType)
@compileLog("Expected TCPSocket.getRemoteAddress to be a getter");
+ if (@TypeOf(TCPSocket.setMaxSendFragment) != CallbackType)
+ @compileLog("Expected TCPSocket.setMaxSendFragment to be a callback but received " ++ @typeName(@TypeOf(TCPSocket.setMaxSendFragment)));
if (@TypeOf(TCPSocket.setServername) != CallbackType)
@compileLog("Expected TCPSocket.setServername to be a callback but received " ++ @typeName(@TypeOf(TCPSocket.setServername)));
+ if (@TypeOf(TCPSocket.setSession) != CallbackType)
+ @compileLog("Expected TCPSocket.setSession to be a callback but received " ++ @typeName(@TypeOf(TCPSocket.setSession)));
if (@TypeOf(TCPSocket.shutdown) != CallbackType)
@compileLog("Expected TCPSocket.shutdown to be a callback but received " ++ @typeName(@TypeOf(TCPSocket.shutdown)));
if (@TypeOf(TCPSocket.timeout) != CallbackType)
@@ -4492,21 +4518,34 @@ pub const JSTCPSocket = struct {
@compileLog("Expected TCPSocket.write to be a callback but received " ++ @typeName(@TypeOf(TCPSocket.write)));
if (!JSC.is_bindgen) {
@export(TCPSocket.end, .{ .name = "TCPSocketPrototype__end" });
+ @export(TCPSocket.exportKeyingMaterial, .{ .name = "TCPSocketPrototype__exportKeyingMaterial" });
@export(TCPSocket.finalize, .{ .name = "TCPSocketClass__finalize" });
@export(TCPSocket.flush, .{ .name = "TCPSocketPrototype__flush" });
@export(TCPSocket.getALPNProtocol, .{ .name = "TCPSocketPrototype__getALPNProtocol" });
@export(TCPSocket.getAuthorizationError, .{ .name = "TCPSocketPrototype__getAuthorizationError" });
@export(TCPSocket.getAuthorized, .{ .name = "TCPSocketPrototype__getAuthorized" });
+ @export(TCPSocket.getCertificate, .{ .name = "TCPSocketPrototype__getCertificate" });
+ @export(TCPSocket.getCipher, .{ .name = "TCPSocketPrototype__getCipher" });
@export(TCPSocket.getData, .{ .name = "TCPSocketPrototype__getData" });
+ @export(TCPSocket.getEphemeralKeyInfo, .{ .name = "TCPSocketPrototype__getEphemeralKeyInfo" });
@export(TCPSocket.getListener, .{ .name = "TCPSocketPrototype__getListener" });
@export(TCPSocket.getLocalPort, .{ .name = "TCPSocketPrototype__getLocalPort" });
+ @export(TCPSocket.getPeerCertificate, .{ .name = "TCPSocketPrototype__getPeerCertificate" });
@export(TCPSocket.getReadyState, .{ .name = "TCPSocketPrototype__getReadyState" });
@export(TCPSocket.getRemoteAddress, .{ .name = "TCPSocketPrototype__getRemoteAddress" });
+ @export(TCPSocket.getSession, .{ .name = "TCPSocketPrototype__getSession" });
+ @export(TCPSocket.getSharedSigalgs, .{ .name = "TCPSocketPrototype__getSharedSigalgs" });
+ @export(TCPSocket.getTLSFinishedMessage, .{ .name = "TCPSocketPrototype__getTLSFinishedMessage" });
+ @export(TCPSocket.getTLSPeerFinishedMessage, .{ .name = "TCPSocketPrototype__getTLSPeerFinishedMessage" });
+ @export(TCPSocket.getTLSTicket, .{ .name = "TCPSocketPrototype__getTLSTicket" });
+ @export(TCPSocket.getTLSVersion, .{ .name = "TCPSocketPrototype__getTLSVersion" });
@export(TCPSocket.hasPendingActivity, .{ .name = "TCPSocket__hasPendingActivity" });
@export(TCPSocket.ref, .{ .name = "TCPSocketPrototype__ref" });
@export(TCPSocket.reload, .{ .name = "TCPSocketPrototype__reload" });
@export(TCPSocket.setData, .{ .name = "TCPSocketPrototype__setData" });
+ @export(TCPSocket.setMaxSendFragment, .{ .name = "TCPSocketPrototype__setMaxSendFragment" });
@export(TCPSocket.setServername, .{ .name = "TCPSocketPrototype__setServername" });
+ @export(TCPSocket.setSession, .{ .name = "TCPSocketPrototype__setSession" });
@export(TCPSocket.shutdown, .{ .name = "TCPSocketPrototype__shutdown" });
@export(TCPSocket.timeout, .{ .name = "TCPSocketPrototype__timeout" });
@export(TCPSocket.unref, .{ .name = "TCPSocketPrototype__unref" });
@@ -4623,10 +4662,32 @@ pub const JSTLSSocket = struct {
@compileLog("Expected TLSSocket.setData to be a setter");
if (@TypeOf(TLSSocket.end) != CallbackType)
@compileLog("Expected TLSSocket.end to be a callback but received " ++ @typeName(@TypeOf(TLSSocket.end)));
+ if (@TypeOf(TLSSocket.exportKeyingMaterial) != CallbackType)
+ @compileLog("Expected TLSSocket.exportKeyingMaterial to be a callback but received " ++ @typeName(@TypeOf(TLSSocket.exportKeyingMaterial)));
if (@TypeOf(TLSSocket.flush) != CallbackType)
@compileLog("Expected TLSSocket.flush to be a callback but received " ++ @typeName(@TypeOf(TLSSocket.flush)));
if (@TypeOf(TLSSocket.getAuthorizationError) != CallbackType)
@compileLog("Expected TLSSocket.getAuthorizationError to be a callback but received " ++ @typeName(@TypeOf(TLSSocket.getAuthorizationError)));
+ if (@TypeOf(TLSSocket.getCertificate) != CallbackType)
+ @compileLog("Expected TLSSocket.getCertificate to be a callback but received " ++ @typeName(@TypeOf(TLSSocket.getCertificate)));
+ if (@TypeOf(TLSSocket.getCipher) != CallbackType)
+ @compileLog("Expected TLSSocket.getCipher to be a callback but received " ++ @typeName(@TypeOf(TLSSocket.getCipher)));
+ if (@TypeOf(TLSSocket.getEphemeralKeyInfo) != CallbackType)
+ @compileLog("Expected TLSSocket.getEphemeralKeyInfo to be a callback but received " ++ @typeName(@TypeOf(TLSSocket.getEphemeralKeyInfo)));
+ if (@TypeOf(TLSSocket.getPeerCertificate) != CallbackType)
+ @compileLog("Expected TLSSocket.getPeerCertificate to be a callback but received " ++ @typeName(@TypeOf(TLSSocket.getPeerCertificate)));
+ if (@TypeOf(TLSSocket.getSession) != CallbackType)
+ @compileLog("Expected TLSSocket.getSession to be a callback but received " ++ @typeName(@TypeOf(TLSSocket.getSession)));
+ if (@TypeOf(TLSSocket.getSharedSigalgs) != CallbackType)
+ @compileLog("Expected TLSSocket.getSharedSigalgs to be a callback but received " ++ @typeName(@TypeOf(TLSSocket.getSharedSigalgs)));
+ if (@TypeOf(TLSSocket.getTLSFinishedMessage) != CallbackType)
+ @compileLog("Expected TLSSocket.getTLSFinishedMessage to be a callback but received " ++ @typeName(@TypeOf(TLSSocket.getTLSFinishedMessage)));
+ if (@TypeOf(TLSSocket.getTLSPeerFinishedMessage) != CallbackType)
+ @compileLog("Expected TLSSocket.getTLSPeerFinishedMessage to be a callback but received " ++ @typeName(@TypeOf(TLSSocket.getTLSPeerFinishedMessage)));
+ if (@TypeOf(TLSSocket.getTLSTicket) != CallbackType)
+ @compileLog("Expected TLSSocket.getTLSTicket to be a callback but received " ++ @typeName(@TypeOf(TLSSocket.getTLSTicket)));
+ if (@TypeOf(TLSSocket.getTLSVersion) != CallbackType)
+ @compileLog("Expected TLSSocket.getTLSVersion to be a callback but received " ++ @typeName(@TypeOf(TLSSocket.getTLSVersion)));
if (@TypeOf(TLSSocket.getListener) != GetterType)
@compileLog("Expected TLSSocket.getListener to be a getter");
@@ -4643,8 +4704,12 @@ pub const JSTLSSocket = struct {
if (@TypeOf(TLSSocket.getRemoteAddress) != GetterType)
@compileLog("Expected TLSSocket.getRemoteAddress to be a getter");
+ if (@TypeOf(TLSSocket.setMaxSendFragment) != CallbackType)
+ @compileLog("Expected TLSSocket.setMaxSendFragment to be a callback but received " ++ @typeName(@TypeOf(TLSSocket.setMaxSendFragment)));
if (@TypeOf(TLSSocket.setServername) != CallbackType)
@compileLog("Expected TLSSocket.setServername to be a callback but received " ++ @typeName(@TypeOf(TLSSocket.setServername)));
+ if (@TypeOf(TLSSocket.setSession) != CallbackType)
+ @compileLog("Expected TLSSocket.setSession to be a callback but received " ++ @typeName(@TypeOf(TLSSocket.setSession)));
if (@TypeOf(TLSSocket.shutdown) != CallbackType)
@compileLog("Expected TLSSocket.shutdown to be a callback but received " ++ @typeName(@TypeOf(TLSSocket.shutdown)));
if (@TypeOf(TLSSocket.timeout) != CallbackType)
@@ -4657,21 +4722,34 @@ pub const JSTLSSocket = struct {
@compileLog("Expected TLSSocket.write to be a callback but received " ++ @typeName(@TypeOf(TLSSocket.write)));
if (!JSC.is_bindgen) {
@export(TLSSocket.end, .{ .name = "TLSSocketPrototype__end" });
+ @export(TLSSocket.exportKeyingMaterial, .{ .name = "TLSSocketPrototype__exportKeyingMaterial" });
@export(TLSSocket.finalize, .{ .name = "TLSSocketClass__finalize" });
@export(TLSSocket.flush, .{ .name = "TLSSocketPrototype__flush" });
@export(TLSSocket.getALPNProtocol, .{ .name = "TLSSocketPrototype__getALPNProtocol" });
@export(TLSSocket.getAuthorizationError, .{ .name = "TLSSocketPrototype__getAuthorizationError" });
@export(TLSSocket.getAuthorized, .{ .name = "TLSSocketPrototype__getAuthorized" });
+ @export(TLSSocket.getCertificate, .{ .name = "TLSSocketPrototype__getCertificate" });
+ @export(TLSSocket.getCipher, .{ .name = "TLSSocketPrototype__getCipher" });
@export(TLSSocket.getData, .{ .name = "TLSSocketPrototype__getData" });
+ @export(TLSSocket.getEphemeralKeyInfo, .{ .name = "TLSSocketPrototype__getEphemeralKeyInfo" });
@export(TLSSocket.getListener, .{ .name = "TLSSocketPrototype__getListener" });
@export(TLSSocket.getLocalPort, .{ .name = "TLSSocketPrototype__getLocalPort" });
+ @export(TLSSocket.getPeerCertificate, .{ .name = "TLSSocketPrototype__getPeerCertificate" });
@export(TLSSocket.getReadyState, .{ .name = "TLSSocketPrototype__getReadyState" });
@export(TLSSocket.getRemoteAddress, .{ .name = "TLSSocketPrototype__getRemoteAddress" });
+ @export(TLSSocket.getSession, .{ .name = "TLSSocketPrototype__getSession" });
+ @export(TLSSocket.getSharedSigalgs, .{ .name = "TLSSocketPrototype__getSharedSigalgs" });
+ @export(TLSSocket.getTLSFinishedMessage, .{ .name = "TLSSocketPrototype__getTLSFinishedMessage" });
+ @export(TLSSocket.getTLSPeerFinishedMessage, .{ .name = "TLSSocketPrototype__getTLSPeerFinishedMessage" });
+ @export(TLSSocket.getTLSTicket, .{ .name = "TLSSocketPrototype__getTLSTicket" });
+ @export(TLSSocket.getTLSVersion, .{ .name = "TLSSocketPrototype__getTLSVersion" });
@export(TLSSocket.hasPendingActivity, .{ .name = "TLSSocket__hasPendingActivity" });
@export(TLSSocket.ref, .{ .name = "TLSSocketPrototype__ref" });
@export(TLSSocket.reload, .{ .name = "TLSSocketPrototype__reload" });
@export(TLSSocket.setData, .{ .name = "TLSSocketPrototype__setData" });
+ @export(TLSSocket.setMaxSendFragment, .{ .name = "TLSSocketPrototype__setMaxSendFragment" });
@export(TLSSocket.setServername, .{ .name = "TLSSocketPrototype__setServername" });
+ @export(TLSSocket.setSession, .{ .name = "TLSSocketPrototype__setSession" });
@export(TLSSocket.shutdown, .{ .name = "TLSSocketPrototype__shutdown" });
@export(TLSSocket.timeout, .{ .name = "TLSSocketPrototype__timeout" });
@export(TLSSocket.unref, .{ .name = "TLSSocketPrototype__unref" });
diff --git a/src/bun.js/bindings/headers.h b/src/bun.js/bindings/headers.h
index 206a7e27c..9bc8cd793 100644
--- a/src/bun.js/bindings/headers.h
+++ b/src/bun.js/bindings/headers.h
@@ -383,6 +383,7 @@ CPP_DECL unsigned char JSC__JSValue__jsType(JSC__JSValue JSValue0);
CPP_DECL JSC__JSValue JSC__JSValue__jsUndefined();
CPP_DECL JSC__JSValue JSC__JSValue__makeWithNameAndPrototype(JSC__JSGlobalObject* arg0, void* arg1, void* arg2, const ZigString* arg3);
CPP_DECL JSC__JSValue JSC__JSValue__parseJSON(JSC__JSValue JSValue0, JSC__JSGlobalObject* arg1);
+CPP_DECL void JSC__JSValue__push(JSC__JSValue JSValue0, JSC__JSGlobalObject* arg1, JSC__JSValue JSValue2);
CPP_DECL void JSC__JSValue__put(JSC__JSValue JSValue0, JSC__JSGlobalObject* arg1, const ZigString* arg2, JSC__JSValue JSValue3);
CPP_DECL void JSC__JSValue__putIndex(JSC__JSValue JSValue0, JSC__JSGlobalObject* arg1, uint32_t arg2, JSC__JSValue JSValue3);
CPP_DECL void JSC__JSValue__putRecord(JSC__JSValue JSValue0, JSC__JSGlobalObject* arg1, ZigString* arg2, ZigString* arg3, size_t arg4);
diff --git a/src/bun.js/bindings/headers.zig b/src/bun.js/bindings/headers.zig
index 155b7cce4..dade6c8ae 100644
--- a/src/bun.js/bindings/headers.zig
+++ b/src/bun.js/bindings/headers.zig
@@ -283,6 +283,7 @@ pub extern fn JSC__JSValue__jsType(JSValue0: JSC__JSValue) u8;
pub extern fn JSC__JSValue__jsUndefined(...) JSC__JSValue;
pub extern fn JSC__JSValue__makeWithNameAndPrototype(arg0: *bindings.JSGlobalObject, arg1: ?*anyopaque, arg2: ?*anyopaque, arg3: [*c]const ZigString) JSC__JSValue;
pub extern fn JSC__JSValue__parseJSON(JSValue0: JSC__JSValue, arg1: *bindings.JSGlobalObject) JSC__JSValue;
+pub extern fn JSC__JSValue__push(JSValue0: JSC__JSValue, arg1: *bindings.JSGlobalObject, JSValue2: JSC__JSValue) void;
pub extern fn JSC__JSValue__put(JSValue0: JSC__JSValue, arg1: *bindings.JSGlobalObject, arg2: [*c]const ZigString, JSValue3: JSC__JSValue) void;
pub extern fn JSC__JSValue__putIndex(JSValue0: JSC__JSValue, arg1: *bindings.JSGlobalObject, arg2: u32, JSValue3: JSC__JSValue) void;
pub extern fn JSC__JSValue__putRecord(JSValue0: JSC__JSValue, arg1: *bindings.JSGlobalObject, arg2: [*c]ZigString, arg3: [*c]ZigString, arg4: usize) void;
diff --git a/src/deps/boringssl.translated.zig b/src/deps/boringssl.translated.zig
index ee4f76260..27c3d621f 100644
--- a/src/deps/boringssl.translated.zig
+++ b/src/deps/boringssl.translated.zig
@@ -1,7 +1,6 @@
const std = @import("std");
const C = @import("std").zig.c_builtins;
-
-const pthread_rwlock_t = C.pthread_rwlock_t;
+const pthread_rwlock_t = @import("../sync.zig").RwLock.pthread_rwlock_t;
const time_t = C.time_t;
const va_list = C.va_list;
const struct_timeval = C.struct_timeval;
@@ -588,6 +587,7 @@ pub const X509_LOOKUP_METHOD = struct_x509_lookup_method_st;
pub const struct_x509_object_st = opaque {};
pub const X509_OBJECT = struct_x509_object_st;
pub const struct_stack_st_X509_EXTENSION = opaque {};
+pub const struct_stack_st_v3_ext_method = opaque {};
pub const struct_stack_st_GENERAL_NAME = opaque {};
pub const struct_x509_revoked_st = extern struct {
serialNumber: [*c]ASN1_INTEGER,
@@ -3759,6 +3759,102 @@ pub fn sk_X509_REVOKED_deep_copy(arg_sk: ?*const struct_stack_st_X509_REVOKED, a
return @ptrCast(?*struct_stack_st_X509_REVOKED, sk_deep_copy(@ptrCast([*c]const _STACK, @alignCast(@import("std").meta.alignment(_STACK), sk)), sk_X509_REVOKED_call_copy_func, @ptrCast(stack_copy_func, @alignCast(@import("std").meta.alignment(fn (?*anyopaque) callconv(.C) ?*anyopaque), copy_func)), sk_X509_REVOKED_call_free_func, @ptrCast(stack_free_func, @alignCast(@import("std").meta.alignment(fn (?*anyopaque) callconv(.C) void), free_func))));
}
pub const struct_stack_st_GENERAL_NAMES = opaque {};
+pub const struct_stack_st_ACCESS_DESCRIPTION = opaque {};
+
+pub const OTHERNAME = extern struct {
+ type_id: ?*ASN1_OBJECT,
+ value: ?*ASN1_TYPE,
+};
+
+pub const GENERAL_NAME = extern struct {
+ name_type: enum(c_int) {
+ GEN_OTHERNAME = 0,
+ GEN_EMAIL = 1,
+ GEN_DNS = 2,
+ GEN_X400 = 3,
+ GEN_DIRNAME = 4,
+ GEN_EDIPARTY = 5,
+ GEN_URI = 6,
+ GEN_IPADD = 7,
+ GEN_RID = 8,
+ },
+ d: extern union {
+ ptr: *c_char,
+ otherName: *OTHERNAME,
+ rfc822Name: *ASN1_IA5STRING,
+ dNSName: *ASN1_IA5STRING,
+ x400Address: *ASN1_STRING,
+ directoryName: *X509_NAME,
+ //EDIPARTYNAME
+ ediPartyName: *anyopaque,
+ uniformResourceIdentifier: *ASN1_IA5STRING,
+ iPAddress: *ASN1_OCTET_STRING,
+ registeredID: *ASN1_OBJECT,
+ ip: *ASN1_OCTET_STRING,
+ dirn: *X509_NAME,
+ ia5: *ASN1_IA5STRING,
+ rid: *ASN1_OBJECT,
+ other: *ASN1_TYPE,
+ },
+};
+
+pub const ACCESS_DESCRIPTION = extern struct {
+ method: *ASN1_OBJECT,
+ location: *GENERAL_NAME,
+};
+
+pub fn sk_GENERAL_NAME_num(arg_sk: ?*const struct_stack_st_GENERAL_NAME) callconv(.C) usize {
+ var sk = arg_sk;
+ return sk_num(@ptrCast([*c]const _STACK, @alignCast(@import("std").meta.alignment(_STACK), sk)));
+}
+pub fn sk_GENERAL_NAME_free(arg_sk: ?*struct_stack_st_GENERAL_NAME) callconv(.C) void {
+ var sk = arg_sk;
+ sk_free(@ptrCast([*c]_STACK, @alignCast(@import("std").meta.alignment(_STACK), sk)));
+}
+pub const stack_GENERAL_NAME_free_func = ?*const fn (?*struct_stack_st_GENERAL_NAME) callconv(.C) void;
+
+pub fn sk_GENERAL_NAME_call_free_func(arg_free_func: stack_free_func, arg_ptr: ?*anyopaque) callconv(.C) void {
+ var free_func = arg_free_func;
+ var ptr = arg_ptr;
+ @ptrCast(stack_GENERAL_NAME_free_func, @alignCast(@import("std").meta.alignment(fn (?*struct_stack_st_GENERAL_NAME) callconv(.C) void), free_func)).?(@ptrCast(?*struct_stack_st_GENERAL_NAME, ptr));
+}
+pub fn sk_GENERAL_NAME_pop_free(arg_sk: ?*struct_stack_st_GENERAL_NAME, arg_free_func: stack_GENERAL_NAME_free_func) callconv(.C) void {
+ var sk = arg_sk;
+ var free_func = arg_free_func;
+ sk_pop_free_ex(@ptrCast([*c]_STACK, @alignCast(@import("std").meta.alignment(_STACK), sk)), sk_GENERAL_NAME_call_free_func, @ptrCast(stack_free_func, @alignCast(@import("std").meta.alignment(fn (?*anyopaque) callconv(.C) void), free_func)));
+}
+pub fn sk_GENERAL_NAME_value(arg_sk: ?*const struct_stack_st_GENERAL_NAME, arg_i: usize) callconv(.C) ?*GENERAL_NAME {
+ var sk = arg_sk;
+ var i = arg_i;
+ return @ptrCast(?*GENERAL_NAME, @alignCast(@alignOf(GENERAL_NAME), sk_value(@ptrCast([*c]const _STACK, @alignCast(@import("std").meta.alignment(_STACK), sk)), i)));
+}
+
+pub fn sk_ACCESS_DESCRIPTION_num(arg_sk: ?*const AUTHORITY_INFO_ACCESS) callconv(.C) usize {
+ var sk = arg_sk;
+ return sk_num(@ptrCast([*c]const _STACK, @alignCast(@import("std").meta.alignment(_STACK), sk)));
+}
+pub fn sk_ACCESS_DESCRIPTION_free(arg_sk: ?*AUTHORITY_INFO_ACCESS) callconv(.C) void {
+ var sk = arg_sk;
+ sk_free(@ptrCast([*c]_STACK, @alignCast(@import("std").meta.alignment(_STACK), sk)));
+}
+pub const stack_ACCESS_DESCRIPTION_free_func = ?*const fn (?*AUTHORITY_INFO_ACCESS) callconv(.C) void;
+
+pub fn sk_ACCESS_DESCRIPTION_call_free_func(arg_free_func: stack_free_func, arg_ptr: ?*anyopaque) callconv(.C) void {
+ var free_func = arg_free_func;
+ var ptr = arg_ptr;
+ @ptrCast(stack_ACCESS_DESCRIPTION_free_func, @alignCast(@import("std").meta.alignment(fn (?*AUTHORITY_INFO_ACCESS) callconv(.C) void), free_func)).?(@ptrCast(?*AUTHORITY_INFO_ACCESS, ptr));
+}
+pub fn sk_ACCESS_DESCRIPTION_pop_free(arg_sk: ?*AUTHORITY_INFO_ACCESS, arg_free_func: stack_ACCESS_DESCRIPTION_free_func) callconv(.C) void {
+ var sk = arg_sk;
+ var free_func = arg_free_func;
+ sk_pop_free_ex(@ptrCast([*c]_STACK, @alignCast(@import("std").meta.alignment(_STACK), sk)), sk_ACCESS_DESCRIPTION_call_free_func, @ptrCast(stack_free_func, @alignCast(@import("std").meta.alignment(fn (?*anyopaque) callconv(.C) void), free_func)));
+}
+pub fn sk_ACCESS_DESCRIPTION_value(arg_sk: ?*const AUTHORITY_INFO_ACCESS, arg_i: usize) callconv(.C) ?*ACCESS_DESCRIPTION {
+ var sk = arg_sk;
+ var i = arg_i;
+ return @ptrCast(?*ACCESS_DESCRIPTION, @alignCast(@alignOf(ACCESS_DESCRIPTION), sk_value(@ptrCast([*c]const _STACK, @alignCast(@import("std").meta.alignment(_STACK), sk)), i)));
+}
+
pub const stack_X509_CRL_free_func = ?*const fn (?*X509_CRL) callconv(.C) void;
pub const stack_X509_CRL_copy_func = ?*const fn (?*X509_CRL) callconv(.C) ?*X509_CRL;
pub const stack_X509_CRL_cmp_func = ?*const fn ([*c]?*const X509_CRL, [*c]?*const X509_CRL) callconv(.C) c_int;
@@ -3988,6 +4084,7 @@ pub fn sk_X509_INFO_deep_copy(arg_sk: ?*const struct_stack_st_X509_INFO, arg_cop
var free_func = arg_free_func;
return @ptrCast(?*struct_stack_st_X509_INFO, sk_deep_copy(@ptrCast([*c]const _STACK, @alignCast(@import("std").meta.alignment(_STACK), sk)), sk_X509_INFO_call_copy_func, @ptrCast(stack_copy_func, @alignCast(@import("std").meta.alignment(fn (?*anyopaque) callconv(.C) ?*anyopaque), copy_func)), sk_X509_INFO_call_free_func, @ptrCast(stack_free_func, @alignCast(@import("std").meta.alignment(fn (?*anyopaque) callconv(.C) void), free_func))));
}
+pub const X509V3_EXT_METHOD = struct_stack_st_v3_ext_method;
pub extern fn X509_get_version(x509: ?*const X509) c_long;
pub extern fn X509_set_version(x509: ?*X509, version: c_long) c_int;
pub extern fn X509_get0_serialNumber(x509: ?*const X509) [*c]const ASN1_INTEGER;
@@ -4111,6 +4208,9 @@ pub extern fn i2d_DHparams_bio(bp: [*c]BIO, dh: [*c]const DH) c_int;
pub extern fn X509_dup(x509: ?*X509) ?*X509;
pub extern fn X509_ATTRIBUTE_dup(xa: ?*X509_ATTRIBUTE) ?*X509_ATTRIBUTE;
pub extern fn X509_EXTENSION_dup(ex: ?*X509_EXTENSION) ?*X509_EXTENSION;
+pub extern fn X509V3_EXT_d2i(ex: ?*X509_EXTENSION) ?*anyopaque;
+pub extern fn X509V3_EXT_get(ex: ?*X509_EXTENSION) ?*X509V3_EXT_METHOD;
+pub extern fn X509V3_EXT_get_nid(ndi: c_int) ?*X509V3_EXT_METHOD;
pub extern fn X509_CRL_dup(crl: ?*X509_CRL) ?*X509_CRL;
pub extern fn X509_REVOKED_dup(rev: [*c]X509_REVOKED) [*c]X509_REVOKED;
pub extern fn X509_REQ_dup(req: ?*X509_REQ) ?*X509_REQ;
@@ -4355,6 +4455,7 @@ pub extern fn X509_get_ext_by_critical(x: ?*const X509, crit: c_int, lastpos: c_
pub extern fn X509_get_ext(x: ?*const X509, loc: c_int) ?*X509_EXTENSION;
pub extern fn X509_delete_ext(x: ?*X509, loc: c_int) ?*X509_EXTENSION;
pub extern fn X509_add_ext(x: ?*X509, ex: ?*X509_EXTENSION, loc: c_int) c_int;
+pub extern fn X509_check_ca(x: ?*X509) c_int;
pub extern fn X509_get_ext_d2i(x509: ?*const X509, nid: c_int, out_critical: [*c]c_int, out_idx: [*c]c_int) ?*anyopaque;
pub extern fn X509_add1_ext_i2d(x: ?*X509, nid: c_int, value: ?*anyopaque, crit: c_int, flags: c_ulong) c_int;
pub extern fn X509_CRL_get_ext_count(x: ?*const X509_CRL) c_int;
@@ -14918,6 +15019,7 @@ pub const OBJ_id_HMACGostR3411_94 = blk: {
pub const SN_id_GostR3410_2001 = "gost2001";
pub const LN_id_GostR3410_2001 = "GOST R 34.10-2001";
pub const NID_id_GostR3410_2001 = @as(c_int, 811);
+
pub const OBJ_id_GostR3410_2001 = blk: {
_ = @as(c_long, 1);
_ = @as(c_long, 2);
@@ -14926,6 +15028,9 @@ pub const OBJ_id_GostR3410_2001 = blk: {
_ = @as(c_long, 2);
break :blk @as(c_long, 19);
};
+
+pub const NID_id_GostR3410_2012_256 = @as(c_int, 979);
+pub const NID_id_GostR3410_2012_512 = @as(c_int, 980);
pub const SN_id_GostR3410_94 = "gost94";
pub const LN_id_GostR3410_94 = "GOST R 34.10-94";
pub const NID_id_GostR3410_94 = @as(c_int, 812);
@@ -16367,6 +16472,11 @@ pub const OBJ_sha512_256 = blk: {
_ = @as(c_long, 2);
break :blk @as(c_long, 6);
};
+
+pub const NID_id_on_SmtpUTF8Mailbox = @as(c_int, 1208);
+pub const NID_XmppAddr = @as(c_int, 1209);
+pub const NID_SRVName = @as(c_int, 1210);
+pub const NID_NAIRealm = @as(c_int, 1211);
pub const EVP_PKEY_NONE = NID_undef;
pub const EVP_PKEY_RSA = NID_rsaEncryption;
pub const EVP_PKEY_RSA_PSS = NID_rsassaPss;
@@ -18658,6 +18768,7 @@ pub const stack_st_DIST_POINT = struct_stack_st_DIST_POINT;
pub const stack_st_X509_TRUST = struct_stack_st_X509_TRUST;
pub const stack_st_X509_REVOKED = struct_stack_st_X509_REVOKED;
pub const stack_st_GENERAL_NAMES = struct_stack_st_GENERAL_NAMES;
+pub const AUTHORITY_INFO_ACCESS = struct_stack_st_ACCESS_DESCRIPTION;
pub const stack_st_X509_INFO = struct_stack_st_X509_INFO;
pub const stack_st_X509_LOOKUP = struct_stack_st_X509_LOOKUP;
pub const stack_st_X509_OBJECT = struct_stack_st_X509_OBJECT;
diff --git a/src/deps/uws.zig b/src/deps/uws.zig
index 83edbe410..da92bb496 100644
--- a/src/deps/uws.zig
+++ b/src/deps/uws.zig
@@ -21,9 +21,9 @@ fn NativeSocketHandleType(comptime ssl: bool) type {
return anyopaque;
}
}
-pub fn NewSocketHandler(comptime ssl: bool) type {
+pub fn NewSocketHandler(comptime is_ssl: bool) type {
return struct {
- const ssl_int: i32 = @intFromBool(ssl);
+ const ssl_int: i32 = @intFromBool(is_ssl);
socket: *Socket,
const ThisSocket = @This();
@@ -44,6 +44,13 @@ pub fn NewSocketHandler(comptime ssl: bool) type {
_ = us_socket_open(comptime ssl_int, this.socket, @intFromBool(is_client), null, 0);
}
+ pub fn ssl(this: ThisSocket) *BoringSSL.SSL {
+ if (comptime is_ssl) {
+ return @ptrCast(*BoringSSL.SSL, this.getNativeHandle());
+ }
+ @panic("socket is not a TLS socket");
+ }
+
// Note: this assumes that the socket is non-TLS and will be adopted and wrapped with a new TLS context
// context ext will not be copied to the new context, new context will contain us_wrapped_socket_context_t on ext
pub fn wrapTLS(
@@ -154,12 +161,12 @@ pub fn NewSocketHandler(comptime ssl: bool) type {
return NewSocketHandler(true).from(socket);
}
- pub fn getNativeHandle(this: ThisSocket) *NativeSocketHandleType(ssl) {
- return @ptrCast(*NativeSocketHandleType(ssl), us_socket_get_native_handle(comptime ssl_int, this.socket).?);
+ pub fn getNativeHandle(this: ThisSocket) *NativeSocketHandleType(is_ssl) {
+ return @ptrCast(*NativeSocketHandleType(is_ssl), us_socket_get_native_handle(comptime ssl_int, this.socket).?);
}
pub fn fd(this: ThisSocket) i32 {
- if (comptime ssl) {
+ if (comptime is_ssl) {
@compileError("SSL sockets do not have a file descriptor accessible this way");
}
@@ -167,7 +174,7 @@ pub fn NewSocketHandler(comptime ssl: bool) type {
}
pub fn markNeedsMoreForSendfile(this: ThisSocket) void {
- if (comptime ssl) {
+ if (comptime is_ssl) {
@compileError("SSL sockets do not support sendfile yet");
}
diff --git a/src/js/node/net.js b/src/js/node/net.js
index d45bb23a1..5501d327b 100644
--- a/src/js/node/net.js
+++ b/src/js/node/net.js
@@ -65,6 +65,7 @@ const bunSocketServerHandlers = Symbol.for("::bunsocket_serverhandlers::");
const bunSocketServerConnections = Symbol.for("::bunnetserverconnections::");
const bunSocketServerOptions = Symbol.for("::bunnetserveroptions::");
const bunSocketInternal = Symbol.for("::bunnetsocketinternal::");
+const bunTLSConnectOptions = Symbol.for("::buntlsconnectoptions::");
var SocketClass;
const Socket = (function (InternalSocket) {
@@ -91,7 +92,6 @@ const Socket = (function (InternalSocket) {
close: Socket.#Close,
connectError(socket, error) {
const self = socket.data;
-
self.emit("error", error);
},
data({ data: self }, buffer) {
@@ -120,11 +120,21 @@ const Socket = (function (InternalSocket) {
socket.ref();
self[bunSocketInternal] = socket;
self.connecting = false;
+ const options = self[bunTLSConnectOptions];
+
+ if (options) {
+ const { session } = options;
+ if (session) {
+ self.setSession(session);
+ }
+ }
+
if (!self.#upgraded) {
// this is not actually emitted on nodejs when socket used on the connection
- // this is already emmited on non-TLS socket and on TLS socket is emmited secureConnect on handshake
+ // this is already emmited on non-TLS socket and on TLS socket is emmited secureConnect after handshake
self.emit("connect", self);
}
+
Socket.#Drain(socket);
},
handshake(socket, success, verifyError) {
@@ -133,16 +143,13 @@ const Socket = (function (InternalSocket) {
self._securePending = false;
self.secureConnecting = false;
self._secureEstablished = !!success;
+ self.emit("secure", self);
- // Needs getPeerCertificate support (not implemented yet)
- // if (!verifyError && !this.isSessionReused()) {
- // const hostname = options.servername ||
- // options.host ||
- // (options.socket && options.socket._host) ||
- // 'localhost';
- // const cert = this.getPeerCertificate(true);
- // verifyError = options.checkServerIdentity(hostname, cert);
- // }
+ const { checkServerIdentity } = self[bunTLSConnectOptions];
+ if (!verifyError && typeof checkServerIdentity === "function" && self.servername) {
+ const cert = self.getPeerCertificate(true);
+ verifyError = checkServerIdentity(self.servername, cert);
+ }
if (self._requestCert || self._rejectUnauthorized) {
if (verifyError) {
@@ -250,19 +257,13 @@ const Socket = (function (InternalSocket) {
self.emit("connection", _socket);
},
- handshake({ data: self }, success, verifyError) {
+ handshake(socket, success, verifyError) {
+ const { data: self } = socket;
+ self.emit("secure", self);
+
self._securePending = false;
self.secureConnecting = false;
self._secureEstablished = !!success;
- // Needs getPeerCertificate support (not implemented yet)
- // if (!verifyError && !this.isSessionReused()) {
- // const hostname = options.servername ||
- // options.host ||
- // (options.socket && options.socket._host) ||
- // 'localhost';
- // const cert = this.getPeerCertificate(true);
- // verifyError = options.checkServerIdentity(hostname, cert);
- // }
if (self._requestCert || self._rejectUnauthorized) {
if (verifyError) {
@@ -276,7 +277,7 @@ const Socket = (function (InternalSocket) {
} else {
self.authorized = true;
}
- self.emit("secureConnect", verifyError);
+ self.emit("secureConnection", verifyError);
},
error(socket, error) {
Socket.#Handlers.error(socket, error);
@@ -296,6 +297,7 @@ const Socket = (function (InternalSocket) {
#readQueue = createFIFO();
remotePort;
[bunSocketInternal] = null;
+ [bunTLSConnectOptions] = null;
timeout = 0;
#writeCallback;
#writeChunk;
@@ -347,13 +349,18 @@ const Socket = (function (InternalSocket) {
socket.ref();
this[bunSocketInternal] = socket;
this.connecting = false;
- this.emit("connect", this);
+ if (!this.#upgraded) {
+ // this is not actually emitted on nodejs when socket used on the connection
+ // this is already emmited on non-TLS socket and on TLS socket is emmited secureConnect after handshake
+ this.emit("connect", this);
+ }
Socket.#Drain(socket);
}
connect(port, host, connectListener) {
var path;
var connection = this.#socket;
+ var _checkServerIdentity = undefined;
if (typeof port === "string") {
path = port;
port = undefined;
@@ -390,8 +397,10 @@ const Socket = (function (InternalSocket) {
rejectUnauthorized,
pauseOnConnect,
servername,
+ checkServerIdentity,
+ session,
} = port;
-
+ _checkServerIdentity = checkServerIdentity;
this.servername = servername;
if (socket) {
connection = socket;
@@ -414,18 +423,14 @@ const Socket = (function (InternalSocket) {
this._rejectUnauthorized = rejectUnauthorized;
if (tls) {
- // TLS can true/false or options
- if (typeof tls !== "object") {
- tls = {
- rejectUnauthorized: rejectUnauthorized,
- requestCert: true,
- };
- } else {
- tls.rejectUnauthorized = rejectUnauthorized;
- tls.requestCert = true;
- if (!connection && tls.socket) {
- connection = tls.socket;
- }
+ tls.rejectUnauthorized = rejectUnauthorized;
+ tls.requestCert = true;
+ tls.session = session || tls.session;
+ this.servername = tls.servername;
+ tls.checkServerIdentity = _checkServerIdentity || tls.checkServerIdentity;
+ this[bunTLSConnectOptions] = tls;
+ if (!connection && tls.socket) {
+ connection = tls.socket;
}
}
if (connection) {
@@ -441,6 +446,7 @@ const Socket = (function (InternalSocket) {
this.secureConnecting = true;
this._secureEstablished = false;
this._securePending = true;
+
if (connectListener) this.on("secureConnect", connectListener);
} else if (connectListener) this.on("connect", connectListener);
// start using existing connection
@@ -809,12 +815,16 @@ class Server extends EventEmitter {
var tls = undefined;
var TLSSocketClass = undefined;
const bunTLS = this[bunTlsSymbol];
+ const options = this[bunSocketServerOptions];
+
if (typeof bunTLS === "function") {
[tls, TLSSocketClass] = bunTLS.call(this, port, hostname, false);
+ options.servername = tls.serverName;
+ options.InternalSocketClass = TLSSocketClass;
+ } else {
+ options.InternalSocketClass = SocketClass;
}
- this[bunSocketServerOptions].InternalSocketClass = TLSSocketClass || SocketClass;
-
this.#server = Bun.listen(
path
? {
diff --git a/src/js/node/tls.js b/src/js/node/tls.js
index 60903239b..259e6e832 100644
--- a/src/js/node/tls.js
+++ b/src/js/node/tls.js
@@ -16,6 +16,8 @@ const StringPrototypeSplit = String.prototype.split;
const StringPrototypeIndexOf = String.prototype.indexOf;
const StringPrototypeSubstring = String.prototype.substring;
const StringPrototypeEndsWith = String.prototype.endsWith;
+const StringFromCharCode = String.fromCharCode;
+const StringPrototypeCharCodeAt = String.prototype.charCodeAt;
const ArrayPrototypeIncludes = Array.prototype.includes;
const ArrayPrototypeJoin = Array.prototype.join;
@@ -40,11 +42,16 @@ function isValidTLSArray(obj) {
}
function unfqdn(host) {
- return RegExpPrototypeSymbolReplace(/[.]$/, host, "");
+ return RegExpPrototypeSymbolReplace.call(/[.]$/, host, "");
+}
+// String#toLowerCase() is locale-sensitive so we use
+// a conservative version that only lowercases A-Z.
+function toLowerCase(c) {
+ return StringFromCharCode.call(32 + StringPrototypeCharCodeAt.call(c, 0));
}
function splitHost(host) {
- return StringPrototypeSplit.call(RegExpPrototypeSymbolReplace(/[A-Z]/g, unfqdn(host), toLowerCase), ".");
+ return StringPrototypeSplit.call(RegExpPrototypeSymbolReplace.call(/[A-Z]/g, unfqdn(host), toLowerCase), ".");
}
function check(hostParts, pattern, wildcards) {
@@ -163,7 +170,6 @@ function checkServerIdentity(hostname, cert) {
let reason = "Unknown reason";
hostname = unfqdn(hostname); // Remove trailing dot for error messages.
-
if (net.isIP(hostname)) {
valid = ArrayPrototypeIncludes.call(ips, canonicalizeIP(hostname));
if (!valid) reason = `IP: ${hostname} is not in the cert's list: ` + ArrayPrototypeJoin.call(ips, ", ");
@@ -178,7 +184,7 @@ function checkServerIdentity(hostname, cert) {
// Match against Common Name only if no supported identifiers exist.
const cn = subject.CN;
- if (ArrayIsArray(cn)) valid = ArrayPrototypeSome.call(cn, wildcard);
+ if (Array.isArray(cn)) valid = ArrayPrototypeSome.call(cn, wildcard);
else if (cn) valid = wildcard(cn);
if (!valid) reason = `Host: ${hostname}. is not cert's CN: ${cn}`;
@@ -186,7 +192,6 @@ function checkServerIdentity(hostname, cert) {
} else {
reason = "Cert does not contain a DNS name";
}
-
if (!valid) {
let error = new Error(`ERR_TLS_CERT_ALTNAME_INVALID: Hostname/IP does not match certificate's altnames: ${reason}`);
error.name = "ERR_TLS_CERT_ALTNAME_INVALID";
@@ -274,9 +279,8 @@ function translatePeerCertificate(c) {
if (c.infoAccess != null) {
const info = c.infoAccess;
c.infoAccess = { __proto__: null };
-
// XXX: More key validation?
- RegExpPrototypeSymbolReplace(/([^\n:]*):([^\n]*)(?:\n|$)/g, info, (all, key, val) => {
+ RegExpPrototypeSymbolReplace.call(/([^\n:]*):([^\n]*)(?:\n|$)/g, info, (all, key, val) => {
if (val.charCodeAt(0) === 0x22) {
// The translatePeerCertificate function is only
// used on internally created legacy certificate
@@ -318,6 +322,8 @@ const TLSSocket = (function (InternalTLSSocket) {
#secureContext;
ALPNProtocols;
#socket;
+ #checkServerIdentity;
+ #session;
constructor(socket, options) {
super(socket instanceof InternalTCPSocket ? options : options || socket);
@@ -337,6 +343,8 @@ const TLSSocket = (function (InternalTLSSocket) {
this.secureConnecting = true;
this._secureEstablished = false;
this._securePending = true;
+ this.#checkServerIdentity = options.checkServerIdentity || checkServerIdentity;
+ this.#session = options.session || null;
}
_secureEstablished = false;
@@ -348,22 +356,76 @@ const TLSSocket = (function (InternalTLSSocket) {
servername;
authorized = false;
authorizationError;
+ #renegotiationDisabled = false;
encrypted = true;
_start() {
- // some frameworks uses this _start internal implementation is suposed to start TLS handshake
- // on Bun we auto start this after on_open callback and when wrapping we start it after the socket is attached to the net.Socket/tls.Socket
+ // some frameworks uses this _start internal implementation is suposed to start TLS handshake/connect
+ this.connect();
}
- exportKeyingMaterial(length, label, context) {
- //SSL_export_keying_material
+ getSession() {
+ return this[bunSocketInternal]?.getSession();
+ }
+
+ getEphemeralKeyInfo() {
+ return this[bunSocketInternal]?.getEphemeralKeyInfo();
+ }
+
+ getCipher() {
+ return this[bunSocketInternal]?.getCipher();
+ }
+
+ getSharedSigalgs() {
+ return this[bunSocketInternal]?.getSharedSigalgs();
+ }
+
+ getProtocol() {
+ return this[bunSocketInternal]?.getTLSVersion();
+ }
+
+ getFinished() {
+ return this[bunSocketInternal]?.getTLSFinishedMessage() || undefined;
+ }
+
+ getPeerFinished() {
+ return this[bunSocketInternal]?.getTLSPeerFinishedMessage() || undefined;
+ }
+
+ isSessionReused() {
+ return !!this.#session;
+ }
+
+ renegotiate() {
+ if (this.#renegotiationDisabled) {
+ const error = new Error("ERR_TLS_RENEGOTIATION_DISABLED: TLS session renegotiation disabled for this socket");
+ error.name = "ERR_TLS_RENEGOTIATION_DISABLED";
+ throw error;
+ }
+
throw Error("Not implented in Bun yet");
}
+ disableRenegotiation() {
+ this.#renegotiationDisabled = true;
+ }
+ getTLSTicket() {
+ return this[bunSocketInternal]?.getTLSTicket();
+ }
+ exportKeyingMaterial(length, label, context) {
+ if (context) {
+ return this[bunSocketInternal]?.exportKeyingMaterial(length, label, context);
+ }
+ return this[bunSocketInternal]?.exportKeyingMaterial(length, label);
+ }
+
setMaxSendFragment(size) {
- // SSL_set_max_send_fragment
- throw Error("Not implented in Bun yet");
+ return this[bunSocketInternal]?.setMaxSendFragment(size) || false;
}
+
+ // only for debug purposes so we just mock for now
+ enableTrace() {}
+
setServername(name) {
if (this.isServer) {
let error = new Error("ERR_TLS_SNI_FROM_SERVER: Cannot issue SNI from a TLS server-side socket");
@@ -374,25 +436,27 @@ const TLSSocket = (function (InternalTLSSocket) {
this.servername = name;
this[bunSocketInternal]?.setServername(name);
}
- setSession() {
- throw Error("Not implented in Bun yet");
+ setSession(session) {
+ this.#session = session;
+ if (typeof session === "string") session = Buffer.from(session, "latin1");
+ return this[bunSocketInternal]?.setSession(session);
}
- getPeerCertificate() {
- // need to implement peerCertificate on socket.zig
- // const cert = this[bunSocketInternal]?.peerCertificate;
- // if(cert) {
- // return translatePeerCertificate(cert);
- // }
- throw Error("Not implented in Bun yet");
+ getPeerCertificate(abbreviated) {
+ const cert =
+ arguments.length < 1
+ ? this[bunSocketInternal]?.getPeerCertificate()
+ : this[bunSocketInternal]?.getPeerCertificate(abbreviated);
+ if (cert) {
+ return translatePeerCertificate(cert);
+ }
}
getCertificate() {
// need to implement certificate on socket.zig
- // const cert = this[bunSocketInternal]?.certificate;
- // if(cert) {
- // It's not a peer cert, but the formatting is identical.
- // return translatePeerCertificate(cert);
- // }
- throw Error("Not implented in Bun yet");
+ const cert = this[bunSocketInternal]?.getCertificate();
+ if (cert) {
+ // It's not a peer cert, but the formatting is identical.
+ return translatePeerCertificate(cert);
+ }
}
getPeerX509Certificate() {
throw Error("Not implented in Bun yet");
@@ -410,6 +474,8 @@ const TLSSocket = (function (InternalTLSSocket) {
socket: this.#socket,
ALPNProtocols: this.ALPNProtocols,
serverName: this.servername || host || "localhost",
+ checkServerIdentity: this.#checkServerIdentity,
+ session: this.#session,
...this.#secureContext,
};
}
@@ -426,23 +492,11 @@ class Server extends NetServer {
_requestCert;
servername;
ALPNProtocols;
- #checkServerIdentity;
constructor(options, secureConnectionListener) {
super(options, secureConnectionListener);
- this.#checkServerIdentity = options?.checkServerIdentity || checkServerIdentity;
this.setSecureContext(options);
}
- emit(event, args) {
- super.emit(event, args);
-
- if (event === "connection") {
- // grabs secureConnect to emit secureConnection
- args.once("secureConnect", () => {
- super.emit("secureConnection", args);
- });
- }
- }
setSecureContext(options) {
if (options instanceof InternalSecureContext) {
options = options.context;
@@ -535,7 +589,6 @@ class Server extends NetServer {
rejectUnauthorized: isClient ? false : this._rejectUnauthorized,
requestCert: isClient ? false : this._requestCert,
ALPNProtocols: this.ALPNProtocols,
- checkServerIdentity: this.#checkServerIdentity,
},
SocketClass,
];
diff --git a/src/js/out/WebCoreJSBuiltins.cpp b/src/js/out/WebCoreJSBuiltins.cpp
index a380322a6..141898930 100644
--- a/src/js/out/WebCoreJSBuiltins.cpp
+++ b/src/js/out/WebCoreJSBuiltins.cpp
@@ -16,7 +16,7 @@ const JSC::ConstructorKind s_bundlerPluginRunSetupFunctionCodeConstructorKind =
const JSC::ImplementationVisibility s_bundlerPluginRunSetupFunctionCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
const int s_bundlerPluginRunSetupFunctionCodeLength = 2165;
static const JSC::Intrinsic s_bundlerPluginRunSetupFunctionCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_bundlerPluginRunSetupFunctionCode = "(function (J,_){\"use strict\";var D=new Map,F=new Map;function H(q,h,E){if(!q||!@isObject(q))@throwTypeError('Expected an object with \"filter\" RegExp');if(!h||!@isCallable(h))@throwTypeError(\"callback must be a function\");var{filter:w,namespace:z=\"file\"}=q;if(!w)@throwTypeError('Expected an object with \"filter\" RegExp');if(!@isRegExpObject(w))@throwTypeError(\"filter must be a RegExp\");if(z&&typeof z!==\"string\")@throwTypeError(\"namespace must be a string\");if((z\?.length\?\?0)===0)z=\"file\";if(!/^([/@a-zA-Z0-9_\\\\-]+)$/.test(z))@throwTypeError(\"namespace can only contain $a-zA-Z0-9_\\\\-\");var A=E.@get(z);if(!A)E.@set(z,[[w,h]]);else @arrayPush(A,[w,h])}function K(q,h){H(q,h,D)}function M(q,h){H(q,h,F)}const I=()=>{var q=!1,h=!1;for(var[E,w]of D.entries())for(var[z]of w)this.addFilter(z,E,1),q=!0;for(var[E,w]of F.entries())for(var[z]of w)this.addFilter(z,E,0),h=!0;if(h){var A=this.onResolve;if(!A)this.onResolve=F;else for(var[E,w]of F.entries()){var C=A.@get(E);if(!C)A.@set(E,w);else A.@set(E,C.concat(w))}}if(q){var G=this.onLoad;if(!G)this.onLoad=D;else for(var[E,w]of D.entries()){var C=G.@get(E);if(!C)G.@set(E,w);else G.@set(E,C.concat(w))}}return q||h};var B=J({config:_,onDispose:()=>@throwTypeError(`@{@2} is not implemented yet. See https://github.com/oven-sh/bun/issues/@1`),onEnd:()=>@throwTypeError(`@{@2} is not implemented yet. See https://github.com/oven-sh/bun/issues/@1`),onLoad:K,onResolve:M,onStart:()=>@throwTypeError(`@{@2} is not implemented yet. See https://github.com/oven-sh/bun/issues/@1`),resolve:()=>@throwTypeError(`@{@2} is not implemented yet. See https://github.com/oven-sh/bun/issues/@1`),initialOptions:{..._,bundle:!0,entryPoints:_.entrypoints\?\?_.entryPoints\?\?[],minify:typeof _.minify===\"boolean\"\?_.minify:!1,minifyIdentifiers:_.minify===!0||_.minify\?.identifiers,minifyWhitespace:_.minify===!0||_.minify\?.whitespace,minifySyntax:_.minify===!0||_.minify\?.syntax,outbase:_.root,platform:_.target===\"bun\"\?\"node\":_.target},esbuild:{}});if(B&&@isPromise(B))if(@getPromiseInternalField(B,@promiseFieldFlags)&@promiseStateFulfilled)B=@getPromiseInternalField(B,@promiseFieldReactionsOrResult);else return B.@then(I);return I()})\n";
+const char* const s_bundlerPluginRunSetupFunctionCode = "(function (_,E){\"use strict\";var w=new Map,h=new Map;function q(D,F,G){if(!D||!@isObject(D))@throwTypeError('Expected an object with \"filter\" RegExp');if(!F||!@isCallable(F))@throwTypeError(\"callback must be a function\");var{filter:H,namespace:I=\"file\"}=D;if(!H)@throwTypeError('Expected an object with \"filter\" RegExp');if(!@isRegExpObject(H))@throwTypeError(\"filter must be a RegExp\");if(I&&typeof I!==\"string\")@throwTypeError(\"namespace must be a string\");if((I\?.length\?\?0)===0)I=\"file\";if(!/^([/@a-zA-Z0-9_\\\\-]+)$/.test(I))@throwTypeError(\"namespace can only contain $a-zA-Z0-9_\\\\-\");var J=G.@get(I);if(!J)G.@set(I,[[H,F]]);else @arrayPush(J,[H,F])}function z(D,F){q(D,F,w)}function A(D,F){q(D,F,h)}const B=()=>{var D=!1,F=!1;for(var[G,H]of w.entries())for(var[I]of H)this.addFilter(I,G,1),D=!0;for(var[G,H]of h.entries())for(var[I]of H)this.addFilter(I,G,0),F=!0;if(F){var J=this.onResolve;if(!J)this.onResolve=h;else for(var[G,H]of h.entries()){var K=J.@get(G);if(!K)J.@set(G,H);else J.@set(G,K.concat(H))}}if(D){var M=this.onLoad;if(!M)this.onLoad=w;else for(var[G,H]of w.entries()){var K=M.@get(G);if(!K)M.@set(G,H);else M.@set(G,K.concat(H))}}return D||F};var C=_({config:E,onDispose:()=>@throwTypeError(`@{@2} is not implemented yet. See https://github.com/oven-sh/bun/issues/@1`),onEnd:()=>@throwTypeError(`@{@2} is not implemented yet. See https://github.com/oven-sh/bun/issues/@1`),onLoad:z,onResolve:A,onStart:()=>@throwTypeError(`@{@2} is not implemented yet. See https://github.com/oven-sh/bun/issues/@1`),resolve:()=>@throwTypeError(`@{@2} is not implemented yet. See https://github.com/oven-sh/bun/issues/@1`),initialOptions:{...E,bundle:!0,entryPoints:E.entrypoints\?\?E.entryPoints\?\?[],minify:typeof E.minify===\"boolean\"\?E.minify:!1,minifyIdentifiers:E.minify===!0||E.minify\?.identifiers,minifyWhitespace:E.minify===!0||E.minify\?.whitespace,minifySyntax:E.minify===!0||E.minify\?.syntax,outbase:E.root,platform:E.target===\"bun\"\?\"node\":E.target},esbuild:{}});if(C&&@isPromise(C))if(@getPromiseInternalField(C,@promiseFieldFlags)&@promiseStateFulfilled)C=@getPromiseInternalField(C,@promiseFieldReactionsOrResult);else return C.@then(B);return B()})\n";
// runOnResolvePlugins
const JSC::ConstructAbility s_bundlerPluginRunOnResolvePluginsCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
@@ -24,7 +24,7 @@ const JSC::ConstructorKind s_bundlerPluginRunOnResolvePluginsCodeConstructorKind
const JSC::ImplementationVisibility s_bundlerPluginRunOnResolvePluginsCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
const int s_bundlerPluginRunOnResolvePluginsCodeLength = 1711;
static const JSC::Intrinsic s_bundlerPluginRunOnResolvePluginsCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_bundlerPluginRunOnResolvePluginsCode = "(function (C,E,F,b,G){\"use strict\";const H=[\"entry-point\",\"import-statement\",\"require-call\",\"dynamic-import\",\"require-resolve\",\"import-rule\",\"url-token\",\"internal\"][G];var g=(async(j,q,J,K)=>{var{onResolve:M,onLoad:A}=this,B=M.@get(q);if(!B)return this.onResolveAsync(b,null,null,null),null;for(let[O,Q]of B)if(O.test(j)){var _=Q({path:j,importer:J,namespace:q,kind:K});while(_&&@isPromise(_)&&(@getPromiseInternalField(_,@promiseFieldFlags)&@promiseStateMask)===@promiseStateFulfilled)_=@getPromiseInternalField(_,@promiseFieldReactionsOrResult);if(_&&@isPromise(_))_=await _;if(!_||!@isObject(_))continue;var{path:y,namespace:w=q,external:z}=_;if(typeof y!==\"string\"||typeof w!==\"string\")@throwTypeError(\"onResolve plugins must return an object with a string 'path' and string 'loader' field\");if(!y)continue;if(!w)w=q;if(typeof z!==\"boolean\"&&!@isUndefinedOrNull(z))@throwTypeError('onResolve plugins \"external\" field must be boolean or unspecified');if(!z){if(w===\"file\"){if(darwin!==\"win32\"){if(y[0]!==\"/\"||y.includes(\"..\"))@throwTypeError('onResolve plugin \"path\" must be absolute when the namespace is \"file\"')}}if(w===\"dataurl\"){if(!y.startsWith(\"data:\"))@throwTypeError('onResolve plugin \"path\" must start with \"data:\" when the namespace is \"dataurl\"')}if(w&&w!==\"file\"&&(!A||!A.@has(w)))@throwTypeError(`Expected onLoad plugin for namespace ${w} to exist`)}return this.onResolveAsync(b,y,w,z),null}return this.onResolveAsync(b,null,null,null),null})(C,E,F,H);while(g&&@isPromise(g)&&(@getPromiseInternalField(g,@promiseFieldFlags)&@promiseStateMask)===@promiseStateFulfilled)g=@getPromiseInternalField(g,@promiseFieldReactionsOrResult);if(g&&@isPromise(g))g.then(()=>{},(j)=>{this.addError(b,j,0)})})\n";
+const char* const s_bundlerPluginRunOnResolvePluginsCode = "(function (_,w,g,y,b){\"use strict\";const j=[\"entry-point\",\"import-statement\",\"require-call\",\"dynamic-import\",\"require-resolve\",\"import-rule\",\"url-token\",\"internal\"][b];var q=(async(z,A,B,C)=>{var{onResolve:E,onLoad:F}=this,G=E.@get(A);if(!G)return this.onResolveAsync(y,null,null,null),null;for(let[O,Q]of G)if(O.test(z)){var H=Q({path:z,importer:B,namespace:A,kind:C});while(H&&@isPromise(H)&&(@getPromiseInternalField(H,@promiseFieldFlags)&@promiseStateMask)===@promiseStateFulfilled)H=@getPromiseInternalField(H,@promiseFieldReactionsOrResult);if(H&&@isPromise(H))H=await H;if(!H||!@isObject(H))continue;var{path:J,namespace:K=A,external:M}=H;if(typeof J!==\"string\"||typeof K!==\"string\")@throwTypeError(\"onResolve plugins must return an object with a string 'path' and string 'loader' field\");if(!J)continue;if(!K)K=A;if(typeof M!==\"boolean\"&&!@isUndefinedOrNull(M))@throwTypeError('onResolve plugins \"external\" field must be boolean or unspecified');if(!M){if(K===\"file\"){if(darwin!==\"win32\"){if(J[0]!==\"/\"||J.includes(\"..\"))@throwTypeError('onResolve plugin \"path\" must be absolute when the namespace is \"file\"')}}if(K===\"dataurl\"){if(!J.startsWith(\"data:\"))@throwTypeError('onResolve plugin \"path\" must start with \"data:\" when the namespace is \"dataurl\"')}if(K&&K!==\"file\"&&(!F||!F.@has(K)))@throwTypeError(`Expected onLoad plugin for namespace ${K} to exist`)}return this.onResolveAsync(y,J,K,M),null}return this.onResolveAsync(y,null,null,null),null})(_,w,g,j);while(q&&@isPromise(q)&&(@getPromiseInternalField(q,@promiseFieldFlags)&@promiseStateMask)===@promiseStateFulfilled)q=@getPromiseInternalField(q,@promiseFieldReactionsOrResult);if(q&&@isPromise(q))q.then(()=>{},(z)=>{this.addError(y,z,0)})})\n";
// runOnLoadPlugins
const JSC::ConstructAbility s_bundlerPluginRunOnLoadPluginsCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
@@ -32,7 +32,7 @@ const JSC::ConstructorKind s_bundlerPluginRunOnLoadPluginsCodeConstructorKind =
const JSC::ImplementationVisibility s_bundlerPluginRunOnLoadPluginsCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
const int s_bundlerPluginRunOnLoadPluginsCodeLength = 1325;
static const JSC::Intrinsic s_bundlerPluginRunOnLoadPluginsCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_bundlerPluginRunOnLoadPluginsCode = "(function (w,F,G,H){\"use strict\";const J={jsx:0,js:1,ts:2,tsx:3,css:4,file:5,json:6,toml:7,wasm:8,napi:9,base64:10,dataurl:11,text:12},K=[\"jsx\",\"js\",\"ts\",\"tsx\",\"css\",\"file\",\"json\",\"toml\",\"wasm\",\"napi\",\"base64\",\"dataurl\",\"text\"][H];var g=(async(j,x,y,z)=>{var B=this.onLoad.@get(y);if(!B)return this.onLoadAsync(j,null,null),null;for(let[Q,T]of B)if(Q.test(x)){var b=T({path:x,namespace:y,loader:z});while(b&&@isPromise(b)&&(@getPromiseInternalField(b,@promiseFieldFlags)&@promiseStateMask)===@promiseStateFulfilled)b=@getPromiseInternalField(b,@promiseFieldReactionsOrResult);if(b&&@isPromise(b))b=await b;if(!b||!@isObject(b))continue;var{contents:q,loader:v=z}=b;if(typeof q!==\"string\"&&!@isTypedArrayView(q))@throwTypeError('onLoad plugins must return an object with \"contents\" as a string or Uint8Array');if(typeof v!==\"string\")@throwTypeError('onLoad plugins must return an object with \"loader\" as a string');const C=J[v];if(C===@undefined)@throwTypeError(`Loader ${v} is not supported.`);return this.onLoadAsync(j,q,C),null}return this.onLoadAsync(j,null,null),null})(w,F,G,K);while(g&&@isPromise(g)&&(@getPromiseInternalField(g,@promiseFieldFlags)&@promiseStateMask)===@promiseStateFulfilled)g=@getPromiseInternalField(g,@promiseFieldReactionsOrResult);if(g&&@isPromise(g))g.then(()=>{},(j)=>{this.addError(w,j,1)})})\n";
+const char* const s_bundlerPluginRunOnLoadPluginsCode = "(function (b,g,j,q){\"use strict\";const v={jsx:0,js:1,ts:2,tsx:3,css:4,file:5,json:6,toml:7,wasm:8,napi:9,base64:10,dataurl:11,text:12},w=[\"jsx\",\"js\",\"ts\",\"tsx\",\"css\",\"file\",\"json\",\"toml\",\"wasm\",\"napi\",\"base64\",\"dataurl\",\"text\"][q];var x=(async(y,z,B,C)=>{var F=this.onLoad.@get(B);if(!F)return this.onLoadAsync(y,null,null),null;for(let[K,Q]of F)if(K.test(z)){var G=Q({path:z,namespace:B,loader:C});while(G&&@isPromise(G)&&(@getPromiseInternalField(G,@promiseFieldFlags)&@promiseStateMask)===@promiseStateFulfilled)G=@getPromiseInternalField(G,@promiseFieldReactionsOrResult);if(G&&@isPromise(G))G=await G;if(!G||!@isObject(G))continue;var{contents:H,loader:J=C}=G;if(typeof H!==\"string\"&&!@isTypedArrayView(H))@throwTypeError('onLoad plugins must return an object with \"contents\" as a string or Uint8Array');if(typeof J!==\"string\")@throwTypeError('onLoad plugins must return an object with \"loader\" as a string');const T=v[J];if(T===@undefined)@throwTypeError(`Loader ${J} is not supported.`);return this.onLoadAsync(y,H,T),null}return this.onLoadAsync(y,null,null),null})(b,g,j,w);while(x&&@isPromise(x)&&(@getPromiseInternalField(x,@promiseFieldFlags)&@promiseStateMask)===@promiseStateFulfilled)x=@getPromiseInternalField(x,@promiseFieldReactionsOrResult);if(x&&@isPromise(x))x.then(()=>{},(y)=>{this.addError(b,y,1)})})\n";
#define DEFINE_BUILTIN_GENERATOR(codeName, functionName, overriddenName, argumentCount) \
JSC::FunctionExecutable* codeName##Generator(JSC::VM& vm) \
@@ -108,7 +108,7 @@ const JSC::ConstructorKind s_writableStreamInternalsCreateWritableStreamCodeCons
const JSC::ImplementationVisibility s_writableStreamInternalsCreateWritableStreamCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
const int s_writableStreamInternalsCreateWritableStreamCodeLength = 278;
static const JSC::Intrinsic s_writableStreamInternalsCreateWritableStreamCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_writableStreamInternalsCreateWritableStreamCode = "(function (p,N,_,f,u,j){\"use strict\";@assert(typeof u===\"number\"&&!@isNaN(u)&&u>=0);const d={};@initializeWritableStreamSlots(d,{});const q=new @WritableStreamDefaultController;return @setUpWritableStreamDefaultController(d,q,p,N,_,f,u,j),@createWritableStreamFromInternal(d)})\n";
+const char* const s_writableStreamInternalsCreateWritableStreamCode = "(function (u,d,p,N,_,f){\"use strict\";@assert(typeof _===\"number\"&&!@isNaN(_)&&_>=0);const j={};@initializeWritableStreamSlots(j,{});const q=new @WritableStreamDefaultController;return @setUpWritableStreamDefaultController(j,q,u,d,p,N,_,f),@createWritableStreamFromInternal(j)})\n";
// createInternalWritableStreamFromUnderlyingSink
const JSC::ConstructAbility s_writableStreamInternalsCreateInternalWritableStreamFromUnderlyingSinkCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
@@ -116,7 +116,7 @@ const JSC::ConstructorKind s_writableStreamInternalsCreateInternalWritableStream
const JSC::ImplementationVisibility s_writableStreamInternalsCreateInternalWritableStreamFromUnderlyingSinkCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
const int s_writableStreamInternalsCreateInternalWritableStreamFromUnderlyingSinkCodeLength = 920;
static const JSC::Intrinsic s_writableStreamInternalsCreateInternalWritableStreamFromUnderlyingSinkCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_writableStreamInternalsCreateInternalWritableStreamFromUnderlyingSinkCode = "(function (f,w){\"use strict\";const C={};if(f===@undefined)f={};if(w===@undefined)w={};if(!@isObject(f))@throwTypeError(\"WritableStream constructor takes an object as first argument\");if(\"type\"in f)@throwRangeError(\"Invalid type is specified\");const E=@extractSizeAlgorithm(w),_=@extractHighWaterMark(w,1),o={};if(\"start\"in f){if(o.start=f.start,typeof o.start!==\"function\")@throwTypeError(\"underlyingSink.start should be a function\")}if(\"write\"in f){if(o.write=f.write,typeof o.write!==\"function\")@throwTypeError(\"underlyingSink.write should be a function\")}if(\"close\"in f){if(o.close=f.close,typeof o.close!==\"function\")@throwTypeError(\"underlyingSink.close should be a function\")}if(\"abort\"in f){if(o.abort=f.abort,typeof o.abort!==\"function\")@throwTypeError(\"underlyingSink.abort should be a function\")}return @initializeWritableStreamSlots(C,f),@setUpWritableStreamDefaultControllerFromUnderlyingSink(C,f,o,_,E),C})\n";
+const char* const s_writableStreamInternalsCreateInternalWritableStreamFromUnderlyingSinkCode = "(function (f,o){\"use strict\";const w={};if(f===@undefined)f={};if(o===@undefined)o={};if(!@isObject(f))@throwTypeError(\"WritableStream constructor takes an object as first argument\");if(\"type\"in f)@throwRangeError(\"Invalid type is specified\");const C=@extractSizeAlgorithm(o),E=@extractHighWaterMark(o,1),_={};if(\"start\"in f){if(_.start=f.start,typeof _.start!==\"function\")@throwTypeError(\"underlyingSink.start should be a function\")}if(\"write\"in f){if(_.write=f.write,typeof _.write!==\"function\")@throwTypeError(\"underlyingSink.write should be a function\")}if(\"close\"in f){if(_.close=f.close,typeof _.close!==\"function\")@throwTypeError(\"underlyingSink.close should be a function\")}if(\"abort\"in f){if(_.abort=f.abort,typeof _.abort!==\"function\")@throwTypeError(\"underlyingSink.abort should be a function\")}return @initializeWritableStreamSlots(w,f),@setUpWritableStreamDefaultControllerFromUnderlyingSink(w,f,_,E,C),w})\n";
// initializeWritableStreamSlots
const JSC::ConstructAbility s_writableStreamInternalsInitializeWritableStreamSlotsCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
@@ -156,7 +156,7 @@ const JSC::ConstructorKind s_writableStreamInternalsSetUpWritableStreamDefaultWr
const JSC::ImplementationVisibility s_writableStreamInternalsSetUpWritableStreamDefaultWriterCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
const int s_writableStreamInternalsSetUpWritableStreamDefaultWriterCodeLength = 887;
static const JSC::Intrinsic s_writableStreamInternalsSetUpWritableStreamDefaultWriterCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_writableStreamInternalsSetUpWritableStreamDefaultWriterCode = "(function (g,n){\"use strict\";if(@isWritableStreamLocked(n))@throwTypeError(\"WritableStream is locked\");@putByIdDirectPrivate(g,\"stream\",n),@putByIdDirectPrivate(n,\"writer\",g);const v=@newPromiseCapability(@Promise),h=@newPromiseCapability(@Promise);@putByIdDirectPrivate(g,\"readyPromise\",v),@putByIdDirectPrivate(g,\"closedPromise\",h);const B=@getByIdDirectPrivate(n,\"state\");if(B===\"writable\"){if(@writableStreamCloseQueuedOrInFlight(n)||!@getByIdDirectPrivate(n,\"backpressure\"))v.@resolve.@call()}else if(B===\"erroring\")v.@reject.@call(@undefined,@getByIdDirectPrivate(n,\"storedError\")),@markPromiseAsHandled(v.@promise);else if(B===\"closed\")v.@resolve.@call(),h.@resolve.@call();else{@assert(B===\"errored\");const _=@getByIdDirectPrivate(n,\"storedError\");v.@reject.@call(@undefined,_),@markPromiseAsHandled(v.@promise),h.@reject.@call(@undefined,_),@markPromiseAsHandled(h.@promise)}})\n";
+const char* const s_writableStreamInternalsSetUpWritableStreamDefaultWriterCode = "(function (n,v){\"use strict\";if(@isWritableStreamLocked(v))@throwTypeError(\"WritableStream is locked\");@putByIdDirectPrivate(n,\"stream\",v),@putByIdDirectPrivate(v,\"writer\",n);const g=@newPromiseCapability(@Promise),h=@newPromiseCapability(@Promise);@putByIdDirectPrivate(n,\"readyPromise\",g),@putByIdDirectPrivate(n,\"closedPromise\",h);const B=@getByIdDirectPrivate(v,\"state\");if(B===\"writable\"){if(@writableStreamCloseQueuedOrInFlight(v)||!@getByIdDirectPrivate(v,\"backpressure\"))g.@resolve.@call()}else if(B===\"erroring\")g.@reject.@call(@undefined,@getByIdDirectPrivate(v,\"storedError\")),@markPromiseAsHandled(g.@promise);else if(B===\"closed\")g.@resolve.@call(),h.@resolve.@call();else{@assert(B===\"errored\");const _=@getByIdDirectPrivate(v,\"storedError\");g.@reject.@call(@undefined,_),@markPromiseAsHandled(g.@promise),h.@reject.@call(@undefined,_),@markPromiseAsHandled(h.@promise)}})\n";
// writableStreamAbort
const JSC::ConstructAbility s_writableStreamInternalsWritableStreamAbortCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
@@ -164,7 +164,7 @@ const JSC::ConstructorKind s_writableStreamInternalsWritableStreamAbortCodeConst
const JSC::ImplementationVisibility s_writableStreamInternalsWritableStreamAbortCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
const int s_writableStreamInternalsWritableStreamAbortCodeLength = 501;
static const JSC::Intrinsic s_writableStreamInternalsWritableStreamAbortCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_writableStreamInternalsWritableStreamAbortCode = "(function (h,B){\"use strict\";const c=@getByIdDirectPrivate(h,\"state\");if(c===\"closed\"||c===\"errored\")return @Promise.@resolve();const f=@getByIdDirectPrivate(h,\"pendingAbortRequest\");if(f!==@undefined)return f.promise.@promise;@assert(c===\"writable\"||c===\"erroring\");let _=!1;if(c===\"erroring\")_=!0,B=@undefined;const j=@newPromiseCapability(@Promise);if(@putByIdDirectPrivate(h,\"pendingAbortRequest\",{promise:j,reason:B,wasAlreadyErroring:_}),!_)@writableStreamStartErroring(h,B);return j.@promise})\n";
+const char* const s_writableStreamInternalsWritableStreamAbortCode = "(function (h,B){\"use strict\";const _=@getByIdDirectPrivate(h,\"state\");if(_===\"closed\"||_===\"errored\")return @Promise.@resolve();const f=@getByIdDirectPrivate(h,\"pendingAbortRequest\");if(f!==@undefined)return f.promise.@promise;@assert(_===\"writable\"||_===\"erroring\");let j=!1;if(_===\"erroring\")j=!0,B=@undefined;const c=@newPromiseCapability(@Promise);if(@putByIdDirectPrivate(h,\"pendingAbortRequest\",{promise:c,reason:B,wasAlreadyErroring:j}),!j)@writableStreamStartErroring(h,B);return c.@promise})\n";
// writableStreamClose
const JSC::ConstructAbility s_writableStreamInternalsWritableStreamCloseCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
@@ -172,7 +172,7 @@ const JSC::ConstructorKind s_writableStreamInternalsWritableStreamCloseCodeConst
const JSC::ImplementationVisibility s_writableStreamInternalsWritableStreamCloseCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
const int s_writableStreamInternalsWritableStreamCloseCodeLength = 642;
static const JSC::Intrinsic s_writableStreamInternalsWritableStreamCloseCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_writableStreamInternalsWritableStreamCloseCode = "(function (n){\"use strict\";const _=@getByIdDirectPrivate(n,\"state\");if(_===\"closed\"||_===\"errored\")return @Promise.@reject(@makeTypeError(\"Cannot close a writable stream that is closed or errored\"));@assert(_===\"writable\"||_===\"erroring\"),@assert(!@writableStreamCloseQueuedOrInFlight(n));const u=@newPromiseCapability(@Promise);@putByIdDirectPrivate(n,\"closeRequest\",u);const d=@getByIdDirectPrivate(n,\"writer\");if(d!==@undefined&&@getByIdDirectPrivate(n,\"backpressure\")&&_===\"writable\")@getByIdDirectPrivate(d,\"readyPromise\").@resolve.@call();return @writableStreamDefaultControllerClose(@getByIdDirectPrivate(n,\"controller\")),u.@promise})\n";
+const char* const s_writableStreamInternalsWritableStreamCloseCode = "(function (_){\"use strict\";const u=@getByIdDirectPrivate(_,\"state\");if(u===\"closed\"||u===\"errored\")return @Promise.@reject(@makeTypeError(\"Cannot close a writable stream that is closed or errored\"));@assert(u===\"writable\"||u===\"erroring\"),@assert(!@writableStreamCloseQueuedOrInFlight(_));const d=@newPromiseCapability(@Promise);@putByIdDirectPrivate(_,\"closeRequest\",d);const n=@getByIdDirectPrivate(_,\"writer\");if(n!==@undefined&&@getByIdDirectPrivate(_,\"backpressure\")&&u===\"writable\")@getByIdDirectPrivate(n,\"readyPromise\").@resolve.@call();return @writableStreamDefaultControllerClose(@getByIdDirectPrivate(_,\"controller\")),d.@promise})\n";
// writableStreamAddWriteRequest
const JSC::ConstructAbility s_writableStreamInternalsWritableStreamAddWriteRequestCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
@@ -196,7 +196,7 @@ const JSC::ConstructorKind s_writableStreamInternalsWritableStreamDealWithReject
const JSC::ImplementationVisibility s_writableStreamInternalsWritableStreamDealWithRejectionCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
const int s_writableStreamInternalsWritableStreamDealWithRejectionCodeLength = 189;
static const JSC::Intrinsic s_writableStreamInternalsWritableStreamDealWithRejectionCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_writableStreamInternalsWritableStreamDealWithRejectionCode = "(function (i,c){\"use strict\";const n=@getByIdDirectPrivate(i,\"state\");if(n===\"writable\"){@writableStreamStartErroring(i,c);return}@assert(n===\"erroring\"),@writableStreamFinishErroring(i)})\n";
+const char* const s_writableStreamInternalsWritableStreamDealWithRejectionCode = "(function (n,c){\"use strict\";const i=@getByIdDirectPrivate(n,\"state\");if(i===\"writable\"){@writableStreamStartErroring(n,c);return}@assert(i===\"erroring\"),@writableStreamFinishErroring(n)})\n";
// writableStreamFinishErroring
const JSC::ConstructAbility s_writableStreamInternalsWritableStreamFinishErroringCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
@@ -204,7 +204,7 @@ const JSC::ConstructorKind s_writableStreamInternalsWritableStreamFinishErroring
const JSC::ImplementationVisibility s_writableStreamInternalsWritableStreamFinishErroringCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
const int s_writableStreamInternalsWritableStreamFinishErroringCodeLength = 1058;
static const JSC::Intrinsic s_writableStreamInternalsWritableStreamFinishErroringCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_writableStreamInternalsWritableStreamFinishErroringCode = "(function (i){\"use strict\";@assert(@getByIdDirectPrivate(i,\"state\")===\"erroring\"),@assert(!@writableStreamHasOperationMarkedInFlight(i)),@putByIdDirectPrivate(i,\"state\",\"errored\");const h=@getByIdDirectPrivate(i,\"controller\");@getByIdDirectPrivate(h,\"errorSteps\").@call();const A=@getByIdDirectPrivate(i,\"storedError\"),B=@getByIdDirectPrivate(i,\"writeRequests\");for(var p=B.shift();p;p=B.shift())p.@reject.@call(@undefined,A);@putByIdDirectPrivate(i,\"writeRequests\",@createFIFO());const _=@getByIdDirectPrivate(i,\"pendingAbortRequest\");if(_===@undefined){@writableStreamRejectCloseAndClosedPromiseIfNeeded(i);return}if(@putByIdDirectPrivate(i,\"pendingAbortRequest\",@undefined),_.wasAlreadyErroring){_.promise.@reject.@call(@undefined,A),@writableStreamRejectCloseAndClosedPromiseIfNeeded(i);return}@getByIdDirectPrivate(h,\"abortSteps\").@call(@undefined,_.reason).@then(()=>{_.promise.@resolve.@call(),@writableStreamRejectCloseAndClosedPromiseIfNeeded(i)},(I)=>{_.promise.@reject.@call(@undefined,I),@writableStreamRejectCloseAndClosedPromiseIfNeeded(i)})})\n";
+const char* const s_writableStreamInternalsWritableStreamFinishErroringCode = "(function (i){\"use strict\";@assert(@getByIdDirectPrivate(i,\"state\")===\"erroring\"),@assert(!@writableStreamHasOperationMarkedInFlight(i)),@putByIdDirectPrivate(i,\"state\",\"errored\");const _=@getByIdDirectPrivate(i,\"controller\");@getByIdDirectPrivate(_,\"errorSteps\").@call();const p=@getByIdDirectPrivate(i,\"storedError\"),h=@getByIdDirectPrivate(i,\"writeRequests\");for(var A=h.shift();A;A=h.shift())A.@reject.@call(@undefined,p);@putByIdDirectPrivate(i,\"writeRequests\",@createFIFO());const B=@getByIdDirectPrivate(i,\"pendingAbortRequest\");if(B===@undefined){@writableStreamRejectCloseAndClosedPromiseIfNeeded(i);return}if(@putByIdDirectPrivate(i,\"pendingAbortRequest\",@undefined),B.wasAlreadyErroring){B.promise.@reject.@call(@undefined,p),@writableStreamRejectCloseAndClosedPromiseIfNeeded(i);return}@getByIdDirectPrivate(_,\"abortSteps\").@call(@undefined,B.reason).@then(()=>{B.promise.@resolve.@call(),@writableStreamRejectCloseAndClosedPromiseIfNeeded(i)},(I)=>{B.promise.@reject.@call(@undefined,I),@writableStreamRejectCloseAndClosedPromiseIfNeeded(i)})})\n";
// writableStreamFinishInFlightClose
const JSC::ConstructAbility s_writableStreamInternalsWritableStreamFinishInFlightCloseCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
@@ -212,7 +212,7 @@ const JSC::ConstructorKind s_writableStreamInternalsWritableStreamFinishInFlight
const JSC::ImplementationVisibility s_writableStreamInternalsWritableStreamFinishInFlightCloseCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
const int s_writableStreamInternalsWritableStreamFinishInFlightCloseCodeLength = 751;
static const JSC::Intrinsic s_writableStreamInternalsWritableStreamFinishInFlightCloseCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_writableStreamInternalsWritableStreamFinishInFlightCloseCode = "(function (d){\"use strict\";@getByIdDirectPrivate(d,\"inFlightCloseRequest\").@resolve.@call(),@putByIdDirectPrivate(d,\"inFlightCloseRequest\",@undefined);const i=@getByIdDirectPrivate(d,\"state\");if(@assert(i===\"writable\"||i===\"erroring\"),i===\"erroring\"){@putByIdDirectPrivate(d,\"storedError\",@undefined);const _=@getByIdDirectPrivate(d,\"pendingAbortRequest\");if(_!==@undefined)_.promise.@resolve.@call(),@putByIdDirectPrivate(d,\"pendingAbortRequest\",@undefined)}@putByIdDirectPrivate(d,\"state\",\"closed\");const n=@getByIdDirectPrivate(d,\"writer\");if(n!==@undefined)@getByIdDirectPrivate(n,\"closedPromise\").@resolve.@call();@assert(@getByIdDirectPrivate(d,\"pendingAbortRequest\")===@undefined),@assert(@getByIdDirectPrivate(d,\"storedError\")===@undefined)})\n";
+const char* const s_writableStreamInternalsWritableStreamFinishInFlightCloseCode = "(function (d){\"use strict\";@getByIdDirectPrivate(d,\"inFlightCloseRequest\").@resolve.@call(),@putByIdDirectPrivate(d,\"inFlightCloseRequest\",@undefined);const n=@getByIdDirectPrivate(d,\"state\");if(@assert(n===\"writable\"||n===\"erroring\"),n===\"erroring\"){@putByIdDirectPrivate(d,\"storedError\",@undefined);const c=@getByIdDirectPrivate(d,\"pendingAbortRequest\");if(c!==@undefined)c.promise.@resolve.@call(),@putByIdDirectPrivate(d,\"pendingAbortRequest\",@undefined)}@putByIdDirectPrivate(d,\"state\",\"closed\");const _=@getByIdDirectPrivate(d,\"writer\");if(_!==@undefined)@getByIdDirectPrivate(_,\"closedPromise\").@resolve.@call();@assert(@getByIdDirectPrivate(d,\"pendingAbortRequest\")===@undefined),@assert(@getByIdDirectPrivate(d,\"storedError\")===@undefined)})\n";
// writableStreamFinishInFlightCloseWithError
const JSC::ConstructAbility s_writableStreamInternalsWritableStreamFinishInFlightCloseWithErrorCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
@@ -220,7 +220,7 @@ const JSC::ConstructorKind s_writableStreamInternalsWritableStreamFinishInFlight
const JSC::ImplementationVisibility s_writableStreamInternalsWritableStreamFinishInFlightCloseWithErrorCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
const int s_writableStreamInternalsWritableStreamFinishInFlightCloseWithErrorCodeLength = 488;
static const JSC::Intrinsic s_writableStreamInternalsWritableStreamFinishInFlightCloseWithErrorCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_writableStreamInternalsWritableStreamFinishInFlightCloseWithErrorCode = "(function (_,c){\"use strict\";const d=@getByIdDirectPrivate(_,\"inFlightCloseRequest\");@assert(d!==@undefined),d.@reject.@call(@undefined,c),@putByIdDirectPrivate(_,\"inFlightCloseRequest\",@undefined);const n=@getByIdDirectPrivate(_,\"state\");@assert(n===\"writable\"||n===\"erroring\");const p=@getByIdDirectPrivate(_,\"pendingAbortRequest\");if(p!==@undefined)p.promise.@reject.@call(@undefined,c),@putByIdDirectPrivate(_,\"pendingAbortRequest\",@undefined);@writableStreamDealWithRejection(_,c)})\n";
+const char* const s_writableStreamInternalsWritableStreamFinishInFlightCloseWithErrorCode = "(function (c,_){\"use strict\";const n=@getByIdDirectPrivate(c,\"inFlightCloseRequest\");@assert(n!==@undefined),n.@reject.@call(@undefined,_),@putByIdDirectPrivate(c,\"inFlightCloseRequest\",@undefined);const p=@getByIdDirectPrivate(c,\"state\");@assert(p===\"writable\"||p===\"erroring\");const d=@getByIdDirectPrivate(c,\"pendingAbortRequest\");if(d!==@undefined)d.promise.@reject.@call(@undefined,_),@putByIdDirectPrivate(c,\"pendingAbortRequest\",@undefined);@writableStreamDealWithRejection(c,_)})\n";
// writableStreamFinishInFlightWrite
const JSC::ConstructAbility s_writableStreamInternalsWritableStreamFinishInFlightWriteCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
@@ -260,7 +260,7 @@ const JSC::ConstructorKind s_writableStreamInternalsWritableStreamMarkFirstWrite
const JSC::ImplementationVisibility s_writableStreamInternalsWritableStreamMarkFirstWriteRequestInFlightCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
const int s_writableStreamInternalsWritableStreamMarkFirstWriteRequestInFlightCodeLength = 240;
static const JSC::Intrinsic s_writableStreamInternalsWritableStreamMarkFirstWriteRequestInFlightCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_writableStreamInternalsWritableStreamMarkFirstWriteRequestInFlightCode = "(function (c){\"use strict\";const d=@getByIdDirectPrivate(c,\"writeRequests\");@assert(@getByIdDirectPrivate(c,\"inFlightWriteRequest\")===@undefined),@assert(d.isNotEmpty());const h=d.shift();@putByIdDirectPrivate(c,\"inFlightWriteRequest\",h)})\n";
+const char* const s_writableStreamInternalsWritableStreamMarkFirstWriteRequestInFlightCode = "(function (d){\"use strict\";const h=@getByIdDirectPrivate(d,\"writeRequests\");@assert(@getByIdDirectPrivate(d,\"inFlightWriteRequest\")===@undefined),@assert(h.isNotEmpty());const c=h.shift();@putByIdDirectPrivate(d,\"inFlightWriteRequest\",c)})\n";
// writableStreamRejectCloseAndClosedPromiseIfNeeded
const JSC::ConstructAbility s_writableStreamInternalsWritableStreamRejectCloseAndClosedPromiseIfNeededCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
@@ -292,7 +292,7 @@ const JSC::ConstructorKind s_writableStreamInternalsWritableStreamDefaultWriterA
const JSC::ImplementationVisibility s_writableStreamInternalsWritableStreamDefaultWriterAbortCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
const int s_writableStreamInternalsWritableStreamDefaultWriterAbortCodeLength = 130;
static const JSC::Intrinsic s_writableStreamInternalsWritableStreamDefaultWriterAbortCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_writableStreamInternalsWritableStreamDefaultWriterAbortCode = "(function (d,f){\"use strict\";const c=@getByIdDirectPrivate(d,\"stream\");return @assert(c!==@undefined),@writableStreamAbort(c,f)})\n";
+const char* const s_writableStreamInternalsWritableStreamDefaultWriterAbortCode = "(function (c,f){\"use strict\";const d=@getByIdDirectPrivate(c,\"stream\");return @assert(d!==@undefined),@writableStreamAbort(d,f)})\n";
// writableStreamDefaultWriterClose
const JSC::ConstructAbility s_writableStreamInternalsWritableStreamDefaultWriterCloseCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
@@ -300,7 +300,7 @@ const JSC::ConstructorKind s_writableStreamInternalsWritableStreamDefaultWriterC
const JSC::ImplementationVisibility s_writableStreamInternalsWritableStreamDefaultWriterCloseCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
const int s_writableStreamInternalsWritableStreamDefaultWriterCloseCodeLength = 126;
static const JSC::Intrinsic s_writableStreamInternalsWritableStreamDefaultWriterCloseCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_writableStreamInternalsWritableStreamDefaultWriterCloseCode = "(function (c){\"use strict\";const _=@getByIdDirectPrivate(c,\"stream\");return @assert(_!==@undefined),@writableStreamClose(_)})\n";
+const char* const s_writableStreamInternalsWritableStreamDefaultWriterCloseCode = "(function (_){\"use strict\";const c=@getByIdDirectPrivate(_,\"stream\");return @assert(c!==@undefined),@writableStreamClose(c)})\n";
// writableStreamDefaultWriterCloseWithErrorPropagation
const JSC::ConstructAbility s_writableStreamInternalsWritableStreamDefaultWriterCloseWithErrorPropagationCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
@@ -308,7 +308,7 @@ const JSC::ConstructorKind s_writableStreamInternalsWritableStreamDefaultWriterC
const JSC::ImplementationVisibility s_writableStreamInternalsWritableStreamDefaultWriterCloseWithErrorPropagationCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
const int s_writableStreamInternalsWritableStreamDefaultWriterCloseWithErrorPropagationCodeLength = 385;
static const JSC::Intrinsic s_writableStreamInternalsWritableStreamDefaultWriterCloseWithErrorPropagationCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_writableStreamInternalsWritableStreamDefaultWriterCloseWithErrorPropagationCode = "(function (u){\"use strict\";const c=@getByIdDirectPrivate(u,\"stream\");@assert(c!==@undefined);const l=@getByIdDirectPrivate(c,\"state\");if(@writableStreamCloseQueuedOrInFlight(c)||l===\"closed\")return @Promise.@resolve();if(l===\"errored\")return @Promise.@reject(@getByIdDirectPrivate(c,\"storedError\"));return @assert(l===\"writable\"||l===\"erroring\"),@writableStreamDefaultWriterClose(u)})\n";
+const char* const s_writableStreamInternalsWritableStreamDefaultWriterCloseWithErrorPropagationCode = "(function (c){\"use strict\";const u=@getByIdDirectPrivate(c,\"stream\");@assert(u!==@undefined);const l=@getByIdDirectPrivate(u,\"state\");if(@writableStreamCloseQueuedOrInFlight(u)||l===\"closed\")return @Promise.@resolve();if(l===\"errored\")return @Promise.@reject(@getByIdDirectPrivate(u,\"storedError\"));return @assert(l===\"writable\"||l===\"erroring\"),@writableStreamDefaultWriterClose(c)})\n";
// writableStreamDefaultWriterEnsureClosedPromiseRejected
const JSC::ConstructAbility s_writableStreamInternalsWritableStreamDefaultWriterEnsureClosedPromiseRejectedCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
@@ -316,7 +316,7 @@ const JSC::ConstructorKind s_writableStreamInternalsWritableStreamDefaultWriterE
const JSC::ImplementationVisibility s_writableStreamInternalsWritableStreamDefaultWriterEnsureClosedPromiseRejectedCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
const int s_writableStreamInternalsWritableStreamDefaultWriterEnsureClosedPromiseRejectedCodeLength = 329;
static const JSC::Intrinsic s_writableStreamInternalsWritableStreamDefaultWriterEnsureClosedPromiseRejectedCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_writableStreamInternalsWritableStreamDefaultWriterEnsureClosedPromiseRejectedCode = "(function (h,u){\"use strict\";let _=@getByIdDirectPrivate(h,\"closedPromise\"),n=_.@promise;if((@getPromiseInternalField(n,@promiseFieldFlags)&@promiseStateMask)!==@promiseStatePending)_=@newPromiseCapability(@Promise),n=_.@promise,@putByIdDirectPrivate(h,\"closedPromise\",_);_.@reject.@call(@undefined,u),@markPromiseAsHandled(n)})\n";
+const char* const s_writableStreamInternalsWritableStreamDefaultWriterEnsureClosedPromiseRejectedCode = "(function (n,_){\"use strict\";let h=@getByIdDirectPrivate(n,\"closedPromise\"),u=h.@promise;if((@getPromiseInternalField(u,@promiseFieldFlags)&@promiseStateMask)!==@promiseStatePending)h=@newPromiseCapability(@Promise),u=h.@promise,@putByIdDirectPrivate(n,\"closedPromise\",h);h.@reject.@call(@undefined,_),@markPromiseAsHandled(u)})\n";
// writableStreamDefaultWriterEnsureReadyPromiseRejected
const JSC::ConstructAbility s_writableStreamInternalsWritableStreamDefaultWriterEnsureReadyPromiseRejectedCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
@@ -324,7 +324,7 @@ const JSC::ConstructorKind s_writableStreamInternalsWritableStreamDefaultWriterE
const JSC::ImplementationVisibility s_writableStreamInternalsWritableStreamDefaultWriterEnsureReadyPromiseRejectedCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
const int s_writableStreamInternalsWritableStreamDefaultWriterEnsureReadyPromiseRejectedCodeLength = 327;
static const JSC::Intrinsic s_writableStreamInternalsWritableStreamDefaultWriterEnsureReadyPromiseRejectedCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_writableStreamInternalsWritableStreamDefaultWriterEnsureReadyPromiseRejectedCode = "(function (h,n){\"use strict\";let c=@getByIdDirectPrivate(h,\"readyPromise\"),g=c.@promise;if((@getPromiseInternalField(g,@promiseFieldFlags)&@promiseStateMask)!==@promiseStatePending)c=@newPromiseCapability(@Promise),g=c.@promise,@putByIdDirectPrivate(h,\"readyPromise\",c);c.@reject.@call(@undefined,n),@markPromiseAsHandled(g)})\n";
+const char* const s_writableStreamInternalsWritableStreamDefaultWriterEnsureReadyPromiseRejectedCode = "(function (c,g){\"use strict\";let n=@getByIdDirectPrivate(c,\"readyPromise\"),h=n.@promise;if((@getPromiseInternalField(h,@promiseFieldFlags)&@promiseStateMask)!==@promiseStatePending)n=@newPromiseCapability(@Promise),h=n.@promise,@putByIdDirectPrivate(c,\"readyPromise\",n);n.@reject.@call(@undefined,g),@markPromiseAsHandled(h)})\n";
// writableStreamDefaultWriterGetDesiredSize
const JSC::ConstructAbility s_writableStreamInternalsWritableStreamDefaultWriterGetDesiredSizeCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
@@ -332,7 +332,7 @@ const JSC::ConstructorKind s_writableStreamInternalsWritableStreamDefaultWriterG
const JSC::ImplementationVisibility s_writableStreamInternalsWritableStreamDefaultWriterGetDesiredSizeCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
const int s_writableStreamInternalsWritableStreamDefaultWriterGetDesiredSizeCodeLength = 299;
static const JSC::Intrinsic s_writableStreamInternalsWritableStreamDefaultWriterGetDesiredSizeCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_writableStreamInternalsWritableStreamDefaultWriterGetDesiredSizeCode = "(function (_){\"use strict\";const c=@getByIdDirectPrivate(_,\"stream\");@assert(c!==@undefined);const l=@getByIdDirectPrivate(c,\"state\");if(l===\"errored\"||l===\"erroring\")return null;if(l===\"closed\")return 0;return @writableStreamDefaultControllerGetDesiredSize(@getByIdDirectPrivate(c,\"controller\"))})\n";
+const char* const s_writableStreamInternalsWritableStreamDefaultWriterGetDesiredSizeCode = "(function (c){\"use strict\";const l=@getByIdDirectPrivate(c,\"stream\");@assert(l!==@undefined);const _=@getByIdDirectPrivate(l,\"state\");if(_===\"errored\"||_===\"erroring\")return null;if(_===\"closed\")return 0;return @writableStreamDefaultControllerGetDesiredSize(@getByIdDirectPrivate(l,\"controller\"))})\n";
// writableStreamDefaultWriterRelease
const JSC::ConstructAbility s_writableStreamInternalsWritableStreamDefaultWriterReleaseCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
@@ -348,7 +348,7 @@ const JSC::ConstructorKind s_writableStreamInternalsWritableStreamDefaultWriterW
const JSC::ImplementationVisibility s_writableStreamInternalsWritableStreamDefaultWriterWriteCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
const int s_writableStreamInternalsWritableStreamDefaultWriterWriteCodeLength = 919;
static const JSC::Intrinsic s_writableStreamInternalsWritableStreamDefaultWriterWriteCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_writableStreamInternalsWritableStreamDefaultWriterWriteCode = "(function (W,_){\"use strict\";const d=@getByIdDirectPrivate(W,\"stream\");@assert(d!==@undefined);const P=@getByIdDirectPrivate(d,\"controller\");@assert(P!==@undefined);const b=@writableStreamDefaultControllerGetChunkSize(P,_);if(d!==@getByIdDirectPrivate(W,\"stream\"))return @Promise.@reject(@makeTypeError(\"writer is not stream's writer\"));const g=@getByIdDirectPrivate(d,\"state\");if(g===\"errored\")return @Promise.@reject(@getByIdDirectPrivate(d,\"storedError\"));if(@writableStreamCloseQueuedOrInFlight(d)||g===\"closed\")return @Promise.@reject(@makeTypeError(\"stream is closing or closed\"));if(@writableStreamCloseQueuedOrInFlight(d)||g===\"closed\")return @Promise.@reject(@makeTypeError(\"stream is closing or closed\"));if(g===\"erroring\")return @Promise.@reject(@getByIdDirectPrivate(d,\"storedError\"));@assert(g===\"writable\");const f=@writableStreamAddWriteRequest(d);return @writableStreamDefaultControllerWrite(P,_,b),f})\n";
+const char* const s_writableStreamInternalsWritableStreamDefaultWriterWriteCode = "(function (d,g){\"use strict\";const P=@getByIdDirectPrivate(d,\"stream\");@assert(P!==@undefined);const W=@getByIdDirectPrivate(P,\"controller\");@assert(W!==@undefined);const _=@writableStreamDefaultControllerGetChunkSize(W,g);if(P!==@getByIdDirectPrivate(d,\"stream\"))return @Promise.@reject(@makeTypeError(\"writer is not stream's writer\"));const b=@getByIdDirectPrivate(P,\"state\");if(b===\"errored\")return @Promise.@reject(@getByIdDirectPrivate(P,\"storedError\"));if(@writableStreamCloseQueuedOrInFlight(P)||b===\"closed\")return @Promise.@reject(@makeTypeError(\"stream is closing or closed\"));if(@writableStreamCloseQueuedOrInFlight(P)||b===\"closed\")return @Promise.@reject(@makeTypeError(\"stream is closing or closed\"));if(b===\"erroring\")return @Promise.@reject(@getByIdDirectPrivate(P,\"storedError\"));@assert(b===\"writable\");const f=@writableStreamAddWriteRequest(P);return @writableStreamDefaultControllerWrite(W,g,_),f})\n";
// setUpWritableStreamDefaultController
const JSC::ConstructAbility s_writableStreamInternalsSetUpWritableStreamDefaultControllerCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
@@ -356,7 +356,7 @@ const JSC::ConstructorKind s_writableStreamInternalsSetUpWritableStreamDefaultCo
const JSC::ImplementationVisibility s_writableStreamInternalsSetUpWritableStreamDefaultControllerCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
const int s_writableStreamInternalsSetUpWritableStreamDefaultControllerCodeLength = 700;
static const JSC::Intrinsic s_writableStreamInternalsSetUpWritableStreamDefaultControllerCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_writableStreamInternalsSetUpWritableStreamDefaultControllerCode = "(function (B,_,v,P,U,d,f,j){\"use strict\";@assert(@isWritableStream(B)),@assert(@getByIdDirectPrivate(B,\"controller\")===@undefined),@putByIdDirectPrivate(_,\"stream\",B),@putByIdDirectPrivate(B,\"controller\",_),@resetQueue(@getByIdDirectPrivate(_,\"queue\")),@putByIdDirectPrivate(_,\"started\",-1),@putByIdDirectPrivate(_,\"startAlgorithm\",v),@putByIdDirectPrivate(_,\"strategySizeAlgorithm\",j),@putByIdDirectPrivate(_,\"strategyHWM\",f),@putByIdDirectPrivate(_,\"writeAlgorithm\",P),@putByIdDirectPrivate(_,\"closeAlgorithm\",U),@putByIdDirectPrivate(_,\"abortAlgorithm\",d);const q=@writableStreamDefaultControllerGetBackpressure(_);@writableStreamUpdateBackpressure(B,q),@writableStreamDefaultControllerStart(_)})\n";
+const char* const s_writableStreamInternalsSetUpWritableStreamDefaultControllerCode = "(function (_,d,B,f,v,j,P,q){\"use strict\";@assert(@isWritableStream(_)),@assert(@getByIdDirectPrivate(_,\"controller\")===@undefined),@putByIdDirectPrivate(d,\"stream\",_),@putByIdDirectPrivate(_,\"controller\",d),@resetQueue(@getByIdDirectPrivate(d,\"queue\")),@putByIdDirectPrivate(d,\"started\",-1),@putByIdDirectPrivate(d,\"startAlgorithm\",B),@putByIdDirectPrivate(d,\"strategySizeAlgorithm\",q),@putByIdDirectPrivate(d,\"strategyHWM\",P),@putByIdDirectPrivate(d,\"writeAlgorithm\",f),@putByIdDirectPrivate(d,\"closeAlgorithm\",v),@putByIdDirectPrivate(d,\"abortAlgorithm\",j);const U=@writableStreamDefaultControllerGetBackpressure(d);@writableStreamUpdateBackpressure(_,U),@writableStreamDefaultControllerStart(d)})\n";
// writableStreamDefaultControllerStart
const JSC::ConstructAbility s_writableStreamInternalsWritableStreamDefaultControllerStartCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
@@ -364,7 +364,7 @@ const JSC::ConstructorKind s_writableStreamInternalsWritableStreamDefaultControl
const JSC::ImplementationVisibility s_writableStreamInternalsWritableStreamDefaultControllerStartCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
const int s_writableStreamInternalsWritableStreamDefaultControllerStartCodeLength = 647;
static const JSC::Intrinsic s_writableStreamInternalsWritableStreamDefaultControllerStartCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_writableStreamInternalsWritableStreamDefaultControllerStartCode = "(function (i){\"use strict\";if(@getByIdDirectPrivate(i,\"started\")!==-1)return;@putByIdDirectPrivate(i,\"started\",0);const p=@getByIdDirectPrivate(i,\"startAlgorithm\");@putByIdDirectPrivate(i,\"startAlgorithm\",@undefined);const d=@getByIdDirectPrivate(i,\"stream\");return @Promise.@resolve(p.@call()).@then(()=>{const _=@getByIdDirectPrivate(d,\"state\");@assert(_===\"writable\"||_===\"erroring\"),@putByIdDirectPrivate(i,\"started\",1),@writableStreamDefaultControllerAdvanceQueueIfNeeded(i)},(_)=>{const u=@getByIdDirectPrivate(d,\"state\");@assert(u===\"writable\"||u===\"erroring\"),@putByIdDirectPrivate(i,\"started\",1),@writableStreamDealWithRejection(d,_)})})\n";
+const char* const s_writableStreamInternalsWritableStreamDefaultControllerStartCode = "(function (i){\"use strict\";if(@getByIdDirectPrivate(i,\"started\")!==-1)return;@putByIdDirectPrivate(i,\"started\",0);const _=@getByIdDirectPrivate(i,\"startAlgorithm\");@putByIdDirectPrivate(i,\"startAlgorithm\",@undefined);const d=@getByIdDirectPrivate(i,\"stream\");return @Promise.@resolve(_.@call()).@then(()=>{const u=@getByIdDirectPrivate(d,\"state\");@assert(u===\"writable\"||u===\"erroring\"),@putByIdDirectPrivate(i,\"started\",1),@writableStreamDefaultControllerAdvanceQueueIfNeeded(i)},(u)=>{const p=@getByIdDirectPrivate(d,\"state\");@assert(p===\"writable\"||p===\"erroring\"),@putByIdDirectPrivate(i,\"started\",1),@writableStreamDealWithRejection(d,u)})})\n";
// setUpWritableStreamDefaultControllerFromUnderlyingSink
const JSC::ConstructAbility s_writableStreamInternalsSetUpWritableStreamDefaultControllerFromUnderlyingSinkCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
@@ -372,7 +372,7 @@ const JSC::ConstructorKind s_writableStreamInternalsSetUpWritableStreamDefaultCo
const JSC::ImplementationVisibility s_writableStreamInternalsSetUpWritableStreamDefaultControllerFromUnderlyingSinkCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
const int s_writableStreamInternalsSetUpWritableStreamDefaultControllerFromUnderlyingSinkCodeLength = 561;
static const JSC::Intrinsic s_writableStreamInternalsSetUpWritableStreamDefaultControllerFromUnderlyingSinkCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_writableStreamInternalsSetUpWritableStreamDefaultControllerFromUnderlyingSinkCode = "(function (C,O,_,E,F){\"use strict\";const f=new @WritableStreamDefaultController;let q=()=>{},v=()=>{return @Promise.@resolve()},x=()=>{return @Promise.@resolve()},B=()=>{return @Promise.@resolve()};if(\"start\"in _){const p=_.start;q=()=>@promiseInvokeOrNoopMethodNoCatch(O,p,[f])}if(\"write\"in _){const p=_.write;v=(j)=>@promiseInvokeOrNoopMethod(O,p,[j,f])}if(\"close\"in _){const p=_.close;x=()=>@promiseInvokeOrNoopMethod(O,p,[])}if(\"abort\"in _){const p=_.abort;B=(j)=>@promiseInvokeOrNoopMethod(O,p,[j])}@setUpWritableStreamDefaultController(C,f,q,v,x,B,E,F)})\n";
+const char* const s_writableStreamInternalsSetUpWritableStreamDefaultControllerFromUnderlyingSinkCode = "(function (_,p,x,O,B){\"use strict\";const f=new @WritableStreamDefaultController;let C=()=>{},j=()=>{return @Promise.@resolve()},E=()=>{return @Promise.@resolve()},q=()=>{return @Promise.@resolve()};if(\"start\"in x){const F=x.start;C=()=>@promiseInvokeOrNoopMethodNoCatch(p,F,[f])}if(\"write\"in x){const F=x.write;j=(v)=>@promiseInvokeOrNoopMethod(p,F,[v,f])}if(\"close\"in x){const F=x.close;E=()=>@promiseInvokeOrNoopMethod(p,F,[])}if(\"abort\"in x){const F=x.abort;q=(v)=>@promiseInvokeOrNoopMethod(p,F,[v])}@setUpWritableStreamDefaultController(_,f,C,j,E,q,O,B)})\n";
// writableStreamDefaultControllerAdvanceQueueIfNeeded
const JSC::ConstructAbility s_writableStreamInternalsWritableStreamDefaultControllerAdvanceQueueIfNeededCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
@@ -412,7 +412,7 @@ const JSC::ConstructorKind s_writableStreamInternalsWritableStreamDefaultControl
const JSC::ImplementationVisibility s_writableStreamInternalsWritableStreamDefaultControllerErrorCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
const int s_writableStreamInternalsWritableStreamDefaultControllerErrorCodeLength = 237;
static const JSC::Intrinsic s_writableStreamInternalsWritableStreamDefaultControllerErrorCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_writableStreamInternalsWritableStreamDefaultControllerErrorCode = "(function (h,b){\"use strict\";const i=@getByIdDirectPrivate(h,\"stream\");@assert(i!==@undefined),@assert(@getByIdDirectPrivate(i,\"state\")===\"writable\"),@writableStreamDefaultControllerClearAlgorithms(h),@writableStreamStartErroring(i,b)})\n";
+const char* const s_writableStreamInternalsWritableStreamDefaultControllerErrorCode = "(function (i,b){\"use strict\";const h=@getByIdDirectPrivate(i,\"stream\");@assert(h!==@undefined),@assert(@getByIdDirectPrivate(h,\"state\")===\"writable\"),@writableStreamDefaultControllerClearAlgorithms(i),@writableStreamStartErroring(h,b)})\n";
// writableStreamDefaultControllerErrorIfNeeded
const JSC::ConstructAbility s_writableStreamInternalsWritableStreamDefaultControllerErrorIfNeededCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
@@ -460,7 +460,7 @@ const JSC::ConstructorKind s_writableStreamInternalsWritableStreamDefaultControl
const JSC::ImplementationVisibility s_writableStreamInternalsWritableStreamDefaultControllerProcessWriteCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
const int s_writableStreamInternalsWritableStreamDefaultControllerProcessWriteCodeLength = 734;
static const JSC::Intrinsic s_writableStreamInternalsWritableStreamDefaultControllerProcessWriteCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_writableStreamInternalsWritableStreamDefaultControllerProcessWriteCode = "(function (d,v){\"use strict\";const i=@getByIdDirectPrivate(d,\"stream\");@writableStreamMarkFirstWriteRequestInFlight(i),@getByIdDirectPrivate(d,\"writeAlgorithm\").@call(@undefined,v).@then(()=>{@writableStreamFinishInFlightWrite(i);const _=@getByIdDirectPrivate(i,\"state\");if(@assert(_===\"writable\"||_===\"erroring\"),@dequeueValue(@getByIdDirectPrivate(d,\"queue\")),!@writableStreamCloseQueuedOrInFlight(i)&&_===\"writable\"){const q=@writableStreamDefaultControllerGetBackpressure(d);@writableStreamUpdateBackpressure(i,q)}@writableStreamDefaultControllerAdvanceQueueIfNeeded(d)},(_)=>{if(@getByIdDirectPrivate(i,\"state\")===\"writable\")@writableStreamDefaultControllerClearAlgorithms(d);@writableStreamFinishInFlightWriteWithError(i,_)})})\n";
+const char* const s_writableStreamInternalsWritableStreamDefaultControllerProcessWriteCode = "(function (d,_){\"use strict\";const q=@getByIdDirectPrivate(d,\"stream\");@writableStreamMarkFirstWriteRequestInFlight(q),@getByIdDirectPrivate(d,\"writeAlgorithm\").@call(@undefined,_).@then(()=>{@writableStreamFinishInFlightWrite(q);const M=@getByIdDirectPrivate(q,\"state\");if(@assert(M===\"writable\"||M===\"erroring\"),@dequeueValue(@getByIdDirectPrivate(d,\"queue\")),!@writableStreamCloseQueuedOrInFlight(q)&&M===\"writable\"){const i=@writableStreamDefaultControllerGetBackpressure(d);@writableStreamUpdateBackpressure(q,i)}@writableStreamDefaultControllerAdvanceQueueIfNeeded(d)},(M)=>{if(@getByIdDirectPrivate(q,\"state\")===\"writable\")@writableStreamDefaultControllerClearAlgorithms(d);@writableStreamFinishInFlightWriteWithError(q,M)})})\n";
// writableStreamDefaultControllerWrite
const JSC::ConstructAbility s_writableStreamInternalsWritableStreamDefaultControllerWriteCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
@@ -468,7 +468,7 @@ const JSC::ConstructorKind s_writableStreamInternalsWritableStreamDefaultControl
const JSC::ImplementationVisibility s_writableStreamInternalsWritableStreamDefaultControllerWriteCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
const int s_writableStreamInternalsWritableStreamDefaultControllerWriteCodeLength = 450;
static const JSC::Intrinsic s_writableStreamInternalsWritableStreamDefaultControllerWriteCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_writableStreamInternalsWritableStreamDefaultControllerWriteCode = "(function (d,B,D){\"use strict\";try{@enqueueValueWithSize(@getByIdDirectPrivate(d,\"queue\"),B,D);const y=@getByIdDirectPrivate(d,\"stream\"),I=@getByIdDirectPrivate(y,\"state\");if(!@writableStreamCloseQueuedOrInFlight(y)&&I===\"writable\"){const _=@writableStreamDefaultControllerGetBackpressure(d);@writableStreamUpdateBackpressure(y,_)}@writableStreamDefaultControllerAdvanceQueueIfNeeded(d)}catch(y){@writableStreamDefaultControllerErrorIfNeeded(d,y)}})\n";
+const char* const s_writableStreamInternalsWritableStreamDefaultControllerWriteCode = "(function (y,D,B){\"use strict\";try{@enqueueValueWithSize(@getByIdDirectPrivate(y,\"queue\"),D,B);const I=@getByIdDirectPrivate(y,\"stream\"),d=@getByIdDirectPrivate(I,\"state\");if(!@writableStreamCloseQueuedOrInFlight(I)&&d===\"writable\"){const _=@writableStreamDefaultControllerGetBackpressure(y);@writableStreamUpdateBackpressure(I,_)}@writableStreamDefaultControllerAdvanceQueueIfNeeded(y)}catch(I){@writableStreamDefaultControllerErrorIfNeeded(y,I)}})\n";
#define DEFINE_BUILTIN_GENERATOR(codeName, functionName, overriddenName, argumentCount) \
JSC::FunctionExecutable* codeName##Generator(JSC::VM& vm) \
@@ -502,7 +502,7 @@ const JSC::ConstructorKind s_transformStreamInternalsCreateTransformStreamCodeCo
const JSC::ImplementationVisibility s_transformStreamInternalsCreateTransformStreamCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
const int s_transformStreamInternalsCreateTransformStreamCodeLength = 513;
static const JSC::Intrinsic s_transformStreamInternalsCreateTransformStreamCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_transformStreamInternalsCreateTransformStreamCode = "(function (D,E,F,_,j,c,q){\"use strict\";if(_===@undefined)_=1;if(j===@undefined)j=()=>1;if(c===@undefined)c=0;if(q===@undefined)q=()=>1;@assert(_>=0),@assert(c>=0);const B={};@putByIdDirectPrivate(B,\"TransformStream\",!0);const v=new @TransformStream(B),x=@newPromiseCapability(@Promise);@initializeTransformStream(v,x.@promise,_,j,c,q);const G=new @TransformStreamDefaultController;return @setUpTransformStreamDefaultController(v,G,E,F),D().@then(()=>{x.@resolve.@call()},(I)=>{x.@reject.@call(@undefined,I)}),v})\n";
+const char* const s_transformStreamInternalsCreateTransformStreamCode = "(function (j,x,_,B,c,D,q){\"use strict\";if(B===@undefined)B=1;if(c===@undefined)c=()=>1;if(D===@undefined)D=0;if(q===@undefined)q=()=>1;@assert(B>=0),@assert(D>=0);const E={};@putByIdDirectPrivate(E,\"TransformStream\",!0);const F=new @TransformStream(E),v=@newPromiseCapability(@Promise);@initializeTransformStream(F,v.@promise,B,c,D,q);const G=new @TransformStreamDefaultController;return @setUpTransformStreamDefaultController(F,G,x,_),j().@then(()=>{v.@resolve.@call()},(I)=>{v.@reject.@call(@undefined,I)}),F})\n";
// initializeTransformStream
const JSC::ConstructAbility s_transformStreamInternalsInitializeTransformStreamCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
@@ -510,7 +510,7 @@ const JSC::ConstructorKind s_transformStreamInternalsInitializeTransformStreamCo
const JSC::ImplementationVisibility s_transformStreamInternalsInitializeTransformStreamCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
const int s_transformStreamInternalsInitializeTransformStreamCodeLength = 1015;
static const JSC::Intrinsic s_transformStreamInternalsInitializeTransformStreamCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_transformStreamInternalsInitializeTransformStreamCode = "(function (f,x,C,D,E,F){\"use strict\";const q=()=>{return x},G=(B)=>{return @transformStreamDefaultSinkWriteAlgorithm(f,B)},I=(B)=>{return @transformStreamDefaultSinkAbortAlgorithm(f,B)},J=()=>{return @transformStreamDefaultSinkCloseAlgorithm(f)},v=@createWritableStream(q,G,J,I,C,D),K=()=>{return @transformStreamDefaultSourcePullAlgorithm(f)},L=(B)=>{return @transformStreamErrorWritableAndUnblockWrite(f,B),@Promise.@resolve()},T={};@putByIdDirectPrivate(T,\"start\",q),@putByIdDirectPrivate(T,\"pull\",K),@putByIdDirectPrivate(T,\"cancel\",L);const j={};@putByIdDirectPrivate(j,\"size\",F),@putByIdDirectPrivate(j,\"highWaterMark\",E);const N=new @ReadableStream(T,j);@putByIdDirectPrivate(f,\"writable\",v),@putByIdDirectPrivate(f,\"internalWritable\",@getInternalWritableStream(v)),@putByIdDirectPrivate(f,\"readable\",N),@putByIdDirectPrivate(f,\"backpressure\",@undefined),@putByIdDirectPrivate(f,\"backpressureChangePromise\",@undefined),@transformStreamSetBackpressure(f,!0),@putByIdDirectPrivate(f,\"controller\",@undefined)})\n";
+const char* const s_transformStreamInternalsInitializeTransformStreamCode = "(function (v,F,C,D,T,J){\"use strict\";const j=()=>{return F},K=(q)=>{return @transformStreamDefaultSinkWriteAlgorithm(v,q)},L=(q)=>{return @transformStreamDefaultSinkAbortAlgorithm(v,q)},x=()=>{return @transformStreamDefaultSinkCloseAlgorithm(v)},G=@createWritableStream(j,K,x,L,C,D),f=()=>{return @transformStreamDefaultSourcePullAlgorithm(v)},B=(q)=>{return @transformStreamErrorWritableAndUnblockWrite(v,q),@Promise.@resolve()},I={};@putByIdDirectPrivate(I,\"start\",j),@putByIdDirectPrivate(I,\"pull\",f),@putByIdDirectPrivate(I,\"cancel\",B);const E={};@putByIdDirectPrivate(E,\"size\",J),@putByIdDirectPrivate(E,\"highWaterMark\",T);const N=new @ReadableStream(I,E);@putByIdDirectPrivate(v,\"writable\",G),@putByIdDirectPrivate(v,\"internalWritable\",@getInternalWritableStream(G)),@putByIdDirectPrivate(v,\"readable\",N),@putByIdDirectPrivate(v,\"backpressure\",@undefined),@putByIdDirectPrivate(v,\"backpressureChangePromise\",@undefined),@transformStreamSetBackpressure(v,!0),@putByIdDirectPrivate(v,\"controller\",@undefined)})\n";
// transformStreamError
const JSC::ConstructAbility s_transformStreamInternalsTransformStreamErrorCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
@@ -534,7 +534,7 @@ const JSC::ConstructorKind s_transformStreamInternalsTransformStreamSetBackpress
const JSC::ImplementationVisibility s_transformStreamInternalsTransformStreamSetBackpressureCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
const int s_transformStreamInternalsTransformStreamSetBackpressureCodeLength = 309;
static const JSC::Intrinsic s_transformStreamInternalsTransformStreamSetBackpressureCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_transformStreamInternalsTransformStreamSetBackpressureCode = "(function (_,d){\"use strict\";@assert(@getByIdDirectPrivate(_,\"backpressure\")!==d);const f=@getByIdDirectPrivate(_,\"backpressureChangePromise\");if(f!==@undefined)f.@resolve.@call();@putByIdDirectPrivate(_,\"backpressureChangePromise\",@newPromiseCapability(@Promise)),@putByIdDirectPrivate(_,\"backpressure\",d)})\n";
+const char* const s_transformStreamInternalsTransformStreamSetBackpressureCode = "(function (_,f){\"use strict\";@assert(@getByIdDirectPrivate(_,\"backpressure\")!==f);const d=@getByIdDirectPrivate(_,\"backpressureChangePromise\");if(d!==@undefined)d.@resolve.@call();@putByIdDirectPrivate(_,\"backpressureChangePromise\",@newPromiseCapability(@Promise)),@putByIdDirectPrivate(_,\"backpressure\",f)})\n";
// setUpTransformStreamDefaultController
const JSC::ConstructAbility s_transformStreamInternalsSetUpTransformStreamDefaultControllerCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
@@ -542,7 +542,7 @@ const JSC::ConstructorKind s_transformStreamInternalsSetUpTransformStreamDefault
const JSC::ImplementationVisibility s_transformStreamInternalsSetUpTransformStreamDefaultControllerCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
const int s_transformStreamInternalsSetUpTransformStreamDefaultControllerCodeLength = 294;
static const JSC::Intrinsic s_transformStreamInternalsSetUpTransformStreamDefaultControllerCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_transformStreamInternalsSetUpTransformStreamDefaultControllerCode = "(function (d,P,_,b){\"use strict\";@assert(@isTransformStream(d)),@assert(@getByIdDirectPrivate(d,\"controller\")===@undefined),@putByIdDirectPrivate(P,\"stream\",d),@putByIdDirectPrivate(d,\"controller\",P),@putByIdDirectPrivate(P,\"transformAlgorithm\",_),@putByIdDirectPrivate(P,\"flushAlgorithm\",b)})\n";
+const char* const s_transformStreamInternalsSetUpTransformStreamDefaultControllerCode = "(function (d,_,P,b){\"use strict\";@assert(@isTransformStream(d)),@assert(@getByIdDirectPrivate(d,\"controller\")===@undefined),@putByIdDirectPrivate(_,\"stream\",d),@putByIdDirectPrivate(d,\"controller\",_),@putByIdDirectPrivate(_,\"transformAlgorithm\",P),@putByIdDirectPrivate(_,\"flushAlgorithm\",b)})\n";
// setUpTransformStreamDefaultControllerFromTransformer
const JSC::ConstructAbility s_transformStreamInternalsSetUpTransformStreamDefaultControllerFromTransformerCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
@@ -550,7 +550,7 @@ const JSC::ConstructorKind s_transformStreamInternalsSetUpTransformStreamDefault
const JSC::ImplementationVisibility s_transformStreamInternalsSetUpTransformStreamDefaultControllerFromTransformerCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
const int s_transformStreamInternalsSetUpTransformStreamDefaultControllerFromTransformerCodeLength = 443;
static const JSC::Intrinsic s_transformStreamInternalsSetUpTransformStreamDefaultControllerFromTransformerCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_transformStreamInternalsSetUpTransformStreamDefaultControllerFromTransformerCode = "(function (q,v,_){\"use strict\";const d=new @TransformStreamDefaultController;let b=(p)=>{try{@transformStreamDefaultControllerEnqueue(d,p)}catch(w){return @Promise.@reject(w)}return @Promise.@resolve()},j=()=>{return @Promise.@resolve()};if(\"transform\"in _)b=(p)=>{return @promiseInvokeOrNoopMethod(v,_.transform,[p,d])};if(\"flush\"in _)j=()=>{return @promiseInvokeOrNoopMethod(v,_.flush,[d])};@setUpTransformStreamDefaultController(q,d,b,j)})\n";
+const char* const s_transformStreamInternalsSetUpTransformStreamDefaultControllerFromTransformerCode = "(function (_,d,p){\"use strict\";const v=new @TransformStreamDefaultController;let b=(q)=>{try{@transformStreamDefaultControllerEnqueue(v,q)}catch(w){return @Promise.@reject(w)}return @Promise.@resolve()},j=()=>{return @Promise.@resolve()};if(\"transform\"in p)b=(q)=>{return @promiseInvokeOrNoopMethod(d,p.transform,[q,v])};if(\"flush\"in p)j=()=>{return @promiseInvokeOrNoopMethod(d,p.flush,[v])};@setUpTransformStreamDefaultController(_,v,b,j)})\n";
// transformStreamDefaultControllerClearAlgorithms
const JSC::ConstructAbility s_transformStreamInternalsTransformStreamDefaultControllerClearAlgorithmsCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
@@ -566,7 +566,7 @@ const JSC::ConstructorKind s_transformStreamInternalsTransformStreamDefaultContr
const JSC::ImplementationVisibility s_transformStreamInternalsTransformStreamDefaultControllerEnqueueCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
const int s_transformStreamInternalsTransformStreamDefaultControllerEnqueueCodeLength = 622;
static const JSC::Intrinsic s_transformStreamInternalsTransformStreamDefaultControllerEnqueueCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_transformStreamInternalsTransformStreamDefaultControllerEnqueueCode = "(function (g,i){\"use strict\";const _=@getByIdDirectPrivate(g,\"stream\"),W=@getByIdDirectPrivate(_,\"readable\"),S=@getByIdDirectPrivate(W,\"readableStreamController\");if(@assert(S!==@undefined),!@readableStreamDefaultControllerCanCloseOrEnqueue(S))@throwTypeError(\"TransformStream.readable cannot close or enqueue\");try{@readableStreamDefaultControllerEnqueue(S,i)}catch(j){throw @transformStreamErrorWritableAndUnblockWrite(_,j),@getByIdDirectPrivate(W,\"storedError\")}const f=!@readableStreamDefaultControllerShouldCallPull(S);if(f!==@getByIdDirectPrivate(_,\"backpressure\"))@assert(f),@transformStreamSetBackpressure(_,!0)})\n";
+const char* const s_transformStreamInternalsTransformStreamDefaultControllerEnqueueCode = "(function (_,W){\"use strict\";const f=@getByIdDirectPrivate(_,\"stream\"),g=@getByIdDirectPrivate(f,\"readable\"),i=@getByIdDirectPrivate(g,\"readableStreamController\");if(@assert(i!==@undefined),!@readableStreamDefaultControllerCanCloseOrEnqueue(i))@throwTypeError(\"TransformStream.readable cannot close or enqueue\");try{@readableStreamDefaultControllerEnqueue(i,W)}catch(S){throw @transformStreamErrorWritableAndUnblockWrite(f,S),@getByIdDirectPrivate(g,\"storedError\")}const j=!@readableStreamDefaultControllerShouldCallPull(i);if(j!==@getByIdDirectPrivate(f,\"backpressure\"))@assert(j),@transformStreamSetBackpressure(f,!0)})\n";
// transformStreamDefaultControllerError
const JSC::ConstructAbility s_transformStreamInternalsTransformStreamDefaultControllerErrorCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
@@ -582,7 +582,7 @@ const JSC::ConstructorKind s_transformStreamInternalsTransformStreamDefaultContr
const JSC::ImplementationVisibility s_transformStreamInternalsTransformStreamDefaultControllerPerformTransformCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
const int s_transformStreamInternalsTransformStreamDefaultControllerPerformTransformCodeLength = 277;
static const JSC::Intrinsic s_transformStreamInternalsTransformStreamDefaultControllerPerformTransformCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_transformStreamInternalsTransformStreamDefaultControllerPerformTransformCode = "(function (d,g){\"use strict\";const _=@newPromiseCapability(@Promise);return @getByIdDirectPrivate(d,\"transformAlgorithm\").@call(@undefined,g).@then(()=>{_.@resolve()},(f)=>{@transformStreamError(@getByIdDirectPrivate(d,\"stream\"),f),_.@reject.@call(@undefined,f)}),_.@promise})\n";
+const char* const s_transformStreamInternalsTransformStreamDefaultControllerPerformTransformCode = "(function (_,d){\"use strict\";const j=@newPromiseCapability(@Promise);return @getByIdDirectPrivate(_,\"transformAlgorithm\").@call(@undefined,d).@then(()=>{j.@resolve()},(f)=>{@transformStreamError(@getByIdDirectPrivate(_,\"stream\"),f),j.@reject.@call(@undefined,f)}),j.@promise})\n";
// transformStreamDefaultControllerTerminate
const JSC::ConstructAbility s_transformStreamInternalsTransformStreamDefaultControllerTerminateCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
@@ -590,7 +590,7 @@ const JSC::ConstructorKind s_transformStreamInternalsTransformStreamDefaultContr
const JSC::ImplementationVisibility s_transformStreamInternalsTransformStreamDefaultControllerTerminateCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
const int s_transformStreamInternalsTransformStreamDefaultControllerTerminateCodeLength = 367;
static const JSC::Intrinsic s_transformStreamInternalsTransformStreamDefaultControllerTerminateCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_transformStreamInternalsTransformStreamDefaultControllerTerminateCode = "(function (f){\"use strict\";const i=@getByIdDirectPrivate(f,\"stream\"),k=@getByIdDirectPrivate(i,\"readable\"),_=@getByIdDirectPrivate(k,\"readableStreamController\");if(@readableStreamDefaultControllerCanCloseOrEnqueue(_))@readableStreamDefaultControllerClose(_);const u=@makeTypeError(\"the stream has been terminated\");@transformStreamErrorWritableAndUnblockWrite(i,u)})\n";
+const char* const s_transformStreamInternalsTransformStreamDefaultControllerTerminateCode = "(function (i){\"use strict\";const _=@getByIdDirectPrivate(i,\"stream\"),f=@getByIdDirectPrivate(_,\"readable\"),k=@getByIdDirectPrivate(f,\"readableStreamController\");if(@readableStreamDefaultControllerCanCloseOrEnqueue(k))@readableStreamDefaultControllerClose(k);const u=@makeTypeError(\"the stream has been terminated\");@transformStreamErrorWritableAndUnblockWrite(_,u)})\n";
// transformStreamDefaultSinkWriteAlgorithm
const JSC::ConstructAbility s_transformStreamInternalsTransformStreamDefaultSinkWriteAlgorithmCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
@@ -598,7 +598,7 @@ const JSC::ConstructorKind s_transformStreamInternalsTransformStreamDefaultSinkW
const JSC::ImplementationVisibility s_transformStreamInternalsTransformStreamDefaultSinkWriteAlgorithmCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
const int s_transformStreamInternalsTransformStreamDefaultSinkWriteAlgorithmCodeLength = 764;
static const JSC::Intrinsic s_transformStreamInternalsTransformStreamDefaultSinkWriteAlgorithmCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_transformStreamInternalsTransformStreamDefaultSinkWriteAlgorithmCode = "(function (d,j){\"use strict\";const f=@getByIdDirectPrivate(d,\"internalWritable\");@assert(@getByIdDirectPrivate(f,\"state\")===\"writable\");const q=@getByIdDirectPrivate(d,\"controller\");if(@getByIdDirectPrivate(d,\"backpressure\")){const _=@newPromiseCapability(@Promise),x=@getByIdDirectPrivate(d,\"backpressureChangePromise\");return @assert(x!==@undefined),x.@promise.@then(()=>{const v=@getByIdDirectPrivate(f,\"state\");if(v===\"erroring\"){_.@reject.@call(@undefined,@getByIdDirectPrivate(f,\"storedError\"));return}@assert(v===\"writable\"),@transformStreamDefaultControllerPerformTransform(q,j).@then(()=>{_.@resolve()},(z)=>{_.@reject.@call(@undefined,z)})},(v)=>{_.@reject.@call(@undefined,v)}),_.@promise}return @transformStreamDefaultControllerPerformTransform(q,j)})\n";
+const char* const s_transformStreamInternalsTransformStreamDefaultSinkWriteAlgorithmCode = "(function (_,d){\"use strict\";const v=@getByIdDirectPrivate(_,\"internalWritable\");@assert(@getByIdDirectPrivate(v,\"state\")===\"writable\");const f=@getByIdDirectPrivate(_,\"controller\");if(@getByIdDirectPrivate(_,\"backpressure\")){const j=@newPromiseCapability(@Promise),q=@getByIdDirectPrivate(_,\"backpressureChangePromise\");return @assert(q!==@undefined),q.@promise.@then(()=>{const x=@getByIdDirectPrivate(v,\"state\");if(x===\"erroring\"){j.@reject.@call(@undefined,@getByIdDirectPrivate(v,\"storedError\"));return}@assert(x===\"writable\"),@transformStreamDefaultControllerPerformTransform(f,d).@then(()=>{j.@resolve()},(z)=>{j.@reject.@call(@undefined,z)})},(x)=>{j.@reject.@call(@undefined,x)}),j.@promise}return @transformStreamDefaultControllerPerformTransform(f,d)})\n";
// transformStreamDefaultSinkAbortAlgorithm
const JSC::ConstructAbility s_transformStreamInternalsTransformStreamDefaultSinkAbortAlgorithmCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
@@ -614,7 +614,7 @@ const JSC::ConstructorKind s_transformStreamInternalsTransformStreamDefaultSinkC
const JSC::ImplementationVisibility s_transformStreamInternalsTransformStreamDefaultSinkCloseAlgorithmCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
const int s_transformStreamInternalsTransformStreamDefaultSinkCloseAlgorithmCodeLength = 789;
static const JSC::Intrinsic s_transformStreamInternalsTransformStreamDefaultSinkCloseAlgorithmCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_transformStreamInternalsTransformStreamDefaultSinkCloseAlgorithmCode = "(function (f){\"use strict\";const _=@getByIdDirectPrivate(f,\"readable\"),q=@getByIdDirectPrivate(f,\"controller\"),j=@getByIdDirectPrivate(_,\"readableStreamController\"),k=@getByIdDirectPrivate(q,\"flushAlgorithm\");@assert(k!==@undefined);const u=@getByIdDirectPrivate(q,\"flushAlgorithm\").@call();@transformStreamDefaultControllerClearAlgorithms(q);const I=@newPromiseCapability(@Promise);return u.@then(()=>{if(@getByIdDirectPrivate(_,\"state\")===@streamErrored){I.@reject.@call(@undefined,@getByIdDirectPrivate(_,\"storedError\"));return}if(@readableStreamDefaultControllerCanCloseOrEnqueue(j))@readableStreamDefaultControllerClose(j);I.@resolve()},(v)=>{@transformStreamError(@getByIdDirectPrivate(q,\"stream\"),v),I.@reject.@call(@undefined,@getByIdDirectPrivate(_,\"storedError\"))}),I.@promise})\n";
+const char* const s_transformStreamInternalsTransformStreamDefaultSinkCloseAlgorithmCode = "(function (_){\"use strict\";const q=@getByIdDirectPrivate(_,\"readable\"),f=@getByIdDirectPrivate(_,\"controller\"),j=@getByIdDirectPrivate(q,\"readableStreamController\"),k=@getByIdDirectPrivate(f,\"flushAlgorithm\");@assert(k!==@undefined);const u=@getByIdDirectPrivate(f,\"flushAlgorithm\").@call();@transformStreamDefaultControllerClearAlgorithms(f);const I=@newPromiseCapability(@Promise);return u.@then(()=>{if(@getByIdDirectPrivate(q,\"state\")===@streamErrored){I.@reject.@call(@undefined,@getByIdDirectPrivate(q,\"storedError\"));return}if(@readableStreamDefaultControllerCanCloseOrEnqueue(j))@readableStreamDefaultControllerClose(j);I.@resolve()},(v)=>{@transformStreamError(@getByIdDirectPrivate(f,\"stream\"),v),I.@reject.@call(@undefined,@getByIdDirectPrivate(q,\"storedError\"))}),I.@promise})\n";
// transformStreamDefaultSourcePullAlgorithm
const JSC::ConstructAbility s_transformStreamInternalsTransformStreamDefaultSourcePullAlgorithmCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
@@ -674,7 +674,7 @@ const JSC::ConstructorKind s_transformStreamInitializeTransformStreamCodeConstru
const JSC::ImplementationVisibility s_transformStreamInitializeTransformStreamCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
const int s_transformStreamInitializeTransformStreamCodeLength = 1304;
static const JSC::Intrinsic s_transformStreamInitializeTransformStreamCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_transformStreamInitializeTransformStreamCode = "(function (){\"use strict\";let _=arguments[0];if(@isObject(_)&&@getByIdDirectPrivate(_,\"TransformStream\"))return this;let j=arguments[1],q=arguments[2];if(_===@undefined)_=null;if(q===@undefined)q={};if(j===@undefined)j={};let u={};if(_!==null){if(\"start\"in _){if(u.start=_.start,typeof u.start!==\"function\")@throwTypeError(\"transformer.start should be a function\")}if(\"transform\"in _){if(u.transform=_.transform,typeof u.transform!==\"function\")@throwTypeError(\"transformer.transform should be a function\")}if(\"flush\"in _){if(u.flush=_.flush,typeof u.flush!==\"function\")@throwTypeError(\"transformer.flush should be a function\")}if(\"readableType\"in _)@throwRangeError(\"TransformStream transformer has a readableType\");if(\"writableType\"in _)@throwRangeError(\"TransformStream transformer has a writableType\")}const x=@extractHighWaterMark(q,0),B=@extractSizeAlgorithm(q),E=@extractHighWaterMark(j,1),F=@extractSizeAlgorithm(j),v=@newPromiseCapability(@Promise);if(@initializeTransformStream(this,v.@promise,E,F,x,B),@setUpTransformStreamDefaultControllerFromTransformer(this,_,u),(\"start\"in u)){const G=@getByIdDirectPrivate(this,\"controller\");(()=>@promiseInvokeOrNoopMethodNoCatch(_,u.start,[G]))().@then(()=>{v.@resolve.@call()},(I)=>{v.@reject.@call(@undefined,I)})}else v.@resolve.@call();return this})\n";
+const char* const s_transformStreamInitializeTransformStreamCode = "(function (){\"use strict\";let _=arguments[0];if(@isObject(_)&&@getByIdDirectPrivate(_,\"TransformStream\"))return this;let u=arguments[1],j=arguments[2];if(_===@undefined)_=null;if(j===@undefined)j={};if(u===@undefined)u={};let q={};if(_!==null){if(\"start\"in _){if(q.start=_.start,typeof q.start!==\"function\")@throwTypeError(\"transformer.start should be a function\")}if(\"transform\"in _){if(q.transform=_.transform,typeof q.transform!==\"function\")@throwTypeError(\"transformer.transform should be a function\")}if(\"flush\"in _){if(q.flush=_.flush,typeof q.flush!==\"function\")@throwTypeError(\"transformer.flush should be a function\")}if(\"readableType\"in _)@throwRangeError(\"TransformStream transformer has a readableType\");if(\"writableType\"in _)@throwRangeError(\"TransformStream transformer has a writableType\")}const v=@extractHighWaterMark(j,0),x=@extractSizeAlgorithm(j),B=@extractHighWaterMark(u,1),E=@extractSizeAlgorithm(u),F=@newPromiseCapability(@Promise);if(@initializeTransformStream(this,F.@promise,B,E,v,x),@setUpTransformStreamDefaultControllerFromTransformer(this,_,q),(\"start\"in q)){const G=@getByIdDirectPrivate(this,\"controller\");(()=>@promiseInvokeOrNoopMethodNoCatch(_,q.start,[G]))().@then(()=>{F.@resolve.@call()},(J)=>{F.@reject.@call(@undefined,J)})}else F.@resolve.@call();return this})\n";
// readable
const JSC::ConstructAbility s_transformStreamReadableCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
@@ -716,7 +716,7 @@ const JSC::ConstructorKind s_moduleRequireCodeConstructorKind = JSC::Constructor
const JSC::ImplementationVisibility s_moduleRequireCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
const int s_moduleRequireCodeLength = 1035;
static const JSC::Intrinsic s_moduleRequireCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_moduleRequireCode = "(function (_){\"use strict\";const b=@requireMap.@get(_)||@requireMap.@get(_=@resolveSync(_,this.path,!1));if(b)return @evaluateCommonJSModule(b),b.exports;if(_.endsWith(\".json\")||_.endsWith(\".toml\")||_.endsWith(\".node\"))return @internalRequire(_);let S=@Loader.registry.@get(_);if(S\?.evaluated&&(S.state\?\?0)>=@ModuleReady){const M=S.module,f=@Loader.getModuleNamespaceObject(M),r=f\?.[@commonJSSymbol]===0||f\?.default\?.[@commonJSSymbol]===0\?f.default:f.__esModule\?f:Object.create(f,{__esModule:{value:!0}});return @requireMap.@set(_,@createCommonJSModule(_,r,!0)),r}const L=@createCommonJSModule(_,{},!1);@requireMap.@set(_,L);var h=this.@require(_,L);if(h===-1){try{h=@requireESM(_)}catch(M){throw @requireMap.@delete(_),M}if(S=@Loader.registry.@get(_),S\?.evaluated&&(S.state\?\?0)>=@ModuleReady){const M=@Loader.getModuleNamespaceObject(S.module);return L.exports=M\?.[@commonJSSymbol]===0||M\?.default\?.[@commonJSSymbol]===0\?M.default:M.__esModule\?M:Object.create(M,{__esModule:{value:!0}})}}return @evaluateCommonJSModule(L),L.exports})\n";
+const char* const s_moduleRequireCode = "(function (M){\"use strict\";const S=@requireMap.@get(M)||@requireMap.@get(M=@resolveSync(M,this.path,!1));if(S)return @evaluateCommonJSModule(S),S.exports;if(M.endsWith(\".json\")||M.endsWith(\".toml\")||M.endsWith(\".node\"))return @internalRequire(M);let f=@Loader.registry.@get(M);if(f\?.evaluated&&(f.state\?\?0)>=@ModuleReady){const b=f.module,r=@Loader.getModuleNamespaceObject(b),_=r\?.[@commonJSSymbol]===0||r\?.default\?.[@commonJSSymbol]===0\?r.default:r.__esModule\?r:Object.create(r,{__esModule:{value:!0}});return @requireMap.@set(M,@createCommonJSModule(M,_,!0)),_}const h=@createCommonJSModule(M,{},!1);@requireMap.@set(M,h);var L=this.@require(M,h);if(L===-1){try{L=@requireESM(M)}catch(b){throw @requireMap.@delete(M),b}if(f=@Loader.registry.@get(M),f\?.evaluated&&(f.state\?\?0)>=@ModuleReady){const b=@Loader.getModuleNamespaceObject(f.module);return h.exports=b\?.[@commonJSSymbol]===0||b\?.default\?.[@commonJSSymbol]===0\?b.default:b.__esModule\?b:Object.create(b,{__esModule:{value:!0}})}}return @evaluateCommonJSModule(h),h.exports})\n";
// requireResolve
const JSC::ConstructAbility s_moduleRequireResolveCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
@@ -830,7 +830,7 @@ const JSC::ConstructorKind s_jsBufferPrototypeReadIntLECodeConstructorKind = JSC
const JSC::ImplementationVisibility s_jsBufferPrototypeReadIntLECodeImplementationVisibility = JSC::ImplementationVisibility::Public;
const int s_jsBufferPrototypeReadIntLECodeLength = 528;
static const JSC::Intrinsic s_jsBufferPrototypeReadIntLECodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_jsBufferPrototypeReadIntLECode = "(function (d,u){\"use strict\";const r=this.@dataView||=new DataView(this.buffer,this.byteOffset,this.byteLength);switch(u){case 1:return r.getInt8(d);case 2:return r.getInt16(d,!0);case 3:{const _=r.getUint16(d,!0)+r.getUint8(d+2)*65536;return _|(_&8388608)*510}case 4:return r.getInt32(d,!0);case 5:{const _=r.getUint8(d+4);return(_|(_&128)*33554430)*4294967296+r.getUint32(d,!0)}case 6:{const _=r.getUint16(d+4,!0);return(_|(_&32768)*131070)*4294967296+r.getUint32(d,!0)}}@throwRangeError(\"byteLength must be >= 1 and <= 6\")})\n";
+const char* const s_jsBufferPrototypeReadIntLECode = "(function (d,r){\"use strict\";const _=this.@dataView||=new DataView(this.buffer,this.byteOffset,this.byteLength);switch(r){case 1:return _.getInt8(d);case 2:return _.getInt16(d,!0);case 3:{const u=_.getUint16(d,!0)+_.getUint8(d+2)*65536;return u|(u&8388608)*510}case 4:return _.getInt32(d,!0);case 5:{const u=_.getUint8(d+4);return(u|(u&128)*33554430)*4294967296+_.getUint32(d,!0)}case 6:{const u=_.getUint16(d+4,!0);return(u|(u&32768)*131070)*4294967296+_.getUint32(d,!0)}}@throwRangeError(\"byteLength must be >= 1 and <= 6\")})\n";
// readIntBE
const JSC::ConstructAbility s_jsBufferPrototypeReadIntBECodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
@@ -838,7 +838,7 @@ const JSC::ConstructorKind s_jsBufferPrototypeReadIntBECodeConstructorKind = JSC
const JSC::ImplementationVisibility s_jsBufferPrototypeReadIntBECodeImplementationVisibility = JSC::ImplementationVisibility::Public;
const int s_jsBufferPrototypeReadIntBECodeLength = 528;
static const JSC::Intrinsic s_jsBufferPrototypeReadIntBECodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_jsBufferPrototypeReadIntBECode = "(function (r,c){\"use strict\";const d=this.@dataView||=new DataView(this.buffer,this.byteOffset,this.byteLength);switch(c){case 1:return d.getInt8(r);case 2:return d.getInt16(r,!1);case 3:{const u=d.getUint16(r+1,!1)+d.getUint8(r)*65536;return u|(u&8388608)*510}case 4:return d.getInt32(r,!1);case 5:{const u=d.getUint8(r);return(u|(u&128)*33554430)*4294967296+d.getUint32(r+1,!1)}case 6:{const u=d.getUint16(r,!1);return(u|(u&32768)*131070)*4294967296+d.getUint32(r+2,!1)}}@throwRangeError(\"byteLength must be >= 1 and <= 6\")})\n";
+const char* const s_jsBufferPrototypeReadIntBECode = "(function (r,d){\"use strict\";const u=this.@dataView||=new DataView(this.buffer,this.byteOffset,this.byteLength);switch(d){case 1:return u.getInt8(r);case 2:return u.getInt16(r,!1);case 3:{const c=u.getUint16(r+1,!1)+u.getUint8(r)*65536;return c|(c&8388608)*510}case 4:return u.getInt32(r,!1);case 5:{const c=u.getUint8(r);return(c|(c&128)*33554430)*4294967296+u.getUint32(r+1,!1)}case 6:{const c=u.getUint16(r,!1);return(c|(c&32768)*131070)*4294967296+u.getUint32(r+2,!1)}}@throwRangeError(\"byteLength must be >= 1 and <= 6\")})\n";
// readUIntLE
const JSC::ConstructAbility s_jsBufferPrototypeReadUIntLECodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
@@ -854,7 +854,7 @@ const JSC::ConstructorKind s_jsBufferPrototypeReadUIntBECodeConstructorKind = JS
const JSC::ImplementationVisibility s_jsBufferPrototypeReadUIntBECodeImplementationVisibility = JSC::ImplementationVisibility::Public;
const int s_jsBufferPrototypeReadUIntBECodeLength = 504;
static const JSC::Intrinsic s_jsBufferPrototypeReadUIntBECodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_jsBufferPrototypeReadUIntBECode = "(function (d,p){\"use strict\";const r=this.@dataView||=new DataView(this.buffer,this.byteOffset,this.byteLength);switch(p){case 1:return r.getUint8(d);case 2:return r.getUint16(d,!1);case 3:return r.getUint16(d+1,!1)+r.getUint8(d)*65536;case 4:return r.getUint32(d,!1);case 5:{const c=r.getUint8(d);return(c|(c&128)*33554430)*4294967296+r.getUint32(d+1,!1)}case 6:{const c=r.getUint16(d,!1);return(c|(c&32768)*131070)*4294967296+r.getUint32(d+2,!1)}}@throwRangeError(\"byteLength must be >= 1 and <= 6\")})\n";
+const char* const s_jsBufferPrototypeReadUIntBECode = "(function (r,c){\"use strict\";const p=this.@dataView||=new DataView(this.buffer,this.byteOffset,this.byteLength);switch(c){case 1:return p.getUint8(r);case 2:return p.getUint16(r,!1);case 3:return p.getUint16(r+1,!1)+p.getUint8(r)*65536;case 4:return p.getUint32(r,!1);case 5:{const d=p.getUint8(r);return(d|(d&128)*33554430)*4294967296+p.getUint32(r+1,!1)}case 6:{const d=p.getUint16(r,!1);return(d|(d&32768)*131070)*4294967296+p.getUint32(r+2,!1)}}@throwRangeError(\"byteLength must be >= 1 and <= 6\")})\n";
// readFloatLE
const JSC::ConstructAbility s_jsBufferPrototypeReadFloatLECodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
@@ -926,7 +926,7 @@ const JSC::ConstructorKind s_jsBufferPrototypeWriteInt8CodeConstructorKind = JSC
const JSC::ImplementationVisibility s_jsBufferPrototypeWriteInt8CodeImplementationVisibility = JSC::ImplementationVisibility::Public;
const int s_jsBufferPrototypeWriteInt8CodeLength = 131;
static const JSC::Intrinsic s_jsBufferPrototypeWriteInt8CodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_jsBufferPrototypeWriteInt8Code = "(function (r,d){\"use strict\";return(this.@dataView||=new DataView(this.buffer,this.byteOffset,this.byteLength)).setInt8(d,r),d+1})\n";
+const char* const s_jsBufferPrototypeWriteInt8Code = "(function (d,r){\"use strict\";return(this.@dataView||=new DataView(this.buffer,this.byteOffset,this.byteLength)).setInt8(r,d),r+1})\n";
// writeUInt8
const JSC::ConstructAbility s_jsBufferPrototypeWriteUInt8CodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
@@ -934,7 +934,7 @@ const JSC::ConstructorKind s_jsBufferPrototypeWriteUInt8CodeConstructorKind = JS
const JSC::ImplementationVisibility s_jsBufferPrototypeWriteUInt8CodeImplementationVisibility = JSC::ImplementationVisibility::Public;
const int s_jsBufferPrototypeWriteUInt8CodeLength = 132;
static const JSC::Intrinsic s_jsBufferPrototypeWriteUInt8CodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_jsBufferPrototypeWriteUInt8Code = "(function (d,c){\"use strict\";return(this.@dataView||=new DataView(this.buffer,this.byteOffset,this.byteLength)).setUint8(c,d),c+1})\n";
+const char* const s_jsBufferPrototypeWriteUInt8Code = "(function (c,d){\"use strict\";return(this.@dataView||=new DataView(this.buffer,this.byteOffset,this.byteLength)).setUint8(d,c),d+1})\n";
// writeInt16LE
const JSC::ConstructAbility s_jsBufferPrototypeWriteInt16LECodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
@@ -942,7 +942,7 @@ const JSC::ConstructorKind s_jsBufferPrototypeWriteInt16LECodeConstructorKind =
const JSC::ImplementationVisibility s_jsBufferPrototypeWriteInt16LECodeImplementationVisibility = JSC::ImplementationVisibility::Public;
const int s_jsBufferPrototypeWriteInt16LECodeLength = 135;
static const JSC::Intrinsic s_jsBufferPrototypeWriteInt16LECodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_jsBufferPrototypeWriteInt16LECode = "(function (d,c){\"use strict\";return(this.@dataView||=new DataView(this.buffer,this.byteOffset,this.byteLength)).setInt16(c,d,!0),c+2})\n";
+const char* const s_jsBufferPrototypeWriteInt16LECode = "(function (c,d){\"use strict\";return(this.@dataView||=new DataView(this.buffer,this.byteOffset,this.byteLength)).setInt16(d,c,!0),d+2})\n";
// writeInt16BE
const JSC::ConstructAbility s_jsBufferPrototypeWriteInt16BECodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
@@ -950,7 +950,7 @@ const JSC::ConstructorKind s_jsBufferPrototypeWriteInt16BECodeConstructorKind =
const JSC::ImplementationVisibility s_jsBufferPrototypeWriteInt16BECodeImplementationVisibility = JSC::ImplementationVisibility::Public;
const int s_jsBufferPrototypeWriteInt16BECodeLength = 135;
static const JSC::Intrinsic s_jsBufferPrototypeWriteInt16BECodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_jsBufferPrototypeWriteInt16BECode = "(function (d,c){\"use strict\";return(this.@dataView||=new DataView(this.buffer,this.byteOffset,this.byteLength)).setInt16(c,d,!1),c+2})\n";
+const char* const s_jsBufferPrototypeWriteInt16BECode = "(function (c,d){\"use strict\";return(this.@dataView||=new DataView(this.buffer,this.byteOffset,this.byteLength)).setInt16(d,c,!1),d+2})\n";
// writeUInt16LE
const JSC::ConstructAbility s_jsBufferPrototypeWriteUInt16LECodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
@@ -958,7 +958,7 @@ const JSC::ConstructorKind s_jsBufferPrototypeWriteUInt16LECodeConstructorKind =
const JSC::ImplementationVisibility s_jsBufferPrototypeWriteUInt16LECodeImplementationVisibility = JSC::ImplementationVisibility::Public;
const int s_jsBufferPrototypeWriteUInt16LECodeLength = 136;
static const JSC::Intrinsic s_jsBufferPrototypeWriteUInt16LECodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_jsBufferPrototypeWriteUInt16LECode = "(function (d,c){\"use strict\";return(this.@dataView||=new DataView(this.buffer,this.byteOffset,this.byteLength)).setUint16(c,d,!0),c+2})\n";
+const char* const s_jsBufferPrototypeWriteUInt16LECode = "(function (c,d){\"use strict\";return(this.@dataView||=new DataView(this.buffer,this.byteOffset,this.byteLength)).setUint16(d,c,!0),d+2})\n";
// writeUInt16BE
const JSC::ConstructAbility s_jsBufferPrototypeWriteUInt16BECodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
@@ -966,7 +966,7 @@ const JSC::ConstructorKind s_jsBufferPrototypeWriteUInt16BECodeConstructorKind =
const JSC::ImplementationVisibility s_jsBufferPrototypeWriteUInt16BECodeImplementationVisibility = JSC::ImplementationVisibility::Public;
const int s_jsBufferPrototypeWriteUInt16BECodeLength = 136;
static const JSC::Intrinsic s_jsBufferPrototypeWriteUInt16BECodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_jsBufferPrototypeWriteUInt16BECode = "(function (d,c){\"use strict\";return(this.@dataView||=new DataView(this.buffer,this.byteOffset,this.byteLength)).setUint16(c,d,!1),c+2})\n";
+const char* const s_jsBufferPrototypeWriteUInt16BECode = "(function (c,d){\"use strict\";return(this.@dataView||=new DataView(this.buffer,this.byteOffset,this.byteLength)).setUint16(d,c,!1),d+2})\n";
// writeInt32LE
const JSC::ConstructAbility s_jsBufferPrototypeWriteInt32LECodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
@@ -974,7 +974,7 @@ const JSC::ConstructorKind s_jsBufferPrototypeWriteInt32LECodeConstructorKind =
const JSC::ImplementationVisibility s_jsBufferPrototypeWriteInt32LECodeImplementationVisibility = JSC::ImplementationVisibility::Public;
const int s_jsBufferPrototypeWriteInt32LECodeLength = 135;
static const JSC::Intrinsic s_jsBufferPrototypeWriteInt32LECodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_jsBufferPrototypeWriteInt32LECode = "(function (d,c){\"use strict\";return(this.@dataView||=new DataView(this.buffer,this.byteOffset,this.byteLength)).setInt32(c,d,!0),c+4})\n";
+const char* const s_jsBufferPrototypeWriteInt32LECode = "(function (c,d){\"use strict\";return(this.@dataView||=new DataView(this.buffer,this.byteOffset,this.byteLength)).setInt32(d,c,!0),d+4})\n";
// writeInt32BE
const JSC::ConstructAbility s_jsBufferPrototypeWriteInt32BECodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
@@ -982,7 +982,7 @@ const JSC::ConstructorKind s_jsBufferPrototypeWriteInt32BECodeConstructorKind =
const JSC::ImplementationVisibility s_jsBufferPrototypeWriteInt32BECodeImplementationVisibility = JSC::ImplementationVisibility::Public;
const int s_jsBufferPrototypeWriteInt32BECodeLength = 135;
static const JSC::Intrinsic s_jsBufferPrototypeWriteInt32BECodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_jsBufferPrototypeWriteInt32BECode = "(function (d,c){\"use strict\";return(this.@dataView||=new DataView(this.buffer,this.byteOffset,this.byteLength)).setInt32(c,d,!1),c+4})\n";
+const char* const s_jsBufferPrototypeWriteInt32BECode = "(function (c,d){\"use strict\";return(this.@dataView||=new DataView(this.buffer,this.byteOffset,this.byteLength)).setInt32(d,c,!1),d+4})\n";
// writeUInt32LE
const JSC::ConstructAbility s_jsBufferPrototypeWriteUInt32LECodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
@@ -990,7 +990,7 @@ const JSC::ConstructorKind s_jsBufferPrototypeWriteUInt32LECodeConstructorKind =
const JSC::ImplementationVisibility s_jsBufferPrototypeWriteUInt32LECodeImplementationVisibility = JSC::ImplementationVisibility::Public;
const int s_jsBufferPrototypeWriteUInt32LECodeLength = 136;
static const JSC::Intrinsic s_jsBufferPrototypeWriteUInt32LECodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_jsBufferPrototypeWriteUInt32LECode = "(function (d,c){\"use strict\";return(this.@dataView||=new DataView(this.buffer,this.byteOffset,this.byteLength)).setUint32(c,d,!0),c+4})\n";
+const char* const s_jsBufferPrototypeWriteUInt32LECode = "(function (c,d){\"use strict\";return(this.@dataView||=new DataView(this.buffer,this.byteOffset,this.byteLength)).setUint32(d,c,!0),d+4})\n";
// writeUInt32BE
const JSC::ConstructAbility s_jsBufferPrototypeWriteUInt32BECodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
@@ -998,7 +998,7 @@ const JSC::ConstructorKind s_jsBufferPrototypeWriteUInt32BECodeConstructorKind =
const JSC::ImplementationVisibility s_jsBufferPrototypeWriteUInt32BECodeImplementationVisibility = JSC::ImplementationVisibility::Public;
const int s_jsBufferPrototypeWriteUInt32BECodeLength = 136;
static const JSC::Intrinsic s_jsBufferPrototypeWriteUInt32BECodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_jsBufferPrototypeWriteUInt32BECode = "(function (d,c){\"use strict\";return(this.@dataView||=new DataView(this.buffer,this.byteOffset,this.byteLength)).setUint32(c,d,!1),c+4})\n";
+const char* const s_jsBufferPrototypeWriteUInt32BECode = "(function (c,d){\"use strict\";return(this.@dataView||=new DataView(this.buffer,this.byteOffset,this.byteLength)).setUint32(d,c,!1),d+4})\n";
// writeIntLE
const JSC::ConstructAbility s_jsBufferPrototypeWriteIntLECodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
@@ -1006,7 +1006,7 @@ const JSC::ConstructorKind s_jsBufferPrototypeWriteIntLECodeConstructorKind = JS
const JSC::ImplementationVisibility s_jsBufferPrototypeWriteIntLECodeImplementationVisibility = JSC::ImplementationVisibility::Public;
const int s_jsBufferPrototypeWriteIntLECodeLength = 573;
static const JSC::Intrinsic s_jsBufferPrototypeWriteIntLECodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_jsBufferPrototypeWriteIntLECode = "(function (r,d,j){\"use strict\";const c=this.@dataView||=new DataView(this.buffer,this.byteOffset,this.byteLength);switch(j){case 1:{c.setInt8(d,r);break}case 2:{c.setInt16(d,r,!0);break}case 3:{c.setUint16(d,r&65535,!0),c.setInt8(d+2,Math.floor(r*0.0000152587890625));break}case 4:{c.setInt32(d,r,!0);break}case 5:{c.setUint32(d,r|0,!0),c.setInt8(d+4,Math.floor(r*0.00000000023283064365386964));break}case 6:{c.setUint32(d,r|0,!0),c.setInt16(d+4,Math.floor(r*0.00000000023283064365386964),!0);break}default:@throwRangeError(\"byteLength must be >= 1 and <= 6\")}return d+j})\n";
+const char* const s_jsBufferPrototypeWriteIntLECode = "(function (r,c,j){\"use strict\";const d=this.@dataView||=new DataView(this.buffer,this.byteOffset,this.byteLength);switch(j){case 1:{d.setInt8(c,r);break}case 2:{d.setInt16(c,r,!0);break}case 3:{d.setUint16(c,r&65535,!0),d.setInt8(c+2,Math.floor(r*0.0000152587890625));break}case 4:{d.setInt32(c,r,!0);break}case 5:{d.setUint32(c,r|0,!0),d.setInt8(c+4,Math.floor(r*0.00000000023283064365386964));break}case 6:{d.setUint32(c,r|0,!0),d.setInt16(c+4,Math.floor(r*0.00000000023283064365386964),!0);break}default:@throwRangeError(\"byteLength must be >= 1 and <= 6\")}return c+j})\n";
// writeIntBE
const JSC::ConstructAbility s_jsBufferPrototypeWriteIntBECodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
@@ -1014,7 +1014,7 @@ const JSC::ConstructorKind s_jsBufferPrototypeWriteIntBECodeConstructorKind = JS
const JSC::ImplementationVisibility s_jsBufferPrototypeWriteIntBECodeImplementationVisibility = JSC::ImplementationVisibility::Public;
const int s_jsBufferPrototypeWriteIntBECodeLength = 573;
static const JSC::Intrinsic s_jsBufferPrototypeWriteIntBECodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_jsBufferPrototypeWriteIntBECode = "(function (r,d,c){\"use strict\";const E=this.@dataView||=new DataView(this.buffer,this.byteOffset,this.byteLength);switch(c){case 1:{E.setInt8(d,r);break}case 2:{E.setInt16(d,r,!1);break}case 3:{E.setUint16(d+1,r&65535,!1),E.setInt8(d,Math.floor(r*0.0000152587890625));break}case 4:{E.setInt32(d,r,!1);break}case 5:{E.setUint32(d+1,r|0,!1),E.setInt8(d,Math.floor(r*0.00000000023283064365386964));break}case 6:{E.setUint32(d+2,r|0,!1),E.setInt16(d,Math.floor(r*0.00000000023283064365386964),!1);break}default:@throwRangeError(\"byteLength must be >= 1 and <= 6\")}return d+c})\n";
+const char* const s_jsBufferPrototypeWriteIntBECode = "(function (d,r,E){\"use strict\";const c=this.@dataView||=new DataView(this.buffer,this.byteOffset,this.byteLength);switch(E){case 1:{c.setInt8(r,d);break}case 2:{c.setInt16(r,d,!1);break}case 3:{c.setUint16(r+1,d&65535,!1),c.setInt8(r,Math.floor(d*0.0000152587890625));break}case 4:{c.setInt32(r,d,!1);break}case 5:{c.setUint32(r+1,d|0,!1),c.setInt8(r,Math.floor(d*0.00000000023283064365386964));break}case 6:{c.setUint32(r+2,d|0,!1),c.setInt16(r,Math.floor(d*0.00000000023283064365386964),!1);break}default:@throwRangeError(\"byteLength must be >= 1 and <= 6\")}return r+E})\n";
// writeUIntLE
const JSC::ConstructAbility s_jsBufferPrototypeWriteUIntLECodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
@@ -1022,7 +1022,7 @@ const JSC::ConstructorKind s_jsBufferPrototypeWriteUIntLECodeConstructorKind = J
const JSC::ImplementationVisibility s_jsBufferPrototypeWriteUIntLECodeImplementationVisibility = JSC::ImplementationVisibility::Public;
const int s_jsBufferPrototypeWriteUIntLECodeLength = 579;
static const JSC::Intrinsic s_jsBufferPrototypeWriteUIntLECodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_jsBufferPrototypeWriteUIntLECode = "(function (r,d,c){\"use strict\";const E=this.@dataView||=new DataView(this.buffer,this.byteOffset,this.byteLength);switch(c){case 1:{E.setUint8(d,r);break}case 2:{E.setUint16(d,r,!0);break}case 3:{E.setUint16(d,r&65535,!0),E.setUint8(d+2,Math.floor(r*0.0000152587890625));break}case 4:{E.setUint32(d,r,!0);break}case 5:{E.setUint32(d,r|0,!0),E.setUint8(d+4,Math.floor(r*0.00000000023283064365386964));break}case 6:{E.setUint32(d,r|0,!0),E.setUint16(d+4,Math.floor(r*0.00000000023283064365386964),!0);break}default:@throwRangeError(\"byteLength must be >= 1 and <= 6\")}return d+c})\n";
+const char* const s_jsBufferPrototypeWriteUIntLECode = "(function (r,d,E){\"use strict\";const c=this.@dataView||=new DataView(this.buffer,this.byteOffset,this.byteLength);switch(E){case 1:{c.setUint8(d,r);break}case 2:{c.setUint16(d,r,!0);break}case 3:{c.setUint16(d,r&65535,!0),c.setUint8(d+2,Math.floor(r*0.0000152587890625));break}case 4:{c.setUint32(d,r,!0);break}case 5:{c.setUint32(d,r|0,!0),c.setUint8(d+4,Math.floor(r*0.00000000023283064365386964));break}case 6:{c.setUint32(d,r|0,!0),c.setUint16(d+4,Math.floor(r*0.00000000023283064365386964),!0);break}default:@throwRangeError(\"byteLength must be >= 1 and <= 6\")}return d+E})\n";
// writeUIntBE
const JSC::ConstructAbility s_jsBufferPrototypeWriteUIntBECodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
@@ -1030,7 +1030,7 @@ const JSC::ConstructorKind s_jsBufferPrototypeWriteUIntBECodeConstructorKind = J
const JSC::ImplementationVisibility s_jsBufferPrototypeWriteUIntBECodeImplementationVisibility = JSC::ImplementationVisibility::Public;
const int s_jsBufferPrototypeWriteUIntBECodeLength = 579;
static const JSC::Intrinsic s_jsBufferPrototypeWriteUIntBECodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_jsBufferPrototypeWriteUIntBECode = "(function (r,d,_){\"use strict\";const p=this.@dataView||=new DataView(this.buffer,this.byteOffset,this.byteLength);switch(_){case 1:{p.setUint8(d,r);break}case 2:{p.setUint16(d,r,!1);break}case 3:{p.setUint16(d+1,r&65535,!1),p.setUint8(d,Math.floor(r*0.0000152587890625));break}case 4:{p.setUint32(d,r,!1);break}case 5:{p.setUint32(d+1,r|0,!1),p.setUint8(d,Math.floor(r*0.00000000023283064365386964));break}case 6:{p.setUint32(d+2,r|0,!1),p.setUint16(d,Math.floor(r*0.00000000023283064365386964),!1);break}default:@throwRangeError(\"byteLength must be >= 1 and <= 6\")}return d+_})\n";
+const char* const s_jsBufferPrototypeWriteUIntBECode = "(function (d,_,p){\"use strict\";const r=this.@dataView||=new DataView(this.buffer,this.byteOffset,this.byteLength);switch(p){case 1:{r.setUint8(_,d);break}case 2:{r.setUint16(_,d,!1);break}case 3:{r.setUint16(_+1,d&65535,!1),r.setUint8(_,Math.floor(d*0.0000152587890625));break}case 4:{r.setUint32(_,d,!1);break}case 5:{r.setUint32(_+1,d|0,!1),r.setUint8(_,Math.floor(d*0.00000000023283064365386964));break}case 6:{r.setUint32(_+2,d|0,!1),r.setUint16(_,Math.floor(d*0.00000000023283064365386964),!1);break}default:@throwRangeError(\"byteLength must be >= 1 and <= 6\")}return _+p})\n";
// writeFloatLE
const JSC::ConstructAbility s_jsBufferPrototypeWriteFloatLECodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
@@ -1038,7 +1038,7 @@ const JSC::ConstructorKind s_jsBufferPrototypeWriteFloatLECodeConstructorKind =
const JSC::ImplementationVisibility s_jsBufferPrototypeWriteFloatLECodeImplementationVisibility = JSC::ImplementationVisibility::Public;
const int s_jsBufferPrototypeWriteFloatLECodeLength = 137;
static const JSC::Intrinsic s_jsBufferPrototypeWriteFloatLECodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_jsBufferPrototypeWriteFloatLECode = "(function (d,c){\"use strict\";return(this.@dataView||=new DataView(this.buffer,this.byteOffset,this.byteLength)).setFloat32(c,d,!0),c+4})\n";
+const char* const s_jsBufferPrototypeWriteFloatLECode = "(function (c,d){\"use strict\";return(this.@dataView||=new DataView(this.buffer,this.byteOffset,this.byteLength)).setFloat32(d,c,!0),d+4})\n";
// writeFloatBE
const JSC::ConstructAbility s_jsBufferPrototypeWriteFloatBECodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
@@ -1046,7 +1046,7 @@ const JSC::ConstructorKind s_jsBufferPrototypeWriteFloatBECodeConstructorKind =
const JSC::ImplementationVisibility s_jsBufferPrototypeWriteFloatBECodeImplementationVisibility = JSC::ImplementationVisibility::Public;
const int s_jsBufferPrototypeWriteFloatBECodeLength = 137;
static const JSC::Intrinsic s_jsBufferPrototypeWriteFloatBECodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_jsBufferPrototypeWriteFloatBECode = "(function (d,c){\"use strict\";return(this.@dataView||=new DataView(this.buffer,this.byteOffset,this.byteLength)).setFloat32(c,d,!1),c+4})\n";
+const char* const s_jsBufferPrototypeWriteFloatBECode = "(function (c,d){\"use strict\";return(this.@dataView||=new DataView(this.buffer,this.byteOffset,this.byteLength)).setFloat32(d,c,!1),d+4})\n";
// writeDoubleLE
const JSC::ConstructAbility s_jsBufferPrototypeWriteDoubleLECodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
@@ -1054,7 +1054,7 @@ const JSC::ConstructorKind s_jsBufferPrototypeWriteDoubleLECodeConstructorKind =
const JSC::ImplementationVisibility s_jsBufferPrototypeWriteDoubleLECodeImplementationVisibility = JSC::ImplementationVisibility::Public;
const int s_jsBufferPrototypeWriteDoubleLECodeLength = 137;
static const JSC::Intrinsic s_jsBufferPrototypeWriteDoubleLECodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_jsBufferPrototypeWriteDoubleLECode = "(function (d,c){\"use strict\";return(this.@dataView||=new DataView(this.buffer,this.byteOffset,this.byteLength)).setFloat64(c,d,!0),c+8})\n";
+const char* const s_jsBufferPrototypeWriteDoubleLECode = "(function (c,d){\"use strict\";return(this.@dataView||=new DataView(this.buffer,this.byteOffset,this.byteLength)).setFloat64(d,c,!0),d+8})\n";
// writeDoubleBE
const JSC::ConstructAbility s_jsBufferPrototypeWriteDoubleBECodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
@@ -1062,7 +1062,7 @@ const JSC::ConstructorKind s_jsBufferPrototypeWriteDoubleBECodeConstructorKind =
const JSC::ImplementationVisibility s_jsBufferPrototypeWriteDoubleBECodeImplementationVisibility = JSC::ImplementationVisibility::Public;
const int s_jsBufferPrototypeWriteDoubleBECodeLength = 137;
static const JSC::Intrinsic s_jsBufferPrototypeWriteDoubleBECodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_jsBufferPrototypeWriteDoubleBECode = "(function (d,c){\"use strict\";return(this.@dataView||=new DataView(this.buffer,this.byteOffset,this.byteLength)).setFloat64(c,d,!1),c+8})\n";
+const char* const s_jsBufferPrototypeWriteDoubleBECode = "(function (c,d){\"use strict\";return(this.@dataView||=new DataView(this.buffer,this.byteOffset,this.byteLength)).setFloat64(d,c,!1),d+8})\n";
// writeBigInt64LE
const JSC::ConstructAbility s_jsBufferPrototypeWriteBigInt64LECodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
@@ -1070,7 +1070,7 @@ const JSC::ConstructorKind s_jsBufferPrototypeWriteBigInt64LECodeConstructorKind
const JSC::ImplementationVisibility s_jsBufferPrototypeWriteBigInt64LECodeImplementationVisibility = JSC::ImplementationVisibility::Public;
const int s_jsBufferPrototypeWriteBigInt64LECodeLength = 138;
static const JSC::Intrinsic s_jsBufferPrototypeWriteBigInt64LECodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_jsBufferPrototypeWriteBigInt64LECode = "(function (d,c){\"use strict\";return(this.@dataView||=new DataView(this.buffer,this.byteOffset,this.byteLength)).setBigInt64(c,d,!0),c+8})\n";
+const char* const s_jsBufferPrototypeWriteBigInt64LECode = "(function (c,d){\"use strict\";return(this.@dataView||=new DataView(this.buffer,this.byteOffset,this.byteLength)).setBigInt64(d,c,!0),d+8})\n";
// writeBigInt64BE
const JSC::ConstructAbility s_jsBufferPrototypeWriteBigInt64BECodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
@@ -1078,7 +1078,7 @@ const JSC::ConstructorKind s_jsBufferPrototypeWriteBigInt64BECodeConstructorKind
const JSC::ImplementationVisibility s_jsBufferPrototypeWriteBigInt64BECodeImplementationVisibility = JSC::ImplementationVisibility::Public;
const int s_jsBufferPrototypeWriteBigInt64BECodeLength = 138;
static const JSC::Intrinsic s_jsBufferPrototypeWriteBigInt64BECodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_jsBufferPrototypeWriteBigInt64BECode = "(function (d,c){\"use strict\";return(this.@dataView||=new DataView(this.buffer,this.byteOffset,this.byteLength)).setBigInt64(c,d,!1),c+8})\n";
+const char* const s_jsBufferPrototypeWriteBigInt64BECode = "(function (c,d){\"use strict\";return(this.@dataView||=new DataView(this.buffer,this.byteOffset,this.byteLength)).setBigInt64(d,c,!1),d+8})\n";
// writeBigUInt64LE
const JSC::ConstructAbility s_jsBufferPrototypeWriteBigUInt64LECodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
@@ -1086,7 +1086,7 @@ const JSC::ConstructorKind s_jsBufferPrototypeWriteBigUInt64LECodeConstructorKin
const JSC::ImplementationVisibility s_jsBufferPrototypeWriteBigUInt64LECodeImplementationVisibility = JSC::ImplementationVisibility::Public;
const int s_jsBufferPrototypeWriteBigUInt64LECodeLength = 139;
static const JSC::Intrinsic s_jsBufferPrototypeWriteBigUInt64LECodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_jsBufferPrototypeWriteBigUInt64LECode = "(function (d,c){\"use strict\";return(this.@dataView||=new DataView(this.buffer,this.byteOffset,this.byteLength)).setBigUint64(c,d,!0),c+8})\n";
+const char* const s_jsBufferPrototypeWriteBigUInt64LECode = "(function (c,d){\"use strict\";return(this.@dataView||=new DataView(this.buffer,this.byteOffset,this.byteLength)).setBigUint64(d,c,!0),d+8})\n";
// writeBigUInt64BE
const JSC::ConstructAbility s_jsBufferPrototypeWriteBigUInt64BECodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
@@ -1094,7 +1094,7 @@ const JSC::ConstructorKind s_jsBufferPrototypeWriteBigUInt64BECodeConstructorKin
const JSC::ImplementationVisibility s_jsBufferPrototypeWriteBigUInt64BECodeImplementationVisibility = JSC::ImplementationVisibility::Public;
const int s_jsBufferPrototypeWriteBigUInt64BECodeLength = 139;
static const JSC::Intrinsic s_jsBufferPrototypeWriteBigUInt64BECodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_jsBufferPrototypeWriteBigUInt64BECode = "(function (d,c){\"use strict\";return(this.@dataView||=new DataView(this.buffer,this.byteOffset,this.byteLength)).setBigUint64(c,d,!1),c+8})\n";
+const char* const s_jsBufferPrototypeWriteBigUInt64BECode = "(function (c,d){\"use strict\";return(this.@dataView||=new DataView(this.buffer,this.byteOffset,this.byteLength)).setBigUint64(d,c,!1),d+8})\n";
// utf8Write
const JSC::ConstructAbility s_jsBufferPrototypeUtf8WriteCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
@@ -1134,7 +1134,7 @@ const JSC::ConstructorKind s_jsBufferPrototypeAsciiWriteCodeConstructorKind = JS
const JSC::ImplementationVisibility s_jsBufferPrototypeAsciiWriteCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
const int s_jsBufferPrototypeAsciiWriteCodeLength = 66;
static const JSC::Intrinsic s_jsBufferPrototypeAsciiWriteCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_jsBufferPrototypeAsciiWriteCode = "(function (c,d,i){\"use strict\";return this.write(c,d,i,\"ascii\")})\n";
+const char* const s_jsBufferPrototypeAsciiWriteCode = "(function (c,i,d){\"use strict\";return this.write(c,i,d,\"ascii\")})\n";
// base64Write
const JSC::ConstructAbility s_jsBufferPrototypeBase64WriteCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
@@ -1158,7 +1158,7 @@ const JSC::ConstructorKind s_jsBufferPrototypeHexWriteCodeConstructorKind = JSC:
const JSC::ImplementationVisibility s_jsBufferPrototypeHexWriteCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
const int s_jsBufferPrototypeHexWriteCodeLength = 64;
static const JSC::Intrinsic s_jsBufferPrototypeHexWriteCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_jsBufferPrototypeHexWriteCode = "(function (d,r,a){\"use strict\";return this.write(d,r,a,\"hex\")})\n";
+const char* const s_jsBufferPrototypeHexWriteCode = "(function (d,a,r){\"use strict\";return this.write(d,a,r,\"hex\")})\n";
// utf8Slice
const JSC::ConstructAbility s_jsBufferPrototypeUtf8SliceCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
@@ -1174,7 +1174,7 @@ const JSC::ConstructorKind s_jsBufferPrototypeUcs2SliceCodeConstructorKind = JSC
const JSC::ImplementationVisibility s_jsBufferPrototypeUcs2SliceCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
const int s_jsBufferPrototypeUcs2SliceCodeLength = 64;
static const JSC::Intrinsic s_jsBufferPrototypeUcs2SliceCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_jsBufferPrototypeUcs2SliceCode = "(function (g,u){\"use strict\";return this.toString(\"ucs2\",g,u)})\n";
+const char* const s_jsBufferPrototypeUcs2SliceCode = "(function (u,g){\"use strict\";return this.toString(\"ucs2\",u,g)})\n";
// utf16leSlice
const JSC::ConstructAbility s_jsBufferPrototypeUtf16leSliceCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
@@ -1238,7 +1238,7 @@ const JSC::ConstructorKind s_jsBufferPrototypeSliceCodeConstructorKind = JSC::Co
const JSC::ImplementationVisibility s_jsBufferPrototypeSliceCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
const int s_jsBufferPrototypeSliceCodeLength = 260;
static const JSC::Intrinsic s_jsBufferPrototypeSliceCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_jsBufferPrototypeSliceCode = "(function (w,m){\"use strict\";var{buffer:x,byteOffset:z,byteLength:p}=this;function q(c,k){if(c=@trunc(c),c===0||@isNaN(c))return 0;else if(c<0)return c+=k,c>0\?c:0;else return c<k\?c:k}var i=q(w,p),v=m!==@undefined\?q(m,p):p;return new @Buffer(x,z+i,v>i\?v-i:0)})\n";
+const char* const s_jsBufferPrototypeSliceCode = "(function (c,p){\"use strict\";var{buffer:i,byteOffset:k,byteLength:m}=this;function q(x,z){if(x=@trunc(x),x===0||@isNaN(x))return 0;else if(x<0)return x+=z,x>0\?x:0;else return x<z\?x:z}var v=q(c,m),w=p!==@undefined\?q(p,m):m;return new @Buffer(i,k+v,w>v\?w-v:0)})\n";
// parent
const JSC::ConstructAbility s_jsBufferPrototypeParentCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
@@ -1312,7 +1312,7 @@ const JSC::ConstructorKind s_readableByteStreamControllerByobRequestCodeConstruc
const JSC::ImplementationVisibility s_readableByteStreamControllerByobRequestCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
const int s_readableByteStreamControllerByobRequestCodeLength = 523;
static const JSC::Intrinsic s_readableByteStreamControllerByobRequestCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_readableByteStreamControllerByobRequestCode = "(function (){\"use strict\";if(!@isReadableByteStreamController(this))throw @makeGetterTypeError(\"ReadableByteStreamController\",\"byobRequest\");var a=@getByIdDirectPrivate(this,\"byobRequest\");if(a===@undefined){var l=@getByIdDirectPrivate(this,\"pendingPullIntos\");const _=l.peek();if(_){const m=new @Uint8Array(_.buffer,_.byteOffset+_.bytesFilled,_.byteLength-_.bytesFilled);@putByIdDirectPrivate(this,\"byobRequest\",new @ReadableStreamBYOBRequest(this,m,@isReadableStream))}}return @getByIdDirectPrivate(this,\"byobRequest\")})\n";
+const char* const s_readableByteStreamControllerByobRequestCode = "(function (){\"use strict\";if(!@isReadableByteStreamController(this))throw @makeGetterTypeError(\"ReadableByteStreamController\",\"byobRequest\");var _=@getByIdDirectPrivate(this,\"byobRequest\");if(_===@undefined){var a=@getByIdDirectPrivate(this,\"pendingPullIntos\");const l=a.peek();if(l){const m=new @Uint8Array(l.buffer,l.byteOffset+l.bytesFilled,l.byteLength-l.bytesFilled);@putByIdDirectPrivate(this,\"byobRequest\",new @ReadableStreamBYOBRequest(this,m,@isReadableStream))}}return @getByIdDirectPrivate(this,\"byobRequest\")})\n";
// desiredSize
const JSC::ConstructAbility s_readableByteStreamControllerDesiredSizeCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
@@ -1338,7 +1338,7 @@ const JSC::ConstructorKind s_consoleObjectAsyncIteratorCodeConstructorKind = JSC
const JSC::ImplementationVisibility s_consoleObjectAsyncIteratorCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
const int s_consoleObjectAsyncIteratorCodeLength = 577;
static const JSC::Intrinsic s_consoleObjectAsyncIteratorCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_consoleObjectAsyncIteratorCode = "(function (){\"use strict\";const D=async function*L(){var F=@Bun.stdin.stream().getReader(),G=new globalThis.TextDecoder(\"utf-8\",{fatal:!1}),z,H=@Bun.indexOfLine;try{while(!0){var A,B,w;const m=F.readMany();if(@isPromise(m))({done:A,value:B}=await m);else({done:A,value:B}=m);if(A){if(w)yield G.decode(w);return}var _;for(let J of B){if(_=J,w)_=@Buffer.concat([w,J]),w=null;var j=0,q=H(_,j);while(q!==-1)yield G.decode(_.subarray(j,q)),j=q+1,q=H(_,j);w=_.subarray(j)}}}catch(m){z=m}finally{if(F.releaseLock(),z)throw z}},K=globalThis.Symbol.asyncIterator;return this[K]=D,D()})\n";
+const char* const s_consoleObjectAsyncIteratorCode = "(function (){\"use strict\";const w=async function*A(){var D=@Bun.stdin.stream().getReader(),_=new globalThis.TextDecoder(\"utf-8\",{fatal:!1}),F,j=@Bun.indexOfLine;try{while(!0){var G,H,m;const M=D.readMany();if(@isPromise(M))({done:G,value:H}=await M);else({done:G,value:H}=M);if(G){if(m)yield _.decode(m);return}var J;for(let q of H){if(J=q,m)J=@Buffer.concat([m,q]),m=null;var K=0,L=j(J,K);while(L!==-1)yield _.decode(J.subarray(K,L)),K=L+1,L=j(J,K);m=J.subarray(K)}}}catch(M){F=M}finally{if(D.releaseLock(),F)throw F}},z=globalThis.Symbol.asyncIterator;return this[z]=w,w()})\n";
// write
const JSC::ConstructAbility s_consoleObjectWriteCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
@@ -1346,7 +1346,7 @@ const JSC::ConstructorKind s_consoleObjectWriteCodeConstructorKind = JSC::Constr
const JSC::ImplementationVisibility s_consoleObjectWriteCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
const int s_consoleObjectWriteCodeLength = 310;
static const JSC::Intrinsic s_consoleObjectWriteCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_consoleObjectWriteCode = "(function (_){\"use strict\";var a=@getByIdDirectPrivate(this,\"writer\");if(!a){var b=@toLength(_\?.length\?\?0);a=@Bun.stdout.writer({highWaterMark:b>65536\?b:65536}),@putByIdDirectPrivate(this,\"writer\",a)}var c=a.write(_);const f=@argumentCount();for(var d=1;d<f;d++)c+=a.write(@argument(d));return a.flush(!0),c})\n";
+const char* const s_consoleObjectWriteCode = "(function (a){\"use strict\";var d=@getByIdDirectPrivate(this,\"writer\");if(!d){var _=@toLength(a\?.length\?\?0);d=@Bun.stdout.writer({highWaterMark:_>65536\?_:65536}),@putByIdDirectPrivate(this,\"writer\",d)}var b=d.write(a);const c=@argumentCount();for(var f=1;f<c;f++)b+=d.write(@argument(f));return d.flush(!0),b})\n";
#define DEFINE_BUILTIN_GENERATOR(codeName, functionName, overriddenName, argumentCount) \
JSC::FunctionExecutable* codeName##Generator(JSC::VM& vm) \
@@ -1364,7 +1364,7 @@ const JSC::ConstructorKind s_readableStreamInternalsReadableStreamReaderGenericI
const JSC::ImplementationVisibility s_readableStreamInternalsReadableStreamReaderGenericInitializeCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
const int s_readableStreamInternalsReadableStreamReaderGenericInitializeCodeLength = 585;
static const JSC::Intrinsic s_readableStreamInternalsReadableStreamReaderGenericInitializeCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_readableStreamInternalsReadableStreamReaderGenericInitializeCode = "(function (_,i){\"use strict\";if(@putByIdDirectPrivate(_,\"ownerReadableStream\",i),@putByIdDirectPrivate(i,\"reader\",_),@getByIdDirectPrivate(i,\"state\")===@streamReadable)@putByIdDirectPrivate(_,\"closedPromiseCapability\",@newPromiseCapability(@Promise));else if(@getByIdDirectPrivate(i,\"state\")===@streamClosed)@putByIdDirectPrivate(_,\"closedPromiseCapability\",{@promise:@Promise.@resolve()});else @assert(@getByIdDirectPrivate(i,\"state\")===@streamErrored),@putByIdDirectPrivate(_,\"closedPromiseCapability\",{@promise:@newHandledRejectedPromise(@getByIdDirectPrivate(i,\"storedError\"))})})\n";
+const char* const s_readableStreamInternalsReadableStreamReaderGenericInitializeCode = "(function (i,_){\"use strict\";if(@putByIdDirectPrivate(i,\"ownerReadableStream\",_),@putByIdDirectPrivate(_,\"reader\",i),@getByIdDirectPrivate(_,\"state\")===@streamReadable)@putByIdDirectPrivate(i,\"closedPromiseCapability\",@newPromiseCapability(@Promise));else if(@getByIdDirectPrivate(_,\"state\")===@streamClosed)@putByIdDirectPrivate(i,\"closedPromiseCapability\",{@promise:@Promise.@resolve()});else @assert(@getByIdDirectPrivate(_,\"state\")===@streamErrored),@putByIdDirectPrivate(i,\"closedPromiseCapability\",{@promise:@newHandledRejectedPromise(@getByIdDirectPrivate(_,\"storedError\"))})})\n";
// privateInitializeReadableStreamDefaultController
const JSC::ConstructAbility s_readableStreamInternalsPrivateInitializeReadableStreamDefaultControllerCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
@@ -1372,7 +1372,7 @@ const JSC::ConstructorKind s_readableStreamInternalsPrivateInitializeReadableStr
const JSC::ImplementationVisibility s_readableStreamInternalsPrivateInitializeReadableStreamDefaultControllerCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
const int s_readableStreamInternalsPrivateInitializeReadableStreamDefaultControllerCodeLength = 675;
static const JSC::Intrinsic s_readableStreamInternalsPrivateInitializeReadableStreamDefaultControllerCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_readableStreamInternalsPrivateInitializeReadableStreamDefaultControllerCode = "(function (d,P,_,b){\"use strict\";if(!@isReadableStream(d))@throwTypeError(\"ReadableStreamDefaultController needs a ReadableStream\");if(@getByIdDirectPrivate(d,\"readableStreamController\")!==null)@throwTypeError(\"ReadableStream already has a controller\");return @putByIdDirectPrivate(this,\"controlledReadableStream\",d),@putByIdDirectPrivate(this,\"underlyingSource\",P),@putByIdDirectPrivate(this,\"queue\",@newQueue()),@putByIdDirectPrivate(this,\"started\",-1),@putByIdDirectPrivate(this,\"closeRequested\",!1),@putByIdDirectPrivate(this,\"pullAgain\",!1),@putByIdDirectPrivate(this,\"pulling\",!1),@putByIdDirectPrivate(this,\"strategy\",@validateAndNormalizeQueuingStrategy(_,b)),this})\n";
+const char* const s_readableStreamInternalsPrivateInitializeReadableStreamDefaultControllerCode = "(function (d,_,P,b){\"use strict\";if(!@isReadableStream(d))@throwTypeError(\"ReadableStreamDefaultController needs a ReadableStream\");if(@getByIdDirectPrivate(d,\"readableStreamController\")!==null)@throwTypeError(\"ReadableStream already has a controller\");return @putByIdDirectPrivate(this,\"controlledReadableStream\",d),@putByIdDirectPrivate(this,\"underlyingSource\",_),@putByIdDirectPrivate(this,\"queue\",@newQueue()),@putByIdDirectPrivate(this,\"started\",-1),@putByIdDirectPrivate(this,\"closeRequested\",!1),@putByIdDirectPrivate(this,\"pullAgain\",!1),@putByIdDirectPrivate(this,\"pulling\",!1),@putByIdDirectPrivate(this,\"strategy\",@validateAndNormalizeQueuingStrategy(P,b)),this})\n";
// readableStreamDefaultControllerError
const JSC::ConstructAbility s_readableStreamInternalsReadableStreamDefaultControllerErrorCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
@@ -1380,7 +1380,7 @@ const JSC::ConstructorKind s_readableStreamInternalsReadableStreamDefaultControl
const JSC::ImplementationVisibility s_readableStreamInternalsReadableStreamDefaultControllerErrorCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
const int s_readableStreamInternalsReadableStreamDefaultControllerErrorCodeLength = 223;
static const JSC::Intrinsic s_readableStreamInternalsReadableStreamDefaultControllerErrorCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_readableStreamInternalsReadableStreamDefaultControllerErrorCode = "(function (i,d){\"use strict\";const u=@getByIdDirectPrivate(i,\"controlledReadableStream\");if(@getByIdDirectPrivate(u,\"state\")!==@streamReadable)return;@putByIdDirectPrivate(i,\"queue\",@newQueue()),@readableStreamError(u,d)})\n";
+const char* const s_readableStreamInternalsReadableStreamDefaultControllerErrorCode = "(function (i,u){\"use strict\";const d=@getByIdDirectPrivate(i,\"controlledReadableStream\");if(@getByIdDirectPrivate(d,\"state\")!==@streamReadable)return;@putByIdDirectPrivate(i,\"queue\",@newQueue()),@readableStreamError(d,u)})\n";
// readableStreamPipeTo
const JSC::ConstructAbility s_readableStreamInternalsReadableStreamPipeToCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
@@ -1388,7 +1388,7 @@ const JSC::ConstructorKind s_readableStreamInternalsReadableStreamPipeToCodeCons
const JSC::ImplementationVisibility s_readableStreamInternalsReadableStreamPipeToCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
const int s_readableStreamInternalsReadableStreamPipeToCodeLength = 427;
static const JSC::Intrinsic s_readableStreamInternalsReadableStreamPipeToCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_readableStreamInternalsReadableStreamPipeToCode = "(function (g,c){\"use strict\";@assert(@isReadableStream(g));const h=new @ReadableStreamDefaultReader(g);@getByIdDirectPrivate(h,\"closedPromiseCapability\").@promise.@then(()=>{},(_)=>{c.error(_)});function y(){@readableStreamDefaultReaderRead(h).@then(function(_){if(_.done){c.close();return}try{c.enqueue(_.value)}catch(S){c.error(\"ReadableStream chunk enqueueing in the sink failed\");return}y()},function(_){c.error(_)})}y()})\n";
+const char* const s_readableStreamInternalsReadableStreamPipeToCode = "(function (c,_){\"use strict\";@assert(@isReadableStream(c));const h=new @ReadableStreamDefaultReader(c);@getByIdDirectPrivate(h,\"closedPromiseCapability\").@promise.@then(()=>{},(g)=>{_.error(g)});function y(){@readableStreamDefaultReaderRead(h).@then(function(g){if(g.done){_.close();return}try{_.enqueue(g.value)}catch(S){_.error(\"ReadableStream chunk enqueueing in the sink failed\");return}y()},function(g){_.error(g)})}y()})\n";
// acquireReadableStreamDefaultReader
const JSC::ConstructAbility s_readableStreamInternalsAcquireReadableStreamDefaultReaderCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
@@ -1404,7 +1404,7 @@ const JSC::ConstructorKind s_readableStreamInternalsSetupReadableStreamDefaultCo
const JSC::ImplementationVisibility s_readableStreamInternalsSetupReadableStreamDefaultControllerCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
const int s_readableStreamInternalsSetupReadableStreamDefaultControllerCodeLength = 523;
static const JSC::Intrinsic s_readableStreamInternalsSetupReadableStreamDefaultControllerCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_readableStreamInternalsSetupReadableStreamDefaultControllerCode = "(function (b,f,j,q,D,v,w){\"use strict\";const _=new @ReadableStreamDefaultController(b,f,j,q,@isReadableStream),x=()=>@promiseInvokeOrNoopMethod(f,v,[_]),B=(C)=>@promiseInvokeOrNoopMethod(f,w,[C]);@putByIdDirectPrivate(_,\"pullAlgorithm\",x),@putByIdDirectPrivate(_,\"cancelAlgorithm\",B),@putByIdDirectPrivate(_,\"pull\",@readableStreamDefaultControllerPull),@putByIdDirectPrivate(_,\"cancel\",@readableStreamDefaultControllerCancel),@putByIdDirectPrivate(b,\"readableStreamController\",_),@readableStreamDefaultControllerStart(_)})\n";
+const char* const s_readableStreamInternalsSetupReadableStreamDefaultControllerCode = "(function (f,b,j,q,v,w,x){\"use strict\";const B=new @ReadableStreamDefaultController(f,b,j,q,@isReadableStream),C=()=>@promiseInvokeOrNoopMethod(b,w,[B]),D=(_)=>@promiseInvokeOrNoopMethod(b,x,[_]);@putByIdDirectPrivate(B,\"pullAlgorithm\",C),@putByIdDirectPrivate(B,\"cancelAlgorithm\",D),@putByIdDirectPrivate(B,\"pull\",@readableStreamDefaultControllerPull),@putByIdDirectPrivate(B,\"cancel\",@readableStreamDefaultControllerCancel),@putByIdDirectPrivate(f,\"readableStreamController\",B),@readableStreamDefaultControllerStart(B)})\n";
// createReadableStreamController
const JSC::ConstructAbility s_readableStreamInternalsCreateReadableStreamControllerCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
@@ -1412,7 +1412,7 @@ const JSC::ConstructorKind s_readableStreamInternalsCreateReadableStreamControll
const JSC::ImplementationVisibility s_readableStreamInternalsCreateReadableStreamControllerCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
const int s_readableStreamInternalsCreateReadableStreamControllerCodeLength = 671;
static const JSC::Intrinsic s_readableStreamInternalsCreateReadableStreamControllerCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_readableStreamInternalsCreateReadableStreamControllerCode = "(function (w,v,f){\"use strict\";const A=v.type,C=@toString(A);if(C===\"bytes\"){if(f.highWaterMark===@undefined)f.highWaterMark=0;if(f.size!==@undefined)@throwRangeError(\"Strategy for a ReadableByteStreamController cannot have a size\");@putByIdDirectPrivate(w,\"readableStreamController\",new @ReadableByteStreamController(w,v,f.highWaterMark,@isReadableStream))}else if(C===\"direct\"){var b=f\?.highWaterMark;@initializeArrayBufferStream.@call(w,v,b)}else if(A===@undefined){if(f.highWaterMark===@undefined)f.highWaterMark=1;@setupReadableStreamDefaultController(w,v,f.size,f.highWaterMark,v.start,v.pull,v.cancel)}else @throwRangeError(\"Invalid type for underlying source\")})\n";
+const char* const s_readableStreamInternalsCreateReadableStreamControllerCode = "(function (v,w,f){\"use strict\";const A=w.type,C=@toString(A);if(C===\"bytes\"){if(f.highWaterMark===@undefined)f.highWaterMark=0;if(f.size!==@undefined)@throwRangeError(\"Strategy for a ReadableByteStreamController cannot have a size\");@putByIdDirectPrivate(v,\"readableStreamController\",new @ReadableByteStreamController(v,w,f.highWaterMark,@isReadableStream))}else if(C===\"direct\"){var b=f\?.highWaterMark;@initializeArrayBufferStream.@call(v,w,b)}else if(A===@undefined){if(f.highWaterMark===@undefined)f.highWaterMark=1;@setupReadableStreamDefaultController(v,w,f.size,f.highWaterMark,w.start,w.pull,w.cancel)}else @throwRangeError(\"Invalid type for underlying source\")})\n";
// readableStreamDefaultControllerStart
const JSC::ConstructAbility s_readableStreamInternalsReadableStreamDefaultControllerStartCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
@@ -1420,7 +1420,7 @@ const JSC::ConstructorKind s_readableStreamInternalsReadableStreamDefaultControl
const JSC::ImplementationVisibility s_readableStreamInternalsReadableStreamDefaultControllerStartCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
const int s_readableStreamInternalsReadableStreamDefaultControllerStartCodeLength = 465;
static const JSC::Intrinsic s_readableStreamInternalsReadableStreamDefaultControllerStartCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_readableStreamInternalsReadableStreamDefaultControllerStartCode = "(function (m){\"use strict\";if(@getByIdDirectPrivate(m,\"started\")!==-1)return;const B=@getByIdDirectPrivate(m,\"underlyingSource\"),a=B.start;@putByIdDirectPrivate(m,\"started\",0),@promiseInvokeOrNoopMethodNoCatch(B,a,[m]).@then(()=>{@putByIdDirectPrivate(m,\"started\",1),@assert(!@getByIdDirectPrivate(m,\"pulling\")),@assert(!@getByIdDirectPrivate(m,\"pullAgain\")),@readableStreamDefaultControllerCallPullIfNeeded(m)},(p)=>{@readableStreamDefaultControllerError(m,p)})})\n";
+const char* const s_readableStreamInternalsReadableStreamDefaultControllerStartCode = "(function (m){\"use strict\";if(@getByIdDirectPrivate(m,\"started\")!==-1)return;const p=@getByIdDirectPrivate(m,\"underlyingSource\"),B=p.start;@putByIdDirectPrivate(m,\"started\",0),@promiseInvokeOrNoopMethodNoCatch(p,B,[m]).@then(()=>{@putByIdDirectPrivate(m,\"started\",1),@assert(!@getByIdDirectPrivate(m,\"pulling\")),@assert(!@getByIdDirectPrivate(m,\"pullAgain\")),@readableStreamDefaultControllerCallPullIfNeeded(m)},(a)=>{@readableStreamDefaultControllerError(m,a)})})\n";
// readableStreamPipeToWritableStream
const JSC::ConstructAbility s_readableStreamInternalsReadableStreamPipeToWritableStreamCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
@@ -1428,7 +1428,7 @@ const JSC::ConstructorKind s_readableStreamInternalsReadableStreamPipeToWritable
const JSC::ImplementationVisibility s_readableStreamInternalsReadableStreamPipeToWritableStreamCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
const int s_readableStreamInternalsReadableStreamPipeToWritableStreamCodeLength = 1631;
static const JSC::Intrinsic s_readableStreamInternalsReadableStreamPipeToWritableStreamCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_readableStreamInternalsReadableStreamPipeToWritableStreamCode = "(function (f,E,z,B,F,D){\"use strict\";if(@assert(@isReadableStream(f)),@assert(@isWritableStream(E)),@assert(!@isReadableStreamLocked(f)),@assert(!@isWritableStreamLocked(E)),@assert(D===@undefined||@isAbortSignal(D)),@getByIdDirectPrivate(f,\"underlyingByteSource\")!==@undefined)return @Promise.@reject(\"Piping to a readable bytestream is not supported\");let _={source:f,destination:E,preventAbort:B,preventCancel:F,preventClose:z,signal:D};if(_.reader=@acquireReadableStreamDefaultReader(f),_.writer=@acquireWritableStreamDefaultWriter(E),@putByIdDirectPrivate(f,\"disturbed\",!0),_.finalized=!1,_.shuttingDown=!1,_.promiseCapability=@newPromiseCapability(@Promise),_.pendingReadPromiseCapability=@newPromiseCapability(@Promise),_.pendingReadPromiseCapability.@resolve.@call(),_.pendingWritePromise=@Promise.@resolve(),D!==@undefined){const G=(T)=>{if(_.finalized)return;@pipeToShutdownWithAction(_,()=>{const H=!_.preventAbort&&@getByIdDirectPrivate(_.destination,\"state\")===\"writable\"\?@writableStreamAbort(_.destination,T):@Promise.@resolve(),I=!_.preventCancel&&@getByIdDirectPrivate(_.source,\"state\")===@streamReadable\?@readableStreamCancel(_.source,T):@Promise.@resolve();let k=@newPromiseCapability(@Promise),q=!0,w=()=>{if(q){q=!1;return}k.@resolve.@call()},x=(J)=>{k.@reject.@call(@undefined,J)};return H.@then(w,x),I.@then(w,x),k.@promise},T)};if(@whenSignalAborted(D,G))return _.promiseCapability.@promise}return @pipeToErrorsMustBePropagatedForward(_),@pipeToErrorsMustBePropagatedBackward(_),@pipeToClosingMustBePropagatedForward(_),@pipeToClosingMustBePropagatedBackward(_),@pipeToLoop(_),_.promiseCapability.@promise})\n";
+const char* const s_readableStreamInternalsReadableStreamPipeToWritableStreamCode = "(function (D,E,T,w,x,z){\"use strict\";if(@assert(@isReadableStream(D)),@assert(@isWritableStream(E)),@assert(!@isReadableStreamLocked(D)),@assert(!@isWritableStreamLocked(E)),@assert(z===@undefined||@isAbortSignal(z)),@getByIdDirectPrivate(D,\"underlyingByteSource\")!==@undefined)return @Promise.@reject(\"Piping to a readable bytestream is not supported\");let B={source:D,destination:E,preventAbort:w,preventCancel:x,preventClose:T,signal:z};if(B.reader=@acquireReadableStreamDefaultReader(D),B.writer=@acquireWritableStreamDefaultWriter(E),@putByIdDirectPrivate(D,\"disturbed\",!0),B.finalized=!1,B.shuttingDown=!1,B.promiseCapability=@newPromiseCapability(@Promise),B.pendingReadPromiseCapability=@newPromiseCapability(@Promise),B.pendingReadPromiseCapability.@resolve.@call(),B.pendingWritePromise=@Promise.@resolve(),z!==@undefined){const F=(G)=>{if(B.finalized)return;@pipeToShutdownWithAction(B,()=>{const _=!B.preventAbort&&@getByIdDirectPrivate(B.destination,\"state\")===\"writable\"\?@writableStreamAbort(B.destination,G):@Promise.@resolve(),k=!B.preventCancel&&@getByIdDirectPrivate(B.source,\"state\")===@streamReadable\?@readableStreamCancel(B.source,G):@Promise.@resolve();let q=@newPromiseCapability(@Promise),I=!0,J=()=>{if(I){I=!1;return}q.@resolve.@call()},K=(L)=>{q.@reject.@call(@undefined,L)};return _.@then(J,K),k.@then(J,K),q.@promise},G)};if(@whenSignalAborted(z,F))return B.promiseCapability.@promise}return @pipeToErrorsMustBePropagatedForward(B),@pipeToErrorsMustBePropagatedBackward(B),@pipeToClosingMustBePropagatedForward(B),@pipeToClosingMustBePropagatedBackward(B),@pipeToLoop(B),B.promiseCapability.@promise})\n";
// pipeToLoop
const JSC::ConstructAbility s_readableStreamInternalsPipeToLoopCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
@@ -1444,7 +1444,7 @@ const JSC::ConstructorKind s_readableStreamInternalsPipeToDoReadWriteCodeConstru
const JSC::ImplementationVisibility s_readableStreamInternalsPipeToDoReadWriteCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
const int s_readableStreamInternalsPipeToDoReadWriteCodeLength = 731;
static const JSC::Intrinsic s_readableStreamInternalsPipeToDoReadWriteCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_readableStreamInternalsPipeToDoReadWriteCode = "(function (_){\"use strict\";return @assert(!_.shuttingDown),_.pendingReadPromiseCapability=@newPromiseCapability(@Promise),@getByIdDirectPrivate(_.writer,\"readyPromise\").@promise.@then(()=>{if(_.shuttingDown){_.pendingReadPromiseCapability.@resolve.@call(@undefined,!1);return}@readableStreamDefaultReaderRead(_.reader).@then((m)=>{const d=!m.done&&@getByIdDirectPrivate(_.writer,\"stream\")!==@undefined;if(_.pendingReadPromiseCapability.@resolve.@call(@undefined,d),!d)return;_.pendingWritePromise=@writableStreamDefaultWriterWrite(_.writer,m.value)},(m)=>{_.pendingReadPromiseCapability.@resolve.@call(@undefined,!1)})},(m)=>{_.pendingReadPromiseCapability.@resolve.@call(@undefined,!1)}),_.pendingReadPromiseCapability.@promise})\n";
+const char* const s_readableStreamInternalsPipeToDoReadWriteCode = "(function (_){\"use strict\";return @assert(!_.shuttingDown),_.pendingReadPromiseCapability=@newPromiseCapability(@Promise),@getByIdDirectPrivate(_.writer,\"readyPromise\").@promise.@then(()=>{if(_.shuttingDown){_.pendingReadPromiseCapability.@resolve.@call(@undefined,!1);return}@readableStreamDefaultReaderRead(_.reader).@then((d)=>{const m=!d.done&&@getByIdDirectPrivate(_.writer,\"stream\")!==@undefined;if(_.pendingReadPromiseCapability.@resolve.@call(@undefined,m),!m)return;_.pendingWritePromise=@writableStreamDefaultWriterWrite(_.writer,d.value)},(d)=>{_.pendingReadPromiseCapability.@resolve.@call(@undefined,!1)})},(d)=>{_.pendingReadPromiseCapability.@resolve.@call(@undefined,!1)}),_.pendingReadPromiseCapability.@promise})\n";
// pipeToErrorsMustBePropagatedForward
const JSC::ConstructAbility s_readableStreamInternalsPipeToErrorsMustBePropagatedForwardCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
@@ -1452,7 +1452,7 @@ const JSC::ConstructorKind s_readableStreamInternalsPipeToErrorsMustBePropagated
const JSC::ImplementationVisibility s_readableStreamInternalsPipeToErrorsMustBePropagatedForwardCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
const int s_readableStreamInternalsPipeToErrorsMustBePropagatedForwardCodeLength = 438;
static const JSC::Intrinsic s_readableStreamInternalsPipeToErrorsMustBePropagatedForwardCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_readableStreamInternalsPipeToErrorsMustBePropagatedForwardCode = "(function (_){\"use strict\";const d=()=>{_.pendingReadPromiseCapability.@resolve.@call(@undefined,!1);const b=@getByIdDirectPrivate(_.source,\"storedError\");if(!_.preventAbort){@pipeToShutdownWithAction(_,()=>@writableStreamAbort(_.destination,b),b);return}@pipeToShutdown(_,b)};if(@getByIdDirectPrivate(_.source,\"state\")===@streamErrored){d();return}@getByIdDirectPrivate(_.reader,\"closedPromiseCapability\").@promise.@then(@undefined,d)})\n";
+const char* const s_readableStreamInternalsPipeToErrorsMustBePropagatedForwardCode = "(function (d){\"use strict\";const _=()=>{d.pendingReadPromiseCapability.@resolve.@call(@undefined,!1);const b=@getByIdDirectPrivate(d.source,\"storedError\");if(!d.preventAbort){@pipeToShutdownWithAction(d,()=>@writableStreamAbort(d.destination,b),b);return}@pipeToShutdown(d,b)};if(@getByIdDirectPrivate(d.source,\"state\")===@streamErrored){_();return}@getByIdDirectPrivate(d.reader,\"closedPromiseCapability\").@promise.@then(@undefined,_)})\n";
// pipeToErrorsMustBePropagatedBackward
const JSC::ConstructAbility s_readableStreamInternalsPipeToErrorsMustBePropagatedBackwardCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
@@ -1460,7 +1460,7 @@ const JSC::ConstructorKind s_readableStreamInternalsPipeToErrorsMustBePropagated
const JSC::ImplementationVisibility s_readableStreamInternalsPipeToErrorsMustBePropagatedBackwardCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
const int s_readableStreamInternalsPipeToErrorsMustBePropagatedBackwardCodeLength = 369;
static const JSC::Intrinsic s_readableStreamInternalsPipeToErrorsMustBePropagatedBackwardCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_readableStreamInternalsPipeToErrorsMustBePropagatedBackwardCode = "(function (m){\"use strict\";const y=()=>{const h=@getByIdDirectPrivate(m.destination,\"storedError\");if(!m.preventCancel){@pipeToShutdownWithAction(m,()=>@readableStreamCancel(m.source,h),h);return}@pipeToShutdown(m,h)};if(@getByIdDirectPrivate(m.destination,\"state\")===\"errored\"){y();return}@getByIdDirectPrivate(m.writer,\"closedPromise\").@promise.@then(@undefined,y)})\n";
+const char* const s_readableStreamInternalsPipeToErrorsMustBePropagatedBackwardCode = "(function (m){\"use strict\";const h=()=>{const y=@getByIdDirectPrivate(m.destination,\"storedError\");if(!m.preventCancel){@pipeToShutdownWithAction(m,()=>@readableStreamCancel(m.source,y),y);return}@pipeToShutdown(m,y)};if(@getByIdDirectPrivate(m.destination,\"state\")===\"errored\"){h();return}@getByIdDirectPrivate(m.writer,\"closedPromise\").@promise.@then(@undefined,h)})\n";
// pipeToClosingMustBePropagatedForward
const JSC::ConstructAbility s_readableStreamInternalsPipeToClosingMustBePropagatedForwardCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
@@ -1484,7 +1484,7 @@ const JSC::ConstructorKind s_readableStreamInternalsPipeToShutdownWithActionCode
const JSC::ImplementationVisibility s_readableStreamInternalsPipeToShutdownWithActionCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
const int s_readableStreamInternalsPipeToShutdownWithActionCodeLength = 458;
static const JSC::Intrinsic s_readableStreamInternalsPipeToShutdownWithActionCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_readableStreamInternalsPipeToShutdownWithActionCode = "(function (_,d){\"use strict\";if(_.shuttingDown)return;_.shuttingDown=!0;const g=arguments.length>2,h=arguments[2],m=()=>{d().@then(()=>{if(g)@pipeToFinalize(_,h);else @pipeToFinalize(_)},(j)=>{@pipeToFinalize(_,j)})};if(@getByIdDirectPrivate(_.destination,\"state\")===\"writable\"&&!@writableStreamCloseQueuedOrInFlight(_.destination)){_.pendingReadPromiseCapability.@promise.@then(()=>{_.pendingWritePromise.@then(m,m)},(b)=>@pipeToFinalize(_,b));return}m()})\n";
+const char* const s_readableStreamInternalsPipeToShutdownWithActionCode = "(function (_,h){\"use strict\";if(_.shuttingDown)return;_.shuttingDown=!0;const b=arguments.length>2,d=arguments[2],m=()=>{h().@then(()=>{if(b)@pipeToFinalize(_,d);else @pipeToFinalize(_)},(j)=>{@pipeToFinalize(_,j)})};if(@getByIdDirectPrivate(_.destination,\"state\")===\"writable\"&&!@writableStreamCloseQueuedOrInFlight(_.destination)){_.pendingReadPromiseCapability.@promise.@then(()=>{_.pendingWritePromise.@then(m,m)},(g)=>@pipeToFinalize(_,g));return}m()})\n";
// pipeToShutdown
const JSC::ConstructAbility s_readableStreamInternalsPipeToShutdownCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
@@ -1492,7 +1492,7 @@ const JSC::ConstructorKind s_readableStreamInternalsPipeToShutdownCodeConstructo
const JSC::ImplementationVisibility s_readableStreamInternalsPipeToShutdownCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
const int s_readableStreamInternalsPipeToShutdownCodeLength = 411;
static const JSC::Intrinsic s_readableStreamInternalsPipeToShutdownCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_readableStreamInternalsPipeToShutdownCode = "(function (_){\"use strict\";if(_.shuttingDown)return;_.shuttingDown=!0;const m=arguments.length>1,u=arguments[1],d=()=>{if(m)@pipeToFinalize(_,u);else @pipeToFinalize(_)};if(@getByIdDirectPrivate(_.destination,\"state\")===\"writable\"&&!@writableStreamCloseQueuedOrInFlight(_.destination)){_.pendingReadPromiseCapability.@promise.@then(()=>{_.pendingWritePromise.@then(d,d)},(I)=>@pipeToFinalize(_,I));return}d()})\n";
+const char* const s_readableStreamInternalsPipeToShutdownCode = "(function (_){\"use strict\";if(_.shuttingDown)return;_.shuttingDown=!0;const d=arguments.length>1,m=arguments[1],u=()=>{if(d)@pipeToFinalize(_,m);else @pipeToFinalize(_)};if(@getByIdDirectPrivate(_.destination,\"state\")===\"writable\"&&!@writableStreamCloseQueuedOrInFlight(_.destination)){_.pendingReadPromiseCapability.@promise.@then(()=>{_.pendingWritePromise.@then(u,u)},(I)=>@pipeToFinalize(_,I));return}u()})\n";
// pipeToFinalize
const JSC::ConstructAbility s_readableStreamInternalsPipeToFinalizeCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
@@ -1508,7 +1508,7 @@ const JSC::ConstructorKind s_readableStreamInternalsReadableStreamTeeCodeConstru
const JSC::ImplementationVisibility s_readableStreamInternalsReadableStreamTeeCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
const int s_readableStreamInternalsReadableStreamTeeCodeLength = 1104;
static const JSC::Intrinsic s_readableStreamInternalsReadableStreamTeeCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_readableStreamInternalsReadableStreamTeeCode = "(function (_,q){\"use strict\";@assert(@isReadableStream(_)),@assert(typeof q===\"boolean\");var v=@getByIdDirectPrivate(_,\"start\");if(v)@putByIdDirectPrivate(_,\"start\",@undefined),v();const w=new @ReadableStreamDefaultReader(_),i={closedOrErrored:!1,canceled1:!1,canceled2:!1,reason1:@undefined,reason2:@undefined};i.cancelPromiseCapability=@newPromiseCapability(@Promise);const x=@readableStreamTeePullFunction(i,w,q),f={};@putByIdDirectPrivate(f,\"pull\",x),@putByIdDirectPrivate(f,\"cancel\",@readableStreamTeeBranch1CancelFunction(i,_));const g={};@putByIdDirectPrivate(g,\"pull\",x),@putByIdDirectPrivate(g,\"cancel\",@readableStreamTeeBranch2CancelFunction(i,_));const j=new @ReadableStream(f),k=new @ReadableStream(g);return @getByIdDirectPrivate(w,\"closedPromiseCapability\").@promise.@then(@undefined,function(y){if(i.closedOrErrored)return;if(@readableStreamDefaultControllerError(j.@readableStreamController,y),@readableStreamDefaultControllerError(k.@readableStreamController,y),i.closedOrErrored=!0,!i.canceled1||!i.canceled2)i.cancelPromiseCapability.@resolve.@call()}),i.branch1=j,i.branch2=k,[j,k]})\n";
+const char* const s_readableStreamInternalsReadableStreamTeeCode = "(function (i,q){\"use strict\";@assert(@isReadableStream(i)),@assert(typeof q===\"boolean\");var v=@getByIdDirectPrivate(i,\"start\");if(v)@putByIdDirectPrivate(i,\"start\",@undefined),v();const k=new @ReadableStreamDefaultReader(i),_={closedOrErrored:!1,canceled1:!1,canceled2:!1,reason1:@undefined,reason2:@undefined};_.cancelPromiseCapability=@newPromiseCapability(@Promise);const w=@readableStreamTeePullFunction(_,k,q),f={};@putByIdDirectPrivate(f,\"pull\",w),@putByIdDirectPrivate(f,\"cancel\",@readableStreamTeeBranch1CancelFunction(_,i));const x={};@putByIdDirectPrivate(x,\"pull\",w),@putByIdDirectPrivate(x,\"cancel\",@readableStreamTeeBranch2CancelFunction(_,i));const y=new @ReadableStream(f),g=new @ReadableStream(x);return @getByIdDirectPrivate(k,\"closedPromiseCapability\").@promise.@then(@undefined,function(j){if(_.closedOrErrored)return;if(@readableStreamDefaultControllerError(y.@readableStreamController,j),@readableStreamDefaultControllerError(g.@readableStreamController,j),_.closedOrErrored=!0,!_.canceled1||!_.canceled2)_.cancelPromiseCapability.@resolve.@call()}),_.branch1=y,_.branch2=g,[y,g]})\n";
// readableStreamTeePullFunction
const JSC::ConstructAbility s_readableStreamInternalsReadableStreamTeePullFunctionCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
@@ -1516,7 +1516,7 @@ const JSC::ConstructorKind s_readableStreamInternalsReadableStreamTeePullFunctio
const JSC::ImplementationVisibility s_readableStreamInternalsReadableStreamTeePullFunctionCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
const int s_readableStreamInternalsReadableStreamTeePullFunctionCodeLength = 764;
static const JSC::Intrinsic s_readableStreamInternalsReadableStreamTeePullFunctionCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_readableStreamInternalsReadableStreamTeePullFunctionCode = "(function (i,f,m){\"use strict\";return function(){@Promise.prototype.@then.@call(@readableStreamDefaultReaderRead(f),function(_){if(@assert(@isObject(_)),@assert(typeof _.done===\"boolean\"),_.done&&!i.closedOrErrored){if(!i.canceled1)@readableStreamDefaultControllerClose(i.branch1.@readableStreamController);if(!i.canceled2)@readableStreamDefaultControllerClose(i.branch2.@readableStreamController);if(i.closedOrErrored=!0,!i.canceled1||!i.canceled2)i.cancelPromiseCapability.@resolve.@call()}if(i.closedOrErrored)return;if(!i.canceled1)@readableStreamDefaultControllerEnqueue(i.branch1.@readableStreamController,_.value);if(!i.canceled2)@readableStreamDefaultControllerEnqueue(i.branch2.@readableStreamController,m\?@structuredCloneForStream(_.value):_.value)})}})\n";
+const char* const s_readableStreamInternalsReadableStreamTeePullFunctionCode = "(function (_,m,f){\"use strict\";return function(){@Promise.prototype.@then.@call(@readableStreamDefaultReaderRead(m),function(i){if(@assert(@isObject(i)),@assert(typeof i.done===\"boolean\"),i.done&&!_.closedOrErrored){if(!_.canceled1)@readableStreamDefaultControllerClose(_.branch1.@readableStreamController);if(!_.canceled2)@readableStreamDefaultControllerClose(_.branch2.@readableStreamController);if(_.closedOrErrored=!0,!_.canceled1||!_.canceled2)_.cancelPromiseCapability.@resolve.@call()}if(_.closedOrErrored)return;if(!_.canceled1)@readableStreamDefaultControllerEnqueue(_.branch1.@readableStreamController,i.value);if(!_.canceled2)@readableStreamDefaultControllerEnqueue(_.branch2.@readableStreamController,f\?@structuredCloneForStream(i.value):i.value)})}})\n";
// readableStreamTeeBranch1CancelFunction
const JSC::ConstructAbility s_readableStreamInternalsReadableStreamTeeBranch1CancelFunctionCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
@@ -1524,7 +1524,7 @@ const JSC::ConstructorKind s_readableStreamInternalsReadableStreamTeeBranch1Canc
const JSC::ImplementationVisibility s_readableStreamInternalsReadableStreamTeeBranch1CancelFunctionCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
const int s_readableStreamInternalsReadableStreamTeeBranch1CancelFunctionCodeLength = 258;
static const JSC::Intrinsic s_readableStreamInternalsReadableStreamTeeBranch1CancelFunctionCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_readableStreamInternalsReadableStreamTeeBranch1CancelFunctionCode = "(function (c,d){\"use strict\";return function(i){if(c.canceled1=!0,c.reason1=i,c.canceled2)@readableStreamCancel(d,[c.reason1,c.reason2]).@then(c.cancelPromiseCapability.@resolve,c.cancelPromiseCapability.@reject);return c.cancelPromiseCapability.@promise}})\n";
+const char* const s_readableStreamInternalsReadableStreamTeeBranch1CancelFunctionCode = "(function (c,i){\"use strict\";return function(d){if(c.canceled1=!0,c.reason1=d,c.canceled2)@readableStreamCancel(i,[c.reason1,c.reason2]).@then(c.cancelPromiseCapability.@resolve,c.cancelPromiseCapability.@reject);return c.cancelPromiseCapability.@promise}})\n";
// readableStreamTeeBranch2CancelFunction
const JSC::ConstructAbility s_readableStreamInternalsReadableStreamTeeBranch2CancelFunctionCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
@@ -1532,7 +1532,7 @@ const JSC::ConstructorKind s_readableStreamInternalsReadableStreamTeeBranch2Canc
const JSC::ImplementationVisibility s_readableStreamInternalsReadableStreamTeeBranch2CancelFunctionCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
const int s_readableStreamInternalsReadableStreamTeeBranch2CancelFunctionCodeLength = 258;
static const JSC::Intrinsic s_readableStreamInternalsReadableStreamTeeBranch2CancelFunctionCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_readableStreamInternalsReadableStreamTeeBranch2CancelFunctionCode = "(function (c,d){\"use strict\";return function(i){if(c.canceled2=!0,c.reason2=i,c.canceled1)@readableStreamCancel(d,[c.reason1,c.reason2]).@then(c.cancelPromiseCapability.@resolve,c.cancelPromiseCapability.@reject);return c.cancelPromiseCapability.@promise}})\n";
+const char* const s_readableStreamInternalsReadableStreamTeeBranch2CancelFunctionCode = "(function (c,i){\"use strict\";return function(d){if(c.canceled2=!0,c.reason2=d,c.canceled1)@readableStreamCancel(i,[c.reason1,c.reason2]).@then(c.cancelPromiseCapability.@resolve,c.cancelPromiseCapability.@reject);return c.cancelPromiseCapability.@promise}})\n";
// isReadableStream
const JSC::ConstructAbility s_readableStreamInternalsIsReadableStreamCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
@@ -1564,7 +1564,7 @@ const JSC::ConstructorKind s_readableStreamInternalsReadDirectStreamCodeConstruc
const JSC::ImplementationVisibility s_readableStreamInternalsReadDirectStreamCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
const int s_readableStreamInternalsReadDirectStreamCodeLength = 900;
static const JSC::Intrinsic s_readableStreamInternalsReadDirectStreamCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_readableStreamInternalsReadDirectStreamCode = "(function (j,q,_){\"use strict\";@putByIdDirectPrivate(j,\"underlyingSource\",@undefined),@putByIdDirectPrivate(j,\"start\",@undefined);function w(f,v){if(v&&_\?.cancel){try{var A=_.cancel(v);@markPromiseAsHandled(A)}catch(B){}_=@undefined}if(f){if(@putByIdDirectPrivate(f,\"readableStreamController\",@undefined),@putByIdDirectPrivate(f,\"reader\",@undefined),v)@putByIdDirectPrivate(f,\"state\",@streamErrored),@putByIdDirectPrivate(f,\"storedError\",v);else @putByIdDirectPrivate(f,\"state\",@streamClosed);f=@undefined}}if(!_.pull){w();return}if(!@isCallable(_.pull)){w(),@throwTypeError(\"pull is not a function\");return}@putByIdDirectPrivate(j,\"readableStreamController\",q);const x=@getByIdDirectPrivate(j,\"highWaterMark\");q.start({highWaterMark:!x||x<64\?64:x}),@startDirectStream.@call(q,j,_.pull,w),@putByIdDirectPrivate(j,\"reader\",{});var z=_.pull(q);if(q=@undefined,z&&@isPromise(z))return z.@then(()=>{})})\n";
+const char* const s_readableStreamInternalsReadDirectStreamCode = "(function (_,f,j){\"use strict\";@putByIdDirectPrivate(_,\"underlyingSource\",@undefined),@putByIdDirectPrivate(_,\"start\",@undefined);function q(x,z){if(z&&j\?.cancel){try{var A=j.cancel(z);@markPromiseAsHandled(A)}catch(B){}j=@undefined}if(x){if(@putByIdDirectPrivate(x,\"readableStreamController\",@undefined),@putByIdDirectPrivate(x,\"reader\",@undefined),z)@putByIdDirectPrivate(x,\"state\",@streamErrored),@putByIdDirectPrivate(x,\"storedError\",z);else @putByIdDirectPrivate(x,\"state\",@streamClosed);x=@undefined}}if(!j.pull){q();return}if(!@isCallable(j.pull)){q(),@throwTypeError(\"pull is not a function\");return}@putByIdDirectPrivate(_,\"readableStreamController\",f);const v=@getByIdDirectPrivate(_,\"highWaterMark\");f.start({highWaterMark:!v||v<64\?64:v}),@startDirectStream.@call(f,_,j.pull,q),@putByIdDirectPrivate(_,\"reader\",{});var w=j.pull(f);if(f=@undefined,w&&@isPromise(w))return w.@then(()=>{})})\n";
// assignToStream
const JSC::ConstructAbility s_readableStreamInternalsAssignToStreamCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
@@ -1580,7 +1580,7 @@ const JSC::ConstructorKind s_readableStreamInternalsReadStreamIntoSinkCodeConstr
const JSC::ImplementationVisibility s_readableStreamInternalsReadStreamIntoSinkCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
const int s_readableStreamInternalsReadStreamIntoSinkCodeLength = 1395;
static const JSC::Intrinsic s_readableStreamInternalsReadStreamIntoSinkCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_readableStreamInternalsReadStreamIntoSinkCode = "(async function (_,c,E){\"use strict\";var x=!1,B=!1;try{var I=_.getReader(),f=I.readMany();if(f&&@isPromise(f))f=await f;if(f.done)return x=!0,c.end();var K=f.value.length;const q=@getByIdDirectPrivate(_,\"highWaterMark\");if(E)@startDirectStream.@call(c,_,@undefined,()=>!B&&@markPromiseAsHandled(_.cancel()));c.start({highWaterMark:q||0});for(var D=0,F=f.value,G=f.value.length;D<G;D++)c.write(F[D]);var A=@getByIdDirectPrivate(_,\"state\");if(A===@streamClosed)return x=!0,c.end();while(!0){var{value:H,done:J}=await I.read();if(J)return x=!0,c.end();c.write(H)}}catch(q){B=!0;try{I=@undefined;const z=_.cancel(q);@markPromiseAsHandled(z)}catch(z){}if(c&&!x){x=!0;try{c.close(q)}catch(z){throw new globalThis.AggregateError([q,z])}}throw q}finally{if(I){try{I.releaseLock()}catch(z){}I=@undefined}c=@undefined;var A=@getByIdDirectPrivate(_,\"state\");if(_){var P=@getByIdDirectPrivate(_,\"readableStreamController\");if(P){if(@getByIdDirectPrivate(P,\"underlyingSource\"))@putByIdDirectPrivate(P,\"underlyingSource\",@undefined);if(@getByIdDirectPrivate(P,\"controlledReadableStream\"))@putByIdDirectPrivate(P,\"controlledReadableStream\",@undefined);if(@putByIdDirectPrivate(_,\"readableStreamController\",null),@getByIdDirectPrivate(_,\"underlyingSource\"))@putByIdDirectPrivate(_,\"underlyingSource\",@undefined);P=@undefined}if(!B&&A!==@streamClosed&&A!==@streamErrored)@readableStreamClose(_);_=@undefined}}})\n";
+const char* const s_readableStreamInternalsReadStreamIntoSinkCode = "(async function (_,D,c){\"use strict\";var f=!1,x=!1;try{var B=_.getReader(),E=B.readMany();if(E&&@isPromise(E))E=await E;if(E.done)return f=!0,D.end();var F=E.value.length;const q=@getByIdDirectPrivate(_,\"highWaterMark\");if(c)@startDirectStream.@call(D,_,@undefined,()=>!x&&@markPromiseAsHandled(_.cancel()));D.start({highWaterMark:q||0});for(var G=0,I=E.value,H=E.value.length;G<H;G++)D.write(I[G]);var J=@getByIdDirectPrivate(_,\"state\");if(J===@streamClosed)return f=!0,D.end();while(!0){var{value:P,done:z}=await B.read();if(z)return f=!0,D.end();D.write(P)}}catch(q){x=!0;try{B=@undefined;const K=_.cancel(q);@markPromiseAsHandled(K)}catch(K){}if(D&&!f){f=!0;try{D.close(q)}catch(K){throw new globalThis.AggregateError([q,K])}}throw q}finally{if(B){try{B.releaseLock()}catch(K){}B=@undefined}D=@undefined;var J=@getByIdDirectPrivate(_,\"state\");if(_){var A=@getByIdDirectPrivate(_,\"readableStreamController\");if(A){if(@getByIdDirectPrivate(A,\"underlyingSource\"))@putByIdDirectPrivate(A,\"underlyingSource\",@undefined);if(@getByIdDirectPrivate(A,\"controlledReadableStream\"))@putByIdDirectPrivate(A,\"controlledReadableStream\",@undefined);if(@putByIdDirectPrivate(_,\"readableStreamController\",null),@getByIdDirectPrivate(_,\"underlyingSource\"))@putByIdDirectPrivate(_,\"underlyingSource\",@undefined);A=@undefined}if(!x&&J!==@streamClosed&&J!==@streamErrored)@readableStreamClose(_);_=@undefined}}})\n";
// handleDirectStreamError
const JSC::ConstructAbility s_readableStreamInternalsHandleDirectStreamErrorCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
@@ -1588,7 +1588,7 @@ const JSC::ConstructorKind s_readableStreamInternalsHandleDirectStreamErrorCodeC
const JSC::ImplementationVisibility s_readableStreamInternalsHandleDirectStreamErrorCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
const int s_readableStreamInternalsHandleDirectStreamErrorCodeLength = 496;
static const JSC::Intrinsic s_readableStreamInternalsHandleDirectStreamErrorCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_readableStreamInternalsHandleDirectStreamErrorCode = "(function (u){\"use strict\";var i=this,_=i.@sink;if(_){@putByIdDirectPrivate(i,\"sink\",@undefined);try{_.close(u)}catch(a){}}if(this.error=this.flush=this.write=this.close=this.end=@onReadableStreamDirectControllerClosed,typeof this.@underlyingSource.close===\"function\")try{this.@underlyingSource.close.@call(this.@underlyingSource,u)}catch(a){}try{var h=i._pendingRead;if(h)i._pendingRead=@undefined,@rejectPromise(h,u)}catch(a){}var R=i.@controlledReadableStream;if(R)@readableStreamError(R,u)})\n";
+const char* const s_readableStreamInternalsHandleDirectStreamErrorCode = "(function (R){\"use strict\";var a=this,h=a.@sink;if(h){@putByIdDirectPrivate(a,\"sink\",@undefined);try{h.close(R)}catch(i){}}if(this.error=this.flush=this.write=this.close=this.end=@onReadableStreamDirectControllerClosed,typeof this.@underlyingSource.close===\"function\")try{this.@underlyingSource.close.@call(this.@underlyingSource,R)}catch(i){}try{var _=a._pendingRead;if(_)a._pendingRead=@undefined,@rejectPromise(_,R)}catch(i){}var u=a.@controlledReadableStream;if(u)@readableStreamError(u,R)})\n";
// handleDirectStreamErrorReject
const JSC::ConstructAbility s_readableStreamInternalsHandleDirectStreamErrorRejectCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
@@ -1604,7 +1604,7 @@ const JSC::ConstructorKind s_readableStreamInternalsOnPullDirectStreamCodeConstr
const JSC::ImplementationVisibility s_readableStreamInternalsOnPullDirectStreamCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
const int s_readableStreamInternalsOnPullDirectStreamCodeLength = 785;
static const JSC::Intrinsic s_readableStreamInternalsOnPullDirectStreamCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_readableStreamInternalsOnPullDirectStreamCode = "(function (g){\"use strict\";var i=g.@controlledReadableStream;if(!i||@getByIdDirectPrivate(i,\"state\")!==@streamReadable)return;if(g._deferClose===-1)return;g._deferClose=-1,g._deferFlush=-1;var _,b;try{var y=g.@underlyingSource.pull(g);if(y&&@isPromise(y)){if(g._handleError===@undefined)g._handleError=@handleDirectStreamErrorReject.bind(g);@Promise.prototype.catch.@call(y,g._handleError)}}catch(k){return @handleDirectStreamErrorReject.@call(g,k)}finally{_=g._deferClose,b=g._deferFlush,g._deferFlush=g._deferClose=0}var h;if(g._pendingRead===@undefined)g._pendingRead=h=@newPromise();else h=@readableStreamAddReadRequest(i);if(_===1){var j=g._deferCloseReason;return g._deferCloseReason=@undefined,@onCloseDirectStream.@call(g,j),h}if(b===1)@onFlushDirectStream.@call(g);return h})\n";
+const char* const s_readableStreamInternalsOnPullDirectStreamCode = "(function (i){\"use strict\";var y=i.@controlledReadableStream;if(!y||@getByIdDirectPrivate(y,\"state\")!==@streamReadable)return;if(i._deferClose===-1)return;i._deferClose=-1,i._deferFlush=-1;var _,g;try{var b=i.@underlyingSource.pull(i);if(b&&@isPromise(b)){if(i._handleError===@undefined)i._handleError=@handleDirectStreamErrorReject.bind(i);@Promise.prototype.catch.@call(b,i._handleError)}}catch(h){return @handleDirectStreamErrorReject.@call(i,h)}finally{_=i._deferClose,g=i._deferFlush,i._deferFlush=i._deferClose=0}var j;if(i._pendingRead===@undefined)i._pendingRead=j=@newPromise();else j=@readableStreamAddReadRequest(y);if(_===1){var k=i._deferCloseReason;return i._deferCloseReason=@undefined,@onCloseDirectStream.@call(i,k),j}if(g===1)@onFlushDirectStream.@call(i);return j})\n";
// noopDoneFunction
const JSC::ConstructAbility s_readableStreamInternalsNoopDoneFunctionCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
@@ -1628,7 +1628,7 @@ const JSC::ConstructorKind s_readableStreamInternalsOnCloseDirectStreamCodeConst
const JSC::ImplementationVisibility s_readableStreamInternalsOnCloseDirectStreamCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
const int s_readableStreamInternalsOnCloseDirectStreamCodeLength = 1460;
static const JSC::Intrinsic s_readableStreamInternalsOnCloseDirectStreamCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_readableStreamInternalsOnCloseDirectStreamCode = "(function (S){\"use strict\";var c=this.@controlledReadableStream;if(!c||@getByIdDirectPrivate(c,\"state\")!==@streamReadable)return;if(this._deferClose!==0){this._deferClose=1,this._deferCloseReason=S;return}if(@putByIdDirectPrivate(c,\"state\",@streamClosing),typeof this.@underlyingSource.close===\"function\")try{this.@underlyingSource.close.@call(this.@underlyingSource,S)}catch(b){}var v;try{v=this.@sink.end(),@putByIdDirectPrivate(this,\"sink\",@undefined)}catch(b){if(this._pendingRead){var y=this._pendingRead;this._pendingRead=@undefined,@rejectPromise(y,b)}@readableStreamError(c,b);return}this.error=this.flush=this.write=this.close=this.end=@onReadableStreamDirectControllerClosed;var B=@getByIdDirectPrivate(c,\"reader\");if(B&&@isReadableStreamDefaultReader(B)){var C=this._pendingRead;if(C&&@isPromise(C)&&v\?.byteLength){this._pendingRead=@undefined,@fulfillPromise(C,{value:v,done:!1}),@readableStreamClose(c);return}}if(v\?.byteLength){var j=@getByIdDirectPrivate(B,\"readRequests\");if(j\?.isNotEmpty()){@readableStreamFulfillReadRequest(c,v,!1),@readableStreamClose(c);return}@putByIdDirectPrivate(c,\"state\",@streamReadable),this.@pull=()=>{var b=@createFulfilledPromise({value:v,done:!1});return v=@undefined,@readableStreamClose(c),c=@undefined,b}}else if(this._pendingRead){var y=this._pendingRead;this._pendingRead=@undefined,@putByIdDirectPrivate(this,\"pull\",@noopDoneFunction),@fulfillPromise(y,{value:@undefined,done:!0})}@readableStreamClose(c)})\n";
+const char* const s_readableStreamInternalsOnCloseDirectStreamCode = "(function (v){\"use strict\";var b=this.@controlledReadableStream;if(!b||@getByIdDirectPrivate(b,\"state\")!==@streamReadable)return;if(this._deferClose!==0){this._deferClose=1,this._deferCloseReason=v;return}if(@putByIdDirectPrivate(b,\"state\",@streamClosing),typeof this.@underlyingSource.close===\"function\")try{this.@underlyingSource.close.@call(this.@underlyingSource,v)}catch(j){}var y;try{y=this.@sink.end(),@putByIdDirectPrivate(this,\"sink\",@undefined)}catch(j){if(this._pendingRead){var B=this._pendingRead;this._pendingRead=@undefined,@rejectPromise(B,j)}@readableStreamError(b,j);return}this.error=this.flush=this.write=this.close=this.end=@onReadableStreamDirectControllerClosed;var C=@getByIdDirectPrivate(b,\"reader\");if(C&&@isReadableStreamDefaultReader(C)){var c=this._pendingRead;if(c&&@isPromise(c)&&y\?.byteLength){this._pendingRead=@undefined,@fulfillPromise(c,{value:y,done:!1}),@readableStreamClose(b);return}}if(y\?.byteLength){var S=@getByIdDirectPrivate(C,\"readRequests\");if(S\?.isNotEmpty()){@readableStreamFulfillReadRequest(b,y,!1),@readableStreamClose(b);return}@putByIdDirectPrivate(b,\"state\",@streamReadable),this.@pull=()=>{var j=@createFulfilledPromise({value:y,done:!1});return y=@undefined,@readableStreamClose(b),b=@undefined,j}}else if(this._pendingRead){var B=this._pendingRead;this._pendingRead=@undefined,@putByIdDirectPrivate(this,\"pull\",@noopDoneFunction),@fulfillPromise(B,{value:@undefined,done:!0})}@readableStreamClose(b)})\n";
// onFlushDirectStream
const JSC::ConstructAbility s_readableStreamInternalsOnFlushDirectStreamCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
@@ -1636,7 +1636,7 @@ const JSC::ConstructorKind s_readableStreamInternalsOnFlushDirectStreamCodeConst
const JSC::ImplementationVisibility s_readableStreamInternalsOnFlushDirectStreamCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
const int s_readableStreamInternalsOnFlushDirectStreamCodeLength = 591;
static const JSC::Intrinsic s_readableStreamInternalsOnFlushDirectStreamCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_readableStreamInternalsOnFlushDirectStreamCode = "(function (){\"use strict\";var B=this.@controlledReadableStream,i=@getByIdDirectPrivate(B,\"reader\");if(!i||!@isReadableStreamDefaultReader(i))return;var b=this._pendingRead;if(this._pendingRead=@undefined,b&&@isPromise(b)){var c=this.@sink.flush();if(c\?.byteLength)this._pendingRead=@getByIdDirectPrivate(B,\"readRequests\")\?.shift(),@fulfillPromise(b,{value:c,done:!1});else this._pendingRead=b}else if(@getByIdDirectPrivate(B,\"readRequests\")\?.isNotEmpty()){var c=this.@sink.flush();if(c\?.byteLength)@readableStreamFulfillReadRequest(B,c,!1)}else if(this._deferFlush===-1)this._deferFlush=1})\n";
+const char* const s_readableStreamInternalsOnFlushDirectStreamCode = "(function (){\"use strict\";var c=this.@controlledReadableStream,i=@getByIdDirectPrivate(c,\"reader\");if(!i||!@isReadableStreamDefaultReader(i))return;var B=this._pendingRead;if(this._pendingRead=@undefined,B&&@isPromise(B)){var b=this.@sink.flush();if(b\?.byteLength)this._pendingRead=@getByIdDirectPrivate(c,\"readRequests\")\?.shift(),@fulfillPromise(B,{value:b,done:!1});else this._pendingRead=B}else if(@getByIdDirectPrivate(c,\"readRequests\")\?.isNotEmpty()){var b=this.@sink.flush();if(b\?.byteLength)@readableStreamFulfillReadRequest(c,b,!1)}else if(this._deferFlush===-1)this._deferFlush=1})\n";
// createTextStream
const JSC::ConstructAbility s_readableStreamInternalsCreateTextStreamCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
@@ -1644,7 +1644,7 @@ const JSC::ConstructorKind s_readableStreamInternalsCreateTextStreamCodeConstruc
const JSC::ImplementationVisibility s_readableStreamInternalsCreateTextStreamCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
const int s_readableStreamInternalsCreateTextStreamCodeLength = 984;
static const JSC::Intrinsic s_readableStreamInternalsCreateTextStreamCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_readableStreamInternalsCreateTextStreamCode = "(function (G){\"use strict\";var q,v=[],x=!1,z=!1,j=\"\",C=@toLength(0),F=@newPromiseCapability(@Promise),A=!1;return q={start(){},write(_){if(typeof _===\"string\"){var w=@toLength(_.length);if(w>0)j+=_,x=!0,C+=w;return w}if(!_||!(@ArrayBuffer.@isView(_)||_ instanceof @ArrayBuffer))@throwTypeError(\"Expected text, ArrayBuffer or ArrayBufferView\");const E=@toLength(_.byteLength);if(E>0)if(z=!0,j.length>0)@arrayPush(v,j,_),j=\"\";else @arrayPush(v,_);return C+=E,E},flush(){return 0},end(){if(A)return\"\";return q.fulfill()},fulfill(){A=!0;const _=q.finishInternal();return @fulfillPromise(F.@promise,_),_},finishInternal(){if(!x&&!z)return\"\";if(x&&!z)return j;if(z&&!x)return new globalThis.TextDecoder().decode(@Bun.concatArrayBuffers(v));var _=new @Bun.ArrayBufferSink;_.start({highWaterMark:C,asUint8Array:!0});for(let w of v)_.write(w);if(v.length=0,j.length>0)_.write(j),j=\"\";return new globalThis.TextDecoder().decode(_.end())},close(){try{if(!A)A=!0,q.fulfill()}catch(_){}}},[q,F]})\n";
+const char* const s_readableStreamInternalsCreateTextStreamCode = "(function (_){\"use strict\";var C,j=[],E=!1,q=!1,F=\"\",v=@toLength(0),G=@newPromiseCapability(@Promise),w=!1;return C={start(){},write(x){if(typeof x===\"string\"){var z=@toLength(x.length);if(z>0)F+=x,E=!0,v+=z;return z}if(!x||!(@ArrayBuffer.@isView(x)||x instanceof @ArrayBuffer))@throwTypeError(\"Expected text, ArrayBuffer or ArrayBufferView\");const A=@toLength(x.byteLength);if(A>0)if(q=!0,F.length>0)@arrayPush(j,F,x),F=\"\";else @arrayPush(j,x);return v+=A,A},flush(){return 0},end(){if(w)return\"\";return C.fulfill()},fulfill(){w=!0;const x=C.finishInternal();return @fulfillPromise(G.@promise,x),x},finishInternal(){if(!E&&!q)return\"\";if(E&&!q)return F;if(q&&!E)return new globalThis.TextDecoder().decode(@Bun.concatArrayBuffers(j));var x=new @Bun.ArrayBufferSink;x.start({highWaterMark:v,asUint8Array:!0});for(let z of j)x.write(z);if(j.length=0,F.length>0)x.write(F),F=\"\";return new globalThis.TextDecoder().decode(x.end())},close(){try{if(!w)w=!0,C.fulfill()}catch(x){}}},[C,G]})\n";
// initializeTextStream
const JSC::ConstructAbility s_readableStreamInternalsInitializeTextStreamCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
@@ -1652,7 +1652,7 @@ const JSC::ConstructorKind s_readableStreamInternalsInitializeTextStreamCodeCons
const JSC::ImplementationVisibility s_readableStreamInternalsInitializeTextStreamCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
const int s_readableStreamInternalsInitializeTextStreamCodeLength = 578;
static const JSC::Intrinsic s_readableStreamInternalsInitializeTextStreamCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_readableStreamInternalsInitializeTextStreamCode = "(function (m,p){\"use strict\";var[_,b]=@createTextStream(p),f={@underlyingSource:m,@pull:@onPullDirectStream,@controlledReadableStream:this,@sink:_,close:@onCloseDirectStream,write:_.write,error:@handleDirectStreamError,end:@onCloseDirectStream,@close:@onCloseDirectStream,flush:@onFlushDirectStream,_pendingRead:@undefined,_deferClose:0,_deferFlush:0,_deferCloseReason:@undefined,_handleError:@undefined};return @putByIdDirectPrivate(this,\"readableStreamController\",f),@putByIdDirectPrivate(this,\"underlyingSource\",@undefined),@putByIdDirectPrivate(this,\"start\",@undefined),b})\n";
+const char* const s_readableStreamInternalsInitializeTextStreamCode = "(function (_,m){\"use strict\";var[p,b]=@createTextStream(m),f={@underlyingSource:_,@pull:@onPullDirectStream,@controlledReadableStream:this,@sink:p,close:@onCloseDirectStream,write:p.write,error:@handleDirectStreamError,end:@onCloseDirectStream,@close:@onCloseDirectStream,flush:@onFlushDirectStream,_pendingRead:@undefined,_deferClose:0,_deferFlush:0,_deferCloseReason:@undefined,_handleError:@undefined};return @putByIdDirectPrivate(this,\"readableStreamController\",f),@putByIdDirectPrivate(this,\"underlyingSource\",@undefined),@putByIdDirectPrivate(this,\"start\",@undefined),b})\n";
// initializeArrayStream
const JSC::ConstructAbility s_readableStreamInternalsInitializeArrayStreamCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
@@ -1660,7 +1660,7 @@ const JSC::ConstructorKind s_readableStreamInternalsInitializeArrayStreamCodeCon
const JSC::ImplementationVisibility s_readableStreamInternalsInitializeArrayStreamCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
const int s_readableStreamInternalsInitializeArrayStreamCodeLength = 797;
static const JSC::Intrinsic s_readableStreamInternalsInitializeArrayStreamCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_readableStreamInternalsInitializeArrayStreamCode = "(function (m,v){\"use strict\";var _=[],b=@newPromiseCapability(@Promise),t=!1;function d(){return t=!0,b.@resolve.@call(@undefined,_),_}var j={start(){},write(p){return @arrayPush(_,p),p.byteLength||p.length},flush(){return 0},end(){if(t)return[];return d()},close(){if(!t)d()}},q={@underlyingSource:m,@pull:@onPullDirectStream,@controlledReadableStream:this,@sink:j,close:@onCloseDirectStream,write:j.write,error:@handleDirectStreamError,end:@onCloseDirectStream,@close:@onCloseDirectStream,flush:@onFlushDirectStream,_pendingRead:@undefined,_deferClose:0,_deferFlush:0,_deferCloseReason:@undefined,_handleError:@undefined};return @putByIdDirectPrivate(this,\"readableStreamController\",q),@putByIdDirectPrivate(this,\"underlyingSource\",@undefined),@putByIdDirectPrivate(this,\"start\",@undefined),b})\n";
+const char* const s_readableStreamInternalsInitializeArrayStreamCode = "(function (t,_){\"use strict\";var b=[],d=@newPromiseCapability(@Promise),j=!1;function p(){return j=!0,d.@resolve.@call(@undefined,b),b}var m={start(){},write(v){return @arrayPush(b,v),v.byteLength||v.length},flush(){return 0},end(){if(j)return[];return p()},close(){if(!j)p()}},q={@underlyingSource:t,@pull:@onPullDirectStream,@controlledReadableStream:this,@sink:m,close:@onCloseDirectStream,write:m.write,error:@handleDirectStreamError,end:@onCloseDirectStream,@close:@onCloseDirectStream,flush:@onFlushDirectStream,_pendingRead:@undefined,_deferClose:0,_deferFlush:0,_deferCloseReason:@undefined,_handleError:@undefined};return @putByIdDirectPrivate(this,\"readableStreamController\",q),@putByIdDirectPrivate(this,\"underlyingSource\",@undefined),@putByIdDirectPrivate(this,\"start\",@undefined),d})\n";
// initializeArrayBufferStream
const JSC::ConstructAbility s_readableStreamInternalsInitializeArrayBufferStreamCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
@@ -1668,7 +1668,7 @@ const JSC::ConstructorKind s_readableStreamInternalsInitializeArrayBufferStreamC
const JSC::ImplementationVisibility s_readableStreamInternalsInitializeArrayBufferStreamCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
const int s_readableStreamInternalsInitializeArrayBufferStreamCodeLength = 690;
static const JSC::Intrinsic s_readableStreamInternalsInitializeArrayBufferStreamCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_readableStreamInternalsInitializeArrayBufferStreamCode = "(function (w,m){\"use strict\";var D=m&&typeof m===\"number\"\?{highWaterMark:m,stream:!0,asUint8Array:!0}:{stream:!0,asUint8Array:!0},_=new @Bun.ArrayBufferSink;_.start(D);var b={@underlyingSource:w,@pull:@onPullDirectStream,@controlledReadableStream:this,@sink:_,close:@onCloseDirectStream,write:_.write.bind(_),error:@handleDirectStreamError,end:@onCloseDirectStream,@close:@onCloseDirectStream,flush:@onFlushDirectStream,_pendingRead:@undefined,_deferClose:0,_deferFlush:0,_deferCloseReason:@undefined,_handleError:@undefined};@putByIdDirectPrivate(this,\"readableStreamController\",b),@putByIdDirectPrivate(this,\"underlyingSource\",@undefined),@putByIdDirectPrivate(this,\"start\",@undefined)})\n";
+const char* const s_readableStreamInternalsInitializeArrayBufferStreamCode = "(function (_,m){\"use strict\";var w=m&&typeof m===\"number\"\?{highWaterMark:m,stream:!0,asUint8Array:!0}:{stream:!0,asUint8Array:!0},D=new @Bun.ArrayBufferSink;D.start(w);var b={@underlyingSource:_,@pull:@onPullDirectStream,@controlledReadableStream:this,@sink:D,close:@onCloseDirectStream,write:D.write.bind(D),error:@handleDirectStreamError,end:@onCloseDirectStream,@close:@onCloseDirectStream,flush:@onFlushDirectStream,_pendingRead:@undefined,_deferClose:0,_deferFlush:0,_deferCloseReason:@undefined,_handleError:@undefined};@putByIdDirectPrivate(this,\"readableStreamController\",b),@putByIdDirectPrivate(this,\"underlyingSource\",@undefined),@putByIdDirectPrivate(this,\"start\",@undefined)})\n";
// readableStreamError
const JSC::ConstructAbility s_readableStreamInternalsReadableStreamErrorCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
@@ -1676,7 +1676,7 @@ const JSC::ConstructorKind s_readableStreamInternalsReadableStreamErrorCodeConst
const JSC::ImplementationVisibility s_readableStreamInternalsReadableStreamErrorCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
const int s_readableStreamInternalsReadableStreamErrorCodeLength = 840;
static const JSC::Intrinsic s_readableStreamInternalsReadableStreamErrorCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_readableStreamInternalsReadableStreamErrorCode = "(function (c,f){\"use strict\";@assert(@isReadableStream(c)),@assert(@getByIdDirectPrivate(c,\"state\")===@streamReadable),@putByIdDirectPrivate(c,\"state\",@streamErrored),@putByIdDirectPrivate(c,\"storedError\",f);const _=@getByIdDirectPrivate(c,\"reader\");if(!_)return;if(@isReadableStreamDefaultReader(_)){const n=@getByIdDirectPrivate(_,\"readRequests\");@putByIdDirectPrivate(_,\"readRequests\",@createFIFO());for(var i=n.shift();i;i=n.shift())@rejectPromise(i,f)}else{@assert(@isReadableStreamBYOBReader(_));const n=@getByIdDirectPrivate(_,\"readIntoRequests\");@putByIdDirectPrivate(_,\"readIntoRequests\",@createFIFO());for(var i=n.shift();i;i=n.shift())@rejectPromise(i,f)}@getByIdDirectPrivate(_,\"closedPromiseCapability\").@reject.@call(@undefined,f);const h=@getByIdDirectPrivate(_,\"closedPromiseCapability\").@promise;@markPromiseAsHandled(h)})\n";
+const char* const s_readableStreamInternalsReadableStreamErrorCode = "(function (i,_){\"use strict\";@assert(@isReadableStream(i)),@assert(@getByIdDirectPrivate(i,\"state\")===@streamReadable),@putByIdDirectPrivate(i,\"state\",@streamErrored),@putByIdDirectPrivate(i,\"storedError\",_);const n=@getByIdDirectPrivate(i,\"reader\");if(!n)return;if(@isReadableStreamDefaultReader(n)){const h=@getByIdDirectPrivate(n,\"readRequests\");@putByIdDirectPrivate(n,\"readRequests\",@createFIFO());for(var f=h.shift();f;f=h.shift())@rejectPromise(f,_)}else{@assert(@isReadableStreamBYOBReader(n));const h=@getByIdDirectPrivate(n,\"readIntoRequests\");@putByIdDirectPrivate(n,\"readIntoRequests\",@createFIFO());for(var f=h.shift();f;f=h.shift())@rejectPromise(f,_)}@getByIdDirectPrivate(n,\"closedPromiseCapability\").@reject.@call(@undefined,_);const c=@getByIdDirectPrivate(n,\"closedPromiseCapability\").@promise;@markPromiseAsHandled(c)})\n";
// readableStreamDefaultControllerShouldCallPull
const JSC::ConstructAbility s_readableStreamInternalsReadableStreamDefaultControllerShouldCallPullCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
@@ -1708,7 +1708,7 @@ const JSC::ConstructorKind s_readableStreamInternalsReadableStreamDefaultControl
const JSC::ImplementationVisibility s_readableStreamInternalsReadableStreamDefaultControllerGetDesiredSizeCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
const int s_readableStreamInternalsReadableStreamDefaultControllerGetDesiredSizeCodeLength = 283;
static const JSC::Intrinsic s_readableStreamInternalsReadableStreamDefaultControllerGetDesiredSizeCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_readableStreamInternalsReadableStreamDefaultControllerGetDesiredSizeCode = "(function (i){\"use strict\";const g=@getByIdDirectPrivate(i,\"controlledReadableStream\"),d=@getByIdDirectPrivate(g,\"state\");if(d===@streamErrored)return null;if(d===@streamClosed)return 0;return @getByIdDirectPrivate(i,\"strategy\").highWaterMark-@getByIdDirectPrivate(i,\"queue\").size})\n";
+const char* const s_readableStreamInternalsReadableStreamDefaultControllerGetDesiredSizeCode = "(function (d){\"use strict\";const i=@getByIdDirectPrivate(d,\"controlledReadableStream\"),g=@getByIdDirectPrivate(i,\"state\");if(g===@streamErrored)return null;if(g===@streamClosed)return 0;return @getByIdDirectPrivate(d,\"strategy\").highWaterMark-@getByIdDirectPrivate(d,\"queue\").size})\n";
// readableStreamReaderGenericCancel
const JSC::ConstructAbility s_readableStreamInternalsReadableStreamReaderGenericCancelCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
@@ -1716,7 +1716,7 @@ const JSC::ConstructorKind s_readableStreamInternalsReadableStreamReaderGenericC
const JSC::ImplementationVisibility s_readableStreamInternalsReadableStreamReaderGenericCancelCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
const int s_readableStreamInternalsReadableStreamReaderGenericCancelCodeLength = 133;
static const JSC::Intrinsic s_readableStreamInternalsReadableStreamReaderGenericCancelCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_readableStreamInternalsReadableStreamReaderGenericCancelCode = "(function (h,i){\"use strict\";const c=@getByIdDirectPrivate(h,\"ownerReadableStream\");return @assert(!!c),@readableStreamCancel(c,i)})\n";
+const char* const s_readableStreamInternalsReadableStreamReaderGenericCancelCode = "(function (c,h){\"use strict\";const i=@getByIdDirectPrivate(c,\"ownerReadableStream\");return @assert(!!i),@readableStreamCancel(i,h)})\n";
// readableStreamCancel
const JSC::ConstructAbility s_readableStreamInternalsReadableStreamCancelCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
@@ -1724,7 +1724,7 @@ const JSC::ConstructorKind s_readableStreamInternalsReadableStreamCancelCodeCons
const JSC::ImplementationVisibility s_readableStreamInternalsReadableStreamCancelCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
const int s_readableStreamInternalsReadableStreamCancelCodeLength = 509;
static const JSC::Intrinsic s_readableStreamInternalsReadableStreamCancelCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_readableStreamInternalsReadableStreamCancelCode = "(function (i,d){\"use strict\";@putByIdDirectPrivate(i,\"disturbed\",!0);const h=@getByIdDirectPrivate(i,\"state\");if(h===@streamClosed)return @Promise.@resolve();if(h===@streamErrored)return @Promise.@reject(@getByIdDirectPrivate(i,\"storedError\"));@readableStreamClose(i);var _=@getByIdDirectPrivate(i,\"readableStreamController\"),p=_.@cancel;if(p)return p(_,d).@then(function(){});var u=_.close;if(u)return @Promise.@resolve(_.close(d));@throwTypeError(\"ReadableStreamController has no cancel or close method\")})\n";
+const char* const s_readableStreamInternalsReadableStreamCancelCode = "(function (i,p){\"use strict\";@putByIdDirectPrivate(i,\"disturbed\",!0);const u=@getByIdDirectPrivate(i,\"state\");if(u===@streamClosed)return @Promise.@resolve();if(u===@streamErrored)return @Promise.@reject(@getByIdDirectPrivate(i,\"storedError\"));@readableStreamClose(i);var h=@getByIdDirectPrivate(i,\"readableStreamController\"),_=h.@cancel;if(_)return _(h,p).@then(function(){});var d=h.close;if(d)return @Promise.@resolve(h.close(p));@throwTypeError(\"ReadableStreamController has no cancel or close method\")})\n";
// readableStreamDefaultControllerCancel
const JSC::ConstructAbility s_readableStreamInternalsReadableStreamDefaultControllerCancelCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
@@ -1764,7 +1764,7 @@ const JSC::ConstructorKind s_readableStreamInternalsReadableStreamFulfillReadReq
const JSC::ImplementationVisibility s_readableStreamInternalsReadableStreamFulfillReadRequestCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
const int s_readableStreamInternalsReadableStreamFulfillReadRequestCodeLength = 157;
static const JSC::Intrinsic s_readableStreamInternalsReadableStreamFulfillReadRequestCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_readableStreamInternalsReadableStreamFulfillReadRequestCode = "(function (i,p,y){\"use strict\";const _=@getByIdDirectPrivate(@getByIdDirectPrivate(i,\"reader\"),\"readRequests\").shift();@fulfillPromise(_,{value:p,done:y})})\n";
+const char* const s_readableStreamInternalsReadableStreamFulfillReadRequestCode = "(function (y,_,i){\"use strict\";const p=@getByIdDirectPrivate(@getByIdDirectPrivate(y,\"reader\"),\"readRequests\").shift();@fulfillPromise(p,{value:_,done:i})})\n";
// readableStreamDefaultControllerEnqueue
const JSC::ConstructAbility s_readableStreamInternalsReadableStreamDefaultControllerEnqueueCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
@@ -1772,7 +1772,7 @@ const JSC::ConstructorKind s_readableStreamInternalsReadableStreamDefaultControl
const JSC::ImplementationVisibility s_readableStreamInternalsReadableStreamDefaultControllerEnqueueCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
const int s_readableStreamInternalsReadableStreamDefaultControllerEnqueueCodeLength = 659;
static const JSC::Intrinsic s_readableStreamInternalsReadableStreamDefaultControllerEnqueueCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_readableStreamInternalsReadableStreamDefaultControllerEnqueueCode = "(function (_,D){\"use strict\";const E=@getByIdDirectPrivate(_,\"controlledReadableStream\");if(@assert(@readableStreamDefaultControllerCanCloseOrEnqueue(_)),@isReadableStreamLocked(E)&&@getByIdDirectPrivate(@getByIdDirectPrivate(E,\"reader\"),\"readRequests\")\?.isNotEmpty()){@readableStreamFulfillReadRequest(E,D,!1),@readableStreamDefaultControllerCallPullIfNeeded(_);return}try{let d=1;if(@getByIdDirectPrivate(_,\"strategy\").size!==@undefined)d=@getByIdDirectPrivate(_,\"strategy\").size(D);@enqueueValueWithSize(@getByIdDirectPrivate(_,\"queue\"),D,d)}catch(d){throw @readableStreamDefaultControllerError(_,d),d}@readableStreamDefaultControllerCallPullIfNeeded(_)})\n";
+const char* const s_readableStreamInternalsReadableStreamDefaultControllerEnqueueCode = "(function (_,d){\"use strict\";const D=@getByIdDirectPrivate(_,\"controlledReadableStream\");if(@assert(@readableStreamDefaultControllerCanCloseOrEnqueue(_)),@isReadableStreamLocked(D)&&@getByIdDirectPrivate(@getByIdDirectPrivate(D,\"reader\"),\"readRequests\")\?.isNotEmpty()){@readableStreamFulfillReadRequest(D,d,!1),@readableStreamDefaultControllerCallPullIfNeeded(_);return}try{let E=1;if(@getByIdDirectPrivate(_,\"strategy\").size!==@undefined)E=@getByIdDirectPrivate(_,\"strategy\").size(d);@enqueueValueWithSize(@getByIdDirectPrivate(_,\"queue\"),d,E)}catch(E){throw @readableStreamDefaultControllerError(_,E),E}@readableStreamDefaultControllerCallPullIfNeeded(_)})\n";
// readableStreamDefaultReaderRead
const JSC::ConstructAbility s_readableStreamInternalsReadableStreamDefaultReaderReadCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
@@ -1780,7 +1780,7 @@ const JSC::ConstructorKind s_readableStreamInternalsReadableStreamDefaultReaderR
const JSC::ImplementationVisibility s_readableStreamInternalsReadableStreamDefaultReaderReadCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
const int s_readableStreamInternalsReadableStreamDefaultReaderReadCodeLength = 491;
static const JSC::Intrinsic s_readableStreamInternalsReadableStreamDefaultReaderReadCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_readableStreamInternalsReadableStreamDefaultReaderReadCode = "(function (y){\"use strict\";const i=@getByIdDirectPrivate(y,\"ownerReadableStream\");@assert(!!i);const n=@getByIdDirectPrivate(i,\"state\");if(@putByIdDirectPrivate(i,\"disturbed\",!0),n===@streamClosed)return @createFulfilledPromise({value:@undefined,done:!0});if(n===@streamErrored)return @Promise.@reject(@getByIdDirectPrivate(i,\"storedError\"));return @assert(n===@streamReadable),@getByIdDirectPrivate(i,\"readableStreamController\").@pull(@getByIdDirectPrivate(i,\"readableStreamController\"))})\n";
+const char* const s_readableStreamInternalsReadableStreamDefaultReaderReadCode = "(function (i){\"use strict\";const n=@getByIdDirectPrivate(i,\"ownerReadableStream\");@assert(!!n);const y=@getByIdDirectPrivate(n,\"state\");if(@putByIdDirectPrivate(n,\"disturbed\",!0),y===@streamClosed)return @createFulfilledPromise({value:@undefined,done:!0});if(y===@streamErrored)return @Promise.@reject(@getByIdDirectPrivate(n,\"storedError\"));return @assert(y===@streamReadable),@getByIdDirectPrivate(n,\"readableStreamController\").@pull(@getByIdDirectPrivate(n,\"readableStreamController\"))})\n";
// readableStreamAddReadRequest
const JSC::ConstructAbility s_readableStreamInternalsReadableStreamAddReadRequestCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
@@ -1820,7 +1820,7 @@ const JSC::ConstructorKind s_readableStreamInternalsLazyLoadStreamCodeConstructo
const JSC::ImplementationVisibility s_readableStreamInternalsLazyLoadStreamCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
const int s_readableStreamInternalsLazyLoadStreamCodeLength = 1589;
static const JSC::Intrinsic s_readableStreamInternalsLazyLoadStreamCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_readableStreamInternalsLazyLoadStreamCode = "(function (J,P){\"use strict\";var G=@getByIdDirectPrivate(J,\"bunNativeType\"),B=@getByIdDirectPrivate(J,\"bunNativePtr\"),x=@lazyStreamPrototypeMap.@get(G);if(x===@undefined){let q=function(m){var{c:b,v:f}=this;this.c=@undefined,this.v=@undefined,I(m,b,f)},N=function(m){try{m.close()}catch(b){globalThis.reportError(b)}},O=function(m,b,f,j){j[0]=!1;var y;try{y=Q(m,f,j)}catch(Y){return b.error(Y)}return I(y,b,f)};var z=q,A=N,p=O,[Q,U,W,Z,D,K,X]=@lazyLoad(G),H=[!1],I;I=function m(b,f,j){if(b&&@isPromise(b))return b.then(q.bind({c:f,v:j}),(y)=>f.error(y));else if(typeof b===\"number\")if(j&&j.byteLength===b&&j.buffer===f.byobRequest\?.view\?.buffer)f.byobRequest.respondWithNewView(j);else f.byobRequest.respond(b);else if(b.constructor===@Uint8Array)f.enqueue(b);if(H[0]||b===!1)@enqueueJob(N,f),H[0]=!1};const F=D\?new FinalizationRegistry(D):null;x=class m{constructor(b,f,j){if(this.#f=b,this.#b={},this.pull=this.#j.bind(this),this.cancel=this.#m.bind(this),this.autoAllocateChunkSize=f,j!==@undefined)this.start=(y)=>{y.enqueue(j)};if(F)F.register(this,b,this.#b)}#b;pull;cancel;start;#f;type=\"bytes\";autoAllocateChunkSize=0;static startSync=U;#j(b){var f=this.#f;if(!f){b.close();return}O(f,b,b.byobRequest.view,H)}#m(b){var f=this.#f;F&&F.unregister(this.#b),K&&K(f,!1),W(f,b)}static deinit=D;static drain=X},@lazyStreamPrototypeMap.@set(G,x)}const L=x.startSync(B,P);var E;const{drain:M,deinit:_}=x;if(M)E=M(B);if(L===0){if(D&&B&&@enqueueJob(D,B),(E\?.byteLength\?\?0)>0)return{start(q){q.enqueue(E),q.close()},type:\"bytes\"};return{start(q){q.close()},type:\"bytes\"}}return new x(B,L,E)})\n";
+const char* const s_readableStreamInternalsLazyLoadStreamCode = "(function (U,j){\"use strict\";var N=@getByIdDirectPrivate(U,\"bunNativeType\"),m=@getByIdDirectPrivate(U,\"bunNativePtr\"),q=@lazyStreamPrototypeMap.@get(N);if(q===@undefined){let J=function(Z){var{c:_,v:p}=this;this.c=@undefined,this.v=@undefined,X(Z,_,p)},K=function(Z){try{Z.close()}catch(_){globalThis.reportError(_)}},L=function(Z,_,p,Q){Q[0]=!1;var z;try{z=W(Z,p,Q)}catch(A){return _.error(A)}return X(z,_,p)};var I=J,P=K,H=L,[W,x,y,B,D,b,E]=@lazyLoad(N),O=[!1],X;X=function Z(_,p,Q){if(_&&@isPromise(_))return _.then(J.bind({c:p,v:Q}),(z)=>p.error(z));else if(typeof _===\"number\")if(Q&&Q.byteLength===_&&Q.buffer===p.byobRequest\?.view\?.buffer)p.byobRequest.respondWithNewView(Q);else p.byobRequest.respond(_);else if(_.constructor===@Uint8Array)p.enqueue(_);if(O[0]||_===!1)@enqueueJob(K,p),O[0]=!1};const M=D\?new FinalizationRegistry(D):null;q=class Z{constructor(_,p,Q){if(this.#f=_,this.#b={},this.pull=this.#j.bind(this),this.cancel=this.#m.bind(this),this.autoAllocateChunkSize=p,Q!==@undefined)this.start=(z)=>{z.enqueue(Q)};if(M)M.register(this,_,this.#b)}#b;pull;cancel;start;#f;type=\"bytes\";autoAllocateChunkSize=0;static startSync=x;#j(_){var p=this.#f;if(!p){_.close();return}L(p,_,_.byobRequest.view,O)}#m(_){var p=this.#f;M&&M.unregister(this.#b),b&&b(p,!1),y(p,_)}static deinit=D;static drain=E},@lazyStreamPrototypeMap.@set(N,q)}const Y=q.startSync(m,j);var f;const{drain:F,deinit:G}=q;if(F)f=F(m);if(Y===0){if(D&&m&&@enqueueJob(D,m),(f\?.byteLength\?\?0)>0)return{start(J){J.enqueue(f),J.close()},type:\"bytes\"};return{start(J){J.close()},type:\"bytes\"}}return new q(m,Y,f)})\n";
// readableStreamIntoArray
const JSC::ConstructAbility s_readableStreamInternalsReadableStreamIntoArrayCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
@@ -1828,7 +1828,7 @@ const JSC::ConstructorKind s_readableStreamInternalsReadableStreamIntoArrayCodeC
const JSC::ImplementationVisibility s_readableStreamInternalsReadableStreamIntoArrayCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
const int s_readableStreamInternalsReadableStreamIntoArrayCodeLength = 247;
static const JSC::Intrinsic s_readableStreamInternalsReadableStreamIntoArrayCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_readableStreamInternalsReadableStreamIntoArrayCode = "(function (q){\"use strict\";var b=q.getReader(),f=b.readMany();async function g(j){if(j.done)return[];var _=j.value||[];while(!0){var p=await b.read();if(p.done)break;_=_.concat(p.value)}return _}if(f&&@isPromise(f))return f.@then(g);return g(f)})\n";
+const char* const s_readableStreamInternalsReadableStreamIntoArrayCode = "(function (f){\"use strict\";var g=f.getReader(),j=g.readMany();async function p(q){if(q.done)return[];var _=q.value||[];while(!0){var b=await g.read();if(b.done)break;_=_.concat(b.value)}return _}if(j&&@isPromise(j))return j.@then(p);return p(j)})\n";
// readableStreamIntoText
const JSC::ConstructAbility s_readableStreamInternalsReadableStreamIntoTextCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
@@ -1836,7 +1836,7 @@ const JSC::ConstructorKind s_readableStreamInternalsReadableStreamIntoTextCodeCo
const JSC::ImplementationVisibility s_readableStreamInternalsReadableStreamIntoTextCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
const int s_readableStreamInternalsReadableStreamIntoTextCodeLength = 214;
static const JSC::Intrinsic s_readableStreamInternalsReadableStreamIntoTextCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_readableStreamInternalsReadableStreamIntoTextCode = "(function (_){\"use strict\";const[h,d]=@createTextStream(@getByIdDirectPrivate(_,\"highWaterMark\")),i=@readStreamIntoSink(_,h,!1);if(i&&@isPromise(i))return @Promise.@resolve(i).@then(d.@promise);return d.@promise})\n";
+const char* const s_readableStreamInternalsReadableStreamIntoTextCode = "(function (i){\"use strict\";const[_,d]=@createTextStream(@getByIdDirectPrivate(i,\"highWaterMark\")),h=@readStreamIntoSink(i,_,!1);if(h&&@isPromise(h))return @Promise.@resolve(h).@then(d.@promise);return d.@promise})\n";
// readableStreamToArrayBufferDirect
const JSC::ConstructAbility s_readableStreamInternalsReadableStreamToArrayBufferDirectCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
@@ -1844,7 +1844,7 @@ const JSC::ConstructorKind s_readableStreamInternalsReadableStreamToArrayBufferD
const JSC::ImplementationVisibility s_readableStreamInternalsReadableStreamToArrayBufferDirectCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
const int s_readableStreamInternalsReadableStreamToArrayBufferDirectCodeLength = 727;
static const JSC::Intrinsic s_readableStreamInternalsReadableStreamToArrayBufferDirectCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_readableStreamInternalsReadableStreamToArrayBufferDirectCode = "(function (O,A){\"use strict\";var j=new @Bun.ArrayBufferSink;@putByIdDirectPrivate(O,\"underlyingSource\",@undefined);var B=@getByIdDirectPrivate(O,\"highWaterMark\");j.start(B\?{highWaterMark:B}:{});var w=@newPromiseCapability(@Promise),q=!1,x=A.pull,v=A.close,z={start(){},close(_){if(!q){if(q=!0,v)v();@fulfillPromise(w.@promise,j.end())}},end(){if(!q){if(q=!0,v)v();@fulfillPromise(w.@promise,j.end())}},flush(){return 0},write:j.write.bind(j)},C=!1;try{const _=x(z);if(_&&@isObject(_)&&@isPromise(_))return async function(D,F,G){while(!q)await G(D);return await F}(z,promise,x);return w.@promise}catch(_){return C=!0,@readableStreamError(O,_),@Promise.@reject(_)}finally{if(!C&&O)@readableStreamClose(O);z=v=j=x=O=@undefined}})\n";
+const char* const s_readableStreamInternalsReadableStreamToArrayBufferDirectCode = "(function (_,A){\"use strict\";var O=new @Bun.ArrayBufferSink;@putByIdDirectPrivate(_,\"underlyingSource\",@undefined);var j=@getByIdDirectPrivate(_,\"highWaterMark\");O.start(j\?{highWaterMark:j}:{});var x=@newPromiseCapability(@Promise),z=!1,B=A.pull,C=A.close,D={start(){},close(F){if(!z){if(z=!0,C)C();@fulfillPromise(x.@promise,O.end())}},end(){if(!z){if(z=!0,C)C();@fulfillPromise(x.@promise,O.end())}},flush(){return 0},write:O.write.bind(O)},q=!1;try{const F=B(D);if(F&&@isObject(F)&&@isPromise(F))return async function(G,v,w){while(!z)await w(G);return await v}(D,promise,B);return x.@promise}catch(F){return q=!0,@readableStreamError(_,F),@Promise.@reject(F)}finally{if(!q&&_)@readableStreamClose(_);D=C=O=B=_=@undefined}})\n";
// readableStreamToTextDirect
const JSC::ConstructAbility s_readableStreamInternalsReadableStreamToTextDirectCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
@@ -1852,7 +1852,7 @@ const JSC::ConstructorKind s_readableStreamInternalsReadableStreamToTextDirectCo
const JSC::ImplementationVisibility s_readableStreamInternalsReadableStreamToTextDirectCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
const int s_readableStreamInternalsReadableStreamToTextDirectCodeLength = 278;
static const JSC::Intrinsic s_readableStreamInternalsReadableStreamToTextDirectCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_readableStreamInternalsReadableStreamToTextDirectCode = "(async function (_,h){\"use strict\";const j=@initializeTextStream.@call(_,h,@undefined);var f=_.getReader();while(@getByIdDirectPrivate(_,\"state\")===@streamReadable){var k=await f.read();if(k.done)break}try{f.releaseLock()}catch(p){}return f=@undefined,_=@undefined,j.@promise})\n";
+const char* const s_readableStreamInternalsReadableStreamToTextDirectCode = "(async function (_,j){\"use strict\";const p=@initializeTextStream.@call(_,j,@undefined);var h=_.getReader();while(@getByIdDirectPrivate(_,\"state\")===@streamReadable){var f=await h.read();if(f.done)break}try{h.releaseLock()}catch(k){}return h=@undefined,_=@undefined,p.@promise})\n";
// readableStreamToArrayDirect
const JSC::ConstructAbility s_readableStreamInternalsReadableStreamToArrayDirectCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
@@ -1860,7 +1860,7 @@ const JSC::ConstructorKind s_readableStreamInternalsReadableStreamToArrayDirectC
const JSC::ImplementationVisibility s_readableStreamInternalsReadableStreamToArrayDirectCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
const int s_readableStreamInternalsReadableStreamToArrayDirectCodeLength = 354;
static const JSC::Intrinsic s_readableStreamInternalsReadableStreamToArrayDirectCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_readableStreamInternalsReadableStreamToArrayDirectCode = "(async function (f,j){\"use strict\";const p=@initializeArrayStream.@call(f,j,@undefined);j=@undefined;var _=f.getReader();try{while(@getByIdDirectPrivate(f,\"state\")===@streamReadable){var q=await _.read();if(q.done)break}try{_.releaseLock()}catch(k){}return _=@undefined,@Promise.@resolve(p.@promise)}catch(k){throw k}finally{f=@undefined,_=@undefined}})\n";
+const char* const s_readableStreamInternalsReadableStreamToArrayDirectCode = "(async function (f,k){\"use strict\";const p=@initializeArrayStream.@call(f,k,@undefined);k=@undefined;var j=f.getReader();try{while(@getByIdDirectPrivate(f,\"state\")===@streamReadable){var _=await j.read();if(_.done)break}try{j.releaseLock()}catch(q){}return j=@undefined,@Promise.@resolve(p.@promise)}catch(q){throw q}finally{f=@undefined,j=@undefined}})\n";
// readableStreamDefineLazyIterators
const JSC::ConstructAbility s_readableStreamInternalsReadableStreamDefineLazyIteratorsCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
@@ -1868,7 +1868,7 @@ const JSC::ConstructorKind s_readableStreamInternalsReadableStreamDefineLazyIter
const JSC::ImplementationVisibility s_readableStreamInternalsReadableStreamDefineLazyIteratorsCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
const int s_readableStreamInternalsReadableStreamDefineLazyIteratorsCodeLength = 516;
static const JSC::Intrinsic s_readableStreamInternalsReadableStreamDefineLazyIteratorsCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_readableStreamInternalsReadableStreamDefineLazyIteratorsCode = "(function (i){\"use strict\";var B=globalThis.Symbol.asyncIterator,w=async function*x(k,G){var z=k.getReader(),g;try{while(!0){var j,q;const h=z.readMany();if(@isPromise(h))({done:j,value:q}=await h);else({done:j,value:q}=h);if(j)return;yield*q}}catch(h){g=h}finally{if(z.releaseLock(),!G)k.cancel(g);if(g)throw g}},D=function x(){return w(this,!1)},F=function x({preventCancel:k=!1}={preventCancel:!1}){return w(this,k)};return @Object.@defineProperty(i,B,{value:D}),@Object.@defineProperty(i,\"values\",{value:F}),i})\n";
+const char* const s_readableStreamInternalsReadableStreamDefineLazyIteratorsCode = "(function (h){\"use strict\";var x=globalThis.Symbol.asyncIterator,z=async function*i(B,D){var j=B.getReader(),q;try{while(!0){var w,F;const G=j.readMany();if(@isPromise(G))({done:w,value:F}=await G);else({done:w,value:F}=G);if(w)return;yield*F}}catch(G){q=G}finally{if(j.releaseLock(),!D)B.cancel(q);if(q)throw q}},k=function i(){return z(this,!1)},g=function i({preventCancel:B=!1}={preventCancel:!1}){return z(this,B)};return @Object.@defineProperty(h,x,{value:k}),@Object.@defineProperty(h,\"values\",{value:g}),h})\n";
#define DEFINE_BUILTIN_GENERATOR(codeName, functionName, overriddenName, argumentCount) \
JSC::FunctionExecutable* codeName##Generator(JSC::VM& vm) \
@@ -1894,7 +1894,7 @@ const JSC::ConstructorKind s_transformStreamDefaultControllerDesiredSizeCodeCons
const JSC::ImplementationVisibility s_transformStreamDefaultControllerDesiredSizeCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
const int s_transformStreamDefaultControllerDesiredSizeCodeLength = 339;
static const JSC::Intrinsic s_transformStreamDefaultControllerDesiredSizeCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_transformStreamDefaultControllerDesiredSizeCode = "(function (){\"use strict\";if(!@isTransformStreamDefaultController(this))throw @makeThisTypeError(\"TransformStreamDefaultController\",\"enqueue\");const _=@getByIdDirectPrivate(this,\"stream\"),u=@getByIdDirectPrivate(_,\"readable\"),i=@getByIdDirectPrivate(u,\"readableStreamController\");return @readableStreamDefaultControllerGetDesiredSize(i)})\n";
+const char* const s_transformStreamDefaultControllerDesiredSizeCode = "(function (){\"use strict\";if(!@isTransformStreamDefaultController(this))throw @makeThisTypeError(\"TransformStreamDefaultController\",\"enqueue\");const _=@getByIdDirectPrivate(this,\"stream\"),i=@getByIdDirectPrivate(_,\"readable\"),u=@getByIdDirectPrivate(i,\"readableStreamController\");return @readableStreamDefaultControllerGetDesiredSize(u)})\n";
// enqueue
const JSC::ConstructAbility s_transformStreamDefaultControllerEnqueueCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
@@ -1986,7 +1986,7 @@ const JSC::ConstructorKind s_jsBufferConstructorFromCodeConstructorKind = JSC::C
const JSC::ImplementationVisibility s_jsBufferConstructorFromCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
const int s_jsBufferConstructorFromCodeLength = 1107;
static const JSC::Intrinsic s_jsBufferConstructorFromCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_jsBufferConstructorFromCode = "(function (n){\"use strict\";if(@isUndefinedOrNull(n))@throwTypeError(\"The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object.\");if(typeof n===\"string\"||typeof n===\"object\"&&(@isTypedArrayView(n)||n instanceof @ArrayBuffer||n instanceof SharedArrayBuffer||n instanceof String))switch(@argumentCount()){case 1:return new @Buffer(n);case 2:return new @Buffer(n,@argument(1));default:return new @Buffer(n,@argument(1),@argument(2))}var d=@toObject(n,\"The first argument must be of type string or an instance of Buffer, ArrayBuffer, or Array or an Array-like Object.\");if(!@isJSArray(d)){const u=@tryGetByIdWithWellKnownSymbol(n,\"toPrimitive\");if(u){const f=u.@call(n,\"string\");if(typeof f===\"string\")switch(@argumentCount()){case 1:return new @Buffer(f);case 2:return new @Buffer(f,@argument(1));default:return new @Buffer(f,@argument(1),@argument(2))}}if(!(\"length\"in d)||@isCallable(d))@throwTypeError(\"The first argument must be of type string or an instance of Buffer, ArrayBuffer, or Array or an Array-like Object.\")}return new @Buffer(@Uint8Array.from(d).buffer)})\n";
+const char* const s_jsBufferConstructorFromCode = "(function (d){\"use strict\";if(@isUndefinedOrNull(d))@throwTypeError(\"The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object.\");if(typeof d===\"string\"||typeof d===\"object\"&&(@isTypedArrayView(d)||d instanceof @ArrayBuffer||d instanceof SharedArrayBuffer||d instanceof String))switch(@argumentCount()){case 1:return new @Buffer(d);case 2:return new @Buffer(d,@argument(1));default:return new @Buffer(d,@argument(1),@argument(2))}var f=@toObject(d,\"The first argument must be of type string or an instance of Buffer, ArrayBuffer, or Array or an Array-like Object.\");if(!@isJSArray(f)){const u=@tryGetByIdWithWellKnownSymbol(d,\"toPrimitive\");if(u){const n=u.@call(d,\"string\");if(typeof n===\"string\")switch(@argumentCount()){case 1:return new @Buffer(n);case 2:return new @Buffer(n,@argument(1));default:return new @Buffer(n,@argument(1),@argument(2))}}if(!(\"length\"in f)||@isCallable(f))@throwTypeError(\"The first argument must be of type string or an instance of Buffer, ArrayBuffer, or Array or an Array-like Object.\")}return new @Buffer(@Uint8Array.from(f).buffer)})\n";
// isBuffer
const JSC::ConstructAbility s_jsBufferConstructorIsBufferCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
@@ -2028,7 +2028,7 @@ const JSC::ConstructorKind s_readableStreamDefaultReaderReadManyCodeConstructorK
const JSC::ImplementationVisibility s_readableStreamDefaultReaderReadManyCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
const int s_readableStreamDefaultReaderReadManyCodeLength = 2598;
static const JSC::Intrinsic s_readableStreamDefaultReaderReadManyCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_readableStreamDefaultReaderReadManyCode = "(function (){\"use strict\";if(!@isReadableStreamDefaultReader(this))@throwTypeError(\"ReadableStreamDefaultReader.readMany() should not be called directly\");const j=@getByIdDirectPrivate(this,\"ownerReadableStream\");if(!j)@throwTypeError(\"readMany() called on a reader owned by no readable stream\");const I=@getByIdDirectPrivate(j,\"state\");if(@putByIdDirectPrivate(j,\"disturbed\",!0),I===@streamClosed)return{value:[],size:0,done:!0};else if(I===@streamErrored)throw @getByIdDirectPrivate(j,\"storedError\");var B=@getByIdDirectPrivate(j,\"readableStreamController\"),F=@getByIdDirectPrivate(B,\"queue\");if(!F)return B.@pull(B).@then(function({done:_,value:w}){return _\?{done:!0,value:[],size:0}:{value:[w],size:1,done:!1}});const N=F.content;var Q=F.size,x=N.toArray(!1),C=x.length;if(C>0){var D=@newArrayWithSize(C);if(@isReadableByteStreamController(B)){{const _=x[0];if(!(@ArrayBuffer.@isView(_)||_ instanceof @ArrayBuffer))@putByValDirect(D,0,new @Uint8Array(_.buffer,_.byteOffset,_.byteLength));else @putByValDirect(D,0,_)}for(var d=1;d<C;d++){const _=x[d];if(!(@ArrayBuffer.@isView(_)||_ instanceof @ArrayBuffer))@putByValDirect(D,d,new @Uint8Array(_.buffer,_.byteOffset,_.byteLength));else @putByValDirect(D,d,_)}}else{@putByValDirect(D,0,x[0].value);for(var d=1;d<C;d++)@putByValDirect(D,d,x[d].value)}if(@resetQueue(@getByIdDirectPrivate(B,\"queue\")),@getByIdDirectPrivate(B,\"closeRequested\"))@readableStreamClose(@getByIdDirectPrivate(B,\"controlledReadableStream\"));else if(@isReadableStreamDefaultController(B))@readableStreamDefaultControllerCallPullIfNeeded(B);else if(@isReadableByteStreamController(B))@readableByteStreamControllerCallPullIfNeeded(B);return{value:D,size:Q,done:!1}}var J=(_)=>{if(_.done)return{value:[],size:0,done:!0};var w=@getByIdDirectPrivate(j,\"readableStreamController\"),G=@getByIdDirectPrivate(w,\"queue\"),k=[_.value].concat(G.content.toArray(!1)),K=k.length;if(@isReadableByteStreamController(w))for(var A=0;A<K;A++){const H=k[A];if(!(@ArrayBuffer.@isView(H)||H instanceof @ArrayBuffer)){const{buffer:T,byteOffset:U,byteLength:W}=H;@putByValDirect(k,A,new @Uint8Array(T,U,W))}}else for(var A=1;A<K;A++)@putByValDirect(k,A,k[A].value);var S=G.size;if(@resetQueue(G),@getByIdDirectPrivate(w,\"closeRequested\"))@readableStreamClose(@getByIdDirectPrivate(w,\"controlledReadableStream\"));else if(@isReadableStreamDefaultController(w))@readableStreamDefaultControllerCallPullIfNeeded(w);else if(@isReadableByteStreamController(w))@readableByteStreamControllerCallPullIfNeeded(w);return{value:k,size:S,done:!1}},E=B.@pull(B);if(E&&@isPromise(E))return E.@then(J);return J(E)})\n";
+const char* const s_readableStreamDefaultReaderReadManyCode = "(function (){\"use strict\";if(!@isReadableStreamDefaultReader(this))@throwTypeError(\"ReadableStreamDefaultReader.readMany() should not be called directly\");const Q=@getByIdDirectPrivate(this,\"ownerReadableStream\");if(!Q)@throwTypeError(\"readMany() called on a reader owned by no readable stream\");const k=@getByIdDirectPrivate(Q,\"state\");if(@putByIdDirectPrivate(Q,\"disturbed\",!0),k===@streamClosed)return{value:[],size:0,done:!0};else if(k===@streamErrored)throw @getByIdDirectPrivate(Q,\"storedError\");var F=@getByIdDirectPrivate(Q,\"readableStreamController\"),x=@getByIdDirectPrivate(F,\"queue\");if(!x)return F.@pull(F).@then(function({done:J,value:_}){return J\?{done:!0,value:[],size:0}:{value:[_],size:1,done:!1}});const C=x.content;var A=x.size,S=C.toArray(!1),D=S.length;if(D>0){var H=@newArrayWithSize(D);if(@isReadableByteStreamController(F)){{const J=S[0];if(!(@ArrayBuffer.@isView(J)||J instanceof @ArrayBuffer))@putByValDirect(H,0,new @Uint8Array(J.buffer,J.byteOffset,J.byteLength));else @putByValDirect(H,0,J)}for(var I=1;I<D;I++){const J=S[I];if(!(@ArrayBuffer.@isView(J)||J instanceof @ArrayBuffer))@putByValDirect(H,I,new @Uint8Array(J.buffer,J.byteOffset,J.byteLength));else @putByValDirect(H,I,J)}}else{@putByValDirect(H,0,S[0].value);for(var I=1;I<D;I++)@putByValDirect(H,I,S[I].value)}if(@resetQueue(@getByIdDirectPrivate(F,\"queue\")),@getByIdDirectPrivate(F,\"closeRequested\"))@readableStreamClose(@getByIdDirectPrivate(F,\"controlledReadableStream\"));else if(@isReadableStreamDefaultController(F))@readableStreamDefaultControllerCallPullIfNeeded(F);else if(@isReadableByteStreamController(F))@readableByteStreamControllerCallPullIfNeeded(F);return{value:H,size:A,done:!1}}var T=(J)=>{if(J.done)return{value:[],size:0,done:!0};var _=@getByIdDirectPrivate(Q,\"readableStreamController\"),E=@getByIdDirectPrivate(_,\"queue\"),K=[J.value].concat(E.content.toArray(!1)),j=K.length;if(@isReadableByteStreamController(_))for(var G=0;G<j;G++){const B=K[G];if(!(@ArrayBuffer.@isView(B)||B instanceof @ArrayBuffer)){const{buffer:N,byteOffset:d,byteLength:W}=B;@putByValDirect(K,G,new @Uint8Array(N,d,W))}}else for(var G=1;G<j;G++)@putByValDirect(K,G,K[G].value);var w=E.size;if(@resetQueue(E),@getByIdDirectPrivate(_,\"closeRequested\"))@readableStreamClose(@getByIdDirectPrivate(_,\"controlledReadableStream\"));else if(@isReadableStreamDefaultController(_))@readableStreamDefaultControllerCallPullIfNeeded(_);else if(@isReadableByteStreamController(_))@readableByteStreamControllerCallPullIfNeeded(_);return{value:K,size:w,done:!1}},U=F.@pull(F);if(U&&@isPromise(U))return U.@then(T);return T(U)})\n";
// read
const JSC::ConstructAbility s_readableStreamDefaultReaderReadCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
@@ -2086,7 +2086,7 @@ const JSC::ConstructorKind s_streamInternalsPromiseInvokeOrNoopMethodNoCatchCode
const JSC::ImplementationVisibility s_streamInternalsPromiseInvokeOrNoopMethodNoCatchCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
const int s_streamInternalsPromiseInvokeOrNoopMethodNoCatchCodeLength = 125;
static const JSC::Intrinsic s_streamInternalsPromiseInvokeOrNoopMethodNoCatchCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_streamInternalsPromiseInvokeOrNoopMethodNoCatchCode = "(function (l,i,n){\"use strict\";if(i===@undefined)return @Promise.@resolve();return @shieldingPromiseResolve(i.@apply(l,n))})\n";
+const char* const s_streamInternalsPromiseInvokeOrNoopMethodNoCatchCode = "(function (i,n,l){\"use strict\";if(n===@undefined)return @Promise.@resolve();return @shieldingPromiseResolve(n.@apply(i,l))})\n";
// promiseInvokeOrNoopNoCatch
const JSC::ConstructAbility s_streamInternalsPromiseInvokeOrNoopNoCatchCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
@@ -2094,7 +2094,7 @@ const JSC::ConstructorKind s_streamInternalsPromiseInvokeOrNoopNoCatchCodeConstr
const JSC::ImplementationVisibility s_streamInternalsPromiseInvokeOrNoopNoCatchCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
const int s_streamInternalsPromiseInvokeOrNoopNoCatchCodeLength = 84;
static const JSC::Intrinsic s_streamInternalsPromiseInvokeOrNoopNoCatchCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_streamInternalsPromiseInvokeOrNoopNoCatchCode = "(function (d,l,n){\"use strict\";return @promiseInvokeOrNoopMethodNoCatch(d,d[l],n)})\n";
+const char* const s_streamInternalsPromiseInvokeOrNoopNoCatchCode = "(function (d,n,l){\"use strict\";return @promiseInvokeOrNoopMethodNoCatch(d,d[n],l)})\n";
// promiseInvokeOrNoopMethod
const JSC::ConstructAbility s_streamInternalsPromiseInvokeOrNoopMethodCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
@@ -2110,7 +2110,7 @@ const JSC::ConstructorKind s_streamInternalsPromiseInvokeOrNoopCodeConstructorKi
const JSC::ImplementationVisibility s_streamInternalsPromiseInvokeOrNoopCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
const int s_streamInternalsPromiseInvokeOrNoopCodeLength = 116;
static const JSC::Intrinsic s_streamInternalsPromiseInvokeOrNoopCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_streamInternalsPromiseInvokeOrNoopCode = "(function (n,d,l){\"use strict\";try{return @promiseInvokeOrNoopNoCatch(n,d,l)}catch(m){return @Promise.@reject(m)}})\n";
+const char* const s_streamInternalsPromiseInvokeOrNoopCode = "(function (l,m,d){\"use strict\";try{return @promiseInvokeOrNoopNoCatch(l,m,d)}catch(n){return @Promise.@reject(n)}})\n";
// promiseInvokeOrFallbackOrNoop
const JSC::ConstructAbility s_streamInternalsPromiseInvokeOrFallbackOrNoopCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
@@ -2118,7 +2118,7 @@ const JSC::ConstructorKind s_streamInternalsPromiseInvokeOrFallbackOrNoopCodeCon
const JSC::ImplementationVisibility s_streamInternalsPromiseInvokeOrFallbackOrNoopCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
const int s_streamInternalsPromiseInvokeOrFallbackOrNoopCodeLength = 198;
static const JSC::Intrinsic s_streamInternalsPromiseInvokeOrFallbackOrNoopCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_streamInternalsPromiseInvokeOrFallbackOrNoopCode = "(function (_,l,p,u,v){\"use strict\";try{const n=_[l];if(n===@undefined)return @promiseInvokeOrNoopNoCatch(_,u,v);return @shieldingPromiseResolve(n.@apply(_,p))}catch(n){return @Promise.@reject(n)}})\n";
+const char* const s_streamInternalsPromiseInvokeOrFallbackOrNoopCode = "(function (n,p,_,l,v){\"use strict\";try{const u=n[p];if(u===@undefined)return @promiseInvokeOrNoopNoCatch(n,l,v);return @shieldingPromiseResolve(u.@apply(n,_))}catch(u){return @Promise.@reject(u)}})\n";
// validateAndNormalizeQueuingStrategy
const JSC::ConstructAbility s_streamInternalsValidateAndNormalizeQueuingStrategyCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
@@ -2126,7 +2126,7 @@ const JSC::ConstructorKind s_streamInternalsValidateAndNormalizeQueuingStrategyC
const JSC::ImplementationVisibility s_streamInternalsValidateAndNormalizeQueuingStrategyCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
const int s_streamInternalsValidateAndNormalizeQueuingStrategyCodeLength = 263;
static const JSC::Intrinsic s_streamInternalsValidateAndNormalizeQueuingStrategyCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_streamInternalsValidateAndNormalizeQueuingStrategyCode = "(function (d,l){\"use strict\";if(d!==@undefined&&typeof d!==\"function\")@throwTypeError(\"size parameter must be a function\");const f=@toNumber(l);if(@isNaN(f)||f<0)@throwRangeError(\"highWaterMark value is negative or not a number\");return{size:d,highWaterMark:f}})\n";
+const char* const s_streamInternalsValidateAndNormalizeQueuingStrategyCode = "(function (d,f){\"use strict\";if(d!==@undefined&&typeof d!==\"function\")@throwTypeError(\"size parameter must be a function\");const l=@toNumber(f);if(@isNaN(l)||l<0)@throwRangeError(\"highWaterMark value is negative or not a number\");return{size:d,highWaterMark:l}})\n";
// createFIFO
const JSC::ConstructAbility s_streamInternalsCreateFIFOCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
@@ -2134,7 +2134,7 @@ const JSC::ConstructorKind s_streamInternalsCreateFIFOCodeConstructorKind = JSC:
const JSC::ImplementationVisibility s_streamInternalsCreateFIFOCodeImplementationVisibility = JSC::ImplementationVisibility::Private;
const int s_streamInternalsCreateFIFOCodeLength = 1473;
static const JSC::Intrinsic s_streamInternalsCreateFIFOCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_streamInternalsCreateFIFOCode = "(function (){\"use strict\";var E=@Array.prototype.slice;class A{constructor(){this._head=0,this._tail=0,this._capacityMask=3,this._list=@newArrayWithSize(4)}_head;_tail;_capacityMask;_list;size(){if(this._head===this._tail)return 0;if(this._head<this._tail)return this._tail-this._head;else return this._capacityMask+1-(this._head-this._tail)}isEmpty(){return this.size()==0}isNotEmpty(){return this.size()>0}shift(){var{_head:g,_tail:b,_list:x,_capacityMask:M}=this;if(g===b)return @undefined;var w=x[g];if(@putByValDirect(x,g,@undefined),g=this._head=g+1&M,g<2&&b>1e4&&b<=x.length>>>2)this._shrinkArray();return w}peek(){if(this._head===this._tail)return @undefined;return this._list[this._head]}push(g){var b=this._tail;if(@putByValDirect(this._list,b,g),this._tail=b+1&this._capacityMask,this._tail===this._head)this._growArray()}toArray(g){var b=this._list,x=@toLength(b.length);if(g||this._head>this._tail){var M=@toLength(this._head),w=@toLength(this._tail),F=@toLength(x-M+w),z=@newArrayWithSize(F),B=0;for(var v=M;v<x;v++)@putByValDirect(z,B++,b[v]);for(var v=0;v<w;v++)@putByValDirect(z,B++,b[v]);return z}else return E.@call(b,this._head,this._tail)}clear(){this._head=0,this._tail=0,this._list.fill(@undefined)}_growArray(){if(this._head)this._list=this.toArray(!0),this._head=0;this._tail=@toLength(this._list.length),this._list.length<<=1,this._capacityMask=this._capacityMask<<1|1}_shrinkArray(){this._list.length>>>=1,this._capacityMask>>>=1}}return new A})\n";
+const char* const s_streamInternalsCreateFIFOCode = "(function (){\"use strict\";var g=@Array.prototype.slice;class M{constructor(){this._head=0,this._tail=0,this._capacityMask=3,this._list=@newArrayWithSize(4)}_head;_tail;_capacityMask;_list;size(){if(this._head===this._tail)return 0;if(this._head<this._tail)return this._tail-this._head;else return this._capacityMask+1-(this._head-this._tail)}isEmpty(){return this.size()==0}isNotEmpty(){return this.size()>0}shift(){var{_head:w,_tail:z,_list:B,_capacityMask:E}=this;if(w===z)return @undefined;var b=B[w];if(@putByValDirect(B,w,@undefined),w=this._head=w+1&E,w<2&&z>1e4&&z<=B.length>>>2)this._shrinkArray();return b}peek(){if(this._head===this._tail)return @undefined;return this._list[this._head]}push(w){var z=this._tail;if(@putByValDirect(this._list,z,w),this._tail=z+1&this._capacityMask,this._tail===this._head)this._growArray()}toArray(w){var z=this._list,B=@toLength(z.length);if(w||this._head>this._tail){var E=@toLength(this._head),b=@toLength(this._tail),F=@toLength(B-E+b),G=@newArrayWithSize(F),v=0;for(var A=E;A<B;A++)@putByValDirect(G,v++,z[A]);for(var A=0;A<b;A++)@putByValDirect(G,v++,z[A]);return G}else return g.@call(z,this._head,this._tail)}clear(){this._head=0,this._tail=0,this._list.fill(@undefined)}_growArray(){if(this._head)this._list=this.toArray(!0),this._head=0;this._tail=@toLength(this._list.length),this._list.length<<=1,this._capacityMask=this._capacityMask<<1|1}_shrinkArray(){this._list.length>>>=1,this._capacityMask>>>=1}}return new M})\n";
// newQueue
const JSC::ConstructAbility s_streamInternalsNewQueueCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
@@ -2158,7 +2158,7 @@ const JSC::ConstructorKind s_streamInternalsEnqueueValueWithSizeCodeConstructorK
const JSC::ImplementationVisibility s_streamInternalsEnqueueValueWithSizeCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
const int s_streamInternalsEnqueueValueWithSizeCodeLength = 161;
static const JSC::Intrinsic s_streamInternalsEnqueueValueWithSizeCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_streamInternalsEnqueueValueWithSizeCode = "(function (d,o,n){\"use strict\";if(n=@toNumber(n),!@isFinite(n)||n<0)@throwRangeError(\"size has an incorrect value\");d.content.push({value:o,size:n}),d.size+=n})\n";
+const char* const s_streamInternalsEnqueueValueWithSizeCode = "(function (n,d,o){\"use strict\";if(o=@toNumber(o),!@isFinite(o)||o<0)@throwRangeError(\"size has an incorrect value\");n.content.push({value:d,size:o}),n.size+=o})\n";
// peekQueueValue
const JSC::ConstructAbility s_streamInternalsPeekQueueValueCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
@@ -2182,7 +2182,7 @@ const JSC::ConstructorKind s_streamInternalsExtractSizeAlgorithmCodeConstructorK
const JSC::ImplementationVisibility s_streamInternalsExtractSizeAlgorithmCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
const int s_streamInternalsExtractSizeAlgorithmCodeLength = 176;
static const JSC::Intrinsic s_streamInternalsExtractSizeAlgorithmCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_streamInternalsExtractSizeAlgorithmCode = "(function (p){\"use strict\";const d=p.size;if(d===@undefined)return()=>1;if(typeof d!==\"function\")@throwTypeError(\"strategy.size must be a function\");return(w)=>{return d(w)}})\n";
+const char* const s_streamInternalsExtractSizeAlgorithmCode = "(function (d){\"use strict\";const p=d.size;if(p===@undefined)return()=>1;if(typeof p!==\"function\")@throwTypeError(\"strategy.size must be a function\");return(w)=>{return p(w)}})\n";
// extractHighWaterMark
const JSC::ConstructAbility s_streamInternalsExtractHighWaterMarkCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
@@ -2190,7 +2190,7 @@ const JSC::ConstructorKind s_streamInternalsExtractHighWaterMarkCodeConstructorK
const JSC::ImplementationVisibility s_streamInternalsExtractHighWaterMarkCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
const int s_streamInternalsExtractHighWaterMarkCodeLength = 188;
static const JSC::Intrinsic s_streamInternalsExtractHighWaterMarkCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_streamInternalsExtractHighWaterMarkCode = "(function (b,c){\"use strict\";const o=b.highWaterMark;if(o===@undefined)return c;if(@isNaN(o)||o<0)@throwRangeError(\"highWaterMark value is negative or not a number\");return @toNumber(o)})\n";
+const char* const s_streamInternalsExtractHighWaterMarkCode = "(function (o,b){\"use strict\";const c=o.highWaterMark;if(c===@undefined)return b;if(@isNaN(c)||c<0)@throwRangeError(\"highWaterMark value is negative or not a number\");return @toNumber(c)})\n";
// extractHighWaterMarkFromQueuingStrategyInit
const JSC::ConstructAbility s_streamInternalsExtractHighWaterMarkFromQueuingStrategyInitCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
@@ -2206,7 +2206,7 @@ const JSC::ConstructorKind s_streamInternalsCreateFulfilledPromiseCodeConstructo
const JSC::ImplementationVisibility s_streamInternalsCreateFulfilledPromiseCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
const int s_streamInternalsCreateFulfilledPromiseCodeLength = 81;
static const JSC::Intrinsic s_streamInternalsCreateFulfilledPromiseCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_streamInternalsCreateFulfilledPromiseCode = "(function (n){\"use strict\";const d=@newPromise();return @fulfillPromise(d,n),d})\n";
+const char* const s_streamInternalsCreateFulfilledPromiseCode = "(function (d){\"use strict\";const n=@newPromise();return @fulfillPromise(n,d),n})\n";
// toDictionary
const JSC::ConstructAbility s_streamInternalsToDictionaryCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
@@ -2214,7 +2214,7 @@ const JSC::ConstructorKind s_streamInternalsToDictionaryCodeConstructorKind = JS
const JSC::ImplementationVisibility s_streamInternalsToDictionaryCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
const int s_streamInternalsToDictionaryCodeLength = 115;
static const JSC::Intrinsic s_streamInternalsToDictionaryCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_streamInternalsToDictionaryCode = "(function (c,n,p){\"use strict\";if(c===@undefined||c===null)return n;if(!@isObject(c))@throwTypeError(p);return c})\n";
+const char* const s_streamInternalsToDictionaryCode = "(function (c,p,n){\"use strict\";if(c===@undefined||c===null)return p;if(!@isObject(c))@throwTypeError(n);return c})\n";
#define DEFINE_BUILTIN_GENERATOR(codeName, functionName, overriddenName, argumentCount) \
JSC::FunctionExecutable* codeName##Generator(JSC::VM& vm) \
@@ -2232,7 +2232,7 @@ const JSC::ConstructorKind s_importMetaObjectLoadCJS2ESMCodeConstructorKind = JS
const JSC::ImplementationVisibility s_importMetaObjectLoadCJS2ESMCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
const int s_importMetaObjectLoadCJS2ESMCodeLength = 1387;
static const JSC::Intrinsic s_importMetaObjectLoadCJS2ESMCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_importMetaObjectLoadCJS2ESMCode = "(function (B){\"use strict\";var D=@Loader,H=@createFIFO(),_=B;while(_){var w=D.registry.@get(_);if((w\?.state\?\?0)<=@ModuleFetch)@fulfillModuleSync(_),w=D.registry.@get(_);var W=@getPromiseInternalField(w.fetch,@promiseFieldReactionsOrResult),x=D.parseModule(_,W),z=w.module;if(x&&@isPromise(x)){var J=@getPromiseInternalField(x,@promiseFieldReactionsOrResult),X=@getPromiseInternalField(x,@promiseFieldFlags),Q=X&@promiseStateMask;if(Q===@promiseStatePending||J&&@isPromise(J))@throwTypeError(`require() async module \"${_}\" is unsupported. use \"await import()\" instead.`);else if(Q===@promiseStateRejected){if(!J\?.message)@throwTypeError(`${J+\"\"\?J:\"An error occurred\"} occurred while parsing module \\\"${_}\\\"`);throw J}w.module=z=J}else if(x&&!z)w.module=z=x;@setStateToMax(w,@ModuleLink);var Y=z.dependenciesMap,I=D.requestedModules(z),T=@newArrayWithSize(I.length);for(var F=0,Z=I.length;F<Z;++F){var G=I[F],U=G[0]===\"/\"\?G:D.resolve(G,_),L=D.ensureRegistered(U);if(L.state<@ModuleLink)H.push(U);@putByValDirect(T,F,L),Y.@set(G,L)}w.dependencies=T,w.instantiate=@Promise.resolve(w),w.satisfy=@Promise.resolve(w),_=H.shift();while(_&&(D.registry.@get(_)\?.state\?\?@ModuleFetch)>=@ModuleLink)_=H.shift()}var V=D.linkAndEvaluateModule(B,@undefined);if(V&&@isPromise(V))@throwTypeError(`require() async module \\\"${B}\\\" is unsupported. use \"await import()\" instead.`);return D.registry.@get(B)})\n";
+const char* const s_importMetaObjectLoadCJS2ESMCode = "(function (J){\"use strict\";var Q=@Loader,T=@createFIFO(),H=J;while(H){var x=Q.registry.@get(H);if((x\?.state\?\?0)<=@ModuleFetch)@fulfillModuleSync(H),x=Q.registry.@get(H);var z=@getPromiseInternalField(x.fetch,@promiseFieldReactionsOrResult),_=Q.parseModule(H,z),I=x.module;if(_&&@isPromise(_)){var B=@getPromiseInternalField(_,@promiseFieldReactionsOrResult),U=@getPromiseInternalField(_,@promiseFieldFlags),F=U&@promiseStateMask;if(F===@promiseStatePending||B&&@isPromise(B))@throwTypeError(`require() async module \"${H}\" is unsupported. use \"await import()\" instead.`);else if(F===@promiseStateRejected){if(!B\?.message)@throwTypeError(`${B+\"\"\?B:\"An error occurred\"} occurred while parsing module \\\"${H}\\\"`);throw B}x.module=I=B}else if(_&&!I)x.module=I=_;@setStateToMax(x,@ModuleLink);var V=I.dependenciesMap,w=Q.requestedModules(I),L=@newArrayWithSize(w.length);for(var D=0,W=w.length;D<W;++D){var X=w[D],G=X[0]===\"/\"\?X:Q.resolve(X,H),Y=Q.ensureRegistered(G);if(Y.state<@ModuleLink)T.push(G);@putByValDirect(L,D,Y),V.@set(X,Y)}x.dependencies=L,x.instantiate=@Promise.resolve(x),x.satisfy=@Promise.resolve(x),H=T.shift();while(H&&(Q.registry.@get(H)\?.state\?\?@ModuleFetch)>=@ModuleLink)H=T.shift()}var Z=Q.linkAndEvaluateModule(J,@undefined);if(Z&&@isPromise(Z))@throwTypeError(`require() async module \\\"${J}\\\" is unsupported. use \"await import()\" instead.`);return Q.registry.@get(J)})\n";
// requireESM
const JSC::ConstructAbility s_importMetaObjectRequireESMCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
@@ -2240,7 +2240,7 @@ const JSC::ConstructorKind s_importMetaObjectRequireESMCodeConstructorKind = JSC
const JSC::ImplementationVisibility s_importMetaObjectRequireESMCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
const int s_importMetaObjectRequireESMCodeLength = 325;
static const JSC::Intrinsic s_importMetaObjectRequireESMCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_importMetaObjectRequireESMCode = "(function (c){\"use strict\";var a=@Loader.registry.@get(c);if(!a||!a.evaluated)a=@loadCJS2ESM(c);if(!a||!a.evaluated||!a.module)@throwTypeError(`require() failed to evaluate module \"${c}\". This is an internal consistentency error.`);var _=@Loader.getModuleNamespaceObject(a.module);if(_[@commonJSSymbol]===0)return;return _})\n";
+const char* const s_importMetaObjectRequireESMCode = "(function (a){\"use strict\";var c=@Loader.registry.@get(a);if(!c||!c.evaluated)c=@loadCJS2ESM(a);if(!c||!c.evaluated||!c.module)@throwTypeError(`require() failed to evaluate module \"${a}\". This is an internal consistentency error.`);var _=@Loader.getModuleNamespaceObject(c.module);if(_[@commonJSSymbol]===0)return;return _})\n";
// internalRequire
const JSC::ConstructAbility s_importMetaObjectInternalRequireCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
@@ -2248,7 +2248,7 @@ const JSC::ConstructorKind s_importMetaObjectInternalRequireCodeConstructorKind
const JSC::ImplementationVisibility s_importMetaObjectInternalRequireCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
const int s_importMetaObjectInternalRequireCodeLength = 747;
static const JSC::Intrinsic s_importMetaObjectInternalRequireCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_importMetaObjectInternalRequireCode = "(function (_){\"use strict\";var n=@requireMap.@get(_);const g=_.substring(_.length-5);if(n)return n.exports;if(g===\".json\"){var j=globalThis[Symbol.for(\"_fs\")]||=@Bun.fs(),b=JSON.parse(j.readFileSync(_,\"utf8\"));return @requireMap.@set(_,@createCommonJSModule(_,b,!0)),b}else if(g===\".node\"){const k=@createCommonJSModule(_,{},!0);return process.dlopen(k,_),@requireMap.@set(_,k),k.exports}else if(g===\".toml\"){var j=globalThis[Symbol.for(\"_fs\")]||=@Bun.fs(),b=@Bun.TOML.parse(j.readFileSync(_,\"utf8\"));return @requireMap.@set(_,@createCommonJSModule(_,b,!0)),b}else{var b=@requireESM(_);const v=@requireMap.@get(_);if(v)return v.exports;var q=b\?.default;if(q\?.[@commonJSSymbol]===0)b=q;return @requireMap.@set(_,@createCommonJSModule(_,b,!0)),b}})\n";
+const char* const s_importMetaObjectInternalRequireCode = "(function (b){\"use strict\";var _=@requireMap.@get(b);const j=b.substring(b.length-5);if(_)return _.exports;if(j===\".json\"){var n=globalThis[Symbol.for(\"_fs\")]||=@Bun.fs(),g=JSON.parse(n.readFileSync(b,\"utf8\"));return @requireMap.@set(b,@createCommonJSModule(b,g,!0)),g}else if(j===\".node\"){const k=@createCommonJSModule(b,{},!0);return process.dlopen(k,b),@requireMap.@set(b,k),k.exports}else if(j===\".toml\"){var n=globalThis[Symbol.for(\"_fs\")]||=@Bun.fs(),g=@Bun.TOML.parse(n.readFileSync(b,\"utf8\"));return @requireMap.@set(b,@createCommonJSModule(b,g,!0)),g}else{var g=@requireESM(b);const q=@requireMap.@get(b);if(q)return q.exports;var v=g\?.default;if(v\?.[@commonJSSymbol]===0)g=v;return @requireMap.@set(b,@createCommonJSModule(b,g,!0)),g}})\n";
// createRequireCache
const JSC::ConstructAbility s_importMetaObjectCreateRequireCacheCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
@@ -2256,7 +2256,7 @@ const JSC::ConstructorKind s_importMetaObjectCreateRequireCacheCodeConstructorKi
const JSC::ImplementationVisibility s_importMetaObjectCreateRequireCacheCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
const int s_importMetaObjectCreateRequireCacheCodeLength = 854;
static const JSC::Intrinsic s_importMetaObjectCreateRequireCacheCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_importMetaObjectCreateRequireCacheCode = "(function (){\"use strict\";var c=new Map,L={};return new Proxy(L,{get(f,_){const h=@requireMap.@get(_);if(h)return h;const t=@Loader.registry.@get(_);if(t\?.evaluated){const u=@Loader.getModuleNamespaceObject(t.module),g=u[@commonJSSymbol]===0||u.default\?.[@commonJSSymbol]\?u.default:u,b=@createCommonJSModule(_,g,!0);return @requireMap.@set(_,b),b}return L[_]},set(f,_,h){return @requireMap.@set(_,h),!0},has(f,_){return @requireMap.@has(_)||@Loader.registry.@has(_)},deleteProperty(f,_){return c.@delete(_),@requireMap.@delete(_),@Loader.registry.@delete(_),!0},ownKeys(f){var _=[...@requireMap.@keys()];const h=[...@Loader.registry.@keys()];for(let t of h)if(!_.includes(t))@arrayPush(_,t);return _},getPrototypeOf(f){return null},getOwnPropertyDescriptor(f,_){if(@requireMap.@has(_)||@Loader.registry.@has(_))return{configurable:!0,enumerable:!0}}})})\n";
+const char* const s_importMetaObjectCreateRequireCacheCode = "(function (){\"use strict\";var f=new Map,h={};return new Proxy(h,{get(t,_){const u=@requireMap.@get(_);if(u)return u;const L=@Loader.registry.@get(_);if(L\?.evaluated){const b=@Loader.getModuleNamespaceObject(L.module),c=b[@commonJSSymbol]===0||b.default\?.[@commonJSSymbol]\?b.default:b,g=@createCommonJSModule(_,c,!0);return @requireMap.@set(_,g),g}return h[_]},set(t,_,u){return @requireMap.@set(_,u),!0},has(t,_){return @requireMap.@has(_)||@Loader.registry.@has(_)},deleteProperty(t,_){return f.@delete(_),@requireMap.@delete(_),@Loader.registry.@delete(_),!0},ownKeys(t){var _=[...@requireMap.@keys()];const u=[...@Loader.registry.@keys()];for(let L of u)if(!_.includes(L))@arrayPush(_,L);return _},getPrototypeOf(t){return null},getOwnPropertyDescriptor(t,_){if(@requireMap.@has(_)||@Loader.registry.@has(_))return{configurable:!0,enumerable:!0}}})})\n";
// require
const JSC::ConstructAbility s_importMetaObjectRequireCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
@@ -2440,7 +2440,7 @@ const JSC::ConstructorKind s_readableStreamInitializeReadableStreamCodeConstruct
const JSC::ImplementationVisibility s_readableStreamInitializeReadableStreamCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
const int s_readableStreamInitializeReadableStreamCodeLength = 2065;
static const JSC::Intrinsic s_readableStreamInitializeReadableStreamCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_readableStreamInitializeReadableStreamCode = "(function (_,f){\"use strict\";if(_===@undefined)_={@bunNativeType:0,@bunNativePtr:0,@lazy:!1};if(f===@undefined)f={};if(!@isObject(_))@throwTypeError(\"ReadableStream constructor takes an object as first argument\");if(f!==@undefined&&!@isObject(f))@throwTypeError(\"ReadableStream constructor takes an object as second argument, if any\");@putByIdDirectPrivate(this,\"state\",@streamReadable),@putByIdDirectPrivate(this,\"reader\",@undefined),@putByIdDirectPrivate(this,\"storedError\",@undefined),@putByIdDirectPrivate(this,\"disturbed\",!1),@putByIdDirectPrivate(this,\"readableStreamController\",null),@putByIdDirectPrivate(this,\"bunNativeType\",@getByIdDirectPrivate(_,\"bunNativeType\")\?\?0),@putByIdDirectPrivate(this,\"bunNativePtr\",@getByIdDirectPrivate(_,\"bunNativePtr\")\?\?0);const B=_.type===\"direct\",b=!!_.@lazy,I=B||b;if(@getByIdDirectPrivate(_,\"pull\")!==@undefined&&!I){const v=@getByIdDirectPrivate(f,\"size\"),m=@getByIdDirectPrivate(f,\"highWaterMark\");return @putByIdDirectPrivate(this,\"highWaterMark\",m),@putByIdDirectPrivate(this,\"underlyingSource\",@undefined),@setupReadableStreamDefaultController(this,_,v,m!==@undefined\?m:1,@getByIdDirectPrivate(_,\"start\"),@getByIdDirectPrivate(_,\"pull\"),@getByIdDirectPrivate(_,\"cancel\")),this}if(B)@putByIdDirectPrivate(this,\"underlyingSource\",_),@putByIdDirectPrivate(this,\"highWaterMark\",@getByIdDirectPrivate(f,\"highWaterMark\")),@putByIdDirectPrivate(this,\"start\",()=>@createReadableStreamController(this,_,f));else if(I){const v=_.autoAllocateChunkSize;@putByIdDirectPrivate(this,\"highWaterMark\",@undefined),@putByIdDirectPrivate(this,\"underlyingSource\",@undefined),@putByIdDirectPrivate(this,\"highWaterMark\",v||@getByIdDirectPrivate(f,\"highWaterMark\")),@putByIdDirectPrivate(this,\"start\",()=>{const m=@lazyLoadStream(this,v);if(m)@createReadableStreamController(this,m,f)})}else @putByIdDirectPrivate(this,\"underlyingSource\",@undefined),@putByIdDirectPrivate(this,\"highWaterMark\",@getByIdDirectPrivate(f,\"highWaterMark\")),@putByIdDirectPrivate(this,\"start\",@undefined),@createReadableStreamController(this,_,f);return this})\n";
+const char* const s_readableStreamInitializeReadableStreamCode = "(function (_,B){\"use strict\";if(_===@undefined)_={@bunNativeType:0,@bunNativePtr:0,@lazy:!1};if(B===@undefined)B={};if(!@isObject(_))@throwTypeError(\"ReadableStream constructor takes an object as first argument\");if(B!==@undefined&&!@isObject(B))@throwTypeError(\"ReadableStream constructor takes an object as second argument, if any\");@putByIdDirectPrivate(this,\"state\",@streamReadable),@putByIdDirectPrivate(this,\"reader\",@undefined),@putByIdDirectPrivate(this,\"storedError\",@undefined),@putByIdDirectPrivate(this,\"disturbed\",!1),@putByIdDirectPrivate(this,\"readableStreamController\",null),@putByIdDirectPrivate(this,\"bunNativeType\",@getByIdDirectPrivate(_,\"bunNativeType\")\?\?0),@putByIdDirectPrivate(this,\"bunNativePtr\",@getByIdDirectPrivate(_,\"bunNativePtr\")\?\?0);const I=_.type===\"direct\",f=!!_.@lazy,m=I||f;if(@getByIdDirectPrivate(_,\"pull\")!==@undefined&&!m){const v=@getByIdDirectPrivate(B,\"size\"),b=@getByIdDirectPrivate(B,\"highWaterMark\");return @putByIdDirectPrivate(this,\"highWaterMark\",b),@putByIdDirectPrivate(this,\"underlyingSource\",@undefined),@setupReadableStreamDefaultController(this,_,v,b!==@undefined\?b:1,@getByIdDirectPrivate(_,\"start\"),@getByIdDirectPrivate(_,\"pull\"),@getByIdDirectPrivate(_,\"cancel\")),this}if(I)@putByIdDirectPrivate(this,\"underlyingSource\",_),@putByIdDirectPrivate(this,\"highWaterMark\",@getByIdDirectPrivate(B,\"highWaterMark\")),@putByIdDirectPrivate(this,\"start\",()=>@createReadableStreamController(this,_,B));else if(m){const v=_.autoAllocateChunkSize;@putByIdDirectPrivate(this,\"highWaterMark\",@undefined),@putByIdDirectPrivate(this,\"underlyingSource\",@undefined),@putByIdDirectPrivate(this,\"highWaterMark\",v||@getByIdDirectPrivate(B,\"highWaterMark\")),@putByIdDirectPrivate(this,\"start\",()=>{const b=@lazyLoadStream(this,v);if(b)@createReadableStreamController(this,b,B)})}else @putByIdDirectPrivate(this,\"underlyingSource\",@undefined),@putByIdDirectPrivate(this,\"highWaterMark\",@getByIdDirectPrivate(B,\"highWaterMark\")),@putByIdDirectPrivate(this,\"start\",@undefined),@createReadableStreamController(this,_,B);return this})\n";
// readableStreamToArray
const JSC::ConstructAbility s_readableStreamReadableStreamToArrayCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
@@ -2456,7 +2456,7 @@ const JSC::ConstructorKind s_readableStreamReadableStreamToTextCodeConstructorKi
const JSC::ImplementationVisibility s_readableStreamReadableStreamToTextCodeImplementationVisibility = JSC::ImplementationVisibility::Private;
const int s_readableStreamReadableStreamToTextCodeLength = 171;
static const JSC::Intrinsic s_readableStreamReadableStreamToTextCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_readableStreamReadableStreamToTextCode = "(function (p){\"use strict\";var _=@getByIdDirectPrivate(p,\"underlyingSource\");if(_!==@undefined)return @readableStreamToTextDirect(p,_);return @readableStreamIntoText(p)})\n";
+const char* const s_readableStreamReadableStreamToTextCode = "(function (_){\"use strict\";var p=@getByIdDirectPrivate(_,\"underlyingSource\");if(p!==@undefined)return @readableStreamToTextDirect(_,p);return @readableStreamIntoText(_)})\n";
// readableStreamToArrayBuffer
const JSC::ConstructAbility s_readableStreamReadableStreamToArrayBufferCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
@@ -2464,7 +2464,7 @@ const JSC::ConstructorKind s_readableStreamReadableStreamToArrayBufferCodeConstr
const JSC::ImplementationVisibility s_readableStreamReadableStreamToArrayBufferCodeImplementationVisibility = JSC::ImplementationVisibility::Private;
const int s_readableStreamReadableStreamToArrayBufferCodeLength = 270;
static const JSC::Intrinsic s_readableStreamReadableStreamToArrayBufferCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_readableStreamReadableStreamToArrayBufferCode = "(function (_){\"use strict\";var p=@getByIdDirectPrivate(_,\"underlyingSource\");if(p!==@undefined)return @readableStreamToArrayBufferDirect(_,p);var b=@Bun.readableStreamToArray(_);if(@isPromise(b))return b.then(@Bun.concatArrayBuffers);return @Bun.concatArrayBuffers(b)})\n";
+const char* const s_readableStreamReadableStreamToArrayBufferCode = "(function (_){\"use strict\";var b=@getByIdDirectPrivate(_,\"underlyingSource\");if(b!==@undefined)return @readableStreamToArrayBufferDirect(_,b);var p=@Bun.readableStreamToArray(_);if(@isPromise(p))return p.then(@Bun.concatArrayBuffers);return @Bun.concatArrayBuffers(p)})\n";
// readableStreamToJSON
const JSC::ConstructAbility s_readableStreamReadableStreamToJSONCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
@@ -2520,7 +2520,7 @@ const JSC::ConstructorKind s_readableStreamGetReaderCodeConstructorKind = JSC::C
const JSC::ImplementationVisibility s_readableStreamGetReaderCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
const int s_readableStreamGetReaderCodeLength = 470;
static const JSC::Intrinsic s_readableStreamGetReaderCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_readableStreamGetReaderCode = "(function (b){\"use strict\";if(!@isReadableStream(this))throw @makeThisTypeError(\"ReadableStream\",\"getReader\");const e=@toDictionary(b,{},\"ReadableStream.getReader takes an object as first argument\").mode;if(e===@undefined){var n=@getByIdDirectPrivate(this,\"start\");if(n)@putByIdDirectPrivate(this,\"start\",@undefined),n();return new @ReadableStreamDefaultReader(this)}if(e==\"byob\")return new @ReadableStreamBYOBReader(this);@throwTypeError(\"Invalid mode is specified\")})\n";
+const char* const s_readableStreamGetReaderCode = "(function (e){\"use strict\";if(!@isReadableStream(this))throw @makeThisTypeError(\"ReadableStream\",\"getReader\");const n=@toDictionary(e,{},\"ReadableStream.getReader takes an object as first argument\").mode;if(n===@undefined){var b=@getByIdDirectPrivate(this,\"start\");if(b)@putByIdDirectPrivate(this,\"start\",@undefined),b();return new @ReadableStreamDefaultReader(this)}if(n==\"byob\")return new @ReadableStreamBYOBReader(this);@throwTypeError(\"Invalid mode is specified\")})\n";
// pipeThrough
const JSC::ConstructAbility s_readableStreamPipeThroughCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
@@ -2528,7 +2528,7 @@ const JSC::ConstructorKind s_readableStreamPipeThroughCodeConstructorKind = JSC:
const JSC::ImplementationVisibility s_readableStreamPipeThroughCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
const int s_readableStreamPipeThroughCodeLength = 859;
static const JSC::Intrinsic s_readableStreamPipeThroughCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_readableStreamPipeThroughCode = "(function (q,_){\"use strict\";const y=q,c=y.readable;if(!@isReadableStream(c))throw @makeTypeError(\"readable should be ReadableStream\");const x=y.writable,u=@getInternalWritableStream(x);if(!@isWritableStream(u))throw @makeTypeError(\"writable should be WritableStream\");let h=!1,j=!1,k=!1,d;if(!@isUndefinedOrNull(_)){if(!@isObject(_))throw @makeTypeError(\"options must be an object\");if(j=!!_.preventAbort,k=!!_.preventCancel,h=!!_.preventClose,d=_.signal,d!==@undefined&&!@isAbortSignal(d))throw @makeTypeError(\"options.signal must be AbortSignal\")}if(!@isReadableStream(this))throw @makeThisTypeError(\"ReadableStream\",\"pipeThrough\");if(@isReadableStreamLocked(this))throw @makeTypeError(\"ReadableStream is locked\");if(@isWritableStreamLocked(u))throw @makeTypeError(\"WritableStream is locked\");return @readableStreamPipeToWritableStream(this,u,h,j,k,d),c})\n";
+const char* const s_readableStreamPipeThroughCode = "(function (_,d){\"use strict\";const u=_,y=u.readable;if(!@isReadableStream(y))throw @makeTypeError(\"readable should be ReadableStream\");const c=u.writable,h=@getInternalWritableStream(c);if(!@isWritableStream(h))throw @makeTypeError(\"writable should be WritableStream\");let j=!1,k=!1,q=!1,x;if(!@isUndefinedOrNull(d)){if(!@isObject(d))throw @makeTypeError(\"options must be an object\");if(k=!!d.preventAbort,q=!!d.preventCancel,j=!!d.preventClose,x=d.signal,x!==@undefined&&!@isAbortSignal(x))throw @makeTypeError(\"options.signal must be AbortSignal\")}if(!@isReadableStream(this))throw @makeThisTypeError(\"ReadableStream\",\"pipeThrough\");if(@isReadableStreamLocked(this))throw @makeTypeError(\"ReadableStream is locked\");if(@isWritableStreamLocked(h))throw @makeTypeError(\"WritableStream is locked\");return @readableStreamPipeToWritableStream(this,h,j,k,q,x),y})\n";
// pipeTo
const JSC::ConstructAbility s_readableStreamPipeToCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
@@ -2536,7 +2536,7 @@ const JSC::ConstructorKind s_readableStreamPipeToCodeConstructorKind = JSC::Cons
const JSC::ImplementationVisibility s_readableStreamPipeToCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
const int s_readableStreamPipeToCodeLength = 914;
static const JSC::Intrinsic s_readableStreamPipeToCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_readableStreamPipeToCode = "(function (S){\"use strict\";if(!@isReadableStream(this))return @Promise.@reject(@makeThisTypeError(\"ReadableStream\",\"pipeTo\"));if(@isReadableStreamLocked(this))return @Promise.@reject(@makeTypeError(\"ReadableStream is locked\"));let m=@argument(1),j=!1,E=!1,R=!1,u;if(!@isUndefinedOrNull(m)){if(!@isObject(m))return @Promise.@reject(@makeTypeError(\"options must be an object\"));try{E=!!m.preventAbort,R=!!m.preventCancel,j=!!m.preventClose,u=m.signal}catch(b){return @Promise.@reject(b)}if(u!==@undefined&&!@isAbortSignal(u))return @Promise.@reject(@makeTypeError(\"options.signal must be AbortSignal\"))}const _=@getInternalWritableStream(S);if(!@isWritableStream(_))return @Promise.@reject(@makeTypeError(\"ReadableStream pipeTo requires a WritableStream\"));if(@isWritableStreamLocked(_))return @Promise.@reject(@makeTypeError(\"WritableStream is locked\"));return @readableStreamPipeToWritableStream(this,_,j,E,R,u)})\n";
+const char* const s_readableStreamPipeToCode = "(function (m){\"use strict\";if(!@isReadableStream(this))return @Promise.@reject(@makeThisTypeError(\"ReadableStream\",\"pipeTo\"));if(@isReadableStreamLocked(this))return @Promise.@reject(@makeTypeError(\"ReadableStream is locked\"));let j=@argument(1),u=!1,_=!1,E=!1,R;if(!@isUndefinedOrNull(j)){if(!@isObject(j))return @Promise.@reject(@makeTypeError(\"options must be an object\"));try{_=!!j.preventAbort,E=!!j.preventCancel,u=!!j.preventClose,R=j.signal}catch(b){return @Promise.@reject(b)}if(R!==@undefined&&!@isAbortSignal(R))return @Promise.@reject(@makeTypeError(\"options.signal must be AbortSignal\"))}const S=@getInternalWritableStream(m);if(!@isWritableStream(S))return @Promise.@reject(@makeTypeError(\"ReadableStream pipeTo requires a WritableStream\"));if(@isWritableStreamLocked(S))return @Promise.@reject(@makeTypeError(\"WritableStream is locked\"));return @readableStreamPipeToWritableStream(this,S,u,_,E,R)})\n";
// tee
const JSC::ConstructAbility s_readableStreamTeeCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
@@ -2560,7 +2560,7 @@ const JSC::ConstructorKind s_readableStreamValuesCodeConstructorKind = JSC::Cons
const JSC::ImplementationVisibility s_readableStreamValuesCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
const int s_readableStreamValuesCodeLength = 129;
static const JSC::Intrinsic s_readableStreamValuesCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_readableStreamValuesCode = "(function (_){\"use strict\";var r=@ReadableStream.prototype;return @readableStreamDefineLazyIterators(r),r.values.@call(this,_)})\n";
+const char* const s_readableStreamValuesCode = "(function (r){\"use strict\";var _=@ReadableStream.prototype;return @readableStreamDefineLazyIterators(_),_.values.@call(this,r)})\n";
// lazyAsyncIterator
const JSC::ConstructAbility s_readableStreamLazyAsyncIteratorCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
@@ -2586,7 +2586,7 @@ const JSC::ConstructorKind s_readableStreamDefaultControllerInitializeReadableSt
const JSC::ImplementationVisibility s_readableStreamDefaultControllerInitializeReadableStreamDefaultControllerCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
const int s_readableStreamDefaultControllerInitializeReadableStreamDefaultControllerCodeLength = 263;
static const JSC::Intrinsic s_readableStreamDefaultControllerInitializeReadableStreamDefaultControllerCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_readableStreamDefaultControllerInitializeReadableStreamDefaultControllerCode = "(function (_,p,C,R){\"use strict\";if(arguments.length!==5&&arguments[4]!==@isReadableStream)@throwTypeError(\"ReadableStreamDefaultController constructor should not be called directly\");return @privateInitializeReadableStreamDefaultController.@call(this,_,p,C,R)})\n";
+const char* const s_readableStreamDefaultControllerInitializeReadableStreamDefaultControllerCode = "(function (_,R,C,p){\"use strict\";if(arguments.length!==5&&arguments[4]!==@isReadableStream)@throwTypeError(\"ReadableStreamDefaultController constructor should not be called directly\");return @privateInitializeReadableStreamDefaultController.@call(this,_,R,C,p)})\n";
// enqueue
const JSC::ConstructAbility s_readableStreamDefaultControllerEnqueueCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
@@ -2636,7 +2636,7 @@ const JSC::ConstructorKind s_readableByteStreamInternalsPrivateInitializeReadabl
const JSC::ImplementationVisibility s_readableByteStreamInternalsPrivateInitializeReadableByteStreamControllerCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
const int s_readableByteStreamInternalsPrivateInitializeReadableByteStreamControllerCodeLength = 1654;
static const JSC::Intrinsic s_readableByteStreamInternalsPrivateInitializeReadableByteStreamControllerCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_readableByteStreamInternalsPrivateInitializeReadableByteStreamControllerCode = "(function (b,p,R){\"use strict\";if(!@isReadableStream(b))@throwTypeError(\"ReadableByteStreamController needs a ReadableStream\");if(@getByIdDirectPrivate(b,\"readableStreamController\")!==null)@throwTypeError(\"ReadableStream already has a controller\");@putByIdDirectPrivate(this,\"controlledReadableStream\",b),@putByIdDirectPrivate(this,\"underlyingByteSource\",p),@putByIdDirectPrivate(this,\"pullAgain\",!1),@putByIdDirectPrivate(this,\"pulling\",!1),@readableByteStreamControllerClearPendingPullIntos(this),@putByIdDirectPrivate(this,\"queue\",@newQueue()),@putByIdDirectPrivate(this,\"started\",0),@putByIdDirectPrivate(this,\"closeRequested\",!1);let f=@toNumber(R);if(@isNaN(f)||f<0)@throwRangeError(\"highWaterMark value is negative or not a number\");@putByIdDirectPrivate(this,\"strategyHWM\",f);let _=p.autoAllocateChunkSize;if(_!==@undefined){if(_=@toNumber(_),_<=0||_===@Infinity||_===-@Infinity)@throwRangeError(\"autoAllocateChunkSize value is negative or equal to positive or negative infinity\")}@putByIdDirectPrivate(this,\"autoAllocateChunkSize\",_),@putByIdDirectPrivate(this,\"pendingPullIntos\",@createFIFO());const v=this;return @promiseInvokeOrNoopNoCatch(@getByIdDirectPrivate(v,\"underlyingByteSource\"),\"start\",[v]).@then(()=>{@putByIdDirectPrivate(v,\"started\",1),@assert(!@getByIdDirectPrivate(v,\"pulling\")),@assert(!@getByIdDirectPrivate(v,\"pullAgain\")),@readableByteStreamControllerCallPullIfNeeded(v)},(d)=>{if(@getByIdDirectPrivate(b,\"state\")===@streamReadable)@readableByteStreamControllerError(v,d)}),@putByIdDirectPrivate(this,\"cancel\",@readableByteStreamControllerCancel),@putByIdDirectPrivate(this,\"pull\",@readableByteStreamControllerPull),this})\n";
+const char* const s_readableByteStreamInternalsPrivateInitializeReadableByteStreamControllerCode = "(function (_,b,p){\"use strict\";if(!@isReadableStream(_))@throwTypeError(\"ReadableByteStreamController needs a ReadableStream\");if(@getByIdDirectPrivate(_,\"readableStreamController\")!==null)@throwTypeError(\"ReadableStream already has a controller\");@putByIdDirectPrivate(this,\"controlledReadableStream\",_),@putByIdDirectPrivate(this,\"underlyingByteSource\",b),@putByIdDirectPrivate(this,\"pullAgain\",!1),@putByIdDirectPrivate(this,\"pulling\",!1),@readableByteStreamControllerClearPendingPullIntos(this),@putByIdDirectPrivate(this,\"queue\",@newQueue()),@putByIdDirectPrivate(this,\"started\",0),@putByIdDirectPrivate(this,\"closeRequested\",!1);let v=@toNumber(p);if(@isNaN(v)||v<0)@throwRangeError(\"highWaterMark value is negative or not a number\");@putByIdDirectPrivate(this,\"strategyHWM\",v);let R=b.autoAllocateChunkSize;if(R!==@undefined){if(R=@toNumber(R),R<=0||R===@Infinity||R===-@Infinity)@throwRangeError(\"autoAllocateChunkSize value is negative or equal to positive or negative infinity\")}@putByIdDirectPrivate(this,\"autoAllocateChunkSize\",R),@putByIdDirectPrivate(this,\"pendingPullIntos\",@createFIFO());const f=this;return @promiseInvokeOrNoopNoCatch(@getByIdDirectPrivate(f,\"underlyingByteSource\"),\"start\",[f]).@then(()=>{@putByIdDirectPrivate(f,\"started\",1),@assert(!@getByIdDirectPrivate(f,\"pulling\")),@assert(!@getByIdDirectPrivate(f,\"pullAgain\")),@readableByteStreamControllerCallPullIfNeeded(f)},(d)=>{if(@getByIdDirectPrivate(_,\"state\")===@streamReadable)@readableByteStreamControllerError(f,d)}),@putByIdDirectPrivate(this,\"cancel\",@readableByteStreamControllerCancel),@putByIdDirectPrivate(this,\"pull\",@readableByteStreamControllerPull),this})\n";
// readableStreamByteStreamControllerStart
const JSC::ConstructAbility s_readableByteStreamInternalsReadableStreamByteStreamControllerStartCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
@@ -2684,7 +2684,7 @@ const JSC::ConstructorKind s_readableByteStreamInternalsReadableByteStreamContro
const JSC::ImplementationVisibility s_readableByteStreamInternalsReadableByteStreamControllerCancelCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
const int s_readableByteStreamInternalsReadableByteStreamControllerCancelCodeLength = 248;
static const JSC::Intrinsic s_readableByteStreamInternalsReadableByteStreamControllerCancelCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_readableByteStreamInternalsReadableByteStreamControllerCancelCode = "(function (a,u){\"use strict\";var _=@getByIdDirectPrivate(a,\"pendingPullIntos\"),p=_.peek();if(p)p.bytesFilled=0;return @putByIdDirectPrivate(a,\"queue\",@newQueue()),@promiseInvokeOrNoop(@getByIdDirectPrivate(a,\"underlyingByteSource\"),\"cancel\",[u])})\n";
+const char* const s_readableByteStreamInternalsReadableByteStreamControllerCancelCode = "(function (p,u){\"use strict\";var _=@getByIdDirectPrivate(p,\"pendingPullIntos\"),a=_.peek();if(a)a.bytesFilled=0;return @putByIdDirectPrivate(p,\"queue\",@newQueue()),@promiseInvokeOrNoop(@getByIdDirectPrivate(p,\"underlyingByteSource\"),\"cancel\",[u])})\n";
// readableByteStreamControllerError
const JSC::ConstructAbility s_readableByteStreamInternalsReadableByteStreamControllerErrorCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
@@ -2700,7 +2700,7 @@ const JSC::ConstructorKind s_readableByteStreamInternalsReadableByteStreamContro
const JSC::ImplementationVisibility s_readableByteStreamInternalsReadableByteStreamControllerCloseCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
const int s_readableByteStreamInternalsReadableByteStreamControllerCloseCodeLength = 569;
static const JSC::Intrinsic s_readableByteStreamInternalsReadableByteStreamControllerCloseCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_readableByteStreamInternalsReadableByteStreamControllerCloseCode = "(function (d){\"use strict\";if(@assert(!@getByIdDirectPrivate(d,\"closeRequested\")),@assert(@getByIdDirectPrivate(@getByIdDirectPrivate(d,\"controlledReadableStream\"),\"state\")===@streamReadable),@getByIdDirectPrivate(d,\"queue\").size>0){@putByIdDirectPrivate(d,\"closeRequested\",!0);return}var a=@getByIdDirectPrivate(d,\"pendingPullIntos\")\?.peek();if(a){if(a.bytesFilled>0){const u=@makeTypeError(\"Close requested while there remain pending bytes\");throw @readableByteStreamControllerError(d,u),u}}@readableStreamClose(@getByIdDirectPrivate(d,\"controlledReadableStream\"))})\n";
+const char* const s_readableByteStreamInternalsReadableByteStreamControllerCloseCode = "(function (u){\"use strict\";if(@assert(!@getByIdDirectPrivate(u,\"closeRequested\")),@assert(@getByIdDirectPrivate(@getByIdDirectPrivate(u,\"controlledReadableStream\"),\"state\")===@streamReadable),@getByIdDirectPrivate(u,\"queue\").size>0){@putByIdDirectPrivate(u,\"closeRequested\",!0);return}var d=@getByIdDirectPrivate(u,\"pendingPullIntos\")\?.peek();if(d){if(d.bytesFilled>0){const a=@makeTypeError(\"Close requested while there remain pending bytes\");throw @readableByteStreamControllerError(u,a),a}}@readableStreamClose(@getByIdDirectPrivate(u,\"controlledReadableStream\"))})\n";
// readableByteStreamControllerClearPendingPullIntos
const JSC::ConstructAbility s_readableByteStreamInternalsReadableByteStreamControllerClearPendingPullIntosCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
@@ -2716,7 +2716,7 @@ const JSC::ConstructorKind s_readableByteStreamInternalsReadableByteStreamContro
const JSC::ImplementationVisibility s_readableByteStreamInternalsReadableByteStreamControllerGetDesiredSizeCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
const int s_readableByteStreamInternalsReadableByteStreamControllerGetDesiredSizeCodeLength = 272;
static const JSC::Intrinsic s_readableByteStreamInternalsReadableByteStreamControllerGetDesiredSizeCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_readableByteStreamInternalsReadableByteStreamControllerGetDesiredSizeCode = "(function (u){\"use strict\";const _=@getByIdDirectPrivate(u,\"controlledReadableStream\"),d=@getByIdDirectPrivate(_,\"state\");if(d===@streamErrored)return null;if(d===@streamClosed)return 0;return @getByIdDirectPrivate(u,\"strategyHWM\")-@getByIdDirectPrivate(u,\"queue\").size})\n";
+const char* const s_readableByteStreamInternalsReadableByteStreamControllerGetDesiredSizeCode = "(function (_){\"use strict\";const u=@getByIdDirectPrivate(_,\"controlledReadableStream\"),d=@getByIdDirectPrivate(u,\"state\");if(d===@streamErrored)return null;if(d===@streamClosed)return 0;return @getByIdDirectPrivate(_,\"strategyHWM\")-@getByIdDirectPrivate(_,\"queue\").size})\n";
// readableStreamHasBYOBReader
const JSC::ConstructAbility s_readableByteStreamInternalsReadableStreamHasBYOBReaderCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
@@ -2732,7 +2732,7 @@ const JSC::ConstructorKind s_readableByteStreamInternalsReadableStreamHasDefault
const JSC::ImplementationVisibility s_readableByteStreamInternalsReadableStreamHasDefaultReaderCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
const int s_readableByteStreamInternalsReadableStreamHasDefaultReaderCodeLength = 128;
static const JSC::Intrinsic s_readableByteStreamInternalsReadableStreamHasDefaultReaderCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_readableByteStreamInternalsReadableStreamHasDefaultReaderCode = "(function (n){\"use strict\";const l=@getByIdDirectPrivate(n,\"reader\");return l!==@undefined&&@isReadableStreamDefaultReader(l)})\n";
+const char* const s_readableByteStreamInternalsReadableStreamHasDefaultReaderCode = "(function (l){\"use strict\";const n=@getByIdDirectPrivate(l,\"reader\");return n!==@undefined&&@isReadableStreamDefaultReader(n)})\n";
// readableByteStreamControllerHandleQueueDrain
const JSC::ConstructAbility s_readableByteStreamInternalsReadableByteStreamControllerHandleQueueDrainCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
@@ -2748,7 +2748,7 @@ const JSC::ConstructorKind s_readableByteStreamInternalsReadableByteStreamContro
const JSC::ImplementationVisibility s_readableByteStreamInternalsReadableByteStreamControllerPullCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
const int s_readableByteStreamInternalsReadableByteStreamControllerPullCodeLength = 1005;
static const JSC::Intrinsic s_readableByteStreamInternalsReadableByteStreamControllerPullCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_readableByteStreamInternalsReadableByteStreamControllerPullCode = "(function (_){\"use strict\";const P=@getByIdDirectPrivate(_,\"controlledReadableStream\");if(@assert(@readableStreamHasDefaultReader(P)),@getByIdDirectPrivate(_,\"queue\").content\?.isNotEmpty()){const d=@getByIdDirectPrivate(_,\"queue\").content.shift();@getByIdDirectPrivate(_,\"queue\").size-=d.byteLength,@readableByteStreamControllerHandleQueueDrain(_);let h;try{h=new @Uint8Array(d.buffer,d.byteOffset,d.byteLength)}catch(F){return @Promise.@reject(F)}return @createFulfilledPromise({value:h,done:!1})}if(@getByIdDirectPrivate(_,\"autoAllocateChunkSize\")!==@undefined){let d;try{d=@createUninitializedArrayBuffer(@getByIdDirectPrivate(_,\"autoAllocateChunkSize\"))}catch(F){return @Promise.@reject(F)}const h={buffer:d,byteOffset:0,byteLength:@getByIdDirectPrivate(_,\"autoAllocateChunkSize\"),bytesFilled:0,elementSize:1,ctor:@Uint8Array,readerType:\"default\"};@getByIdDirectPrivate(_,\"pendingPullIntos\").push(h)}const R=@readableStreamAddReadRequest(P);return @readableByteStreamControllerCallPullIfNeeded(_),R})\n";
+const char* const s_readableByteStreamInternalsReadableByteStreamControllerPullCode = "(function (_){\"use strict\";const F=@getByIdDirectPrivate(_,\"controlledReadableStream\");if(@assert(@readableStreamHasDefaultReader(F)),@getByIdDirectPrivate(_,\"queue\").content\?.isNotEmpty()){const P=@getByIdDirectPrivate(_,\"queue\").content.shift();@getByIdDirectPrivate(_,\"queue\").size-=P.byteLength,@readableByteStreamControllerHandleQueueDrain(_);let R;try{R=new @Uint8Array(P.buffer,P.byteOffset,P.byteLength)}catch(h){return @Promise.@reject(h)}return @createFulfilledPromise({value:R,done:!1})}if(@getByIdDirectPrivate(_,\"autoAllocateChunkSize\")!==@undefined){let P;try{P=@createUninitializedArrayBuffer(@getByIdDirectPrivate(_,\"autoAllocateChunkSize\"))}catch(h){return @Promise.@reject(h)}const R={buffer:P,byteOffset:0,byteLength:@getByIdDirectPrivate(_,\"autoAllocateChunkSize\"),bytesFilled:0,elementSize:1,ctor:@Uint8Array,readerType:\"default\"};@getByIdDirectPrivate(_,\"pendingPullIntos\").push(R)}const d=@readableStreamAddReadRequest(F);return @readableByteStreamControllerCallPullIfNeeded(_),d})\n";
// readableByteStreamControllerShouldCallPull
const JSC::ConstructAbility s_readableByteStreamInternalsReadableByteStreamControllerShouldCallPullCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
@@ -2756,7 +2756,7 @@ const JSC::ConstructorKind s_readableByteStreamInternalsReadableByteStreamContro
const JSC::ImplementationVisibility s_readableByteStreamInternalsReadableByteStreamControllerShouldCallPullCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
const int s_readableByteStreamInternalsReadableByteStreamControllerShouldCallPullCodeLength = 619;
static const JSC::Intrinsic s_readableByteStreamInternalsReadableByteStreamControllerShouldCallPullCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_readableByteStreamInternalsReadableByteStreamControllerShouldCallPullCode = "(function (u){\"use strict\";const P=@getByIdDirectPrivate(u,\"controlledReadableStream\");if(@getByIdDirectPrivate(P,\"state\")!==@streamReadable)return!1;if(@getByIdDirectPrivate(u,\"closeRequested\"))return!1;if(!(@getByIdDirectPrivate(u,\"started\")>0))return!1;const b=@getByIdDirectPrivate(P,\"reader\");if(b&&(@getByIdDirectPrivate(b,\"readRequests\")\?.isNotEmpty()||!!@getByIdDirectPrivate(b,\"bunNativePtr\")))return!0;if(@readableStreamHasBYOBReader(P)&&@getByIdDirectPrivate(@getByIdDirectPrivate(P,\"reader\"),\"readIntoRequests\")\?.isNotEmpty())return!0;if(@readableByteStreamControllerGetDesiredSize(u)>0)return!0;return!1})\n";
+const char* const s_readableByteStreamInternalsReadableByteStreamControllerShouldCallPullCode = "(function (b){\"use strict\";const P=@getByIdDirectPrivate(b,\"controlledReadableStream\");if(@getByIdDirectPrivate(P,\"state\")!==@streamReadable)return!1;if(@getByIdDirectPrivate(b,\"closeRequested\"))return!1;if(!(@getByIdDirectPrivate(b,\"started\")>0))return!1;const u=@getByIdDirectPrivate(P,\"reader\");if(u&&(@getByIdDirectPrivate(u,\"readRequests\")\?.isNotEmpty()||!!@getByIdDirectPrivate(u,\"bunNativePtr\")))return!0;if(@readableStreamHasBYOBReader(P)&&@getByIdDirectPrivate(@getByIdDirectPrivate(P,\"reader\"),\"readIntoRequests\")\?.isNotEmpty())return!0;if(@readableByteStreamControllerGetDesiredSize(b)>0)return!0;return!1})\n";
// readableByteStreamControllerCallPullIfNeeded
const JSC::ConstructAbility s_readableByteStreamInternalsReadableByteStreamControllerCallPullIfNeededCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
@@ -2788,7 +2788,7 @@ const JSC::ConstructorKind s_readableByteStreamInternalsReadableByteStreamContro
const JSC::ImplementationVisibility s_readableByteStreamInternalsReadableByteStreamControllerEnqueueCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
const int s_readableByteStreamInternalsReadableByteStreamControllerEnqueueCodeLength = 1076;
static const JSC::Intrinsic s_readableByteStreamInternalsReadableByteStreamControllerEnqueueCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_readableByteStreamInternalsReadableByteStreamControllerEnqueueCode = "(function (d,i){\"use strict\";const _=@getByIdDirectPrivate(d,\"controlledReadableStream\");switch(@assert(!@getByIdDirectPrivate(d,\"closeRequested\")),@assert(@getByIdDirectPrivate(_,\"state\")===@streamReadable),@getByIdDirectPrivate(_,\"reader\")\?@readableStreamReaderKind(@getByIdDirectPrivate(_,\"reader\")):0){case 1:{if(!@getByIdDirectPrivate(@getByIdDirectPrivate(_,\"reader\"),\"readRequests\")\?.isNotEmpty())@readableByteStreamControllerEnqueueChunk(d,@transferBufferToCurrentRealm(i.buffer),i.byteOffset,i.byteLength);else{@assert(!@getByIdDirectPrivate(d,\"queue\").content.size());const f=i.constructor===@Uint8Array\?i:new @Uint8Array(i.buffer,i.byteOffset,i.byteLength);@readableStreamFulfillReadRequest(_,f,!1)}break}case 2:{@readableByteStreamControllerEnqueueChunk(d,@transferBufferToCurrentRealm(i.buffer),i.byteOffset,i.byteLength),@readableByteStreamControllerProcessPullDescriptors(d);break}case 3:break;default:{@assert(!@isReadableStreamLocked(_)),@readableByteStreamControllerEnqueueChunk(d,@transferBufferToCurrentRealm(i.buffer),i.byteOffset,i.byteLength);break}}})\n";
+const char* const s_readableByteStreamInternalsReadableByteStreamControllerEnqueueCode = "(function (i,_){\"use strict\";const d=@getByIdDirectPrivate(i,\"controlledReadableStream\");switch(@assert(!@getByIdDirectPrivate(i,\"closeRequested\")),@assert(@getByIdDirectPrivate(d,\"state\")===@streamReadable),@getByIdDirectPrivate(d,\"reader\")\?@readableStreamReaderKind(@getByIdDirectPrivate(d,\"reader\")):0){case 1:{if(!@getByIdDirectPrivate(@getByIdDirectPrivate(d,\"reader\"),\"readRequests\")\?.isNotEmpty())@readableByteStreamControllerEnqueueChunk(i,@transferBufferToCurrentRealm(_.buffer),_.byteOffset,_.byteLength);else{@assert(!@getByIdDirectPrivate(i,\"queue\").content.size());const f=_.constructor===@Uint8Array\?_:new @Uint8Array(_.buffer,_.byteOffset,_.byteLength);@readableStreamFulfillReadRequest(d,f,!1)}break}case 2:{@readableByteStreamControllerEnqueueChunk(i,@transferBufferToCurrentRealm(_.buffer),_.byteOffset,_.byteLength),@readableByteStreamControllerProcessPullDescriptors(i);break}case 3:break;default:{@assert(!@isReadableStreamLocked(d)),@readableByteStreamControllerEnqueueChunk(i,@transferBufferToCurrentRealm(_.buffer),_.byteOffset,_.byteLength);break}}})\n";
// readableByteStreamControllerEnqueueChunk
const JSC::ConstructAbility s_readableByteStreamInternalsReadableByteStreamControllerEnqueueChunkCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
@@ -2796,7 +2796,7 @@ const JSC::ConstructorKind s_readableByteStreamInternalsReadableByteStreamContro
const JSC::ImplementationVisibility s_readableByteStreamInternalsReadableByteStreamControllerEnqueueChunkCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
const int s_readableByteStreamInternalsReadableByteStreamControllerEnqueueChunkCodeLength = 160;
static const JSC::Intrinsic s_readableByteStreamInternalsReadableByteStreamControllerEnqueueChunkCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_readableByteStreamInternalsReadableByteStreamControllerEnqueueChunkCode = "(function (_,d,p,a){\"use strict\";@getByIdDirectPrivate(_,\"queue\").content.push({buffer:d,byteOffset:p,byteLength:a}),@getByIdDirectPrivate(_,\"queue\").size+=a})\n";
+const char* const s_readableByteStreamInternalsReadableByteStreamControllerEnqueueChunkCode = "(function (_,a,d,p){\"use strict\";@getByIdDirectPrivate(_,\"queue\").content.push({buffer:a,byteOffset:d,byteLength:p}),@getByIdDirectPrivate(_,\"queue\").size+=p})\n";
// readableByteStreamControllerRespondWithNewView
const JSC::ConstructAbility s_readableByteStreamInternalsReadableByteStreamControllerRespondWithNewViewCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
@@ -2804,7 +2804,7 @@ const JSC::ConstructorKind s_readableByteStreamInternalsReadableByteStreamContro
const JSC::ImplementationVisibility s_readableByteStreamInternalsReadableByteStreamControllerRespondWithNewViewCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
const int s_readableByteStreamInternalsReadableByteStreamControllerRespondWithNewViewCodeLength = 417;
static const JSC::Intrinsic s_readableByteStreamInternalsReadableByteStreamControllerRespondWithNewViewCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_readableByteStreamInternalsReadableByteStreamControllerRespondWithNewViewCode = "(function (d,u){\"use strict\";@assert(@getByIdDirectPrivate(d,\"pendingPullIntos\").isNotEmpty());let a=@getByIdDirectPrivate(d,\"pendingPullIntos\").peek();if(a.byteOffset+a.bytesFilled!==u.byteOffset)@throwRangeError(\"Invalid value for view.byteOffset\");if(a.byteLength!==u.byteLength)@throwRangeError(\"Invalid value for view.byteLength\");a.buffer=u.buffer,@readableByteStreamControllerRespondInternal(d,u.byteLength)})\n";
+const char* const s_readableByteStreamInternalsReadableByteStreamControllerRespondWithNewViewCode = "(function (a,u){\"use strict\";@assert(@getByIdDirectPrivate(a,\"pendingPullIntos\").isNotEmpty());let d=@getByIdDirectPrivate(a,\"pendingPullIntos\").peek();if(d.byteOffset+d.bytesFilled!==u.byteOffset)@throwRangeError(\"Invalid value for view.byteOffset\");if(d.byteLength!==u.byteLength)@throwRangeError(\"Invalid value for view.byteLength\");d.buffer=u.buffer,@readableByteStreamControllerRespondInternal(a,u.byteLength)})\n";
// readableByteStreamControllerRespond
const JSC::ConstructAbility s_readableByteStreamInternalsReadableByteStreamControllerRespondCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
@@ -2812,7 +2812,7 @@ const JSC::ConstructorKind s_readableByteStreamInternalsReadableByteStreamContro
const JSC::ImplementationVisibility s_readableByteStreamInternalsReadableByteStreamControllerRespondCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
const int s_readableByteStreamInternalsReadableByteStreamControllerRespondCodeLength = 251;
static const JSC::Intrinsic s_readableByteStreamInternalsReadableByteStreamControllerRespondCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_readableByteStreamInternalsReadableByteStreamControllerRespondCode = "(function (I,u){\"use strict\";if(u=@toNumber(u),@isNaN(u)||u===@Infinity||u<0)@throwRangeError(\"bytesWritten has an incorrect value\");@assert(@getByIdDirectPrivate(I,\"pendingPullIntos\").isNotEmpty()),@readableByteStreamControllerRespondInternal(I,u)})\n";
+const char* const s_readableByteStreamInternalsReadableByteStreamControllerRespondCode = "(function (u,I){\"use strict\";if(I=@toNumber(I),@isNaN(I)||I===@Infinity||I<0)@throwRangeError(\"bytesWritten has an incorrect value\");@assert(@getByIdDirectPrivate(u,\"pendingPullIntos\").isNotEmpty()),@readableByteStreamControllerRespondInternal(u,I)})\n";
// readableByteStreamControllerRespondInternal
const JSC::ConstructAbility s_readableByteStreamInternalsReadableByteStreamControllerRespondInternalCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
@@ -2820,7 +2820,7 @@ const JSC::ConstructorKind s_readableByteStreamInternalsReadableByteStreamContro
const JSC::ImplementationVisibility s_readableByteStreamInternalsReadableByteStreamControllerRespondInternalCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
const int s_readableByteStreamInternalsReadableByteStreamControllerRespondInternalCodeLength = 464;
static const JSC::Intrinsic s_readableByteStreamInternalsReadableByteStreamControllerRespondInternalCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_readableByteStreamInternalsReadableByteStreamControllerRespondInternalCode = "(function (d,u){\"use strict\";let _=@getByIdDirectPrivate(d,\"pendingPullIntos\").peek(),k=@getByIdDirectPrivate(d,\"controlledReadableStream\");if(@getByIdDirectPrivate(k,\"state\")===@streamClosed){if(u!==0)@throwTypeError(\"bytesWritten is different from 0 even though stream is closed\");@readableByteStreamControllerRespondInClosedState(d,_)}else @assert(@getByIdDirectPrivate(k,\"state\")===@streamReadable),@readableByteStreamControllerRespondInReadableState(d,u,_)})\n";
+const char* const s_readableByteStreamInternalsReadableByteStreamControllerRespondInternalCode = "(function (d,_){\"use strict\";let u=@getByIdDirectPrivate(d,\"pendingPullIntos\").peek(),k=@getByIdDirectPrivate(d,\"controlledReadableStream\");if(@getByIdDirectPrivate(k,\"state\")===@streamClosed){if(_!==0)@throwTypeError(\"bytesWritten is different from 0 even though stream is closed\");@readableByteStreamControllerRespondInClosedState(d,u)}else @assert(@getByIdDirectPrivate(k,\"state\")===@streamReadable),@readableByteStreamControllerRespondInReadableState(d,_,u)})\n";
// readableByteStreamControllerRespondInReadableState
const JSC::ConstructAbility s_readableByteStreamInternalsReadableByteStreamControllerRespondInReadableStateCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
@@ -2828,7 +2828,7 @@ const JSC::ConstructorKind s_readableByteStreamInternalsReadableByteStreamContro
const JSC::ImplementationVisibility s_readableByteStreamInternalsReadableByteStreamControllerRespondInReadableStateCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
const int s_readableByteStreamInternalsReadableByteStreamControllerRespondInReadableStateCodeLength = 799;
static const JSC::Intrinsic s_readableByteStreamInternalsReadableByteStreamControllerRespondInReadableStateCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_readableByteStreamInternalsReadableByteStreamControllerRespondInReadableStateCode = "(function (w,_,f){\"use strict\";if(f.bytesFilled+_>f.byteLength)@throwRangeError(\"bytesWritten value is too great\");if(@assert(@getByIdDirectPrivate(w,\"pendingPullIntos\").isEmpty()||@getByIdDirectPrivate(w,\"pendingPullIntos\").peek()===f),@readableByteStreamControllerInvalidateBYOBRequest(w),f.bytesFilled+=_,f.bytesFilled<f.elementSize)return;@readableByteStreamControllerShiftPendingDescriptor(w);const R=f.bytesFilled%f.elementSize;if(R>0){const h=f.byteOffset+f.bytesFilled,g=@cloneArrayBuffer(f.buffer,h-R,R);@readableByteStreamControllerEnqueueChunk(w,g,0,g.byteLength)}f.buffer=@transferBufferToCurrentRealm(f.buffer),f.bytesFilled-=R,@readableByteStreamControllerCommitDescriptor(@getByIdDirectPrivate(w,\"controlledReadableStream\"),f),@readableByteStreamControllerProcessPullDescriptors(w)})\n";
+const char* const s_readableByteStreamInternalsReadableByteStreamControllerRespondInReadableStateCode = "(function (w,g,R){\"use strict\";if(R.bytesFilled+g>R.byteLength)@throwRangeError(\"bytesWritten value is too great\");if(@assert(@getByIdDirectPrivate(w,\"pendingPullIntos\").isEmpty()||@getByIdDirectPrivate(w,\"pendingPullIntos\").peek()===R),@readableByteStreamControllerInvalidateBYOBRequest(w),R.bytesFilled+=g,R.bytesFilled<R.elementSize)return;@readableByteStreamControllerShiftPendingDescriptor(w);const _=R.bytesFilled%R.elementSize;if(_>0){const h=R.byteOffset+R.bytesFilled,f=@cloneArrayBuffer(R.buffer,h-_,_);@readableByteStreamControllerEnqueueChunk(w,f,0,f.byteLength)}R.buffer=@transferBufferToCurrentRealm(R.buffer),R.bytesFilled-=_,@readableByteStreamControllerCommitDescriptor(@getByIdDirectPrivate(w,\"controlledReadableStream\"),R),@readableByteStreamControllerProcessPullDescriptors(w)})\n";
// readableByteStreamControllerRespondInClosedState
const JSC::ConstructAbility s_readableByteStreamInternalsReadableByteStreamControllerRespondInClosedStateCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
@@ -2836,7 +2836,7 @@ const JSC::ConstructorKind s_readableByteStreamInternalsReadableByteStreamContro
const JSC::ImplementationVisibility s_readableByteStreamInternalsReadableByteStreamControllerRespondInClosedStateCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
const int s_readableByteStreamInternalsReadableByteStreamControllerRespondInClosedStateCodeLength = 502;
static const JSC::Intrinsic s_readableByteStreamInternalsReadableByteStreamControllerRespondInClosedStateCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_readableByteStreamInternalsReadableByteStreamControllerRespondInClosedStateCode = "(function (a,_){\"use strict\";if(_.buffer=@transferBufferToCurrentRealm(_.buffer),@assert(_.bytesFilled===0),@readableStreamHasBYOBReader(@getByIdDirectPrivate(a,\"controlledReadableStream\")))while(@getByIdDirectPrivate(@getByIdDirectPrivate(@getByIdDirectPrivate(a,\"controlledReadableStream\"),\"reader\"),\"readIntoRequests\")\?.isNotEmpty()){let d=@readableByteStreamControllerShiftPendingDescriptor(a);@readableByteStreamControllerCommitDescriptor(@getByIdDirectPrivate(a,\"controlledReadableStream\"),d)}})\n";
+const char* const s_readableByteStreamInternalsReadableByteStreamControllerRespondInClosedStateCode = "(function (a,d){\"use strict\";if(d.buffer=@transferBufferToCurrentRealm(d.buffer),@assert(d.bytesFilled===0),@readableStreamHasBYOBReader(@getByIdDirectPrivate(a,\"controlledReadableStream\")))while(@getByIdDirectPrivate(@getByIdDirectPrivate(@getByIdDirectPrivate(a,\"controlledReadableStream\"),\"reader\"),\"readIntoRequests\")\?.isNotEmpty()){let _=@readableByteStreamControllerShiftPendingDescriptor(a);@readableByteStreamControllerCommitDescriptor(@getByIdDirectPrivate(a,\"controlledReadableStream\"),_)}})\n";
// readableByteStreamControllerProcessPullDescriptors
const JSC::ConstructAbility s_readableByteStreamInternalsReadableByteStreamControllerProcessPullDescriptorsCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
@@ -2852,7 +2852,7 @@ const JSC::ConstructorKind s_readableByteStreamInternalsReadableByteStreamContro
const JSC::ImplementationVisibility s_readableByteStreamInternalsReadableByteStreamControllerFillDescriptorFromQueueCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
const int s_readableByteStreamInternalsReadableByteStreamControllerFillDescriptorFromQueueCodeLength = 970;
static const JSC::Intrinsic s_readableByteStreamInternalsReadableByteStreamControllerFillDescriptorFromQueueCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_readableByteStreamInternalsReadableByteStreamControllerFillDescriptorFromQueueCode = "(function (q,_){\"use strict\";const H=_.bytesFilled-_.bytesFilled%_.elementSize,z=@getByIdDirectPrivate(q,\"queue\").size<_.byteLength-_.bytesFilled\?@getByIdDirectPrivate(q,\"queue\").size:_.byteLength-_.bytesFilled,E=_.bytesFilled+z,G=E-E%_.elementSize;let v=z,w=!1;if(G>H)v=G-_.bytesFilled,w=!0;while(v>0){let j=@getByIdDirectPrivate(q,\"queue\").content.peek();const k=v<j.byteLength\?v:j.byteLength,J=_.byteOffset+_.bytesFilled;if(new @Uint8Array(_.buffer).set(new @Uint8Array(j.buffer,j.byteOffset,k),J),j.byteLength===k)@getByIdDirectPrivate(q,\"queue\").content.shift();else j.byteOffset+=k,j.byteLength-=k;@getByIdDirectPrivate(q,\"queue\").size-=k,@assert(@getByIdDirectPrivate(q,\"pendingPullIntos\").isEmpty()||@getByIdDirectPrivate(q,\"pendingPullIntos\").peek()===_),@readableByteStreamControllerInvalidateBYOBRequest(q),_.bytesFilled+=k,v-=k}if(!w)@assert(@getByIdDirectPrivate(q,\"queue\").size===0),@assert(_.bytesFilled>0),@assert(_.bytesFilled<_.elementSize);return w})\n";
+const char* const s_readableByteStreamInternalsReadableByteStreamControllerFillDescriptorFromQueueCode = "(function (_,q){\"use strict\";const v=q.bytesFilled-q.bytesFilled%q.elementSize,w=@getByIdDirectPrivate(_,\"queue\").size<q.byteLength-q.bytesFilled\?@getByIdDirectPrivate(_,\"queue\").size:q.byteLength-q.bytesFilled,j=q.bytesFilled+w,z=j-j%q.elementSize;let G=w,H=!1;if(z>v)G=z-q.bytesFilled,H=!0;while(G>0){let k=@getByIdDirectPrivate(_,\"queue\").content.peek();const J=G<k.byteLength\?G:k.byteLength,E=q.byteOffset+q.bytesFilled;if(new @Uint8Array(q.buffer).set(new @Uint8Array(k.buffer,k.byteOffset,J),E),k.byteLength===J)@getByIdDirectPrivate(_,\"queue\").content.shift();else k.byteOffset+=J,k.byteLength-=J;@getByIdDirectPrivate(_,\"queue\").size-=J,@assert(@getByIdDirectPrivate(_,\"pendingPullIntos\").isEmpty()||@getByIdDirectPrivate(_,\"pendingPullIntos\").peek()===q),@readableByteStreamControllerInvalidateBYOBRequest(_),q.bytesFilled+=J,G-=J}if(!H)@assert(@getByIdDirectPrivate(_,\"queue\").size===0),@assert(q.bytesFilled>0),@assert(q.bytesFilled<q.elementSize);return H})\n";
// readableByteStreamControllerShiftPendingDescriptor
const JSC::ConstructAbility s_readableByteStreamInternalsReadableByteStreamControllerShiftPendingDescriptorCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
@@ -2876,7 +2876,7 @@ const JSC::ConstructorKind s_readableByteStreamInternalsReadableByteStreamContro
const JSC::ImplementationVisibility s_readableByteStreamInternalsReadableByteStreamControllerCommitDescriptorCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
const int s_readableByteStreamInternalsReadableByteStreamControllerCommitDescriptorCodeLength = 386;
static const JSC::Intrinsic s_readableByteStreamInternalsReadableByteStreamControllerCommitDescriptorCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_readableByteStreamInternalsReadableByteStreamControllerCommitDescriptorCode = "(function (_,b){\"use strict\";@assert(@getByIdDirectPrivate(_,\"state\")!==@streamErrored);let g=!1;if(@getByIdDirectPrivate(_,\"state\")===@streamClosed)@assert(!b.bytesFilled),g=!0;let h=@readableByteStreamControllerConvertDescriptor(b);if(b.readerType===\"default\")@readableStreamFulfillReadRequest(_,h,g);else @assert(b.readerType===\"byob\"),@readableStreamFulfillReadIntoRequest(_,h,g)})\n";
+const char* const s_readableByteStreamInternalsReadableByteStreamControllerCommitDescriptorCode = "(function (h,g){\"use strict\";@assert(@getByIdDirectPrivate(h,\"state\")!==@streamErrored);let _=!1;if(@getByIdDirectPrivate(h,\"state\")===@streamClosed)@assert(!g.bytesFilled),_=!0;let b=@readableByteStreamControllerConvertDescriptor(g);if(g.readerType===\"default\")@readableStreamFulfillReadRequest(h,b,_);else @assert(g.readerType===\"byob\"),@readableStreamFulfillReadIntoRequest(h,b,_)})\n";
// readableByteStreamControllerConvertDescriptor
const JSC::ConstructAbility s_readableByteStreamInternalsReadableByteStreamControllerConvertDescriptorCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
@@ -2892,7 +2892,7 @@ const JSC::ConstructorKind s_readableByteStreamInternalsReadableStreamFulfillRea
const JSC::ImplementationVisibility s_readableByteStreamInternalsReadableStreamFulfillReadIntoRequestCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
const int s_readableByteStreamInternalsReadableStreamFulfillReadIntoRequestCodeLength = 161;
static const JSC::Intrinsic s_readableByteStreamInternalsReadableStreamFulfillReadIntoRequestCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_readableByteStreamInternalsReadableStreamFulfillReadIntoRequestCode = "(function (l,i,p){\"use strict\";const _=@getByIdDirectPrivate(@getByIdDirectPrivate(l,\"reader\"),\"readIntoRequests\").shift();@fulfillPromise(_,{value:i,done:p})})\n";
+const char* const s_readableByteStreamInternalsReadableStreamFulfillReadIntoRequestCode = "(function (l,_,i){\"use strict\";const p=@getByIdDirectPrivate(@getByIdDirectPrivate(l,\"reader\"),\"readIntoRequests\").shift();@fulfillPromise(p,{value:_,done:i})})\n";
// readableStreamBYOBReaderRead
const JSC::ConstructAbility s_readableByteStreamInternalsReadableStreamBYOBReaderReadCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
@@ -2900,7 +2900,7 @@ const JSC::ConstructorKind s_readableByteStreamInternalsReadableStreamBYOBReader
const JSC::ImplementationVisibility s_readableByteStreamInternalsReadableStreamBYOBReaderReadCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
const int s_readableByteStreamInternalsReadableStreamBYOBReaderReadCodeLength = 356;
static const JSC::Intrinsic s_readableByteStreamInternalsReadableStreamBYOBReaderReadCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_readableByteStreamInternalsReadableStreamBYOBReaderReadCode = "(function (c,l){\"use strict\";const o=@getByIdDirectPrivate(c,\"ownerReadableStream\");if(@assert(!!o),@putByIdDirectPrivate(o,\"disturbed\",!0),@getByIdDirectPrivate(o,\"state\")===@streamErrored)return @Promise.@reject(@getByIdDirectPrivate(o,\"storedError\"));return @readableByteStreamControllerPullInto(@getByIdDirectPrivate(o,\"readableStreamController\"),l)})\n";
+const char* const s_readableByteStreamInternalsReadableStreamBYOBReaderReadCode = "(function (o,c){\"use strict\";const l=@getByIdDirectPrivate(o,\"ownerReadableStream\");if(@assert(!!l),@putByIdDirectPrivate(l,\"disturbed\",!0),@getByIdDirectPrivate(l,\"state\")===@streamErrored)return @Promise.@reject(@getByIdDirectPrivate(l,\"storedError\"));return @readableByteStreamControllerPullInto(@getByIdDirectPrivate(l,\"readableStreamController\"),c)})\n";
// readableByteStreamControllerPullInto
const JSC::ConstructAbility s_readableByteStreamInternalsReadableByteStreamControllerPullIntoCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
@@ -2908,7 +2908,7 @@ const JSC::ConstructorKind s_readableByteStreamInternalsReadableByteStreamContro
const JSC::ImplementationVisibility s_readableByteStreamInternalsReadableByteStreamControllerPullIntoCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
const int s_readableByteStreamInternalsReadableByteStreamControllerPullIntoCodeLength = 1255;
static const JSC::Intrinsic s_readableByteStreamInternalsReadableByteStreamControllerPullIntoCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_readableByteStreamInternalsReadableByteStreamControllerPullIntoCode = "(function (b,d){\"use strict\";const A=@getByIdDirectPrivate(b,\"controlledReadableStream\");let E=1;if(d.BYTES_PER_ELEMENT!==@undefined)E=d.BYTES_PER_ELEMENT;const L=d.constructor,_={buffer:d.buffer,byteOffset:d.byteOffset,byteLength:d.byteLength,bytesFilled:0,elementSize:E,ctor:L,readerType:\"byob\"};var N=@getByIdDirectPrivate(b,\"pendingPullIntos\");if(N\?.isNotEmpty())return _.buffer=@transferBufferToCurrentRealm(_.buffer),N.push(_),@readableStreamAddReadIntoRequest(A);if(@getByIdDirectPrivate(A,\"state\")===@streamClosed){const k=new L(_.buffer,_.byteOffset,0);return @createFulfilledPromise({value:k,done:!0})}if(@getByIdDirectPrivate(b,\"queue\").size>0){if(@readableByteStreamControllerFillDescriptorFromQueue(b,_)){const k=@readableByteStreamControllerConvertDescriptor(_);return @readableByteStreamControllerHandleQueueDrain(b),@createFulfilledPromise({value:k,done:!1})}if(@getByIdDirectPrivate(b,\"closeRequested\")){const k=@makeTypeError(\"Closing stream has been requested\");return @readableByteStreamControllerError(b,k),@Promise.@reject(k)}}_.buffer=@transferBufferToCurrentRealm(_.buffer),@getByIdDirectPrivate(b,\"pendingPullIntos\").push(_);const R=@readableStreamAddReadIntoRequest(A);return @readableByteStreamControllerCallPullIfNeeded(b),R})\n";
+const char* const s_readableByteStreamInternalsReadableByteStreamControllerPullIntoCode = "(function (_,E){\"use strict\";const k=@getByIdDirectPrivate(_,\"controlledReadableStream\");let L=1;if(E.BYTES_PER_ELEMENT!==@undefined)L=E.BYTES_PER_ELEMENT;const b=E.constructor,N={buffer:E.buffer,byteOffset:E.byteOffset,byteLength:E.byteLength,bytesFilled:0,elementSize:L,ctor:b,readerType:\"byob\"};var d=@getByIdDirectPrivate(_,\"pendingPullIntos\");if(d\?.isNotEmpty())return N.buffer=@transferBufferToCurrentRealm(N.buffer),d.push(N),@readableStreamAddReadIntoRequest(k);if(@getByIdDirectPrivate(k,\"state\")===@streamClosed){const A=new b(N.buffer,N.byteOffset,0);return @createFulfilledPromise({value:A,done:!0})}if(@getByIdDirectPrivate(_,\"queue\").size>0){if(@readableByteStreamControllerFillDescriptorFromQueue(_,N)){const A=@readableByteStreamControllerConvertDescriptor(N);return @readableByteStreamControllerHandleQueueDrain(_),@createFulfilledPromise({value:A,done:!1})}if(@getByIdDirectPrivate(_,\"closeRequested\")){const A=@makeTypeError(\"Closing stream has been requested\");return @readableByteStreamControllerError(_,A),@Promise.@reject(A)}}N.buffer=@transferBufferToCurrentRealm(N.buffer),@getByIdDirectPrivate(_,\"pendingPullIntos\").push(N);const R=@readableStreamAddReadIntoRequest(k);return @readableByteStreamControllerCallPullIfNeeded(_),R})\n";
// readableStreamAddReadIntoRequest
const JSC::ConstructAbility s_readableByteStreamInternalsReadableStreamAddReadIntoRequestCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
@@ -2942,7 +2942,7 @@ const JSC::ConstructorKind s_writableStreamDefaultControllerErrorCodeConstructor
const JSC::ImplementationVisibility s_writableStreamDefaultControllerErrorCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
const int s_writableStreamDefaultControllerErrorCodeLength = 301;
static const JSC::Intrinsic s_writableStreamDefaultControllerErrorCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_writableStreamDefaultControllerErrorCode = "(function (r){\"use strict\";if(@getByIdDirectPrivate(this,\"abortSteps\")===@undefined)throw @makeThisTypeError(\"WritableStreamDefaultController\",\"error\");const t=@getByIdDirectPrivate(this,\"stream\");if(@getByIdDirectPrivate(t,\"state\")!==\"writable\")return;@writableStreamDefaultControllerError(this,r)})\n";
+const char* const s_writableStreamDefaultControllerErrorCode = "(function (t){\"use strict\";if(@getByIdDirectPrivate(this,\"abortSteps\")===@undefined)throw @makeThisTypeError(\"WritableStreamDefaultController\",\"error\");const r=@getByIdDirectPrivate(this,\"stream\");if(@getByIdDirectPrivate(r,\"state\")!==\"writable\")return;@writableStreamDefaultControllerError(this,t)})\n";
#define DEFINE_BUILTIN_GENERATOR(codeName, functionName, overriddenName, argumentCount) \
JSC::FunctionExecutable* codeName##Generator(JSC::VM& vm) \
@@ -2960,7 +2960,7 @@ const JSC::ConstructorKind s_eventSourceGetEventSourceCodeConstructorKind = JSC:
const JSC::ImplementationVisibility s_eventSourceGetEventSourceCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
const int s_eventSourceGetEventSourceCodeLength = 5477;
static const JSC::Intrinsic s_eventSourceGetEventSourceCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_eventSourceGetEventSourceCode = "(function (){\"use strict\";class F extends EventTarget{#B;#$;#J;#K;#L;#M=!1;#A=null;#j=\"\";#O=\"\";#Q=\"\";#U=!0;#F=0;#G=0;#X=0;#w=null;static#V(j){j.#H()}static#Y(j,A){const w=j.data,B=w.#Q\?`Last-Event-ID: ${w.#Q}\\r\\n`:\"\",K=`GET ${A.pathname}${A.search} HTTP/1.1\\r\\nHost: bun\\r\\nContent-type: text/event-stream\\r\\nContent-length: 0\\r\\n${B}\\r\\n`,G=j.write(K);if(G!==K.length)w.#O=K.substring(G)}static#Z(j,A,w){for(;;){if(w>=A.length)return;let B=-1,K=A.indexOf(\"\\r\\n\",w);const G=K+2;if(K>0)if(j.#F===0){const J=parseInt(A.substring(w,K),16);if(J===0){j.#$=2,j.#A\?.end();return}B=G+J}else B=A.length;else{if(j.#j.length===0){j.#j+=A.substring(w);return}B=A.length}let M=A.substring(G,B);w=B+2;let Z=0,L=M.indexOf(\"\\n\\n\");if(L==-1){j.#j+=A.substring(G);return}if(j.#j.length)j.#j+=M,M=j.#j,j.#j=\"\";let X=!0;while(X){const J=M.substring(Z,L);let Y,O=\"\",Q,W=0,V=-1;for(;;){let z=J.indexOf(\"\\n\",W);if(z===-1){if(W>=J.length)break;z=J.length}const U=J.substring(W,z);if(U.startsWith(\"data:\"))if(O.length)O+=`\\n${U.substring(5).trim()}`;else O=U.substring(5).trim();else if(U.startsWith(\"event:\"))Y=U.substring(6).trim();else if(U.startsWith(\"id:\"))Q=U.substring(3).trim();else if(U.startsWith(\"retry:\")){if(V=parseInt(U.substring(6).trim(),10),@isNaN(V))V=-1}W=z+1}if(j.#Q=Q||\"\",V>=0)j.#X=V;if(O||Q||Y)j.dispatchEvent(new MessageEvent(Y||\"message\",{data:O||\"\",origin:j.#B.origin,source:j,lastEventId:Q}));if(M.length===L+2){X=!1;break}const H=M.indexOf(\"\\n\\n\",L+1);if(H===-1)break;Z=L,L=H}}}static#z={open(j){const A=j.data;if(A.#A=j,!A.#M)F.#Y(j,A.#B)},handshake(j,A,w){const B=j.data;if(A)F.#Y(j,B.#B);else B.#$=2,B.dispatchEvent(new ErrorEvent(\"error\",{error:w})),j.end()},data(j,A){const w=j.data;switch(w.#$){case 0:{let B=A.toString();const K=B.indexOf(\"\\r\\n\\r\\n\");if(K===-1){w.#j+=B;return}if(w.#j.length)w.#j+=B,B=w.#j,w.#j=\"\";const G=B.substring(0,K),M=G.indexOf(\"\\r\\n\");if(M===-1){w.#$=2,w.dispatchEvent(new ErrorEvent(\"error\",{error:new Error(\"Invalid HTTP request\")})),j.end();return}const Z=G.substring(0,M);if(Z!==\"HTTP/1.1 200 OK\"){w.#$=2,w.dispatchEvent(new ErrorEvent(\"error\",{error:new Error(Z)})),j.end();return}let L=M+1,X=!1,J=-1;for(;;){let O=G.indexOf(\"\\r\\n\",L);if(O===-1){if(L>=G.length){if(!X)w.#$=2,w.dispatchEvent(new ErrorEvent(\"error\",{error:new Error(`EventSource's response has no MIME type and \"text/event-stream\" is required. Aborting the connection.`)})),j.end();return}O=G.length}const Q=G.substring(L+1,O),W=Q.indexOf(\":\"),V=Q.substring(0,W),H=V.localeCompare(\"content-type\",@undefined,{sensitivity:\"accent\"})===0;if(L=O+1,H)if(Q.endsWith(\" text/event-stream\"))X=!0;else{w.#$=2,w.dispatchEvent(new ErrorEvent(\"error\",{error:new Error(`EventSource's response has a MIME type that is not \"text/event-stream\". Aborting the connection.`)})),j.end();return}else if(V.localeCompare(\"content-length\",@undefined,{sensitivity:\"accent\"})===0){if(J=parseInt(Q.substring(W+1).trim(),10),@isNaN(J)||J<=0){w.dispatchEvent(new ErrorEvent(\"error\",{error:new Error(`EventSource's Content-Length is invalid. Aborting the connection.`)})),j.end();return}if(X)break}else if(V.localeCompare(\"transfer-encoding\",@undefined,{sensitivity:\"accent\"})===0){if(Q.substring(W+1).trim()!==\"chunked\"){w.dispatchEvent(new ErrorEvent(\"error\",{error:new Error(`EventSource's Transfer-Encoding is invalid. Aborting the connection.`)})),j.end();return}if(J=0,X)break}}w.#F=J,w.#$=1,w.dispatchEvent(new Event(\"open\"));const Y=B.substring(K+4);if(F.#Z(w,Y,0),w.#F>0){if(w.#G+=Y.length,w.#G>=w.#F)w.#$=2,j.end()}return}case 1:if(F.#Z(w,A.toString(),2),w.#F>0){if(w.#G+=A.byteLength,w.#G>=w.#F)w.#$=2,j.end()}return;default:break}},drain(j){const A=j.data;if(A.#$===0){const w=A.#j;if(w.length){const B=j.write(w);if(B!==w.length)j.data.#O=w.substring(B);else j.data.#O=\"\"}}},close:F.#W,end(j){F.#W(j).dispatchEvent(new ErrorEvent(\"error\",{error:new Error(\"Connection closed by server\")}))},timeout(j){F.#W(j).dispatchEvent(new ErrorEvent(\"error\",{error:new Error(\"Timeout\")}))},binaryType:\"buffer\"};static#W(j){const A=j.data;if(A.#A=null,A.#G=0,A.#$=2,A.#U){if(A.#w)clearTimeout(A.#w);A.#w=setTimeout(F.#V,A.#X,A)}return A}constructor(j,A=@undefined){super();const w=new URL(j);this.#M=w.protocol===\"https:\",this.#B=w,this.#$=2,process.nextTick(F.#V,this)}ref(){this.#w\?.ref(),this.#A\?.ref()}unref(){this.#w\?.unref(),this.#A\?.unref()}#H(){if(this.#$!==2)return;const j=this.#B,A=this.#M;this.#$=0,@Bun.connect({data:this,socket:F.#z,hostname:j.hostname,port:parseInt(j.port||(A\?\"443\":\"80\"),10),tls:A\?{requestCert:!0,rejectUnauthorized:!1}:!1}).catch((w)=>{if(super.dispatchEvent(new ErrorEvent(\"error\",{error:w})),this.#U){if(this.#w)this.#w.unref\?.();this.#w=setTimeout(F.#V,1000,this)}})}get url(){return this.#B.href}get readyState(){return this.#$}close(){this.#U=!1,this.#$=2,this.#A\?.unref(),this.#A\?.end()}get onopen(){return this.#L}get onerror(){return this.#J}get onmessage(){return this.#K}set onopen(j){if(this.#L)super.removeEventListener(\"close\",this.#L);super.addEventListener(\"open\",j),this.#L=j}set onerror(j){if(this.#J)super.removeEventListener(\"error\",this.#J);super.addEventListener(\"error\",j),this.#J=j}set onmessage(j){if(this.#K)super.removeEventListener(\"message\",this.#K);super.addEventListener(\"message\",j),this.#K=j}}return Object.defineProperty(F.prototype,\"CONNECTING\",{enumerable:!0,value:0}),Object.defineProperty(F.prototype,\"OPEN\",{enumerable:!0,value:1}),Object.defineProperty(F.prototype,\"CLOSED\",{enumerable:!0,value:2}),F[Symbol.for(\"CommonJS\")]=0,F})\n";
+const char* const s_eventSourceGetEventSourceCode = "(function (){\"use strict\";class B extends EventTarget{#$;#j;#w;#A;#B;#F=!1;#G=null;#J=\"\";#K=\"\";#L=\"\";#M=!0;#O=0;#Q=0;#U=0;#V=null;static#W(V){V.#H()}static#X(V,j){const w=V.data,F=w.#L\?`Last-Event-ID: ${w.#L}\\r\\n`:\"\",G=`GET ${j.pathname}${j.search} HTTP/1.1\\r\\nHost: bun\\r\\nContent-type: text/event-stream\\r\\nContent-length: 0\\r\\n${F}\\r\\n`,W=V.write(G);if(W!==G.length)w.#K=G.substring(W)}static#Y(V,j,w){for(;;){if(w>=j.length)return;let F=-1,G=j.indexOf(\"\\r\\n\",w);const W=G+2;if(G>0)if(V.#O===0){const Z=parseInt(j.substring(w,G),16);if(Z===0){V.#j=2,V.#G\?.end();return}F=W+Z}else F=j.length;else{if(V.#J.length===0){V.#J+=j.substring(w);return}F=j.length}let X=j.substring(W,F);w=F+2;let J=0,Y=X.indexOf(\"\\n\\n\");if(Y==-1){V.#J+=j.substring(W);return}if(V.#J.length)V.#J+=X,X=V.#J,V.#J=\"\";let K=!0;while(K){const Z=X.substring(J,Y);let L,z=\"\",A,H=0,M=-1;for(;;){let Q=Z.indexOf(\"\\n\",H);if(Q===-1){if(H>=Z.length)break;Q=Z.length}const U=Z.substring(H,Q);if(U.startsWith(\"data:\"))if(z.length)z+=`\\n${U.substring(5).trim()}`;else z=U.substring(5).trim();else if(U.startsWith(\"event:\"))L=U.substring(6).trim();else if(U.startsWith(\"id:\"))A=U.substring(3).trim();else if(U.startsWith(\"retry:\")){if(M=parseInt(U.substring(6).trim(),10),@isNaN(M))M=-1}H=Q+1}if(V.#L=A||\"\",M>=0)V.#U=M;if(z||A||L)V.dispatchEvent(new MessageEvent(L||\"message\",{data:z||\"\",origin:V.#$.origin,source:V,lastEventId:A}));if(X.length===Y+2){K=!1;break}const O=X.indexOf(\"\\n\\n\",Y+1);if(O===-1)break;J=Y,Y=O}}}static#Z={open(V){const j=V.data;if(j.#G=V,!j.#F)B.#X(V,j.#$)},handshake(V,j,w){const F=V.data;if(j)B.#X(V,F.#$);else F.#j=2,F.dispatchEvent(new ErrorEvent(\"error\",{error:w})),V.end()},data(V,j){const w=V.data;switch(w.#j){case 0:{let F=j.toString();const G=F.indexOf(\"\\r\\n\\r\\n\");if(G===-1){w.#J+=F;return}if(w.#J.length)w.#J+=F,F=w.#J,w.#J=\"\";const W=F.substring(0,G),X=W.indexOf(\"\\r\\n\");if(X===-1){w.#j=2,w.dispatchEvent(new ErrorEvent(\"error\",{error:new Error(\"Invalid HTTP request\")})),V.end();return}const J=W.substring(0,X);if(J!==\"HTTP/1.1 200 OK\"){w.#j=2,w.dispatchEvent(new ErrorEvent(\"error\",{error:new Error(J)})),V.end();return}let Y=X+1,K=!1,Z=-1;for(;;){let z=W.indexOf(\"\\r\\n\",Y);if(z===-1){if(Y>=W.length){if(!K)w.#j=2,w.dispatchEvent(new ErrorEvent(\"error\",{error:new Error(`EventSource's response has no MIME type and \"text/event-stream\" is required. Aborting the connection.`)})),V.end();return}z=W.length}const A=W.substring(Y+1,z),H=A.indexOf(\":\"),M=A.substring(0,H),O=M.localeCompare(\"content-type\",@undefined,{sensitivity:\"accent\"})===0;if(Y=z+1,O)if(A.endsWith(\" text/event-stream\"))K=!0;else{w.#j=2,w.dispatchEvent(new ErrorEvent(\"error\",{error:new Error(`EventSource's response has a MIME type that is not \"text/event-stream\". Aborting the connection.`)})),V.end();return}else if(M.localeCompare(\"content-length\",@undefined,{sensitivity:\"accent\"})===0){if(Z=parseInt(A.substring(H+1).trim(),10),@isNaN(Z)||Z<=0){w.dispatchEvent(new ErrorEvent(\"error\",{error:new Error(`EventSource's Content-Length is invalid. Aborting the connection.`)})),V.end();return}if(K)break}else if(M.localeCompare(\"transfer-encoding\",@undefined,{sensitivity:\"accent\"})===0){if(A.substring(H+1).trim()!==\"chunked\"){w.dispatchEvent(new ErrorEvent(\"error\",{error:new Error(`EventSource's Transfer-Encoding is invalid. Aborting the connection.`)})),V.end();return}if(Z=0,K)break}}w.#O=Z,w.#j=1,w.dispatchEvent(new Event(\"open\"));const L=F.substring(G+4);if(B.#Y(w,L,0),w.#O>0){if(w.#Q+=L.length,w.#Q>=w.#O)w.#j=2,V.end()}return}case 1:if(B.#Y(w,j.toString(),2),w.#O>0){if(w.#Q+=j.byteLength,w.#Q>=w.#O)w.#j=2,V.end()}return;default:break}},drain(V){const j=V.data;if(j.#j===0){const w=j.#J;if(w.length){const F=V.write(w);if(F!==w.length)V.data.#K=w.substring(F);else V.data.#K=\"\"}}},close:B.#z,end(V){B.#z(V).dispatchEvent(new ErrorEvent(\"error\",{error:new Error(\"Connection closed by server\")}))},timeout(V){B.#z(V).dispatchEvent(new ErrorEvent(\"error\",{error:new Error(\"Timeout\")}))},binaryType:\"buffer\"};static#z(V){const j=V.data;if(j.#G=null,j.#Q=0,j.#j=2,j.#M){if(j.#V)clearTimeout(j.#V);j.#V=setTimeout(B.#W,j.#U,j)}return j}constructor(V,j=@undefined){super();const w=new URL(V);this.#F=w.protocol===\"https:\",this.#$=w,this.#j=2,process.nextTick(B.#W,this)}ref(){this.#V\?.ref(),this.#G\?.ref()}unref(){this.#V\?.unref(),this.#G\?.unref()}#H(){if(this.#j!==2)return;const V=this.#$,j=this.#F;this.#j=0,@Bun.connect({data:this,socket:B.#Z,hostname:V.hostname,port:parseInt(V.port||(j\?\"443\":\"80\"),10),tls:j\?{requestCert:!0,rejectUnauthorized:!1}:!1}).catch((w)=>{if(super.dispatchEvent(new ErrorEvent(\"error\",{error:w})),this.#M){if(this.#V)this.#V.unref\?.();this.#V=setTimeout(B.#W,1000,this)}})}get url(){return this.#$.href}get readyState(){return this.#j}close(){this.#M=!1,this.#j=2,this.#G\?.unref(),this.#G\?.end()}get onopen(){return this.#B}get onerror(){return this.#w}get onmessage(){return this.#A}set onopen(V){if(this.#B)super.removeEventListener(\"close\",this.#B);super.addEventListener(\"open\",V),this.#B=V}set onerror(V){if(this.#w)super.removeEventListener(\"error\",this.#w);super.addEventListener(\"error\",V),this.#w=V}set onmessage(V){if(this.#A)super.removeEventListener(\"message\",this.#A);super.addEventListener(\"message\",V),this.#A=V}}return Object.defineProperty(B.prototype,\"CONNECTING\",{enumerable:!0,value:0}),Object.defineProperty(B.prototype,\"OPEN\",{enumerable:!0,value:1}),Object.defineProperty(B.prototype,\"CLOSED\",{enumerable:!0,value:2}),B[Symbol.for(\"CommonJS\")]=0,B})\n";
#define DEFINE_BUILTIN_GENERATOR(codeName, functionName, overriddenName, argumentCount) \
JSC::FunctionExecutable* codeName##Generator(JSC::VM& vm) \
diff --git a/src/js/out/modules/node/net.js b/src/js/out/modules/node/net.js
index 7f3102648..06b2ef6ef 100644
--- a/src/js/out/modules/node/net.js
+++ b/src/js/out/modules/node/net.js
@@ -26,7 +26,7 @@ var isIPv4 = function(s) {
self.emit("listening");
}, createServer = function(options, connectionListener) {
return new Server(options, connectionListener);
-}, v4Seg = "(?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])", v4Str = `(${v4Seg}[.]){3}${v4Seg}`, IPv4Reg = new RegExp(`^${v4Str}$`), v6Seg = "(?:[0-9a-fA-F]{1,4})", IPv6Reg = new RegExp("^(" + `(?:${v6Seg}:){7}(?:${v6Seg}|:)|` + `(?:${v6Seg}:){6}(?:${v4Str}|:${v6Seg}|:)|` + `(?:${v6Seg}:){5}(?::${v4Str}|(:${v6Seg}){1,2}|:)|` + `(?:${v6Seg}:){4}(?:(:${v6Seg}){0,1}:${v4Str}|(:${v6Seg}){1,3}|:)|` + `(?:${v6Seg}:){3}(?:(:${v6Seg}){0,2}:${v4Str}|(:${v6Seg}){1,4}|:)|` + `(?:${v6Seg}:){2}(?:(:${v6Seg}){0,3}:${v4Str}|(:${v6Seg}){1,5}|:)|` + `(?:${v6Seg}:){1}(?:(:${v6Seg}){0,4}:${v4Str}|(:${v6Seg}){1,6}|:)|` + `(?::((?::${v6Seg}){0,5}:${v4Str}|(?::${v6Seg}){1,7}|:))` + ")(%[0-9a-zA-Z-.:]{1,})?$"), { Bun, createFIFO, Object } = globalThis[Symbol.for("Bun.lazy")]("primordials"), { connect: bunConnect } = Bun, { setTimeout } = globalThis, bunTlsSymbol = Symbol.for("::buntls::"), bunSocketServerHandlers = Symbol.for("::bunsocket_serverhandlers::"), bunSocketServerConnections = Symbol.for("::bunnetserverconnections::"), bunSocketServerOptions = Symbol.for("::bunnetserveroptions::"), bunSocketInternal = Symbol.for("::bunnetsocketinternal::"), SocketClass, Socket = function(InternalSocket) {
+}, v4Seg = "(?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])", v4Str = `(${v4Seg}[.]){3}${v4Seg}`, IPv4Reg = new RegExp(`^${v4Str}$`), v6Seg = "(?:[0-9a-fA-F]{1,4})", IPv6Reg = new RegExp("^(" + `(?:${v6Seg}:){7}(?:${v6Seg}|:)|` + `(?:${v6Seg}:){6}(?:${v4Str}|:${v6Seg}|:)|` + `(?:${v6Seg}:){5}(?::${v4Str}|(:${v6Seg}){1,2}|:)|` + `(?:${v6Seg}:){4}(?:(:${v6Seg}){0,1}:${v4Str}|(:${v6Seg}){1,3}|:)|` + `(?:${v6Seg}:){3}(?:(:${v6Seg}){0,2}:${v4Str}|(:${v6Seg}){1,4}|:)|` + `(?:${v6Seg}:){2}(?:(:${v6Seg}){0,3}:${v4Str}|(:${v6Seg}){1,5}|:)|` + `(?:${v6Seg}:){1}(?:(:${v6Seg}){0,4}:${v4Str}|(:${v6Seg}){1,6}|:)|` + `(?::((?::${v6Seg}){0,5}:${v4Str}|(?::${v6Seg}){1,7}|:))` + ")(%[0-9a-zA-Z-.:]{1,})?$"), { Bun, createFIFO, Object } = globalThis[Symbol.for("Bun.lazy")]("primordials"), { connect: bunConnect } = Bun, { setTimeout } = globalThis, bunTlsSymbol = Symbol.for("::buntls::"), bunSocketServerHandlers = Symbol.for("::bunsocket_serverhandlers::"), bunSocketServerConnections = Symbol.for("::bunnetserverconnections::"), bunSocketServerOptions = Symbol.for("::bunnetserveroptions::"), bunSocketInternal = Symbol.for("::bunnetsocketinternal::"), bunTLSConnectOptions = Symbol.for("::buntlsconnectoptions::"), SocketClass, Socket = function(InternalSocket) {
return SocketClass = InternalSocket, Object.defineProperty(SocketClass.prototype, Symbol.toStringTag, {
value: "Socket",
enumerable: !1
@@ -62,13 +62,26 @@ var isIPv4 = function(s) {
},
open(socket) {
const self = socket.data;
- if (socket.timeout(self.timeout), socket.ref(), self[bunSocketInternal] = socket, self.connecting = !1, !self.#upgraded)
+ socket.timeout(self.timeout), socket.ref(), self[bunSocketInternal] = socket, self.connecting = !1;
+ const options = self[bunTLSConnectOptions];
+ if (options) {
+ const { session } = options;
+ if (session)
+ self.setSession(session);
+ }
+ if (!self.#upgraded)
self.emit("connect", self);
Socket2.#Drain(socket);
},
handshake(socket, success, verifyError) {
const { data: self } = socket;
- if (self._securePending = !1, self.secureConnecting = !1, self._secureEstablished = !!success, self._requestCert || self._rejectUnauthorized) {
+ self._securePending = !1, self.secureConnecting = !1, self._secureEstablished = !!success, self.emit("secure", self);
+ const { checkServerIdentity } = self[bunTLSConnectOptions];
+ if (!verifyError && typeof checkServerIdentity === "function" && self.servername) {
+ const cert = self.getPeerCertificate(!0);
+ verifyError = checkServerIdentity(self.servername, cert);
+ }
+ if (self._requestCert || self._rejectUnauthorized) {
if (verifyError) {
if (self.authorized = !1, self.authorizationError = verifyError.code || verifyError.message, self._rejectUnauthorized) {
self.destroy(verifyError);
@@ -138,8 +151,9 @@ var isIPv4 = function(s) {
connectionListener(_socket);
self.emit("connection", _socket);
},
- handshake({ data: self }, success, verifyError) {
- if (self._securePending = !1, self.secureConnecting = !1, self._secureEstablished = !!success, self._requestCert || self._rejectUnauthorized) {
+ handshake(socket, success, verifyError) {
+ const { data: self } = socket;
+ if (self.emit("secure", self), self._securePending = !1, self.secureConnecting = !1, self._secureEstablished = !!success, self._requestCert || self._rejectUnauthorized) {
if (verifyError) {
if (self.authorized = !1, self.authorizationError = verifyError.code || verifyError.message, self._rejectUnauthorized) {
self.destroy(verifyError);
@@ -148,7 +162,7 @@ var isIPv4 = function(s) {
}
} else
self.authorized = !0;
- self.emit("secureConnect", verifyError);
+ self.emit("secureConnection", verifyError);
},
error(socket, error) {
Socket2.#Handlers.error(socket, error), this.data.emit("error", error);
@@ -166,6 +180,7 @@ var isIPv4 = function(s) {
#readQueue = createFIFO();
remotePort;
[bunSocketInternal] = null;
+ [bunTLSConnectOptions] = null;
timeout = 0;
#writeCallback;
#writeChunk;
@@ -199,10 +214,12 @@ var isIPv4 = function(s) {
return this.writableLength;
}
#attach(port, socket) {
- this.remotePort = port, socket.data = this, socket.timeout(this.timeout), socket.ref(), this[bunSocketInternal] = socket, this.connecting = !1, this.emit("connect", this), Socket2.#Drain(socket);
+ if (this.remotePort = port, socket.data = this, socket.timeout(this.timeout), socket.ref(), this[bunSocketInternal] = socket, this.connecting = !1, !this.#upgraded)
+ this.emit("connect", this);
+ Socket2.#Drain(socket);
}
connect(port, host, connectListener) {
- var path, connection = this.#socket;
+ var path, connection = this.#socket, _checkServerIdentity = void 0;
if (typeof port === "string") {
if (path = port, port = void 0, typeof host === "function")
connectListener = host, host = void 0;
@@ -228,9 +245,11 @@ var isIPv4 = function(s) {
requestCert,
rejectUnauthorized,
pauseOnConnect,
- servername
+ servername,
+ checkServerIdentity,
+ session
} = port;
- if (this.servername = servername, socket)
+ if (_checkServerIdentity = checkServerIdentity, this.servername = servername, socket)
connection = socket;
}
if (!pauseOnConnect)
@@ -240,12 +259,7 @@ var isIPv4 = function(s) {
var tls = void 0;
if (typeof bunTLS === "function") {
if (tls = bunTLS.call(this, port, host, !0), this._requestCert = !0, this._rejectUnauthorized = rejectUnauthorized, tls) {
- if (typeof tls !== "object")
- tls = {
- rejectUnauthorized,
- requestCert: !0
- };
- else if (tls.rejectUnauthorized = rejectUnauthorized, tls.requestCert = !0, !connection && tls.socket)
+ if (tls.rejectUnauthorized = rejectUnauthorized, tls.requestCert = !0, tls.session = session || tls.session, this.servername = tls.servername, tls.checkServerIdentity = _checkServerIdentity || tls.checkServerIdentity, this[bunTLSConnectOptions] = tls, !connection && tls.socket)
connection = tls.socket;
}
if (connection) {
@@ -491,10 +505,12 @@ class Server extends EventEmitter {
}
try {
var tls = void 0, TLSSocketClass = void 0;
- const bunTLS = this[bunTlsSymbol];
+ const bunTLS = this[bunTlsSymbol], options = this[bunSocketServerOptions];
if (typeof bunTLS === "function")
- [tls, TLSSocketClass] = bunTLS.call(this, port, hostname, !1);
- this[bunSocketServerOptions].InternalSocketClass = TLSSocketClass || SocketClass, this.#server = Bun.listen(path ? {
+ [tls, TLSSocketClass] = bunTLS.call(this, port, hostname, !1), options.servername = tls.serverName, options.InternalSocketClass = TLSSocketClass;
+ else
+ options.InternalSocketClass = SocketClass;
+ this.#server = Bun.listen(path ? {
exclusive,
unix: path,
tls,
diff --git a/src/js/out/modules/node/tls.js b/src/js/out/modules/node/tls.js
index ca8a13270..3c9626cce 100644
--- a/src/js/out/modules/node/tls.js
+++ b/src/js/out/modules/node/tls.js
@@ -12,9 +12,11 @@ var parseCertString = function() {
return !0;
}
}, unfqdn = function(host2) {
- return RegExpPrototypeSymbolReplace(/[.]$/, host2, "");
+ return RegExpPrototypeSymbolReplace.call(/[.]$/, host2, "");
+}, toLowerCase = function(c) {
+ return StringFromCharCode.call(32 + StringPrototypeCharCodeAt.call(c, 0));
}, splitHost = function(host2) {
- return StringPrototypeSplit.call(RegExpPrototypeSymbolReplace(/[A-Z]/g, unfqdn(host2), toLowerCase), ".");
+ return StringPrototypeSplit.call(RegExpPrototypeSymbolReplace.call(/[A-Z]/g, unfqdn(host2), toLowerCase), ".");
}, check = function(hostParts, pattern, wildcards) {
if (!pattern)
return !1;
@@ -87,7 +89,7 @@ var parseCertString = function() {
reason = `Host: ${hostname}. is not in the cert's altnames: ${altNames}`;
} else {
const cn = subject.CN;
- if (ArrayIsArray(cn))
+ if (Array.isArray(cn))
valid = ArrayPrototypeSome.call(cn, wildcard);
else if (cn)
valid = wildcard(cn);
@@ -104,8 +106,24 @@ var parseCertString = function() {
return new InternalSecureContext(options);
}, createSecureContext = function(options) {
return new SecureContext(options);
-};
-var createServer = function(options, connectionListener) {
+}, translatePeerCertificate = function(c) {
+ if (!c)
+ return null;
+ if (c.issuerCertificate != null && c.issuerCertificate !== c)
+ c.issuerCertificate = translatePeerCertificate(c.issuerCertificate);
+ if (c.infoAccess != null) {
+ const info = c.infoAccess;
+ c.infoAccess = { __proto__: null }, RegExpPrototypeSymbolReplace.call(/([^\n:]*):([^\n]*)(?:\n|$)/g, info, (all, key, val) => {
+ if (val.charCodeAt(0) === 34)
+ val = JSONParse(val);
+ if (key in c.infoAccess)
+ ArrayPrototypePush.call(c.infoAccess[key], val);
+ else
+ c.infoAccess[key] = [val];
+ });
+ }
+ return c;
+}, createServer = function(options, connectionListener) {
return new Server(options, connectionListener);
}, getCiphers = function() {
return DEFAULT_CIPHERS.split(":");
@@ -131,7 +149,7 @@ var createServer = function(options, connectionListener) {
out.ALPNProtocols = Buffer.from(protocols.buffer.slice(protocols.byteOffset, protocols.byteOffset + protocols.byteLength));
else if (Buffer.isBuffer(protocols))
out.ALPNProtocols = protocols;
-}, InternalTCPSocket = net[Symbol.for("::bunternal::")], bunSocketInternal = Symbol.for("::bunnetsocketinternal::"), { RegExp, Array, String } = globalThis[Symbol.for("Bun.lazy")]("primordials"), SymbolReplace = Symbol.replace, RegExpPrototypeSymbolReplace = RegExp.prototype[SymbolReplace], RegExpPrototypeExec = RegExp.prototype.exec, StringPrototypeStartsWith = String.prototype.startsWith, StringPrototypeSlice = String.prototype.slice, StringPrototypeIncludes = String.prototype.includes, StringPrototypeSplit = String.prototype.split, StringPrototypeIndexOf = String.prototype.indexOf, StringPrototypeSubstring = String.prototype.substring, StringPrototypeEndsWith = String.prototype.endsWith, ArrayPrototypeIncludes = Array.prototype.includes, ArrayPrototypeJoin = Array.prototype.join, ArrayPrototypeForEach = Array.prototype.forEach, ArrayPrototypePush = Array.prototype.push, ArrayPrototypeSome = Array.prototype.some, ArrayPrototypeReduce = Array.prototype.reduce, jsonStringPattern = /^"(?:[^"\\\u0000-\u001f]|\\(?:["\\/bfnrt]|u[0-9a-fA-F]{4}))*"/, InternalSecureContext = class SecureContext2 {
+}, InternalTCPSocket = net[Symbol.for("::bunternal::")], bunSocketInternal = Symbol.for("::bunnetsocketinternal::"), { RegExp, Array, String } = globalThis[Symbol.for("Bun.lazy")]("primordials"), SymbolReplace = Symbol.replace, RegExpPrototypeSymbolReplace = RegExp.prototype[SymbolReplace], RegExpPrototypeExec = RegExp.prototype.exec, StringPrototypeStartsWith = String.prototype.startsWith, StringPrototypeSlice = String.prototype.slice, StringPrototypeIncludes = String.prototype.includes, StringPrototypeSplit = String.prototype.split, StringPrototypeIndexOf = String.prototype.indexOf, StringPrototypeSubstring = String.prototype.substring, StringPrototypeEndsWith = String.prototype.endsWith, StringFromCharCode = String.fromCharCode, StringPrototypeCharCodeAt = String.prototype.charCodeAt, ArrayPrototypeIncludes = Array.prototype.includes, ArrayPrototypeJoin = Array.prototype.join, ArrayPrototypeForEach = Array.prototype.forEach, ArrayPrototypePush = Array.prototype.push, ArrayPrototypeSome = Array.prototype.some, ArrayPrototypeReduce = Array.prototype.reduce, jsonStringPattern = /^"(?:[^"\\\u0000-\u001f]|\\(?:["\\/bfnrt]|u[0-9a-fA-F]{4}))*"/, InternalSecureContext = class SecureContext2 {
context;
constructor(options) {
const context = {};
@@ -184,6 +202,8 @@ var createServer = function(options, connectionListener) {
#secureContext;
ALPNProtocols;
#socket;
+ #checkServerIdentity;
+ #session;
constructor(socket, options) {
super(socket instanceof InternalTCPSocket ? options : options || socket);
if (options = options || socket || {}, typeof options === "object") {
@@ -193,7 +213,7 @@ var createServer = function(options, connectionListener) {
if (socket instanceof InternalTCPSocket)
this.#socket = socket;
}
- this.#secureContext = options.secureContext || createSecureContext(options), this.authorized = !1, this.secureConnecting = !0, this._secureEstablished = !1, this._securePending = !0;
+ this.#secureContext = options.secureContext || createSecureContext(options), this.authorized = !1, this.secureConnecting = !0, this._secureEstablished = !1, this._securePending = !0, this.#checkServerIdentity = options.checkServerIdentity || checkServerIdentity, this.#session = options.session || null;
}
_secureEstablished = !1;
_securePending = !0;
@@ -204,14 +224,57 @@ var createServer = function(options, connectionListener) {
servername;
authorized = !1;
authorizationError;
+ #renegotiationDisabled = !1;
encrypted = !0;
_start() {
+ this.connect();
}
- exportKeyingMaterial(length, label, context) {
+ getSession() {
+ return this[bunSocketInternal]?.getSession();
+ }
+ getEphemeralKeyInfo() {
+ return this[bunSocketInternal]?.getEphemeralKeyInfo();
+ }
+ getCipher() {
+ return this[bunSocketInternal]?.getCipher();
+ }
+ getSharedSigalgs() {
+ return this[bunSocketInternal]?.getSharedSigalgs();
+ }
+ getProtocol() {
+ return this[bunSocketInternal]?.getTLSVersion();
+ }
+ getFinished() {
+ return this[bunSocketInternal]?.getTLSFinishedMessage() || void 0;
+ }
+ getPeerFinished() {
+ return this[bunSocketInternal]?.getTLSPeerFinishedMessage() || void 0;
+ }
+ isSessionReused() {
+ return !!this.#session;
+ }
+ renegotiate() {
+ if (this.#renegotiationDisabled) {
+ const error = new Error("ERR_TLS_RENEGOTIATION_DISABLED: TLS session renegotiation disabled for this socket");
+ throw error.name = "ERR_TLS_RENEGOTIATION_DISABLED", error;
+ }
throw Error("Not implented in Bun yet");
}
+ disableRenegotiation() {
+ this.#renegotiationDisabled = !0;
+ }
+ getTLSTicket() {
+ return this[bunSocketInternal]?.getTLSTicket();
+ }
+ exportKeyingMaterial(length, label, context) {
+ if (context)
+ return this[bunSocketInternal]?.exportKeyingMaterial(length, label, context);
+ return this[bunSocketInternal]?.exportKeyingMaterial(length, label);
+ }
setMaxSendFragment(size) {
- throw Error("Not implented in Bun yet");
+ return this[bunSocketInternal]?.setMaxSendFragment(size) || !1;
+ }
+ enableTrace() {
}
setServername(name) {
if (this.isServer) {
@@ -220,14 +283,20 @@ var createServer = function(options, connectionListener) {
}
this.servername = name, this[bunSocketInternal]?.setServername(name);
}
- setSession() {
- throw Error("Not implented in Bun yet");
+ setSession(session) {
+ if (this.#session = session, typeof session === "string")
+ session = Buffer.from(session, "latin1");
+ return this[bunSocketInternal]?.setSession(session);
}
- getPeerCertificate() {
- throw Error("Not implented in Bun yet");
+ getPeerCertificate(abbreviated) {
+ const cert = arguments.length < 1 ? this[bunSocketInternal]?.getPeerCertificate() : this[bunSocketInternal]?.getPeerCertificate(abbreviated);
+ if (cert)
+ return translatePeerCertificate(cert);
}
getCertificate() {
- throw Error("Not implented in Bun yet");
+ const cert = this[bunSocketInternal]?.getCertificate();
+ if (cert)
+ return translatePeerCertificate(cert);
}
getPeerX509Certificate() {
throw Error("Not implented in Bun yet");
@@ -243,6 +312,8 @@ var createServer = function(options, connectionListener) {
socket: this.#socket,
ALPNProtocols: this.ALPNProtocols,
serverName: this.servername || host2 || "localhost",
+ checkServerIdentity: this.#checkServerIdentity,
+ session: this.#session,
...this.#secureContext
};
}
@@ -258,16 +329,9 @@ class Server extends NetServer {
_requestCert;
servername;
ALPNProtocols;
- #checkServerIdentity;
constructor(options, secureConnectionListener) {
super(options, secureConnectionListener);
- this.#checkServerIdentity = options?.checkServerIdentity || checkServerIdentity, this.setSecureContext(options);
- }
- emit(event, args) {
- if (super.emit(event, args), event === "connection")
- args.once("secureConnect", () => {
- super.emit("secureConnection", args);
- });
+ this.setSecureContext(options);
}
setSecureContext(options) {
if (options instanceof InternalSecureContext)
@@ -335,8 +399,7 @@ class Server extends NetServer {
secureOptions: this.secureOptions,
rejectUnauthorized: isClient ? !1 : this._rejectUnauthorized,
requestCert: isClient ? !1 : this._requestCert,
- ALPNProtocols: this.ALPNProtocols,
- checkServerIdentity: this.#checkServerIdentity
+ ALPNProtocols: this.ALPNProtocols
},
SocketClass
];
diff --git a/src/sync.zig b/src/sync.zig
index 598831099..ca0818744 100644
--- a/src/sync.zig
+++ b/src/sync.zig
@@ -571,7 +571,7 @@ pub const RwLock = if (@import("builtin").os.tag != .windows and @import("builti
}
const PTHREAD_RWLOCK_INITIALIZER = pthread_rwlock_t{};
- const pthread_rwlock_t = switch (@import("builtin").os.tag) {
+ pub const pthread_rwlock_t = switch (@import("builtin").os.tag) {
.macos, .ios, .watchos, .tvos => extern struct {
__sig: c_long = 0x2DA8B3B4,
__opaque: [192]u8 = [_]u8{0} ** 192,