From b297fabd1786bbc72185b45aed3de1b08b7352e6 Mon Sep 17 00:00:00 2001 From: Liz Date: Fri, 22 Sep 2023 03:44:05 +0200 Subject: fix: correctly pass the encrypted(bool) property on "Socket" for express.js (#5878) * fix: correctly pass the encrypted property on "Socket" for express.js Express relies on this for setting the requests protocol. Since this is on a dummy object, a property is simply set with the actual value. Which seams okay as a workaround. * chore: add generated files * chore: add test * refactor: set property directly rather then through a getter --- src/js/node/http.ts | 2 +- src/js/out/InternalModuleRegistryConstants.h | 6 +- src/js/out/WebCoreJSBuiltins.cpp | 4678 +++++++-------- src/js/out/WebCoreJSBuiltins.d.ts | 118 +- src/js/out/WebCoreJSBuiltins.h | 8238 +++++++++++++------------- 5 files changed, 6521 insertions(+), 6521 deletions(-) (limited to 'src/js') diff --git a/src/js/node/http.ts b/src/js/node/http.ts index 0fad2a153..8a7cd35ae 100644 --- a/src/js/node/http.ts +++ b/src/js/node/http.ts @@ -132,7 +132,6 @@ var FakeSocket = class Socket extends Duplex { remoteAddress: string | null = null; remotePort; timeout = 0; - isServer = false; address() { @@ -601,6 +600,7 @@ class IncomingMessage extends Readable { const socket = new FakeSocket(); socket.remoteAddress = url.hostname; socket.remotePort = url.port; + if (url.protocol === "https:") socket.encrypted = true; this.#fakeSocket = socket; this.url = url.pathname + url.search; diff --git a/src/js/out/InternalModuleRegistryConstants.h b/src/js/out/InternalModuleRegistryConstants.h index a4e1e29d6..9518ee928 100644 --- a/src/js/out/InternalModuleRegistryConstants.h +++ b/src/js/out/InternalModuleRegistryConstants.h @@ -90,7 +90,7 @@ static constexpr ASCIILiteral NodeFSPromisesCode = "(function (){\"use strict\"; // // -static constexpr ASCIILiteral NodeHttpCode = "(function (){\"use strict\";// src/js/out/tmp/node/http.ts\nvar checkInvalidHeaderChar = function(val) {\n return RegExpPrototypeExec.call(headerCharRegex, val) !== null;\n}, isIPv6 = function(input) {\n return new @RegExp(\"^((\?:(\?:[0-9a-fA-F]{1,4}):){7}(\?:(\?:[0-9a-fA-F]{1,4})|:)|(\?:(\?:[0-9a-fA-F]{1,4}):){6}(\?:((\?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])[.]){3}(\?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])|:(\?:[0-9a-fA-F]{1,4})|:)|(\?:(\?:[0-9a-fA-F]{1,4}):){5}(\?::((\?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])[.]){3}(\?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])|(:(\?:[0-9a-fA-F]{1,4})){1,2}|:)|(\?:(\?:[0-9a-fA-F]{1,4}):){4}(\?:(:(\?:[0-9a-fA-F]{1,4})){0,1}:((\?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])[.]){3}(\?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])|(:(\?:[0-9a-fA-F]{1,4})){1,3}|:)|(\?:(\?:[0-9a-fA-F]{1,4}):){3}(\?:(:(\?:[0-9a-fA-F]{1,4})){0,2}:((\?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])[.]){3}(\?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])|(:(\?:[0-9a-fA-F]{1,4})){1,4}|:)|(\?:(\?:[0-9a-fA-F]{1,4}):){2}(\?:(:(\?:[0-9a-fA-F]{1,4})){0,3}:((\?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])[.]){3}(\?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])|(:(\?:[0-9a-fA-F]{1,4})){1,5}|:)|(\?:(\?:[0-9a-fA-F]{1,4}):){1}(\?:(:(\?:[0-9a-fA-F]{1,4})){0,4}:((\?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])[.]){3}(\?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])|(:(\?:[0-9a-fA-F]{1,4})){1,6}|:)|(\?::((\?::(\?:[0-9a-fA-F]{1,4})){0,5}:((\?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])[.]){3}(\?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])|(\?::(\?:[0-9a-fA-F]{1,4})){1,7}|:)))(%[0-9a-zA-Z-.:]{1,})\?$\").test(input);\n}, isValidTLSArray = function(obj) {\n if (typeof obj === \"string\" || isTypedArray(obj) || obj instanceof @ArrayBuffer || obj instanceof Blob)\n return !0;\n if (@Array.isArray(obj)) {\n for (var i = 0;i < obj.length; i++)\n if (typeof obj !== \"string\" && !isTypedArray(obj) && !(obj instanceof @ArrayBuffer) && !(obj instanceof Blob))\n return !1;\n return !0;\n }\n}, validateMsecs = function(numberlike, field) {\n if (typeof numberlike !== \"number\" || numberlike < 0)\n throw new ERR_INVALID_ARG_TYPE(field, \"number\", numberlike);\n return numberlike;\n}, validateFunction = function(callable, field) {\n if (typeof callable !== \"function\")\n throw new ERR_INVALID_ARG_TYPE(field, \"Function\", callable);\n return callable;\n}, createServer = function(options, callback) {\n return new Server(options, callback);\n}, emitListeningNextTick = function(self, onListen, err, hostname, port) {\n if (typeof onListen === \"function\")\n try {\n onListen(err, hostname, port);\n } catch (err2) {\n self.emit(\"error\", err2);\n }\n if (self.listening = !err, err)\n self.emit(\"error\", err);\n else\n self.emit(\"listening\", hostname, port);\n}, assignHeaders = function(object, req) {\n var headers = req.headers.toJSON();\n const rawHeaders = @newArrayWithSize(req.headers.count * 2);\n var i = 0;\n for (let key in headers)\n rawHeaders[i++] = key, rawHeaders[i++] = headers[key];\n object.headers = headers, object.rawHeaders = rawHeaders;\n};\nvar getDefaultHTTPSAgent = function() {\n return _defaultHTTPSAgent \?\?= new Agent({ defaultPort: 443, protocol: \"https:\" });\n};\nvar urlToHttpOptions = function(url) {\n var { protocol, hostname, hash, search, pathname, href, port, username, password } = url;\n return {\n protocol,\n hostname: typeof hostname === \"string\" && StringPrototypeStartsWith.call(hostname, \"[\") \? StringPrototypeSlice.call(hostname, 1, -1) : hostname,\n hash,\n search,\n pathname,\n path: `${pathname || \"\"}${search || \"\"}`,\n href,\n port: port \? Number(port) : protocol === \"https:\" \? 443 : protocol === \"http:\" \? 80 : @undefined,\n auth: username || password \? `${decodeURIComponent(username)}:${decodeURIComponent(password)}` : @undefined\n };\n}, validateHost = function(host, name) {\n if (host !== null && host !== @undefined && typeof host !== \"string\")\n throw new Error(\"Invalid arg type in options\");\n return host;\n}, checkIsHttpToken = function(val) {\n return RegExpPrototypeExec.call(tokenRegExp, val) !== null;\n};\nvar _writeHead = function(statusCode, reason, obj, response) {\n if (statusCode |= 0, statusCode < 100 || statusCode > 999)\n throw new Error(\"status code must be between 100 and 999\");\n if (typeof reason === \"string\")\n response.statusMessage = reason;\n else {\n if (!response.statusMessage)\n response.statusMessage = STATUS_CODES[statusCode] || \"unknown\";\n obj = reason;\n }\n response.statusCode = statusCode;\n {\n let k;\n if (@Array.isArray(obj)) {\n if (obj.length % 2 !== 0)\n throw new Error(\"raw headers must have an even number of elements\");\n for (let n = 0;n < obj.length; n += 2)\n if (k = obj[n + 0], k)\n response.setHeader(k, obj[n + 1]);\n } else if (obj) {\n const keys = Object.keys(obj);\n for (let i = 0;i < keys.length; i++)\n if (k = keys[i], k)\n response.setHeader(k, obj[k]);\n }\n }\n if (statusCode === 204 || statusCode === 304 || statusCode >= 100 && statusCode <= 199)\n response._hasBody = !1;\n}, request = function(url, options, cb) {\n return new ClientRequest(url, options, cb);\n}, get = function(url, options, cb) {\n const req = request(url, options, cb);\n return req.end(), req;\n}, $, EventEmitter = @getInternalField(@internalModuleRegistry, 18) || @createInternalModuleById(18), { isTypedArray } = @requireNativeModule(\"util/types\"), { Duplex, Readable, Writable } = @getInternalField(@internalModuleRegistry, 37) || @createInternalModuleById(37), { getHeader, setHeader } = @lazy(\"http\"), headerCharRegex = /[^\\t\\x20-\\x7e\\x80-\\xff]/, validateHeaderName = (name, label) => {\n if (typeof name !== \"string\" || !name || !checkIsHttpToken(name))\n throw new Error(\"ERR_INVALID_HTTP_TOKEN\");\n}, validateHeaderValue = (name, value) => {\n if (value === @undefined)\n throw new Error(\"ERR_HTTP_INVALID_HEADER_VALUE\");\n if (checkInvalidHeaderChar(value))\n throw new Error(\"ERR_INVALID_CHAR\");\n}, { URL } = globalThis, globalReportError = globalThis.reportError, setTimeout = globalThis.setTimeout, fetch = Bun.fetch;\nvar kEmptyObject = Object.freeze(Object.create(null)), kOutHeaders = Symbol.for(\"kOutHeaders\"), kEndCalled = Symbol.for(\"kEndCalled\"), kAbortController = Symbol.for(\"kAbortController\"), kClearTimeout = Symbol(\"kClearTimeout\"), kCorked = Symbol.for(\"kCorked\"), searchParamsSymbol = Symbol.for(\"query\"), StringPrototypeSlice = @String.prototype.slice, StringPrototypeStartsWith = @String.prototype.startsWith, StringPrototypeToUpperCase = @String.prototype.toUpperCase, ArrayIsArray = @Array.isArray, RegExpPrototypeExec = @RegExp.prototype.exec, ObjectAssign = Object.assign, INVALID_PATH_REGEX = /[^\\u0021-\\u00ff]/;\nvar _defaultHTTPSAgent, kInternalRequest = Symbol(\"kInternalRequest\"), kInternalSocketData = Symbol.for(\"::bunternal::\"), kEmptyBuffer = @Buffer.alloc(0);\n\nclass ERR_INVALID_ARG_TYPE extends TypeError {\n constructor(name, expected, actual) {\n super(`The ${name} argument must be of type ${expected}. Received type ${typeof actual}`);\n this.code = \"ERR_INVALID_ARG_TYPE\";\n }\n}\nvar FakeSocket = class Socket extends Duplex {\n [kInternalSocketData];\n bytesRead = 0;\n bytesWritten = 0;\n connecting = !1;\n remoteAddress = null;\n remotePort;\n timeout = 0;\n isServer = !1;\n address() {\n return {\n address: this.localAddress,\n family: this.localFamily,\n port: this.localPort\n };\n }\n get bufferSize() {\n return this.writableLength;\n }\n connect(port, host, connectListener) {\n return this;\n }\n _destroy(err, callback) {\n }\n _final(callback) {\n }\n get localAddress() {\n return \"127.0.0.1\";\n }\n get localFamily() {\n return \"IPv4\";\n }\n get localPort() {\n return 80;\n }\n get pending() {\n return this.connecting;\n }\n _read(size) {\n }\n get readyState() {\n if (this.connecting)\n return \"opening\";\n if (this.readable)\n return this.writable \? \"open\" : \"readOnly\";\n else\n return this.writable \? \"writeOnly\" : \"closed\";\n }\n ref() {\n }\n get remoteFamily() {\n return \"IPv4\";\n }\n resetAndDestroy() {\n }\n setKeepAlive(enable = !1, initialDelay = 0) {\n }\n setNoDelay(noDelay = !0) {\n return this;\n }\n setTimeout(timeout, callback) {\n return this;\n }\n unref() {\n }\n _write(chunk, encoding, callback) {\n }\n};\n\nclass Agent extends EventEmitter {\n defaultPort = 80;\n protocol = \"http:\";\n options;\n requests;\n sockets;\n freeSockets;\n keepAliveMsecs;\n keepAlive;\n maxSockets;\n maxFreeSockets;\n scheduling;\n maxTotalSockets;\n totalSocketCount;\n #fakeSocket;\n static get globalAgent() {\n return globalAgent;\n }\n static get defaultMaxSockets() {\n return @Infinity;\n }\n constructor(options = kEmptyObject) {\n super();\n if (this.options = options = { ...options, path: null }, options.noDelay === @undefined)\n options.noDelay = !0;\n this.requests = kEmptyObject, this.sockets = kEmptyObject, this.freeSockets = kEmptyObject, this.keepAliveMsecs = options.keepAliveMsecs || 1000, this.keepAlive = options.keepAlive || !1, this.maxSockets = options.maxSockets || Agent.defaultMaxSockets, this.maxFreeSockets = options.maxFreeSockets || 256, this.scheduling = options.scheduling || \"lifo\", this.maxTotalSockets = options.maxTotalSockets, this.totalSocketCount = 0, this.defaultPort = options.defaultPort || 80, this.protocol = options.protocol || \"http:\";\n }\n createConnection() {\n return this.#fakeSocket \?\?= new FakeSocket;\n }\n getName(options = kEmptyObject) {\n let name = `http:${options.host || \"localhost\"}:`;\n if (options.port)\n name += options.port;\n if (name += \":\", options.localAddress)\n name += options.localAddress;\n if (options.family === 4 || options.family === 6)\n name += `:${options.family}`;\n if (options.socketPath)\n name += `:${options.socketPath}`;\n return name;\n }\n addRequest() {\n }\n createSocket(req, options, cb) {\n cb(null, this.#fakeSocket \?\?= new FakeSocket);\n }\n removeSocket() {\n }\n keepSocketAlive() {\n return !0;\n }\n reuseSocket() {\n }\n destroy() {\n }\n}\n\nclass Server extends EventEmitter {\n #server;\n #options;\n #tls;\n #is_tls = !1;\n listening = !1;\n serverName;\n constructor(options, callback) {\n super();\n if (typeof options === \"function\")\n callback = options, options = {};\n else if (options == null || typeof options === \"object\") {\n options = { ...options }, this.#tls = null;\n let key = options.key;\n if (key) {\n if (!isValidTLSArray(key))\n @throwTypeError(\"key argument must be an string, Buffer, TypedArray, BunFile or an array containing string, Buffer, TypedArray or BunFile\");\n this.#is_tls = !0;\n }\n let cert = options.cert;\n if (cert) {\n if (!isValidTLSArray(cert))\n @throwTypeError(\"cert argument must be an string, Buffer, TypedArray, BunFile or an array containing string, Buffer, TypedArray or BunFile\");\n this.#is_tls = !0;\n }\n let ca = options.ca;\n if (ca) {\n if (!isValidTLSArray(ca))\n @throwTypeError(\"ca argument must be an string, Buffer, TypedArray, BunFile or an array containing string, Buffer, TypedArray or BunFile\");\n this.#is_tls = !0;\n }\n let passphrase = options.passphrase;\n if (passphrase && typeof passphrase !== \"string\")\n @throwTypeError(\"passphrase argument must be an string\");\n let serverName = options.servername;\n if (serverName && typeof serverName !== \"string\")\n @throwTypeError(\"servername argument must be an string\");\n let secureOptions = options.secureOptions || 0;\n if (secureOptions && typeof secureOptions !== \"number\")\n @throwTypeError(\"secureOptions argument must be an number\");\n if (this.#is_tls)\n this.#tls = {\n serverName,\n key,\n cert,\n ca,\n passphrase,\n secureOptions\n };\n else\n this.#tls = null;\n } else\n throw new Error(\"bun-http-polyfill: invalid arguments\");\n if (this.#options = options, callback)\n this.on(\"request\", callback);\n }\n closeAllConnections() {\n const server = this.#server;\n if (!server)\n return;\n this.#server = @undefined, server.stop(!0), this.emit(\"close\");\n }\n closeIdleConnections() {\n }\n close(optionalCallback) {\n const server = this.#server;\n if (!server) {\n if (typeof optionalCallback === \"function\")\n process.nextTick(optionalCallback, new Error(\"Server is not running\"));\n return;\n }\n if (this.#server = @undefined, typeof optionalCallback === \"function\")\n this.once(\"close\", optionalCallback);\n server.stop(), this.emit(\"close\");\n }\n address() {\n if (!this.#server)\n return null;\n const address = this.#server.hostname;\n return {\n address,\n family: isIPv6(address) \? \"IPv6\" : \"IPv4\",\n port: this.#server.port\n };\n }\n listen(port, host, backlog, onListen) {\n const server = this;\n let socketPath;\n if (typeof port == \"string\" && !Number.isSafeInteger(Number(port)))\n socketPath = port;\n if (typeof host === \"function\")\n onListen = host, host = @undefined;\n if (typeof port === \"function\")\n onListen = port;\n else if (typeof port === \"object\") {\n if (port\?.signal\?.addEventListener(\"abort\", () => {\n this.close();\n }), host = port\?.host, port = port\?.port, typeof port\?.callback === \"function\")\n onListen = port\?.callback;\n }\n if (typeof backlog === \"function\")\n onListen = backlog;\n const ResponseClass = this.#options.ServerResponse || ServerResponse, RequestClass = this.#options.IncomingMessage || IncomingMessage;\n try {\n const tls = this.#tls;\n if (tls)\n this.serverName = tls.serverName || host || \"localhost\";\n this.#server = Bun.serve({\n tls,\n port,\n hostname: host,\n unix: socketPath,\n websocket: {\n open(ws) {\n ws.data.open(ws);\n },\n message(ws, message) {\n ws.data.message(ws, message);\n },\n close(ws, code, reason) {\n ws.data.close(ws, code, reason);\n },\n drain(ws) {\n ws.data.drain(ws);\n }\n },\n fetch(req, _server) {\n var pendingResponse, pendingError, rejectFunction, resolveFunction, reject = (err) => {\n if (pendingError)\n return;\n if (pendingError = err, rejectFunction)\n rejectFunction(err);\n }, reply = function(resp) {\n if (pendingResponse)\n return;\n if (pendingResponse = resp, resolveFunction)\n resolveFunction(resp);\n };\n const http_req = new RequestClass(req), http_res = new ResponseClass({ reply, req: http_req });\n if (http_req.once(\"error\", (err) => reject(err)), http_res.once(\"error\", (err) => reject(err)), req.headers.get(\"upgrade\")) {\n const socket = http_req.socket;\n socket[kInternalSocketData] = [_server, http_res, req], server.emit(\"upgrade\", http_req, socket, kEmptyBuffer);\n } else\n server.emit(\"request\", http_req, http_res);\n if (pendingError)\n throw pendingError;\n if (pendingResponse)\n return pendingResponse;\n return new @Promise((resolve, reject2) => {\n resolveFunction = resolve, rejectFunction = reject2;\n });\n }\n }), setTimeout(emitListeningNextTick, 1, this, onListen, null, this.#server.hostname, this.#server.port);\n } catch (err) {\n server.emit(\"error\", err);\n }\n return this;\n }\n setTimeout(msecs, callback) {\n }\n}\nclass IncomingMessage extends Readable {\n method;\n complete;\n constructor(req, defaultIncomingOpts) {\n const method = req.method;\n super();\n const url = new URL(req.url);\n var { type = \"request\", [kInternalRequest]: nodeReq } = defaultIncomingOpts || {};\n this.#noBody = type === \"request\" \? method === \"GET\" || method === \"HEAD\" || method === \"TRACE\" || method === \"CONNECT\" || method === \"OPTIONS\" || (parseInt(req.headers.get(\"Content-Length\") || \"\") || 0) === 0 : !1, this.#req = req, this.method = method, this.#type = type, this.complete = !!this.#noBody, this.#bodyStream = @undefined;\n const socket = new FakeSocket;\n socket.remoteAddress = url.hostname, socket.remotePort = url.port, this.#fakeSocket = socket, this.url = url.pathname + url.search, this.#nodeReq = this.req = nodeReq, assignHeaders(this, req);\n }\n headers;\n rawHeaders;\n _consuming = !1;\n _dumped = !1;\n #bodyStream;\n #fakeSocket;\n #noBody = !1;\n #aborted = !1;\n #req;\n url;\n #type;\n #nodeReq;\n _construct(callback) {\n if (this.#type === \"response\" || this.#noBody) {\n callback();\n return;\n }\n const contentLength = this.#req.headers.get(\"content-length\");\n if ((contentLength \? parseInt(contentLength, 10) : 0) === 0) {\n this.#noBody = !0, callback();\n return;\n }\n callback();\n }\n async#consumeStream(reader) {\n while (!0) {\n var { done, value } = await reader.readMany();\n if (this.#aborted)\n return;\n if (done) {\n this.push(null), this.destroy();\n break;\n }\n for (var v of value)\n this.push(v);\n }\n }\n _read(size) {\n if (this.#noBody)\n this.push(null), this.complete = !0;\n else if (this.#bodyStream == null) {\n const reader = this.#req.body\?.getReader();\n if (!reader) {\n this.push(null);\n return;\n }\n this.#bodyStream = reader, this.#consumeStream(reader);\n }\n }\n get aborted() {\n return this.#aborted;\n }\n #abort() {\n if (this.#aborted)\n return;\n this.#aborted = !0;\n var bodyStream = this.#bodyStream;\n if (!bodyStream)\n return;\n bodyStream.cancel(), this.complete = !0, this.#bodyStream = @undefined, this.push(null);\n }\n get connection() {\n return this.#fakeSocket;\n }\n get statusCode() {\n return this.#req.status;\n }\n get statusMessage() {\n return STATUS_CODES[this.#req.status];\n }\n get httpVersion() {\n return \"1.1\";\n }\n get rawTrailers() {\n return [];\n }\n get httpVersionMajor() {\n return 1;\n }\n get httpVersionMinor() {\n return 1;\n }\n get trailers() {\n return kEmptyObject;\n }\n get socket() {\n return this.#fakeSocket \?\?= new FakeSocket;\n }\n set socket(val) {\n this.#fakeSocket = val;\n }\n setTimeout(msecs, callback) {\n throw new Error(\"not implemented\");\n }\n}\n\nclass OutgoingMessage extends Writable {\n constructor() {\n super(...arguments);\n }\n #headers;\n headersSent = !1;\n sendDate = !0;\n req;\n timeout;\n #finished = !1;\n [kEndCalled] = !1;\n #fakeSocket;\n #timeoutTimer;\n [kAbortController] = null;\n _implicitHeader() {\n }\n get headers() {\n if (!this.#headers)\n return kEmptyObject;\n return this.#headers.toJSON();\n }\n get shouldKeepAlive() {\n return !0;\n }\n get chunkedEncoding() {\n return !1;\n }\n set chunkedEncoding(value) {\n }\n set shouldKeepAlive(value) {\n }\n get useChunkedEncodingByDefault() {\n return !0;\n }\n set useChunkedEncodingByDefault(value) {\n }\n get socket() {\n return this.#fakeSocket \?\?= new FakeSocket;\n }\n set socket(val) {\n this.#fakeSocket = val;\n }\n get connection() {\n return this.socket;\n }\n get finished() {\n return this.#finished;\n }\n appendHeader(name, value) {\n var headers = this.#headers \?\?= new Headers;\n headers.append(name, value);\n }\n flushHeaders() {\n }\n getHeader(name) {\n return getHeader(this.#headers, name);\n }\n getHeaders() {\n if (!this.#headers)\n return kEmptyObject;\n return this.#headers.toJSON();\n }\n getHeaderNames() {\n var headers = this.#headers;\n if (!headers)\n return [];\n return @Array.from(headers.keys());\n }\n removeHeader(name) {\n if (!this.#headers)\n return;\n this.#headers.delete(name);\n }\n setHeader(name, value) {\n var headers = this.#headers \?\?= new Headers;\n return headers.set(name, value), this;\n }\n hasHeader(name) {\n if (!this.#headers)\n return !1;\n return this.#headers.has(name);\n }\n addTrailers(headers) {\n throw new Error(\"not implemented\");\n }\n [kClearTimeout]() {\n if (this.#timeoutTimer)\n clearTimeout(this.#timeoutTimer), this.removeAllListeners(\"timeout\"), this.#timeoutTimer = @undefined;\n }\n #onTimeout() {\n this.#timeoutTimer = @undefined, this[kAbortController]\?.abort(), this.emit(\"timeout\");\n }\n setTimeout(msecs, callback) {\n if (this.destroyed)\n return this;\n if (this.timeout = msecs = validateMsecs(msecs, \"msecs\"), clearTimeout(this.#timeoutTimer), msecs === 0) {\n if (callback !== @undefined)\n validateFunction(callback, \"callback\"), this.removeListener(\"timeout\", callback);\n this.#timeoutTimer = @undefined;\n } else if (this.#timeoutTimer = setTimeout(this.#onTimeout.bind(this), msecs).unref(), callback !== @undefined)\n validateFunction(callback, \"callback\"), this.once(\"timeout\", callback);\n return this;\n }\n}\nvar OriginalWriteHeadFn, OriginalImplicitHeadFn;\n\nclass ServerResponse extends Writable {\n constructor(c) {\n super();\n if (!c)\n c = {};\n var req = c.req || {}, reply = c.reply;\n if (this.req = req, this._reply = reply, this.sendDate = !0, this.statusCode = 200, this.headersSent = !1, this.statusMessage = @undefined, this.#controller = @undefined, this.#firstWrite = @undefined, this._writableState.decodeStrings = !1, this.#deferred = @undefined, req.method === \"HEAD\")\n this._hasBody = !1;\n }\n req;\n _reply;\n sendDate;\n statusCode;\n #headers;\n headersSent = !1;\n statusMessage;\n #controller;\n #firstWrite;\n _sent100 = !1;\n _defaultKeepAlive = !1;\n _removedConnection = !1;\n _removedContLen = !1;\n _hasBody = !0;\n #deferred = @undefined;\n #finished = !1;\n _implicitHeader() {\n this.writeHead(this.statusCode);\n }\n _write(chunk, encoding, callback) {\n if (!this.#firstWrite && !this.headersSent) {\n this.#firstWrite = chunk, callback();\n return;\n }\n this.#ensureReadableStreamController((controller) => {\n controller.write(chunk), callback();\n });\n }\n _writev(chunks, callback) {\n if (chunks.length === 1 && !this.headersSent && !this.#firstWrite) {\n this.#firstWrite = chunks[0].chunk, callback();\n return;\n }\n this.#ensureReadableStreamController((controller) => {\n for (let chunk of chunks)\n controller.write(chunk.chunk);\n callback();\n });\n }\n #ensureReadableStreamController(run) {\n var thisController = this.#controller;\n if (thisController)\n return run(thisController);\n this.headersSent = !0;\n var firstWrite = this.#firstWrite;\n this.#firstWrite = @undefined, this._reply(new Response(new @ReadableStream({\n type: \"direct\",\n pull: (controller) => {\n if (this.#controller = controller, firstWrite)\n controller.write(firstWrite);\n if (firstWrite = @undefined, run(controller), !this.#finished)\n return new @Promise((resolve) => {\n this.#deferred = resolve;\n });\n }\n }), {\n headers: this.#headers,\n status: this.statusCode,\n statusText: this.statusMessage \?\? STATUS_CODES[this.statusCode]\n }));\n }\n #drainHeadersIfObservable() {\n if (this._implicitHeader === OriginalImplicitHeadFn && this.writeHead === OriginalWriteHeadFn)\n return;\n this._implicitHeader();\n }\n _final(callback) {\n if (!this.headersSent) {\n var data = this.#firstWrite || \"\";\n this.#firstWrite = @undefined, this.#finished = !0, this.#drainHeadersIfObservable(), this._reply(new Response(data, {\n headers: this.#headers,\n status: this.statusCode,\n statusText: this.statusMessage \?\? STATUS_CODES[this.statusCode]\n })), callback && callback();\n return;\n }\n this.#finished = !0, this.#ensureReadableStreamController((controller) => {\n controller.end(), callback();\n var deferred = this.#deferred;\n if (deferred)\n this.#deferred = @undefined, deferred();\n });\n }\n writeProcessing() {\n throw new Error(\"not implemented\");\n }\n addTrailers(headers) {\n throw new Error(\"not implemented\");\n }\n assignSocket(socket) {\n throw new Error(\"not implemented\");\n }\n detachSocket(socket) {\n throw new Error(\"not implemented\");\n }\n writeContinue(callback) {\n throw new Error(\"not implemented\");\n }\n setTimeout(msecs, callback) {\n throw new Error(\"not implemented\");\n }\n get shouldKeepAlive() {\n return !0;\n }\n get chunkedEncoding() {\n return !1;\n }\n set chunkedEncoding(value) {\n }\n set shouldKeepAlive(value) {\n }\n get useChunkedEncodingByDefault() {\n return !0;\n }\n set useChunkedEncodingByDefault(value) {\n }\n appendHeader(name, value) {\n var headers = this.#headers \?\?= new Headers;\n headers.append(name, value);\n }\n flushHeaders() {\n }\n getHeader(name) {\n return getHeader(this.#headers, name);\n }\n getHeaders() {\n var headers = this.#headers;\n if (!headers)\n return kEmptyObject;\n return headers.toJSON();\n }\n getHeaderNames() {\n var headers = this.#headers;\n if (!headers)\n return [];\n return @Array.from(headers.keys());\n }\n removeHeader(name) {\n if (!this.#headers)\n return;\n this.#headers.delete(name);\n }\n setHeader(name, value) {\n var headers = this.#headers \?\?= new Headers;\n return setHeader(headers, name, value), this;\n }\n hasHeader(name) {\n if (!this.#headers)\n return !1;\n return this.#headers.has(name);\n }\n writeHead(statusCode, statusMessage, headers) {\n return _writeHead(statusCode, statusMessage, headers, this), this;\n }\n}\nOriginalWriteHeadFn = ServerResponse.prototype.writeHead;\nOriginalImplicitHeadFn = ServerResponse.prototype._implicitHeader;\n\nclass ClientRequest extends OutgoingMessage {\n #timeout;\n #res = null;\n #upgradeOrConnect = !1;\n #parser = null;\n #maxHeadersCount = null;\n #reusedSocket = !1;\n #host;\n #protocol;\n #method;\n #port;\n #useDefaultPort;\n #joinDuplicateHeaders;\n #maxHeaderSize;\n #agent = globalAgent;\n #path;\n #socketPath;\n #bodyChunks = null;\n #fetchRequest;\n #signal = null;\n [kAbortController] = null;\n #timeoutTimer = @undefined;\n #options;\n #finished;\n get path() {\n return this.#path;\n }\n get port() {\n return this.#port;\n }\n get method() {\n return this.#method;\n }\n get host() {\n return this.#host;\n }\n get protocol() {\n return this.#protocol;\n }\n _write(chunk, encoding, callback) {\n if (!this.#bodyChunks) {\n this.#bodyChunks = [chunk], callback();\n return;\n }\n this.#bodyChunks.push(chunk), callback();\n }\n _writev(chunks, callback) {\n if (!this.#bodyChunks) {\n this.#bodyChunks = chunks, callback();\n return;\n }\n this.#bodyChunks.push(...chunks), callback();\n }\n _final(callback) {\n if (this.#finished = !0, this[kAbortController] = new AbortController, this[kAbortController].signal.addEventListener(\"abort\", () => {\n this[kClearTimeout]();\n }), this.#signal\?.aborted)\n this[kAbortController].abort();\n var method = this.#method, body = this.#bodyChunks\?.length === 1 \? this.#bodyChunks[0] : @Buffer.concat(this.#bodyChunks || []);\n let url, proxy;\n if (this.#path.startsWith(\"http://\") || this.#path.startsWith(\"https://\"))\n url = this.#path, proxy = `${this.#protocol}//${this.#host}${this.#useDefaultPort \? \"\" : \":\" + this.#port}`;\n else\n url = `${this.#protocol}//${this.#host}${this.#useDefaultPort \? \"\" : \":\" + this.#port}${this.#path}`;\n try {\n this.#fetchRequest = fetch(url, {\n method,\n headers: this.getHeaders(),\n body: body && method !== \"GET\" && method !== \"HEAD\" && method !== \"OPTIONS\" \? body : @undefined,\n redirect: \"manual\",\n verbose: !1,\n signal: this[kAbortController].signal,\n proxy,\n timeout: !1,\n decompress: !1\n }).then((response) => {\n var res = this.#res = new IncomingMessage(response, {\n type: \"response\",\n [kInternalRequest]: this\n });\n this.emit(\"response\", res);\n }).catch((err) => {\n this.emit(\"error\", err);\n }).finally(() => {\n this.#fetchRequest = null, this[kClearTimeout]();\n });\n } catch (err) {\n this.emit(\"error\", err);\n } finally {\n callback();\n }\n }\n get aborted() {\n return this.#signal\?.aborted || !!this[kAbortController]\?.signal.aborted;\n }\n abort() {\n if (this.aborted)\n return;\n this[kAbortController].abort();\n }\n constructor(input, options, cb) {\n super();\n if (typeof input === \"string\") {\n const urlStr = input;\n try {\n var urlObject = new URL(urlStr);\n } catch (e) {\n @throwTypeError(`Invalid URL: ${urlStr}`);\n }\n input = urlToHttpOptions(urlObject);\n } else if (input && typeof input === \"object\" && input instanceof URL)\n input = urlToHttpOptions(input);\n else\n cb = options, options = input, input = null;\n if (typeof options === \"function\")\n cb = options, options = input || kEmptyObject;\n else\n options = ObjectAssign(input || {}, options);\n var defaultAgent = options._defaultAgent || Agent.globalAgent;\n let protocol = options.protocol;\n if (!protocol)\n if (options.port === 443)\n protocol = \"https:\";\n else\n protocol = defaultAgent.protocol || \"http:\";\n switch (this.#protocol = protocol, this.#agent\?.protocol) {\n case @undefined:\n break;\n case \"http:\":\n if (protocol === \"https:\") {\n defaultAgent = this.#agent = getDefaultHTTPSAgent();\n break;\n }\n case \"https:\":\n if (protocol === \"https\") {\n defaultAgent = this.#agent = Agent.globalAgent;\n break;\n }\n default:\n break;\n }\n if (options.path) {\n const path = @String(options.path);\n if (RegExpPrototypeExec.call(INVALID_PATH_REGEX, path) !== null)\n throw new Error(\"Path contains unescaped characters\");\n }\n if (protocol !== \"http:\" && protocol !== \"https:\" && protocol) {\n const expectedProtocol = defaultAgent\?.protocol \?\? \"http:\";\n throw new Error(`Protocol mismatch. Expected: ${expectedProtocol}. Got: ${protocol}`);\n }\n const defaultPort = protocol === \"https:\" \? 443 : 80;\n this.#port = options.port || options.defaultPort || this.#agent\?.defaultPort || defaultPort, this.#useDefaultPort = this.#port === defaultPort;\n const host = this.#host = options.host = validateHost(options.hostname, \"hostname\") || validateHost(options.host, \"host\") || \"localhost\";\n this.#socketPath = options.socketPath;\n const signal = options.signal;\n if (signal)\n signal.addEventListener(\"abort\", () => {\n this[kAbortController]\?.abort();\n }), this.#signal = signal;\n let method = options.method;\n const methodIsString = typeof method === \"string\";\n if (method !== null && method !== @undefined && !methodIsString)\n throw new Error(\"ERR_INVALID_ARG_TYPE: options.method\");\n if (methodIsString && method) {\n if (!checkIsHttpToken(method))\n throw new Error(\"ERR_INVALID_HTTP_TOKEN: Method\");\n method = this.#method = StringPrototypeToUpperCase.call(method);\n } else\n method = this.#method = \"GET\";\n const _maxHeaderSize = options.maxHeaderSize;\n this.#maxHeaderSize = _maxHeaderSize;\n var _joinDuplicateHeaders = options.joinDuplicateHeaders;\n if (this.#joinDuplicateHeaders = _joinDuplicateHeaders, this.#path = options.path || \"/\", cb)\n this.once(\"response\", cb);\n this.#finished = !1, this.#res = null, this.#upgradeOrConnect = !1, this.#parser = null, this.#maxHeadersCount = null, this.#reusedSocket = !1, this.#host = host, this.#protocol = protocol;\n var timeout = options.timeout;\n if (timeout !== @undefined && timeout !== 0)\n this.setTimeout(timeout, @undefined);\n if (!ArrayIsArray(headers)) {\n var headers = options.headers;\n if (headers)\n for (let key in headers)\n this.setHeader(key, headers[key]);\n var auth = options.auth;\n if (auth && !this.getHeader(\"Authorization\"))\n this.setHeader(\"Authorization\", \"Basic \" + @Buffer.from(auth).toString(\"base64\"));\n }\n var { signal: _signal, ...optsWithoutSignal } = options;\n this.#options = optsWithoutSignal;\n }\n setSocketKeepAlive(enable = !0, initialDelay = 0) {\n }\n setNoDelay(noDelay = !0) {\n }\n [kClearTimeout]() {\n if (this.#timeoutTimer)\n clearTimeout(this.#timeoutTimer), this.#timeoutTimer = @undefined, this.removeAllListeners(\"timeout\");\n }\n #onTimeout() {\n this.#timeoutTimer = @undefined, this[kAbortController]\?.abort(), this.emit(\"timeout\");\n }\n setTimeout(msecs, callback) {\n if (this.destroyed)\n return this;\n if (this.timeout = msecs = validateMsecs(msecs, \"msecs\"), clearTimeout(this.#timeoutTimer), msecs === 0) {\n if (callback !== @undefined)\n validateFunction(callback, \"callback\"), this.removeListener(\"timeout\", callback);\n this.#timeoutTimer = @undefined;\n } else if (this.#timeoutTimer = setTimeout(this.#onTimeout.bind(this), msecs).unref(), callback !== @undefined)\n validateFunction(callback, \"callback\"), this.once(\"timeout\", callback);\n return this;\n }\n}\nvar tokenRegExp = /^[\\^_`a-zA-Z\\-0-9!#$%&'*+.|~]+$/, METHODS = [\n \"ACL\",\n \"BIND\",\n \"CHECKOUT\",\n \"CONNECT\",\n \"COPY\",\n \"DELETE\",\n \"GET\",\n \"HEAD\",\n \"LINK\",\n \"LOCK\",\n \"M-SEARCH\",\n \"MERGE\",\n \"MKACTIVITY\",\n \"MKCALENDAR\",\n \"MKCOL\",\n \"MOVE\",\n \"NOTIFY\",\n \"OPTIONS\",\n \"PATCH\",\n \"POST\",\n \"PROPFIND\",\n \"PROPPATCH\",\n \"PURGE\",\n \"PUT\",\n \"REBIND\",\n \"REPORT\",\n \"SEARCH\",\n \"SOURCE\",\n \"SUBSCRIBE\",\n \"TRACE\",\n \"UNBIND\",\n \"UNLINK\",\n \"UNLOCK\",\n \"UNSUBSCRIBE\"\n], STATUS_CODES = {\n 100: \"Continue\",\n 101: \"Switching Protocols\",\n 102: \"Processing\",\n 103: \"Early Hints\",\n 200: \"OK\",\n 201: \"Created\",\n 202: \"Accepted\",\n 203: \"Non-Authoritative Information\",\n 204: \"No Content\",\n 205: \"Reset Content\",\n 206: \"Partial Content\",\n 207: \"Multi-Status\",\n 208: \"Already Reported\",\n 226: \"IM Used\",\n 300: \"Multiple Choices\",\n 301: \"Moved Permanently\",\n 302: \"Found\",\n 303: \"See Other\",\n 304: \"Not Modified\",\n 305: \"Use Proxy\",\n 307: \"Temporary Redirect\",\n 308: \"Permanent Redirect\",\n 400: \"Bad Request\",\n 401: \"Unauthorized\",\n 402: \"Payment Required\",\n 403: \"Forbidden\",\n 404: \"Not Found\",\n 405: \"Method Not Allowed\",\n 406: \"Not Acceptable\",\n 407: \"Proxy Authentication Required\",\n 408: \"Request Timeout\",\n 409: \"Conflict\",\n 410: \"Gone\",\n 411: \"Length Required\",\n 412: \"Precondition Failed\",\n 413: \"Payload Too Large\",\n 414: \"URI Too Long\",\n 415: \"Unsupported Media Type\",\n 416: \"Range Not Satisfiable\",\n 417: \"Expectation Failed\",\n 418: \"I'm a Teapot\",\n 421: \"Misdirected Request\",\n 422: \"Unprocessable Entity\",\n 423: \"Locked\",\n 424: \"Failed Dependency\",\n 425: \"Too Early\",\n 426: \"Upgrade Required\",\n 428: \"Precondition Required\",\n 429: \"Too Many Requests\",\n 431: \"Request Header Fields Too Large\",\n 451: \"Unavailable For Legal Reasons\",\n 500: \"Internal Server Error\",\n 501: \"Not Implemented\",\n 502: \"Bad Gateway\",\n 503: \"Service Unavailable\",\n 504: \"Gateway Timeout\",\n 505: \"HTTP Version Not Supported\",\n 506: \"Variant Also Negotiates\",\n 507: \"Insufficient Storage\",\n 508: \"Loop Detected\",\n 509: \"Bandwidth Limit Exceeded\",\n 510: \"Not Extended\",\n 511: \"Network Authentication Required\"\n}, globalAgent = new Agent;\n$ = {\n Agent,\n Server,\n METHODS,\n STATUS_CODES,\n createServer,\n ServerResponse,\n IncomingMessage,\n request,\n get,\n maxHeaderSize: 16384,\n validateHeaderName,\n validateHeaderValue,\n setMaxIdleHTTPParsers(max) {\n },\n globalAgent,\n ClientRequest,\n OutgoingMessage\n};\nreturn $})\n"_s; +static constexpr ASCIILiteral NodeHttpCode = "(function (){\"use strict\";// src/js/out/tmp/node/http.ts\nvar checkInvalidHeaderChar = function(val) {\n return RegExpPrototypeExec.call(headerCharRegex, val) !== null;\n}, isIPv6 = function(input) {\n return new @RegExp(\"^((\?:(\?:[0-9a-fA-F]{1,4}):){7}(\?:(\?:[0-9a-fA-F]{1,4})|:)|(\?:(\?:[0-9a-fA-F]{1,4}):){6}(\?:((\?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])[.]){3}(\?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])|:(\?:[0-9a-fA-F]{1,4})|:)|(\?:(\?:[0-9a-fA-F]{1,4}):){5}(\?::((\?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])[.]){3}(\?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])|(:(\?:[0-9a-fA-F]{1,4})){1,2}|:)|(\?:(\?:[0-9a-fA-F]{1,4}):){4}(\?:(:(\?:[0-9a-fA-F]{1,4})){0,1}:((\?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])[.]){3}(\?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])|(:(\?:[0-9a-fA-F]{1,4})){1,3}|:)|(\?:(\?:[0-9a-fA-F]{1,4}):){3}(\?:(:(\?:[0-9a-fA-F]{1,4})){0,2}:((\?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])[.]){3}(\?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])|(:(\?:[0-9a-fA-F]{1,4})){1,4}|:)|(\?:(\?:[0-9a-fA-F]{1,4}):){2}(\?:(:(\?:[0-9a-fA-F]{1,4})){0,3}:((\?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])[.]){3}(\?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])|(:(\?:[0-9a-fA-F]{1,4})){1,5}|:)|(\?:(\?:[0-9a-fA-F]{1,4}):){1}(\?:(:(\?:[0-9a-fA-F]{1,4})){0,4}:((\?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])[.]){3}(\?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])|(:(\?:[0-9a-fA-F]{1,4})){1,6}|:)|(\?::((\?::(\?:[0-9a-fA-F]{1,4})){0,5}:((\?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])[.]){3}(\?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])|(\?::(\?:[0-9a-fA-F]{1,4})){1,7}|:)))(%[0-9a-zA-Z-.:]{1,})\?$\").test(input);\n}, isValidTLSArray = function(obj) {\n if (typeof obj === \"string\" || isTypedArray(obj) || obj instanceof @ArrayBuffer || obj instanceof Blob)\n return !0;\n if (@Array.isArray(obj)) {\n for (var i = 0;i < obj.length; i++)\n if (typeof obj !== \"string\" && !isTypedArray(obj) && !(obj instanceof @ArrayBuffer) && !(obj instanceof Blob))\n return !1;\n return !0;\n }\n}, validateMsecs = function(numberlike, field) {\n if (typeof numberlike !== \"number\" || numberlike < 0)\n throw new ERR_INVALID_ARG_TYPE(field, \"number\", numberlike);\n return numberlike;\n}, validateFunction = function(callable, field) {\n if (typeof callable !== \"function\")\n throw new ERR_INVALID_ARG_TYPE(field, \"Function\", callable);\n return callable;\n}, createServer = function(options, callback) {\n return new Server(options, callback);\n}, emitListeningNextTick = function(self, onListen, err, hostname, port) {\n if (typeof onListen === \"function\")\n try {\n onListen(err, hostname, port);\n } catch (err2) {\n self.emit(\"error\", err2);\n }\n if (self.listening = !err, err)\n self.emit(\"error\", err);\n else\n self.emit(\"listening\", hostname, port);\n}, assignHeaders = function(object, req) {\n var headers = req.headers.toJSON();\n const rawHeaders = @newArrayWithSize(req.headers.count * 2);\n var i = 0;\n for (let key in headers)\n rawHeaders[i++] = key, rawHeaders[i++] = headers[key];\n object.headers = headers, object.rawHeaders = rawHeaders;\n};\nvar getDefaultHTTPSAgent = function() {\n return _defaultHTTPSAgent \?\?= new Agent({ defaultPort: 443, protocol: \"https:\" });\n};\nvar urlToHttpOptions = function(url) {\n var { protocol, hostname, hash, search, pathname, href, port, username, password } = url;\n return {\n protocol,\n hostname: typeof hostname === \"string\" && StringPrototypeStartsWith.call(hostname, \"[\") \? StringPrototypeSlice.call(hostname, 1, -1) : hostname,\n hash,\n search,\n pathname,\n path: `${pathname || \"\"}${search || \"\"}`,\n href,\n port: port \? Number(port) : protocol === \"https:\" \? 443 : protocol === \"http:\" \? 80 : @undefined,\n auth: username || password \? `${decodeURIComponent(username)}:${decodeURIComponent(password)}` : @undefined\n };\n}, validateHost = function(host, name) {\n if (host !== null && host !== @undefined && typeof host !== \"string\")\n throw new Error(\"Invalid arg type in options\");\n return host;\n}, checkIsHttpToken = function(val) {\n return RegExpPrototypeExec.call(tokenRegExp, val) !== null;\n};\nvar _writeHead = function(statusCode, reason, obj, response) {\n if (statusCode |= 0, statusCode < 100 || statusCode > 999)\n throw new Error(\"status code must be between 100 and 999\");\n if (typeof reason === \"string\")\n response.statusMessage = reason;\n else {\n if (!response.statusMessage)\n response.statusMessage = STATUS_CODES[statusCode] || \"unknown\";\n obj = reason;\n }\n response.statusCode = statusCode;\n {\n let k;\n if (@Array.isArray(obj)) {\n if (obj.length % 2 !== 0)\n throw new Error(\"raw headers must have an even number of elements\");\n for (let n = 0;n < obj.length; n += 2)\n if (k = obj[n + 0], k)\n response.setHeader(k, obj[n + 1]);\n } else if (obj) {\n const keys = Object.keys(obj);\n for (let i = 0;i < keys.length; i++)\n if (k = keys[i], k)\n response.setHeader(k, obj[k]);\n }\n }\n if (statusCode === 204 || statusCode === 304 || statusCode >= 100 && statusCode <= 199)\n response._hasBody = !1;\n}, request = function(url, options, cb) {\n return new ClientRequest(url, options, cb);\n}, get = function(url, options, cb) {\n const req = request(url, options, cb);\n return req.end(), req;\n}, $, EventEmitter = @getInternalField(@internalModuleRegistry, 18) || @createInternalModuleById(18), { isTypedArray } = @requireNativeModule(\"util/types\"), { Duplex, Readable, Writable } = @getInternalField(@internalModuleRegistry, 37) || @createInternalModuleById(37), { getHeader, setHeader } = @lazy(\"http\"), headerCharRegex = /[^\\t\\x20-\\x7e\\x80-\\xff]/, validateHeaderName = (name, label) => {\n if (typeof name !== \"string\" || !name || !checkIsHttpToken(name))\n throw new Error(\"ERR_INVALID_HTTP_TOKEN\");\n}, validateHeaderValue = (name, value) => {\n if (value === @undefined)\n throw new Error(\"ERR_HTTP_INVALID_HEADER_VALUE\");\n if (checkInvalidHeaderChar(value))\n throw new Error(\"ERR_INVALID_CHAR\");\n}, { URL } = globalThis, globalReportError = globalThis.reportError, setTimeout = globalThis.setTimeout, fetch = Bun.fetch;\nvar kEmptyObject = Object.freeze(Object.create(null)), kOutHeaders = Symbol.for(\"kOutHeaders\"), kEndCalled = Symbol.for(\"kEndCalled\"), kAbortController = Symbol.for(\"kAbortController\"), kClearTimeout = Symbol(\"kClearTimeout\"), kCorked = Symbol.for(\"kCorked\"), searchParamsSymbol = Symbol.for(\"query\"), StringPrototypeSlice = @String.prototype.slice, StringPrototypeStartsWith = @String.prototype.startsWith, StringPrototypeToUpperCase = @String.prototype.toUpperCase, ArrayIsArray = @Array.isArray, RegExpPrototypeExec = @RegExp.prototype.exec, ObjectAssign = Object.assign, INVALID_PATH_REGEX = /[^\\u0021-\\u00ff]/;\nvar _defaultHTTPSAgent, kInternalRequest = Symbol(\"kInternalRequest\"), kInternalSocketData = Symbol.for(\"::bunternal::\"), kEmptyBuffer = @Buffer.alloc(0);\n\nclass ERR_INVALID_ARG_TYPE extends TypeError {\n constructor(name, expected, actual) {\n super(`The ${name} argument must be of type ${expected}. Received type ${typeof actual}`);\n this.code = \"ERR_INVALID_ARG_TYPE\";\n }\n}\nvar FakeSocket = class Socket extends Duplex {\n [kInternalSocketData];\n bytesRead = 0;\n bytesWritten = 0;\n connecting = !1;\n remoteAddress = null;\n remotePort;\n timeout = 0;\n isServer = !1;\n address() {\n return {\n address: this.localAddress,\n family: this.localFamily,\n port: this.localPort\n };\n }\n get bufferSize() {\n return this.writableLength;\n }\n connect(port, host, connectListener) {\n return this;\n }\n _destroy(err, callback) {\n }\n _final(callback) {\n }\n get localAddress() {\n return \"127.0.0.1\";\n }\n get localFamily() {\n return \"IPv4\";\n }\n get localPort() {\n return 80;\n }\n get pending() {\n return this.connecting;\n }\n _read(size) {\n }\n get readyState() {\n if (this.connecting)\n return \"opening\";\n if (this.readable)\n return this.writable \? \"open\" : \"readOnly\";\n else\n return this.writable \? \"writeOnly\" : \"closed\";\n }\n ref() {\n }\n get remoteFamily() {\n return \"IPv4\";\n }\n resetAndDestroy() {\n }\n setKeepAlive(enable = !1, initialDelay = 0) {\n }\n setNoDelay(noDelay = !0) {\n return this;\n }\n setTimeout(timeout, callback) {\n return this;\n }\n unref() {\n }\n _write(chunk, encoding, callback) {\n }\n};\n\nclass Agent extends EventEmitter {\n defaultPort = 80;\n protocol = \"http:\";\n options;\n requests;\n sockets;\n freeSockets;\n keepAliveMsecs;\n keepAlive;\n maxSockets;\n maxFreeSockets;\n scheduling;\n maxTotalSockets;\n totalSocketCount;\n #fakeSocket;\n static get globalAgent() {\n return globalAgent;\n }\n static get defaultMaxSockets() {\n return @Infinity;\n }\n constructor(options = kEmptyObject) {\n super();\n if (this.options = options = { ...options, path: null }, options.noDelay === @undefined)\n options.noDelay = !0;\n this.requests = kEmptyObject, this.sockets = kEmptyObject, this.freeSockets = kEmptyObject, this.keepAliveMsecs = options.keepAliveMsecs || 1000, this.keepAlive = options.keepAlive || !1, this.maxSockets = options.maxSockets || Agent.defaultMaxSockets, this.maxFreeSockets = options.maxFreeSockets || 256, this.scheduling = options.scheduling || \"lifo\", this.maxTotalSockets = options.maxTotalSockets, this.totalSocketCount = 0, this.defaultPort = options.defaultPort || 80, this.protocol = options.protocol || \"http:\";\n }\n createConnection() {\n return this.#fakeSocket \?\?= new FakeSocket;\n }\n getName(options = kEmptyObject) {\n let name = `http:${options.host || \"localhost\"}:`;\n if (options.port)\n name += options.port;\n if (name += \":\", options.localAddress)\n name += options.localAddress;\n if (options.family === 4 || options.family === 6)\n name += `:${options.family}`;\n if (options.socketPath)\n name += `:${options.socketPath}`;\n return name;\n }\n addRequest() {\n }\n createSocket(req, options, cb) {\n cb(null, this.#fakeSocket \?\?= new FakeSocket);\n }\n removeSocket() {\n }\n keepSocketAlive() {\n return !0;\n }\n reuseSocket() {\n }\n destroy() {\n }\n}\n\nclass Server extends EventEmitter {\n #server;\n #options;\n #tls;\n #is_tls = !1;\n listening = !1;\n serverName;\n constructor(options, callback) {\n super();\n if (typeof options === \"function\")\n callback = options, options = {};\n else if (options == null || typeof options === \"object\") {\n options = { ...options }, this.#tls = null;\n let key = options.key;\n if (key) {\n if (!isValidTLSArray(key))\n @throwTypeError(\"key argument must be an string, Buffer, TypedArray, BunFile or an array containing string, Buffer, TypedArray or BunFile\");\n this.#is_tls = !0;\n }\n let cert = options.cert;\n if (cert) {\n if (!isValidTLSArray(cert))\n @throwTypeError(\"cert argument must be an string, Buffer, TypedArray, BunFile or an array containing string, Buffer, TypedArray or BunFile\");\n this.#is_tls = !0;\n }\n let ca = options.ca;\n if (ca) {\n if (!isValidTLSArray(ca))\n @throwTypeError(\"ca argument must be an string, Buffer, TypedArray, BunFile or an array containing string, Buffer, TypedArray or BunFile\");\n this.#is_tls = !0;\n }\n let passphrase = options.passphrase;\n if (passphrase && typeof passphrase !== \"string\")\n @throwTypeError(\"passphrase argument must be an string\");\n let serverName = options.servername;\n if (serverName && typeof serverName !== \"string\")\n @throwTypeError(\"servername argument must be an string\");\n let secureOptions = options.secureOptions || 0;\n if (secureOptions && typeof secureOptions !== \"number\")\n @throwTypeError(\"secureOptions argument must be an number\");\n if (this.#is_tls)\n this.#tls = {\n serverName,\n key,\n cert,\n ca,\n passphrase,\n secureOptions\n };\n else\n this.#tls = null;\n } else\n throw new Error(\"bun-http-polyfill: invalid arguments\");\n if (this.#options = options, callback)\n this.on(\"request\", callback);\n }\n closeAllConnections() {\n const server = this.#server;\n if (!server)\n return;\n this.#server = @undefined, server.stop(!0), this.emit(\"close\");\n }\n closeIdleConnections() {\n }\n close(optionalCallback) {\n const server = this.#server;\n if (!server) {\n if (typeof optionalCallback === \"function\")\n process.nextTick(optionalCallback, new Error(\"Server is not running\"));\n return;\n }\n if (this.#server = @undefined, typeof optionalCallback === \"function\")\n this.once(\"close\", optionalCallback);\n server.stop(), this.emit(\"close\");\n }\n address() {\n if (!this.#server)\n return null;\n const address = this.#server.hostname;\n return {\n address,\n family: isIPv6(address) \? \"IPv6\" : \"IPv4\",\n port: this.#server.port\n };\n }\n listen(port, host, backlog, onListen) {\n const server = this;\n let socketPath;\n if (typeof port == \"string\" && !Number.isSafeInteger(Number(port)))\n socketPath = port;\n if (typeof host === \"function\")\n onListen = host, host = @undefined;\n if (typeof port === \"function\")\n onListen = port;\n else if (typeof port === \"object\") {\n if (port\?.signal\?.addEventListener(\"abort\", () => {\n this.close();\n }), host = port\?.host, port = port\?.port, typeof port\?.callback === \"function\")\n onListen = port\?.callback;\n }\n if (typeof backlog === \"function\")\n onListen = backlog;\n const ResponseClass = this.#options.ServerResponse || ServerResponse, RequestClass = this.#options.IncomingMessage || IncomingMessage;\n try {\n const tls = this.#tls;\n if (tls)\n this.serverName = tls.serverName || host || \"localhost\";\n this.#server = Bun.serve({\n tls,\n port,\n hostname: host,\n unix: socketPath,\n websocket: {\n open(ws) {\n ws.data.open(ws);\n },\n message(ws, message) {\n ws.data.message(ws, message);\n },\n close(ws, code, reason) {\n ws.data.close(ws, code, reason);\n },\n drain(ws) {\n ws.data.drain(ws);\n }\n },\n fetch(req, _server) {\n var pendingResponse, pendingError, rejectFunction, resolveFunction, reject = (err) => {\n if (pendingError)\n return;\n if (pendingError = err, rejectFunction)\n rejectFunction(err);\n }, reply = function(resp) {\n if (pendingResponse)\n return;\n if (pendingResponse = resp, resolveFunction)\n resolveFunction(resp);\n };\n const http_req = new RequestClass(req), http_res = new ResponseClass({ reply, req: http_req });\n if (http_req.once(\"error\", (err) => reject(err)), http_res.once(\"error\", (err) => reject(err)), req.headers.get(\"upgrade\")) {\n const socket = http_req.socket;\n socket[kInternalSocketData] = [_server, http_res, req], server.emit(\"upgrade\", http_req, socket, kEmptyBuffer);\n } else\n server.emit(\"request\", http_req, http_res);\n if (pendingError)\n throw pendingError;\n if (pendingResponse)\n return pendingResponse;\n return new @Promise((resolve, reject2) => {\n resolveFunction = resolve, rejectFunction = reject2;\n });\n }\n }), setTimeout(emitListeningNextTick, 1, this, onListen, null, this.#server.hostname, this.#server.port);\n } catch (err) {\n server.emit(\"error\", err);\n }\n return this;\n }\n setTimeout(msecs, callback) {\n }\n}\nclass IncomingMessage extends Readable {\n method;\n complete;\n constructor(req, defaultIncomingOpts) {\n const method = req.method;\n super();\n const url = new URL(req.url);\n var { type = \"request\", [kInternalRequest]: nodeReq } = defaultIncomingOpts || {};\n this.#noBody = type === \"request\" \? method === \"GET\" || method === \"HEAD\" || method === \"TRACE\" || method === \"CONNECT\" || method === \"OPTIONS\" || (parseInt(req.headers.get(\"Content-Length\") || \"\") || 0) === 0 : !1, this.#req = req, this.method = method, this.#type = type, this.complete = !!this.#noBody, this.#bodyStream = @undefined;\n const socket = new FakeSocket;\n if (socket.remoteAddress = url.hostname, socket.remotePort = url.port, url.protocol === \"https:\")\n socket.encrypted = !0;\n this.#fakeSocket = socket, this.url = url.pathname + url.search, this.#nodeReq = this.req = nodeReq, assignHeaders(this, req);\n }\n headers;\n rawHeaders;\n _consuming = !1;\n _dumped = !1;\n #bodyStream;\n #fakeSocket;\n #noBody = !1;\n #aborted = !1;\n #req;\n url;\n #type;\n #nodeReq;\n _construct(callback) {\n if (this.#type === \"response\" || this.#noBody) {\n callback();\n return;\n }\n const contentLength = this.#req.headers.get(\"content-length\");\n if ((contentLength \? parseInt(contentLength, 10) : 0) === 0) {\n this.#noBody = !0, callback();\n return;\n }\n callback();\n }\n async#consumeStream(reader) {\n while (!0) {\n var { done, value } = await reader.readMany();\n if (this.#aborted)\n return;\n if (done) {\n this.push(null), this.destroy();\n break;\n }\n for (var v of value)\n this.push(v);\n }\n }\n _read(size) {\n if (this.#noBody)\n this.push(null), this.complete = !0;\n else if (this.#bodyStream == null) {\n const reader = this.#req.body\?.getReader();\n if (!reader) {\n this.push(null);\n return;\n }\n this.#bodyStream = reader, this.#consumeStream(reader);\n }\n }\n get aborted() {\n return this.#aborted;\n }\n #abort() {\n if (this.#aborted)\n return;\n this.#aborted = !0;\n var bodyStream = this.#bodyStream;\n if (!bodyStream)\n return;\n bodyStream.cancel(), this.complete = !0, this.#bodyStream = @undefined, this.push(null);\n }\n get connection() {\n return this.#fakeSocket;\n }\n get statusCode() {\n return this.#req.status;\n }\n get statusMessage() {\n return STATUS_CODES[this.#req.status];\n }\n get httpVersion() {\n return \"1.1\";\n }\n get rawTrailers() {\n return [];\n }\n get httpVersionMajor() {\n return 1;\n }\n get httpVersionMinor() {\n return 1;\n }\n get trailers() {\n return kEmptyObject;\n }\n get socket() {\n return this.#fakeSocket \?\?= new FakeSocket;\n }\n set socket(val) {\n this.#fakeSocket = val;\n }\n setTimeout(msecs, callback) {\n throw new Error(\"not implemented\");\n }\n}\n\nclass OutgoingMessage extends Writable {\n constructor() {\n super(...arguments);\n }\n #headers;\n headersSent = !1;\n sendDate = !0;\n req;\n timeout;\n #finished = !1;\n [kEndCalled] = !1;\n #fakeSocket;\n #timeoutTimer;\n [kAbortController] = null;\n _implicitHeader() {\n }\n get headers() {\n if (!this.#headers)\n return kEmptyObject;\n return this.#headers.toJSON();\n }\n get shouldKeepAlive() {\n return !0;\n }\n get chunkedEncoding() {\n return !1;\n }\n set chunkedEncoding(value) {\n }\n set shouldKeepAlive(value) {\n }\n get useChunkedEncodingByDefault() {\n return !0;\n }\n set useChunkedEncodingByDefault(value) {\n }\n get socket() {\n return this.#fakeSocket \?\?= new FakeSocket;\n }\n set socket(val) {\n this.#fakeSocket = val;\n }\n get connection() {\n return this.socket;\n }\n get finished() {\n return this.#finished;\n }\n appendHeader(name, value) {\n var headers = this.#headers \?\?= new Headers;\n headers.append(name, value);\n }\n flushHeaders() {\n }\n getHeader(name) {\n return getHeader(this.#headers, name);\n }\n getHeaders() {\n if (!this.#headers)\n return kEmptyObject;\n return this.#headers.toJSON();\n }\n getHeaderNames() {\n var headers = this.#headers;\n if (!headers)\n return [];\n return @Array.from(headers.keys());\n }\n removeHeader(name) {\n if (!this.#headers)\n return;\n this.#headers.delete(name);\n }\n setHeader(name, value) {\n var headers = this.#headers \?\?= new Headers;\n return headers.set(name, value), this;\n }\n hasHeader(name) {\n if (!this.#headers)\n return !1;\n return this.#headers.has(name);\n }\n addTrailers(headers) {\n throw new Error(\"not implemented\");\n }\n [kClearTimeout]() {\n if (this.#timeoutTimer)\n clearTimeout(this.#timeoutTimer), this.removeAllListeners(\"timeout\"), this.#timeoutTimer = @undefined;\n }\n #onTimeout() {\n this.#timeoutTimer = @undefined, this[kAbortController]\?.abort(), this.emit(\"timeout\");\n }\n setTimeout(msecs, callback) {\n if (this.destroyed)\n return this;\n if (this.timeout = msecs = validateMsecs(msecs, \"msecs\"), clearTimeout(this.#timeoutTimer), msecs === 0) {\n if (callback !== @undefined)\n validateFunction(callback, \"callback\"), this.removeListener(\"timeout\", callback);\n this.#timeoutTimer = @undefined;\n } else if (this.#timeoutTimer = setTimeout(this.#onTimeout.bind(this), msecs).unref(), callback !== @undefined)\n validateFunction(callback, \"callback\"), this.once(\"timeout\", callback);\n return this;\n }\n}\nvar OriginalWriteHeadFn, OriginalImplicitHeadFn;\n\nclass ServerResponse extends Writable {\n constructor(c) {\n super();\n if (!c)\n c = {};\n var req = c.req || {}, reply = c.reply;\n if (this.req = req, this._reply = reply, this.sendDate = !0, this.statusCode = 200, this.headersSent = !1, this.statusMessage = @undefined, this.#controller = @undefined, this.#firstWrite = @undefined, this._writableState.decodeStrings = !1, this.#deferred = @undefined, req.method === \"HEAD\")\n this._hasBody = !1;\n }\n req;\n _reply;\n sendDate;\n statusCode;\n #headers;\n headersSent = !1;\n statusMessage;\n #controller;\n #firstWrite;\n _sent100 = !1;\n _defaultKeepAlive = !1;\n _removedConnection = !1;\n _removedContLen = !1;\n _hasBody = !0;\n #deferred = @undefined;\n #finished = !1;\n _implicitHeader() {\n this.writeHead(this.statusCode);\n }\n _write(chunk, encoding, callback) {\n if (!this.#firstWrite && !this.headersSent) {\n this.#firstWrite = chunk, callback();\n return;\n }\n this.#ensureReadableStreamController((controller) => {\n controller.write(chunk), callback();\n });\n }\n _writev(chunks, callback) {\n if (chunks.length === 1 && !this.headersSent && !this.#firstWrite) {\n this.#firstWrite = chunks[0].chunk, callback();\n return;\n }\n this.#ensureReadableStreamController((controller) => {\n for (let chunk of chunks)\n controller.write(chunk.chunk);\n callback();\n });\n }\n #ensureReadableStreamController(run) {\n var thisController = this.#controller;\n if (thisController)\n return run(thisController);\n this.headersSent = !0;\n var firstWrite = this.#firstWrite;\n this.#firstWrite = @undefined, this._reply(new Response(new @ReadableStream({\n type: \"direct\",\n pull: (controller) => {\n if (this.#controller = controller, firstWrite)\n controller.write(firstWrite);\n if (firstWrite = @undefined, run(controller), !this.#finished)\n return new @Promise((resolve) => {\n this.#deferred = resolve;\n });\n }\n }), {\n headers: this.#headers,\n status: this.statusCode,\n statusText: this.statusMessage \?\? STATUS_CODES[this.statusCode]\n }));\n }\n #drainHeadersIfObservable() {\n if (this._implicitHeader === OriginalImplicitHeadFn && this.writeHead === OriginalWriteHeadFn)\n return;\n this._implicitHeader();\n }\n _final(callback) {\n if (!this.headersSent) {\n var data = this.#firstWrite || \"\";\n this.#firstWrite = @undefined, this.#finished = !0, this.#drainHeadersIfObservable(), this._reply(new Response(data, {\n headers: this.#headers,\n status: this.statusCode,\n statusText: this.statusMessage \?\? STATUS_CODES[this.statusCode]\n })), callback && callback();\n return;\n }\n this.#finished = !0, this.#ensureReadableStreamController((controller) => {\n controller.end(), callback();\n var deferred = this.#deferred;\n if (deferred)\n this.#deferred = @undefined, deferred();\n });\n }\n writeProcessing() {\n throw new Error(\"not implemented\");\n }\n addTrailers(headers) {\n throw new Error(\"not implemented\");\n }\n assignSocket(socket) {\n throw new Error(\"not implemented\");\n }\n detachSocket(socket) {\n throw new Error(\"not implemented\");\n }\n writeContinue(callback) {\n throw new Error(\"not implemented\");\n }\n setTimeout(msecs, callback) {\n throw new Error(\"not implemented\");\n }\n get shouldKeepAlive() {\n return !0;\n }\n get chunkedEncoding() {\n return !1;\n }\n set chunkedEncoding(value) {\n }\n set shouldKeepAlive(value) {\n }\n get useChunkedEncodingByDefault() {\n return !0;\n }\n set useChunkedEncodingByDefault(value) {\n }\n appendHeader(name, value) {\n var headers = this.#headers \?\?= new Headers;\n headers.append(name, value);\n }\n flushHeaders() {\n }\n getHeader(name) {\n return getHeader(this.#headers, name);\n }\n getHeaders() {\n var headers = this.#headers;\n if (!headers)\n return kEmptyObject;\n return headers.toJSON();\n }\n getHeaderNames() {\n var headers = this.#headers;\n if (!headers)\n return [];\n return @Array.from(headers.keys());\n }\n removeHeader(name) {\n if (!this.#headers)\n return;\n this.#headers.delete(name);\n }\n setHeader(name, value) {\n var headers = this.#headers \?\?= new Headers;\n return setHeader(headers, name, value), this;\n }\n hasHeader(name) {\n if (!this.#headers)\n return !1;\n return this.#headers.has(name);\n }\n writeHead(statusCode, statusMessage, headers) {\n return _writeHead(statusCode, statusMessage, headers, this), this;\n }\n}\nOriginalWriteHeadFn = ServerResponse.prototype.writeHead;\nOriginalImplicitHeadFn = ServerResponse.prototype._implicitHeader;\n\nclass ClientRequest extends OutgoingMessage {\n #timeout;\n #res = null;\n #upgradeOrConnect = !1;\n #parser = null;\n #maxHeadersCount = null;\n #reusedSocket = !1;\n #host;\n #protocol;\n #method;\n #port;\n #useDefaultPort;\n #joinDuplicateHeaders;\n #maxHeaderSize;\n #agent = globalAgent;\n #path;\n #socketPath;\n #bodyChunks = null;\n #fetchRequest;\n #signal = null;\n [kAbortController] = null;\n #timeoutTimer = @undefined;\n #options;\n #finished;\n get path() {\n return this.#path;\n }\n get port() {\n return this.#port;\n }\n get method() {\n return this.#method;\n }\n get host() {\n return this.#host;\n }\n get protocol() {\n return this.#protocol;\n }\n _write(chunk, encoding, callback) {\n if (!this.#bodyChunks) {\n this.#bodyChunks = [chunk], callback();\n return;\n }\n this.#bodyChunks.push(chunk), callback();\n }\n _writev(chunks, callback) {\n if (!this.#bodyChunks) {\n this.#bodyChunks = chunks, callback();\n return;\n }\n this.#bodyChunks.push(...chunks), callback();\n }\n _final(callback) {\n if (this.#finished = !0, this[kAbortController] = new AbortController, this[kAbortController].signal.addEventListener(\"abort\", () => {\n this[kClearTimeout]();\n }), this.#signal\?.aborted)\n this[kAbortController].abort();\n var method = this.#method, body = this.#bodyChunks\?.length === 1 \? this.#bodyChunks[0] : @Buffer.concat(this.#bodyChunks || []);\n let url, proxy;\n if (this.#path.startsWith(\"http://\") || this.#path.startsWith(\"https://\"))\n url = this.#path, proxy = `${this.#protocol}//${this.#host}${this.#useDefaultPort \? \"\" : \":\" + this.#port}`;\n else\n url = `${this.#protocol}//${this.#host}${this.#useDefaultPort \? \"\" : \":\" + this.#port}${this.#path}`;\n try {\n this.#fetchRequest = fetch(url, {\n method,\n headers: this.getHeaders(),\n body: body && method !== \"GET\" && method !== \"HEAD\" && method !== \"OPTIONS\" \? body : @undefined,\n redirect: \"manual\",\n verbose: !1,\n signal: this[kAbortController].signal,\n proxy,\n timeout: !1,\n decompress: !1\n }).then((response) => {\n var res = this.#res = new IncomingMessage(response, {\n type: \"response\",\n [kInternalRequest]: this\n });\n this.emit(\"response\", res);\n }).catch((err) => {\n this.emit(\"error\", err);\n }).finally(() => {\n this.#fetchRequest = null, this[kClearTimeout]();\n });\n } catch (err) {\n this.emit(\"error\", err);\n } finally {\n callback();\n }\n }\n get aborted() {\n return this.#signal\?.aborted || !!this[kAbortController]\?.signal.aborted;\n }\n abort() {\n if (this.aborted)\n return;\n this[kAbortController].abort();\n }\n constructor(input, options, cb) {\n super();\n if (typeof input === \"string\") {\n const urlStr = input;\n try {\n var urlObject = new URL(urlStr);\n } catch (e) {\n @throwTypeError(`Invalid URL: ${urlStr}`);\n }\n input = urlToHttpOptions(urlObject);\n } else if (input && typeof input === \"object\" && input instanceof URL)\n input = urlToHttpOptions(input);\n else\n cb = options, options = input, input = null;\n if (typeof options === \"function\")\n cb = options, options = input || kEmptyObject;\n else\n options = ObjectAssign(input || {}, options);\n var defaultAgent = options._defaultAgent || Agent.globalAgent;\n let protocol = options.protocol;\n if (!protocol)\n if (options.port === 443)\n protocol = \"https:\";\n else\n protocol = defaultAgent.protocol || \"http:\";\n switch (this.#protocol = protocol, this.#agent\?.protocol) {\n case @undefined:\n break;\n case \"http:\":\n if (protocol === \"https:\") {\n defaultAgent = this.#agent = getDefaultHTTPSAgent();\n break;\n }\n case \"https:\":\n if (protocol === \"https\") {\n defaultAgent = this.#agent = Agent.globalAgent;\n break;\n }\n default:\n break;\n }\n if (options.path) {\n const path = @String(options.path);\n if (RegExpPrototypeExec.call(INVALID_PATH_REGEX, path) !== null)\n throw new Error(\"Path contains unescaped characters\");\n }\n if (protocol !== \"http:\" && protocol !== \"https:\" && protocol) {\n const expectedProtocol = defaultAgent\?.protocol \?\? \"http:\";\n throw new Error(`Protocol mismatch. Expected: ${expectedProtocol}. Got: ${protocol}`);\n }\n const defaultPort = protocol === \"https:\" \? 443 : 80;\n this.#port = options.port || options.defaultPort || this.#agent\?.defaultPort || defaultPort, this.#useDefaultPort = this.#port === defaultPort;\n const host = this.#host = options.host = validateHost(options.hostname, \"hostname\") || validateHost(options.host, \"host\") || \"localhost\";\n this.#socketPath = options.socketPath;\n const signal = options.signal;\n if (signal)\n signal.addEventListener(\"abort\", () => {\n this[kAbortController]\?.abort();\n }), this.#signal = signal;\n let method = options.method;\n const methodIsString = typeof method === \"string\";\n if (method !== null && method !== @undefined && !methodIsString)\n throw new Error(\"ERR_INVALID_ARG_TYPE: options.method\");\n if (methodIsString && method) {\n if (!checkIsHttpToken(method))\n throw new Error(\"ERR_INVALID_HTTP_TOKEN: Method\");\n method = this.#method = StringPrototypeToUpperCase.call(method);\n } else\n method = this.#method = \"GET\";\n const _maxHeaderSize = options.maxHeaderSize;\n this.#maxHeaderSize = _maxHeaderSize;\n var _joinDuplicateHeaders = options.joinDuplicateHeaders;\n if (this.#joinDuplicateHeaders = _joinDuplicateHeaders, this.#path = options.path || \"/\", cb)\n this.once(\"response\", cb);\n this.#finished = !1, this.#res = null, this.#upgradeOrConnect = !1, this.#parser = null, this.#maxHeadersCount = null, this.#reusedSocket = !1, this.#host = host, this.#protocol = protocol;\n var timeout = options.timeout;\n if (timeout !== @undefined && timeout !== 0)\n this.setTimeout(timeout, @undefined);\n if (!ArrayIsArray(headers)) {\n var headers = options.headers;\n if (headers)\n for (let key in headers)\n this.setHeader(key, headers[key]);\n var auth = options.auth;\n if (auth && !this.getHeader(\"Authorization\"))\n this.setHeader(\"Authorization\", \"Basic \" + @Buffer.from(auth).toString(\"base64\"));\n }\n var { signal: _signal, ...optsWithoutSignal } = options;\n this.#options = optsWithoutSignal;\n }\n setSocketKeepAlive(enable = !0, initialDelay = 0) {\n }\n setNoDelay(noDelay = !0) {\n }\n [kClearTimeout]() {\n if (this.#timeoutTimer)\n clearTimeout(this.#timeoutTimer), this.#timeoutTimer = @undefined, this.removeAllListeners(\"timeout\");\n }\n #onTimeout() {\n this.#timeoutTimer = @undefined, this[kAbortController]\?.abort(), this.emit(\"timeout\");\n }\n setTimeout(msecs, callback) {\n if (this.destroyed)\n return this;\n if (this.timeout = msecs = validateMsecs(msecs, \"msecs\"), clearTimeout(this.#timeoutTimer), msecs === 0) {\n if (callback !== @undefined)\n validateFunction(callback, \"callback\"), this.removeListener(\"timeout\", callback);\n this.#timeoutTimer = @undefined;\n } else if (this.#timeoutTimer = setTimeout(this.#onTimeout.bind(this), msecs).unref(), callback !== @undefined)\n validateFunction(callback, \"callback\"), this.once(\"timeout\", callback);\n return this;\n }\n}\nvar tokenRegExp = /^[\\^_`a-zA-Z\\-0-9!#$%&'*+.|~]+$/, METHODS = [\n \"ACL\",\n \"BIND\",\n \"CHECKOUT\",\n \"CONNECT\",\n \"COPY\",\n \"DELETE\",\n \"GET\",\n \"HEAD\",\n \"LINK\",\n \"LOCK\",\n \"M-SEARCH\",\n \"MERGE\",\n \"MKACTIVITY\",\n \"MKCALENDAR\",\n \"MKCOL\",\n \"MOVE\",\n \"NOTIFY\",\n \"OPTIONS\",\n \"PATCH\",\n \"POST\",\n \"PROPFIND\",\n \"PROPPATCH\",\n \"PURGE\",\n \"PUT\",\n \"REBIND\",\n \"REPORT\",\n \"SEARCH\",\n \"SOURCE\",\n \"SUBSCRIBE\",\n \"TRACE\",\n \"UNBIND\",\n \"UNLINK\",\n \"UNLOCK\",\n \"UNSUBSCRIBE\"\n], STATUS_CODES = {\n 100: \"Continue\",\n 101: \"Switching Protocols\",\n 102: \"Processing\",\n 103: \"Early Hints\",\n 200: \"OK\",\n 201: \"Created\",\n 202: \"Accepted\",\n 203: \"Non-Authoritative Information\",\n 204: \"No Content\",\n 205: \"Reset Content\",\n 206: \"Partial Content\",\n 207: \"Multi-Status\",\n 208: \"Already Reported\",\n 226: \"IM Used\",\n 300: \"Multiple Choices\",\n 301: \"Moved Permanently\",\n 302: \"Found\",\n 303: \"See Other\",\n 304: \"Not Modified\",\n 305: \"Use Proxy\",\n 307: \"Temporary Redirect\",\n 308: \"Permanent Redirect\",\n 400: \"Bad Request\",\n 401: \"Unauthorized\",\n 402: \"Payment Required\",\n 403: \"Forbidden\",\n 404: \"Not Found\",\n 405: \"Method Not Allowed\",\n 406: \"Not Acceptable\",\n 407: \"Proxy Authentication Required\",\n 408: \"Request Timeout\",\n 409: \"Conflict\",\n 410: \"Gone\",\n 411: \"Length Required\",\n 412: \"Precondition Failed\",\n 413: \"Payload Too Large\",\n 414: \"URI Too Long\",\n 415: \"Unsupported Media Type\",\n 416: \"Range Not Satisfiable\",\n 417: \"Expectation Failed\",\n 418: \"I'm a Teapot\",\n 421: \"Misdirected Request\",\n 422: \"Unprocessable Entity\",\n 423: \"Locked\",\n 424: \"Failed Dependency\",\n 425: \"Too Early\",\n 426: \"Upgrade Required\",\n 428: \"Precondition Required\",\n 429: \"Too Many Requests\",\n 431: \"Request Header Fields Too Large\",\n 451: \"Unavailable For Legal Reasons\",\n 500: \"Internal Server Error\",\n 501: \"Not Implemented\",\n 502: \"Bad Gateway\",\n 503: \"Service Unavailable\",\n 504: \"Gateway Timeout\",\n 505: \"HTTP Version Not Supported\",\n 506: \"Variant Also Negotiates\",\n 507: \"Insufficient Storage\",\n 508: \"Loop Detected\",\n 509: \"Bandwidth Limit Exceeded\",\n 510: \"Not Extended\",\n 511: \"Network Authentication Required\"\n}, globalAgent = new Agent;\n$ = {\n Agent,\n Server,\n METHODS,\n STATUS_CODES,\n createServer,\n ServerResponse,\n IncomingMessage,\n request,\n get,\n maxHeaderSize: 16384,\n validateHeaderName,\n validateHeaderValue,\n setMaxIdleHTTPParsers(max) {\n },\n globalAgent,\n ClientRequest,\n OutgoingMessage\n};\nreturn $})\n"_s; // // @@ -331,7 +331,7 @@ static constexpr ASCIILiteral NodeFSPromisesCode = "(function (){\"use strict\"; // // -static constexpr ASCIILiteral NodeHttpCode = "(function (){\"use strict\";// src/js/out/tmp/node/http.ts\nvar checkInvalidHeaderChar = function(val) {\n return RegExpPrototypeExec.call(headerCharRegex, val) !== null;\n}, isIPv6 = function(input) {\n return new @RegExp(\"^((\?:(\?:[0-9a-fA-F]{1,4}):){7}(\?:(\?:[0-9a-fA-F]{1,4})|:)|(\?:(\?:[0-9a-fA-F]{1,4}):){6}(\?:((\?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])[.]){3}(\?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])|:(\?:[0-9a-fA-F]{1,4})|:)|(\?:(\?:[0-9a-fA-F]{1,4}):){5}(\?::((\?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])[.]){3}(\?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])|(:(\?:[0-9a-fA-F]{1,4})){1,2}|:)|(\?:(\?:[0-9a-fA-F]{1,4}):){4}(\?:(:(\?:[0-9a-fA-F]{1,4})){0,1}:((\?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])[.]){3}(\?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])|(:(\?:[0-9a-fA-F]{1,4})){1,3}|:)|(\?:(\?:[0-9a-fA-F]{1,4}):){3}(\?:(:(\?:[0-9a-fA-F]{1,4})){0,2}:((\?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])[.]){3}(\?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])|(:(\?:[0-9a-fA-F]{1,4})){1,4}|:)|(\?:(\?:[0-9a-fA-F]{1,4}):){2}(\?:(:(\?:[0-9a-fA-F]{1,4})){0,3}:((\?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])[.]){3}(\?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])|(:(\?:[0-9a-fA-F]{1,4})){1,5}|:)|(\?:(\?:[0-9a-fA-F]{1,4}):){1}(\?:(:(\?:[0-9a-fA-F]{1,4})){0,4}:((\?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])[.]){3}(\?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])|(:(\?:[0-9a-fA-F]{1,4})){1,6}|:)|(\?::((\?::(\?:[0-9a-fA-F]{1,4})){0,5}:((\?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])[.]){3}(\?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])|(\?::(\?:[0-9a-fA-F]{1,4})){1,7}|:)))(%[0-9a-zA-Z-.:]{1,})\?$\").test(input);\n}, isValidTLSArray = function(obj) {\n if (typeof obj === \"string\" || isTypedArray(obj) || obj instanceof @ArrayBuffer || obj instanceof Blob)\n return !0;\n if (@Array.isArray(obj)) {\n for (var i = 0;i < obj.length; i++)\n if (typeof obj !== \"string\" && !isTypedArray(obj) && !(obj instanceof @ArrayBuffer) && !(obj instanceof Blob))\n return !1;\n return !0;\n }\n}, validateMsecs = function(numberlike, field) {\n if (typeof numberlike !== \"number\" || numberlike < 0)\n throw new ERR_INVALID_ARG_TYPE(field, \"number\", numberlike);\n return numberlike;\n}, validateFunction = function(callable, field) {\n if (typeof callable !== \"function\")\n throw new ERR_INVALID_ARG_TYPE(field, \"Function\", callable);\n return callable;\n}, createServer = function(options, callback) {\n return new Server(options, callback);\n}, emitListeningNextTick = function(self, onListen, err, hostname, port) {\n if (typeof onListen === \"function\")\n try {\n onListen(err, hostname, port);\n } catch (err2) {\n self.emit(\"error\", err2);\n }\n if (self.listening = !err, err)\n self.emit(\"error\", err);\n else\n self.emit(\"listening\", hostname, port);\n}, assignHeaders = function(object, req) {\n var headers = req.headers.toJSON();\n const rawHeaders = @newArrayWithSize(req.headers.count * 2);\n var i = 0;\n for (let key in headers)\n rawHeaders[i++] = key, rawHeaders[i++] = headers[key];\n object.headers = headers, object.rawHeaders = rawHeaders;\n};\nvar getDefaultHTTPSAgent = function() {\n return _defaultHTTPSAgent \?\?= new Agent({ defaultPort: 443, protocol: \"https:\" });\n};\nvar urlToHttpOptions = function(url) {\n var { protocol, hostname, hash, search, pathname, href, port, username, password } = url;\n return {\n protocol,\n hostname: typeof hostname === \"string\" && StringPrototypeStartsWith.call(hostname, \"[\") \? StringPrototypeSlice.call(hostname, 1, -1) : hostname,\n hash,\n search,\n pathname,\n path: `${pathname || \"\"}${search || \"\"}`,\n href,\n port: port \? Number(port) : protocol === \"https:\" \? 443 : protocol === \"http:\" \? 80 : @undefined,\n auth: username || password \? `${decodeURIComponent(username)}:${decodeURIComponent(password)}` : @undefined\n };\n}, validateHost = function(host, name) {\n if (host !== null && host !== @undefined && typeof host !== \"string\")\n throw new Error(\"Invalid arg type in options\");\n return host;\n}, checkIsHttpToken = function(val) {\n return RegExpPrototypeExec.call(tokenRegExp, val) !== null;\n};\nvar _writeHead = function(statusCode, reason, obj, response) {\n if (statusCode |= 0, statusCode < 100 || statusCode > 999)\n throw new Error(\"status code must be between 100 and 999\");\n if (typeof reason === \"string\")\n response.statusMessage = reason;\n else {\n if (!response.statusMessage)\n response.statusMessage = STATUS_CODES[statusCode] || \"unknown\";\n obj = reason;\n }\n response.statusCode = statusCode;\n {\n let k;\n if (@Array.isArray(obj)) {\n if (obj.length % 2 !== 0)\n throw new Error(\"raw headers must have an even number of elements\");\n for (let n = 0;n < obj.length; n += 2)\n if (k = obj[n + 0], k)\n response.setHeader(k, obj[n + 1]);\n } else if (obj) {\n const keys = Object.keys(obj);\n for (let i = 0;i < keys.length; i++)\n if (k = keys[i], k)\n response.setHeader(k, obj[k]);\n }\n }\n if (statusCode === 204 || statusCode === 304 || statusCode >= 100 && statusCode <= 199)\n response._hasBody = !1;\n}, request = function(url, options, cb) {\n return new ClientRequest(url, options, cb);\n}, get = function(url, options, cb) {\n const req = request(url, options, cb);\n return req.end(), req;\n}, $, EventEmitter = @getInternalField(@internalModuleRegistry, 18) || @createInternalModuleById(18), { isTypedArray } = @requireNativeModule(\"util/types\"), { Duplex, Readable, Writable } = @getInternalField(@internalModuleRegistry, 37) || @createInternalModuleById(37), { getHeader, setHeader } = @lazy(\"http\"), headerCharRegex = /[^\\t\\x20-\\x7e\\x80-\\xff]/, validateHeaderName = (name, label) => {\n if (typeof name !== \"string\" || !name || !checkIsHttpToken(name))\n throw new Error(\"ERR_INVALID_HTTP_TOKEN\");\n}, validateHeaderValue = (name, value) => {\n if (value === @undefined)\n throw new Error(\"ERR_HTTP_INVALID_HEADER_VALUE\");\n if (checkInvalidHeaderChar(value))\n throw new Error(\"ERR_INVALID_CHAR\");\n}, { URL } = globalThis, globalReportError = globalThis.reportError, setTimeout = globalThis.setTimeout, fetch = Bun.fetch;\nvar kEmptyObject = Object.freeze(Object.create(null)), kOutHeaders = Symbol.for(\"kOutHeaders\"), kEndCalled = Symbol.for(\"kEndCalled\"), kAbortController = Symbol.for(\"kAbortController\"), kClearTimeout = Symbol(\"kClearTimeout\"), kCorked = Symbol.for(\"kCorked\"), searchParamsSymbol = Symbol.for(\"query\"), StringPrototypeSlice = @String.prototype.slice, StringPrototypeStartsWith = @String.prototype.startsWith, StringPrototypeToUpperCase = @String.prototype.toUpperCase, ArrayIsArray = @Array.isArray, RegExpPrototypeExec = @RegExp.prototype.exec, ObjectAssign = Object.assign, INVALID_PATH_REGEX = /[^\\u0021-\\u00ff]/;\nvar _defaultHTTPSAgent, kInternalRequest = Symbol(\"kInternalRequest\"), kInternalSocketData = Symbol.for(\"::bunternal::\"), kEmptyBuffer = @Buffer.alloc(0);\n\nclass ERR_INVALID_ARG_TYPE extends TypeError {\n constructor(name, expected, actual) {\n super(`The ${name} argument must be of type ${expected}. Received type ${typeof actual}`);\n this.code = \"ERR_INVALID_ARG_TYPE\";\n }\n}\nvar FakeSocket = class Socket extends Duplex {\n [kInternalSocketData];\n bytesRead = 0;\n bytesWritten = 0;\n connecting = !1;\n remoteAddress = null;\n remotePort;\n timeout = 0;\n isServer = !1;\n address() {\n return {\n address: this.localAddress,\n family: this.localFamily,\n port: this.localPort\n };\n }\n get bufferSize() {\n return this.writableLength;\n }\n connect(port, host, connectListener) {\n return this;\n }\n _destroy(err, callback) {\n }\n _final(callback) {\n }\n get localAddress() {\n return \"127.0.0.1\";\n }\n get localFamily() {\n return \"IPv4\";\n }\n get localPort() {\n return 80;\n }\n get pending() {\n return this.connecting;\n }\n _read(size) {\n }\n get readyState() {\n if (this.connecting)\n return \"opening\";\n if (this.readable)\n return this.writable \? \"open\" : \"readOnly\";\n else\n return this.writable \? \"writeOnly\" : \"closed\";\n }\n ref() {\n }\n get remoteFamily() {\n return \"IPv4\";\n }\n resetAndDestroy() {\n }\n setKeepAlive(enable = !1, initialDelay = 0) {\n }\n setNoDelay(noDelay = !0) {\n return this;\n }\n setTimeout(timeout, callback) {\n return this;\n }\n unref() {\n }\n _write(chunk, encoding, callback) {\n }\n};\n\nclass Agent extends EventEmitter {\n defaultPort = 80;\n protocol = \"http:\";\n options;\n requests;\n sockets;\n freeSockets;\n keepAliveMsecs;\n keepAlive;\n maxSockets;\n maxFreeSockets;\n scheduling;\n maxTotalSockets;\n totalSocketCount;\n #fakeSocket;\n static get globalAgent() {\n return globalAgent;\n }\n static get defaultMaxSockets() {\n return @Infinity;\n }\n constructor(options = kEmptyObject) {\n super();\n if (this.options = options = { ...options, path: null }, options.noDelay === @undefined)\n options.noDelay = !0;\n this.requests = kEmptyObject, this.sockets = kEmptyObject, this.freeSockets = kEmptyObject, this.keepAliveMsecs = options.keepAliveMsecs || 1000, this.keepAlive = options.keepAlive || !1, this.maxSockets = options.maxSockets || Agent.defaultMaxSockets, this.maxFreeSockets = options.maxFreeSockets || 256, this.scheduling = options.scheduling || \"lifo\", this.maxTotalSockets = options.maxTotalSockets, this.totalSocketCount = 0, this.defaultPort = options.defaultPort || 80, this.protocol = options.protocol || \"http:\";\n }\n createConnection() {\n return this.#fakeSocket \?\?= new FakeSocket;\n }\n getName(options = kEmptyObject) {\n let name = `http:${options.host || \"localhost\"}:`;\n if (options.port)\n name += options.port;\n if (name += \":\", options.localAddress)\n name += options.localAddress;\n if (options.family === 4 || options.family === 6)\n name += `:${options.family}`;\n if (options.socketPath)\n name += `:${options.socketPath}`;\n return name;\n }\n addRequest() {\n }\n createSocket(req, options, cb) {\n cb(null, this.#fakeSocket \?\?= new FakeSocket);\n }\n removeSocket() {\n }\n keepSocketAlive() {\n return !0;\n }\n reuseSocket() {\n }\n destroy() {\n }\n}\n\nclass Server extends EventEmitter {\n #server;\n #options;\n #tls;\n #is_tls = !1;\n listening = !1;\n serverName;\n constructor(options, callback) {\n super();\n if (typeof options === \"function\")\n callback = options, options = {};\n else if (options == null || typeof options === \"object\") {\n options = { ...options }, this.#tls = null;\n let key = options.key;\n if (key) {\n if (!isValidTLSArray(key))\n @throwTypeError(\"key argument must be an string, Buffer, TypedArray, BunFile or an array containing string, Buffer, TypedArray or BunFile\");\n this.#is_tls = !0;\n }\n let cert = options.cert;\n if (cert) {\n if (!isValidTLSArray(cert))\n @throwTypeError(\"cert argument must be an string, Buffer, TypedArray, BunFile or an array containing string, Buffer, TypedArray or BunFile\");\n this.#is_tls = !0;\n }\n let ca = options.ca;\n if (ca) {\n if (!isValidTLSArray(ca))\n @throwTypeError(\"ca argument must be an string, Buffer, TypedArray, BunFile or an array containing string, Buffer, TypedArray or BunFile\");\n this.#is_tls = !0;\n }\n let passphrase = options.passphrase;\n if (passphrase && typeof passphrase !== \"string\")\n @throwTypeError(\"passphrase argument must be an string\");\n let serverName = options.servername;\n if (serverName && typeof serverName !== \"string\")\n @throwTypeError(\"servername argument must be an string\");\n let secureOptions = options.secureOptions || 0;\n if (secureOptions && typeof secureOptions !== \"number\")\n @throwTypeError(\"secureOptions argument must be an number\");\n if (this.#is_tls)\n this.#tls = {\n serverName,\n key,\n cert,\n ca,\n passphrase,\n secureOptions\n };\n else\n this.#tls = null;\n } else\n throw new Error(\"bun-http-polyfill: invalid arguments\");\n if (this.#options = options, callback)\n this.on(\"request\", callback);\n }\n closeAllConnections() {\n const server = this.#server;\n if (!server)\n return;\n this.#server = @undefined, server.stop(!0), this.emit(\"close\");\n }\n closeIdleConnections() {\n }\n close(optionalCallback) {\n const server = this.#server;\n if (!server) {\n if (typeof optionalCallback === \"function\")\n process.nextTick(optionalCallback, new Error(\"Server is not running\"));\n return;\n }\n if (this.#server = @undefined, typeof optionalCallback === \"function\")\n this.once(\"close\", optionalCallback);\n server.stop(), this.emit(\"close\");\n }\n address() {\n if (!this.#server)\n return null;\n const address = this.#server.hostname;\n return {\n address,\n family: isIPv6(address) \? \"IPv6\" : \"IPv4\",\n port: this.#server.port\n };\n }\n listen(port, host, backlog, onListen) {\n const server = this;\n let socketPath;\n if (typeof port == \"string\" && !Number.isSafeInteger(Number(port)))\n socketPath = port;\n if (typeof host === \"function\")\n onListen = host, host = @undefined;\n if (typeof port === \"function\")\n onListen = port;\n else if (typeof port === \"object\") {\n if (port\?.signal\?.addEventListener(\"abort\", () => {\n this.close();\n }), host = port\?.host, port = port\?.port, typeof port\?.callback === \"function\")\n onListen = port\?.callback;\n }\n if (typeof backlog === \"function\")\n onListen = backlog;\n const ResponseClass = this.#options.ServerResponse || ServerResponse, RequestClass = this.#options.IncomingMessage || IncomingMessage;\n try {\n const tls = this.#tls;\n if (tls)\n this.serverName = tls.serverName || host || \"localhost\";\n this.#server = Bun.serve({\n tls,\n port,\n hostname: host,\n unix: socketPath,\n websocket: {\n open(ws) {\n ws.data.open(ws);\n },\n message(ws, message) {\n ws.data.message(ws, message);\n },\n close(ws, code, reason) {\n ws.data.close(ws, code, reason);\n },\n drain(ws) {\n ws.data.drain(ws);\n }\n },\n fetch(req, _server) {\n var pendingResponse, pendingError, rejectFunction, resolveFunction, reject = (err) => {\n if (pendingError)\n return;\n if (pendingError = err, rejectFunction)\n rejectFunction(err);\n }, reply = function(resp) {\n if (pendingResponse)\n return;\n if (pendingResponse = resp, resolveFunction)\n resolveFunction(resp);\n };\n const http_req = new RequestClass(req), http_res = new ResponseClass({ reply, req: http_req });\n if (http_req.once(\"error\", (err) => reject(err)), http_res.once(\"error\", (err) => reject(err)), req.headers.get(\"upgrade\")) {\n const socket = http_req.socket;\n socket[kInternalSocketData] = [_server, http_res, req], server.emit(\"upgrade\", http_req, socket, kEmptyBuffer);\n } else\n server.emit(\"request\", http_req, http_res);\n if (pendingError)\n throw pendingError;\n if (pendingResponse)\n return pendingResponse;\n return new @Promise((resolve, reject2) => {\n resolveFunction = resolve, rejectFunction = reject2;\n });\n }\n }), setTimeout(emitListeningNextTick, 1, this, onListen, null, this.#server.hostname, this.#server.port);\n } catch (err) {\n server.emit(\"error\", err);\n }\n return this;\n }\n setTimeout(msecs, callback) {\n }\n}\nclass IncomingMessage extends Readable {\n method;\n complete;\n constructor(req, defaultIncomingOpts) {\n const method = req.method;\n super();\n const url = new URL(req.url);\n var { type = \"request\", [kInternalRequest]: nodeReq } = defaultIncomingOpts || {};\n this.#noBody = type === \"request\" \? method === \"GET\" || method === \"HEAD\" || method === \"TRACE\" || method === \"CONNECT\" || method === \"OPTIONS\" || (parseInt(req.headers.get(\"Content-Length\") || \"\") || 0) === 0 : !1, this.#req = req, this.method = method, this.#type = type, this.complete = !!this.#noBody, this.#bodyStream = @undefined;\n const socket = new FakeSocket;\n socket.remoteAddress = url.hostname, socket.remotePort = url.port, this.#fakeSocket = socket, this.url = url.pathname + url.search, this.#nodeReq = this.req = nodeReq, assignHeaders(this, req);\n }\n headers;\n rawHeaders;\n _consuming = !1;\n _dumped = !1;\n #bodyStream;\n #fakeSocket;\n #noBody = !1;\n #aborted = !1;\n #req;\n url;\n #type;\n #nodeReq;\n _construct(callback) {\n if (this.#type === \"response\" || this.#noBody) {\n callback();\n return;\n }\n const contentLength = this.#req.headers.get(\"content-length\");\n if ((contentLength \? parseInt(contentLength, 10) : 0) === 0) {\n this.#noBody = !0, callback();\n return;\n }\n callback();\n }\n async#consumeStream(reader) {\n while (!0) {\n var { done, value } = await reader.readMany();\n if (this.#aborted)\n return;\n if (done) {\n this.push(null), this.destroy();\n break;\n }\n for (var v of value)\n this.push(v);\n }\n }\n _read(size) {\n if (this.#noBody)\n this.push(null), this.complete = !0;\n else if (this.#bodyStream == null) {\n const reader = this.#req.body\?.getReader();\n if (!reader) {\n this.push(null);\n return;\n }\n this.#bodyStream = reader, this.#consumeStream(reader);\n }\n }\n get aborted() {\n return this.#aborted;\n }\n #abort() {\n if (this.#aborted)\n return;\n this.#aborted = !0;\n var bodyStream = this.#bodyStream;\n if (!bodyStream)\n return;\n bodyStream.cancel(), this.complete = !0, this.#bodyStream = @undefined, this.push(null);\n }\n get connection() {\n return this.#fakeSocket;\n }\n get statusCode() {\n return this.#req.status;\n }\n get statusMessage() {\n return STATUS_CODES[this.#req.status];\n }\n get httpVersion() {\n return \"1.1\";\n }\n get rawTrailers() {\n return [];\n }\n get httpVersionMajor() {\n return 1;\n }\n get httpVersionMinor() {\n return 1;\n }\n get trailers() {\n return kEmptyObject;\n }\n get socket() {\n return this.#fakeSocket \?\?= new FakeSocket;\n }\n set socket(val) {\n this.#fakeSocket = val;\n }\n setTimeout(msecs, callback) {\n throw new Error(\"not implemented\");\n }\n}\n\nclass OutgoingMessage extends Writable {\n constructor() {\n super(...arguments);\n }\n #headers;\n headersSent = !1;\n sendDate = !0;\n req;\n timeout;\n #finished = !1;\n [kEndCalled] = !1;\n #fakeSocket;\n #timeoutTimer;\n [kAbortController] = null;\n _implicitHeader() {\n }\n get headers() {\n if (!this.#headers)\n return kEmptyObject;\n return this.#headers.toJSON();\n }\n get shouldKeepAlive() {\n return !0;\n }\n get chunkedEncoding() {\n return !1;\n }\n set chunkedEncoding(value) {\n }\n set shouldKeepAlive(value) {\n }\n get useChunkedEncodingByDefault() {\n return !0;\n }\n set useChunkedEncodingByDefault(value) {\n }\n get socket() {\n return this.#fakeSocket \?\?= new FakeSocket;\n }\n set socket(val) {\n this.#fakeSocket = val;\n }\n get connection() {\n return this.socket;\n }\n get finished() {\n return this.#finished;\n }\n appendHeader(name, value) {\n var headers = this.#headers \?\?= new Headers;\n headers.append(name, value);\n }\n flushHeaders() {\n }\n getHeader(name) {\n return getHeader(this.#headers, name);\n }\n getHeaders() {\n if (!this.#headers)\n return kEmptyObject;\n return this.#headers.toJSON();\n }\n getHeaderNames() {\n var headers = this.#headers;\n if (!headers)\n return [];\n return @Array.from(headers.keys());\n }\n removeHeader(name) {\n if (!this.#headers)\n return;\n this.#headers.delete(name);\n }\n setHeader(name, value) {\n var headers = this.#headers \?\?= new Headers;\n return headers.set(name, value), this;\n }\n hasHeader(name) {\n if (!this.#headers)\n return !1;\n return this.#headers.has(name);\n }\n addTrailers(headers) {\n throw new Error(\"not implemented\");\n }\n [kClearTimeout]() {\n if (this.#timeoutTimer)\n clearTimeout(this.#timeoutTimer), this.removeAllListeners(\"timeout\"), this.#timeoutTimer = @undefined;\n }\n #onTimeout() {\n this.#timeoutTimer = @undefined, this[kAbortController]\?.abort(), this.emit(\"timeout\");\n }\n setTimeout(msecs, callback) {\n if (this.destroyed)\n return this;\n if (this.timeout = msecs = validateMsecs(msecs, \"msecs\"), clearTimeout(this.#timeoutTimer), msecs === 0) {\n if (callback !== @undefined)\n validateFunction(callback, \"callback\"), this.removeListener(\"timeout\", callback);\n this.#timeoutTimer = @undefined;\n } else if (this.#timeoutTimer = setTimeout(this.#onTimeout.bind(this), msecs).unref(), callback !== @undefined)\n validateFunction(callback, \"callback\"), this.once(\"timeout\", callback);\n return this;\n }\n}\nvar OriginalWriteHeadFn, OriginalImplicitHeadFn;\n\nclass ServerResponse extends Writable {\n constructor(c) {\n super();\n if (!c)\n c = {};\n var req = c.req || {}, reply = c.reply;\n if (this.req = req, this._reply = reply, this.sendDate = !0, this.statusCode = 200, this.headersSent = !1, this.statusMessage = @undefined, this.#controller = @undefined, this.#firstWrite = @undefined, this._writableState.decodeStrings = !1, this.#deferred = @undefined, req.method === \"HEAD\")\n this._hasBody = !1;\n }\n req;\n _reply;\n sendDate;\n statusCode;\n #headers;\n headersSent = !1;\n statusMessage;\n #controller;\n #firstWrite;\n _sent100 = !1;\n _defaultKeepAlive = !1;\n _removedConnection = !1;\n _removedContLen = !1;\n _hasBody = !0;\n #deferred = @undefined;\n #finished = !1;\n _implicitHeader() {\n this.writeHead(this.statusCode);\n }\n _write(chunk, encoding, callback) {\n if (!this.#firstWrite && !this.headersSent) {\n this.#firstWrite = chunk, callback();\n return;\n }\n this.#ensureReadableStreamController((controller) => {\n controller.write(chunk), callback();\n });\n }\n _writev(chunks, callback) {\n if (chunks.length === 1 && !this.headersSent && !this.#firstWrite) {\n this.#firstWrite = chunks[0].chunk, callback();\n return;\n }\n this.#ensureReadableStreamController((controller) => {\n for (let chunk of chunks)\n controller.write(chunk.chunk);\n callback();\n });\n }\n #ensureReadableStreamController(run) {\n var thisController = this.#controller;\n if (thisController)\n return run(thisController);\n this.headersSent = !0;\n var firstWrite = this.#firstWrite;\n this.#firstWrite = @undefined, this._reply(new Response(new @ReadableStream({\n type: \"direct\",\n pull: (controller) => {\n if (this.#controller = controller, firstWrite)\n controller.write(firstWrite);\n if (firstWrite = @undefined, run(controller), !this.#finished)\n return new @Promise((resolve) => {\n this.#deferred = resolve;\n });\n }\n }), {\n headers: this.#headers,\n status: this.statusCode,\n statusText: this.statusMessage \?\? STATUS_CODES[this.statusCode]\n }));\n }\n #drainHeadersIfObservable() {\n if (this._implicitHeader === OriginalImplicitHeadFn && this.writeHead === OriginalWriteHeadFn)\n return;\n this._implicitHeader();\n }\n _final(callback) {\n if (!this.headersSent) {\n var data = this.#firstWrite || \"\";\n this.#firstWrite = @undefined, this.#finished = !0, this.#drainHeadersIfObservable(), this._reply(new Response(data, {\n headers: this.#headers,\n status: this.statusCode,\n statusText: this.statusMessage \?\? STATUS_CODES[this.statusCode]\n })), callback && callback();\n return;\n }\n this.#finished = !0, this.#ensureReadableStreamController((controller) => {\n controller.end(), callback();\n var deferred = this.#deferred;\n if (deferred)\n this.#deferred = @undefined, deferred();\n });\n }\n writeProcessing() {\n throw new Error(\"not implemented\");\n }\n addTrailers(headers) {\n throw new Error(\"not implemented\");\n }\n assignSocket(socket) {\n throw new Error(\"not implemented\");\n }\n detachSocket(socket) {\n throw new Error(\"not implemented\");\n }\n writeContinue(callback) {\n throw new Error(\"not implemented\");\n }\n setTimeout(msecs, callback) {\n throw new Error(\"not implemented\");\n }\n get shouldKeepAlive() {\n return !0;\n }\n get chunkedEncoding() {\n return !1;\n }\n set chunkedEncoding(value) {\n }\n set shouldKeepAlive(value) {\n }\n get useChunkedEncodingByDefault() {\n return !0;\n }\n set useChunkedEncodingByDefault(value) {\n }\n appendHeader(name, value) {\n var headers = this.#headers \?\?= new Headers;\n headers.append(name, value);\n }\n flushHeaders() {\n }\n getHeader(name) {\n return getHeader(this.#headers, name);\n }\n getHeaders() {\n var headers = this.#headers;\n if (!headers)\n return kEmptyObject;\n return headers.toJSON();\n }\n getHeaderNames() {\n var headers = this.#headers;\n if (!headers)\n return [];\n return @Array.from(headers.keys());\n }\n removeHeader(name) {\n if (!this.#headers)\n return;\n this.#headers.delete(name);\n }\n setHeader(name, value) {\n var headers = this.#headers \?\?= new Headers;\n return setHeader(headers, name, value), this;\n }\n hasHeader(name) {\n if (!this.#headers)\n return !1;\n return this.#headers.has(name);\n }\n writeHead(statusCode, statusMessage, headers) {\n return _writeHead(statusCode, statusMessage, headers, this), this;\n }\n}\nOriginalWriteHeadFn = ServerResponse.prototype.writeHead;\nOriginalImplicitHeadFn = ServerResponse.prototype._implicitHeader;\n\nclass ClientRequest extends OutgoingMessage {\n #timeout;\n #res = null;\n #upgradeOrConnect = !1;\n #parser = null;\n #maxHeadersCount = null;\n #reusedSocket = !1;\n #host;\n #protocol;\n #method;\n #port;\n #useDefaultPort;\n #joinDuplicateHeaders;\n #maxHeaderSize;\n #agent = globalAgent;\n #path;\n #socketPath;\n #bodyChunks = null;\n #fetchRequest;\n #signal = null;\n [kAbortController] = null;\n #timeoutTimer = @undefined;\n #options;\n #finished;\n get path() {\n return this.#path;\n }\n get port() {\n return this.#port;\n }\n get method() {\n return this.#method;\n }\n get host() {\n return this.#host;\n }\n get protocol() {\n return this.#protocol;\n }\n _write(chunk, encoding, callback) {\n if (!this.#bodyChunks) {\n this.#bodyChunks = [chunk], callback();\n return;\n }\n this.#bodyChunks.push(chunk), callback();\n }\n _writev(chunks, callback) {\n if (!this.#bodyChunks) {\n this.#bodyChunks = chunks, callback();\n return;\n }\n this.#bodyChunks.push(...chunks), callback();\n }\n _final(callback) {\n if (this.#finished = !0, this[kAbortController] = new AbortController, this[kAbortController].signal.addEventListener(\"abort\", () => {\n this[kClearTimeout]();\n }), this.#signal\?.aborted)\n this[kAbortController].abort();\n var method = this.#method, body = this.#bodyChunks\?.length === 1 \? this.#bodyChunks[0] : @Buffer.concat(this.#bodyChunks || []);\n let url, proxy;\n if (this.#path.startsWith(\"http://\") || this.#path.startsWith(\"https://\"))\n url = this.#path, proxy = `${this.#protocol}//${this.#host}${this.#useDefaultPort \? \"\" : \":\" + this.#port}`;\n else\n url = `${this.#protocol}//${this.#host}${this.#useDefaultPort \? \"\" : \":\" + this.#port}${this.#path}`;\n try {\n this.#fetchRequest = fetch(url, {\n method,\n headers: this.getHeaders(),\n body: body && method !== \"GET\" && method !== \"HEAD\" && method !== \"OPTIONS\" \? body : @undefined,\n redirect: \"manual\",\n verbose: !1,\n signal: this[kAbortController].signal,\n proxy,\n timeout: !1,\n decompress: !1\n }).then((response) => {\n var res = this.#res = new IncomingMessage(response, {\n type: \"response\",\n [kInternalRequest]: this\n });\n this.emit(\"response\", res);\n }).catch((err) => {\n this.emit(\"error\", err);\n }).finally(() => {\n this.#fetchRequest = null, this[kClearTimeout]();\n });\n } catch (err) {\n this.emit(\"error\", err);\n } finally {\n callback();\n }\n }\n get aborted() {\n return this.#signal\?.aborted || !!this[kAbortController]\?.signal.aborted;\n }\n abort() {\n if (this.aborted)\n return;\n this[kAbortController].abort();\n }\n constructor(input, options, cb) {\n super();\n if (typeof input === \"string\") {\n const urlStr = input;\n try {\n var urlObject = new URL(urlStr);\n } catch (e) {\n @throwTypeError(`Invalid URL: ${urlStr}`);\n }\n input = urlToHttpOptions(urlObject);\n } else if (input && typeof input === \"object\" && input instanceof URL)\n input = urlToHttpOptions(input);\n else\n cb = options, options = input, input = null;\n if (typeof options === \"function\")\n cb = options, options = input || kEmptyObject;\n else\n options = ObjectAssign(input || {}, options);\n var defaultAgent = options._defaultAgent || Agent.globalAgent;\n let protocol = options.protocol;\n if (!protocol)\n if (options.port === 443)\n protocol = \"https:\";\n else\n protocol = defaultAgent.protocol || \"http:\";\n switch (this.#protocol = protocol, this.#agent\?.protocol) {\n case @undefined:\n break;\n case \"http:\":\n if (protocol === \"https:\") {\n defaultAgent = this.#agent = getDefaultHTTPSAgent();\n break;\n }\n case \"https:\":\n if (protocol === \"https\") {\n defaultAgent = this.#agent = Agent.globalAgent;\n break;\n }\n default:\n break;\n }\n if (options.path) {\n const path = @String(options.path);\n if (RegExpPrototypeExec.call(INVALID_PATH_REGEX, path) !== null)\n throw new Error(\"Path contains unescaped characters\");\n }\n if (protocol !== \"http:\" && protocol !== \"https:\" && protocol) {\n const expectedProtocol = defaultAgent\?.protocol \?\? \"http:\";\n throw new Error(`Protocol mismatch. Expected: ${expectedProtocol}. Got: ${protocol}`);\n }\n const defaultPort = protocol === \"https:\" \? 443 : 80;\n this.#port = options.port || options.defaultPort || this.#agent\?.defaultPort || defaultPort, this.#useDefaultPort = this.#port === defaultPort;\n const host = this.#host = options.host = validateHost(options.hostname, \"hostname\") || validateHost(options.host, \"host\") || \"localhost\";\n this.#socketPath = options.socketPath;\n const signal = options.signal;\n if (signal)\n signal.addEventListener(\"abort\", () => {\n this[kAbortController]\?.abort();\n }), this.#signal = signal;\n let method = options.method;\n const methodIsString = typeof method === \"string\";\n if (method !== null && method !== @undefined && !methodIsString)\n throw new Error(\"ERR_INVALID_ARG_TYPE: options.method\");\n if (methodIsString && method) {\n if (!checkIsHttpToken(method))\n throw new Error(\"ERR_INVALID_HTTP_TOKEN: Method\");\n method = this.#method = StringPrototypeToUpperCase.call(method);\n } else\n method = this.#method = \"GET\";\n const _maxHeaderSize = options.maxHeaderSize;\n this.#maxHeaderSize = _maxHeaderSize;\n var _joinDuplicateHeaders = options.joinDuplicateHeaders;\n if (this.#joinDuplicateHeaders = _joinDuplicateHeaders, this.#path = options.path || \"/\", cb)\n this.once(\"response\", cb);\n this.#finished = !1, this.#res = null, this.#upgradeOrConnect = !1, this.#parser = null, this.#maxHeadersCount = null, this.#reusedSocket = !1, this.#host = host, this.#protocol = protocol;\n var timeout = options.timeout;\n if (timeout !== @undefined && timeout !== 0)\n this.setTimeout(timeout, @undefined);\n if (!ArrayIsArray(headers)) {\n var headers = options.headers;\n if (headers)\n for (let key in headers)\n this.setHeader(key, headers[key]);\n var auth = options.auth;\n if (auth && !this.getHeader(\"Authorization\"))\n this.setHeader(\"Authorization\", \"Basic \" + @Buffer.from(auth).toString(\"base64\"));\n }\n var { signal: _signal, ...optsWithoutSignal } = options;\n this.#options = optsWithoutSignal;\n }\n setSocketKeepAlive(enable = !0, initialDelay = 0) {\n }\n setNoDelay(noDelay = !0) {\n }\n [kClearTimeout]() {\n if (this.#timeoutTimer)\n clearTimeout(this.#timeoutTimer), this.#timeoutTimer = @undefined, this.removeAllListeners(\"timeout\");\n }\n #onTimeout() {\n this.#timeoutTimer = @undefined, this[kAbortController]\?.abort(), this.emit(\"timeout\");\n }\n setTimeout(msecs, callback) {\n if (this.destroyed)\n return this;\n if (this.timeout = msecs = validateMsecs(msecs, \"msecs\"), clearTimeout(this.#timeoutTimer), msecs === 0) {\n if (callback !== @undefined)\n validateFunction(callback, \"callback\"), this.removeListener(\"timeout\", callback);\n this.#timeoutTimer = @undefined;\n } else if (this.#timeoutTimer = setTimeout(this.#onTimeout.bind(this), msecs).unref(), callback !== @undefined)\n validateFunction(callback, \"callback\"), this.once(\"timeout\", callback);\n return this;\n }\n}\nvar tokenRegExp = /^[\\^_`a-zA-Z\\-0-9!#$%&'*+.|~]+$/, METHODS = [\n \"ACL\",\n \"BIND\",\n \"CHECKOUT\",\n \"CONNECT\",\n \"COPY\",\n \"DELETE\",\n \"GET\",\n \"HEAD\",\n \"LINK\",\n \"LOCK\",\n \"M-SEARCH\",\n \"MERGE\",\n \"MKACTIVITY\",\n \"MKCALENDAR\",\n \"MKCOL\",\n \"MOVE\",\n \"NOTIFY\",\n \"OPTIONS\",\n \"PATCH\",\n \"POST\",\n \"PROPFIND\",\n \"PROPPATCH\",\n \"PURGE\",\n \"PUT\",\n \"REBIND\",\n \"REPORT\",\n \"SEARCH\",\n \"SOURCE\",\n \"SUBSCRIBE\",\n \"TRACE\",\n \"UNBIND\",\n \"UNLINK\",\n \"UNLOCK\",\n \"UNSUBSCRIBE\"\n], STATUS_CODES = {\n 100: \"Continue\",\n 101: \"Switching Protocols\",\n 102: \"Processing\",\n 103: \"Early Hints\",\n 200: \"OK\",\n 201: \"Created\",\n 202: \"Accepted\",\n 203: \"Non-Authoritative Information\",\n 204: \"No Content\",\n 205: \"Reset Content\",\n 206: \"Partial Content\",\n 207: \"Multi-Status\",\n 208: \"Already Reported\",\n 226: \"IM Used\",\n 300: \"Multiple Choices\",\n 301: \"Moved Permanently\",\n 302: \"Found\",\n 303: \"See Other\",\n 304: \"Not Modified\",\n 305: \"Use Proxy\",\n 307: \"Temporary Redirect\",\n 308: \"Permanent Redirect\",\n 400: \"Bad Request\",\n 401: \"Unauthorized\",\n 402: \"Payment Required\",\n 403: \"Forbidden\",\n 404: \"Not Found\",\n 405: \"Method Not Allowed\",\n 406: \"Not Acceptable\",\n 407: \"Proxy Authentication Required\",\n 408: \"Request Timeout\",\n 409: \"Conflict\",\n 410: \"Gone\",\n 411: \"Length Required\",\n 412: \"Precondition Failed\",\n 413: \"Payload Too Large\",\n 414: \"URI Too Long\",\n 415: \"Unsupported Media Type\",\n 416: \"Range Not Satisfiable\",\n 417: \"Expectation Failed\",\n 418: \"I'm a Teapot\",\n 421: \"Misdirected Request\",\n 422: \"Unprocessable Entity\",\n 423: \"Locked\",\n 424: \"Failed Dependency\",\n 425: \"Too Early\",\n 426: \"Upgrade Required\",\n 428: \"Precondition Required\",\n 429: \"Too Many Requests\",\n 431: \"Request Header Fields Too Large\",\n 451: \"Unavailable For Legal Reasons\",\n 500: \"Internal Server Error\",\n 501: \"Not Implemented\",\n 502: \"Bad Gateway\",\n 503: \"Service Unavailable\",\n 504: \"Gateway Timeout\",\n 505: \"HTTP Version Not Supported\",\n 506: \"Variant Also Negotiates\",\n 507: \"Insufficient Storage\",\n 508: \"Loop Detected\",\n 509: \"Bandwidth Limit Exceeded\",\n 510: \"Not Extended\",\n 511: \"Network Authentication Required\"\n}, globalAgent = new Agent;\n$ = {\n Agent,\n Server,\n METHODS,\n STATUS_CODES,\n createServer,\n ServerResponse,\n IncomingMessage,\n request,\n get,\n maxHeaderSize: 16384,\n validateHeaderName,\n validateHeaderValue,\n setMaxIdleHTTPParsers(max) {\n },\n globalAgent,\n ClientRequest,\n OutgoingMessage\n};\nreturn $})\n"_s; +static constexpr ASCIILiteral NodeHttpCode = "(function (){\"use strict\";// src/js/out/tmp/node/http.ts\nvar checkInvalidHeaderChar = function(val) {\n return RegExpPrototypeExec.call(headerCharRegex, val) !== null;\n}, isIPv6 = function(input) {\n return new @RegExp(\"^((\?:(\?:[0-9a-fA-F]{1,4}):){7}(\?:(\?:[0-9a-fA-F]{1,4})|:)|(\?:(\?:[0-9a-fA-F]{1,4}):){6}(\?:((\?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])[.]){3}(\?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])|:(\?:[0-9a-fA-F]{1,4})|:)|(\?:(\?:[0-9a-fA-F]{1,4}):){5}(\?::((\?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])[.]){3}(\?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])|(:(\?:[0-9a-fA-F]{1,4})){1,2}|:)|(\?:(\?:[0-9a-fA-F]{1,4}):){4}(\?:(:(\?:[0-9a-fA-F]{1,4})){0,1}:((\?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])[.]){3}(\?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])|(:(\?:[0-9a-fA-F]{1,4})){1,3}|:)|(\?:(\?:[0-9a-fA-F]{1,4}):){3}(\?:(:(\?:[0-9a-fA-F]{1,4})){0,2}:((\?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])[.]){3}(\?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])|(:(\?:[0-9a-fA-F]{1,4})){1,4}|:)|(\?:(\?:[0-9a-fA-F]{1,4}):){2}(\?:(:(\?:[0-9a-fA-F]{1,4})){0,3}:((\?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])[.]){3}(\?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])|(:(\?:[0-9a-fA-F]{1,4})){1,5}|:)|(\?:(\?:[0-9a-fA-F]{1,4}):){1}(\?:(:(\?:[0-9a-fA-F]{1,4})){0,4}:((\?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])[.]){3}(\?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])|(:(\?:[0-9a-fA-F]{1,4})){1,6}|:)|(\?::((\?::(\?:[0-9a-fA-F]{1,4})){0,5}:((\?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])[.]){3}(\?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])|(\?::(\?:[0-9a-fA-F]{1,4})){1,7}|:)))(%[0-9a-zA-Z-.:]{1,})\?$\").test(input);\n}, isValidTLSArray = function(obj) {\n if (typeof obj === \"string\" || isTypedArray(obj) || obj instanceof @ArrayBuffer || obj instanceof Blob)\n return !0;\n if (@Array.isArray(obj)) {\n for (var i = 0;i < obj.length; i++)\n if (typeof obj !== \"string\" && !isTypedArray(obj) && !(obj instanceof @ArrayBuffer) && !(obj instanceof Blob))\n return !1;\n return !0;\n }\n}, validateMsecs = function(numberlike, field) {\n if (typeof numberlike !== \"number\" || numberlike < 0)\n throw new ERR_INVALID_ARG_TYPE(field, \"number\", numberlike);\n return numberlike;\n}, validateFunction = function(callable, field) {\n if (typeof callable !== \"function\")\n throw new ERR_INVALID_ARG_TYPE(field, \"Function\", callable);\n return callable;\n}, createServer = function(options, callback) {\n return new Server(options, callback);\n}, emitListeningNextTick = function(self, onListen, err, hostname, port) {\n if (typeof onListen === \"function\")\n try {\n onListen(err, hostname, port);\n } catch (err2) {\n self.emit(\"error\", err2);\n }\n if (self.listening = !err, err)\n self.emit(\"error\", err);\n else\n self.emit(\"listening\", hostname, port);\n}, assignHeaders = function(object, req) {\n var headers = req.headers.toJSON();\n const rawHeaders = @newArrayWithSize(req.headers.count * 2);\n var i = 0;\n for (let key in headers)\n rawHeaders[i++] = key, rawHeaders[i++] = headers[key];\n object.headers = headers, object.rawHeaders = rawHeaders;\n};\nvar getDefaultHTTPSAgent = function() {\n return _defaultHTTPSAgent \?\?= new Agent({ defaultPort: 443, protocol: \"https:\" });\n};\nvar urlToHttpOptions = function(url) {\n var { protocol, hostname, hash, search, pathname, href, port, username, password } = url;\n return {\n protocol,\n hostname: typeof hostname === \"string\" && StringPrototypeStartsWith.call(hostname, \"[\") \? StringPrototypeSlice.call(hostname, 1, -1) : hostname,\n hash,\n search,\n pathname,\n path: `${pathname || \"\"}${search || \"\"}`,\n href,\n port: port \? Number(port) : protocol === \"https:\" \? 443 : protocol === \"http:\" \? 80 : @undefined,\n auth: username || password \? `${decodeURIComponent(username)}:${decodeURIComponent(password)}` : @undefined\n };\n}, validateHost = function(host, name) {\n if (host !== null && host !== @undefined && typeof host !== \"string\")\n throw new Error(\"Invalid arg type in options\");\n return host;\n}, checkIsHttpToken = function(val) {\n return RegExpPrototypeExec.call(tokenRegExp, val) !== null;\n};\nvar _writeHead = function(statusCode, reason, obj, response) {\n if (statusCode |= 0, statusCode < 100 || statusCode > 999)\n throw new Error(\"status code must be between 100 and 999\");\n if (typeof reason === \"string\")\n response.statusMessage = reason;\n else {\n if (!response.statusMessage)\n response.statusMessage = STATUS_CODES[statusCode] || \"unknown\";\n obj = reason;\n }\n response.statusCode = statusCode;\n {\n let k;\n if (@Array.isArray(obj)) {\n if (obj.length % 2 !== 0)\n throw new Error(\"raw headers must have an even number of elements\");\n for (let n = 0;n < obj.length; n += 2)\n if (k = obj[n + 0], k)\n response.setHeader(k, obj[n + 1]);\n } else if (obj) {\n const keys = Object.keys(obj);\n for (let i = 0;i < keys.length; i++)\n if (k = keys[i], k)\n response.setHeader(k, obj[k]);\n }\n }\n if (statusCode === 204 || statusCode === 304 || statusCode >= 100 && statusCode <= 199)\n response._hasBody = !1;\n}, request = function(url, options, cb) {\n return new ClientRequest(url, options, cb);\n}, get = function(url, options, cb) {\n const req = request(url, options, cb);\n return req.end(), req;\n}, $, EventEmitter = @getInternalField(@internalModuleRegistry, 18) || @createInternalModuleById(18), { isTypedArray } = @requireNativeModule(\"util/types\"), { Duplex, Readable, Writable } = @getInternalField(@internalModuleRegistry, 37) || @createInternalModuleById(37), { getHeader, setHeader } = @lazy(\"http\"), headerCharRegex = /[^\\t\\x20-\\x7e\\x80-\\xff]/, validateHeaderName = (name, label) => {\n if (typeof name !== \"string\" || !name || !checkIsHttpToken(name))\n throw new Error(\"ERR_INVALID_HTTP_TOKEN\");\n}, validateHeaderValue = (name, value) => {\n if (value === @undefined)\n throw new Error(\"ERR_HTTP_INVALID_HEADER_VALUE\");\n if (checkInvalidHeaderChar(value))\n throw new Error(\"ERR_INVALID_CHAR\");\n}, { URL } = globalThis, globalReportError = globalThis.reportError, setTimeout = globalThis.setTimeout, fetch = Bun.fetch;\nvar kEmptyObject = Object.freeze(Object.create(null)), kOutHeaders = Symbol.for(\"kOutHeaders\"), kEndCalled = Symbol.for(\"kEndCalled\"), kAbortController = Symbol.for(\"kAbortController\"), kClearTimeout = Symbol(\"kClearTimeout\"), kCorked = Symbol.for(\"kCorked\"), searchParamsSymbol = Symbol.for(\"query\"), StringPrototypeSlice = @String.prototype.slice, StringPrototypeStartsWith = @String.prototype.startsWith, StringPrototypeToUpperCase = @String.prototype.toUpperCase, ArrayIsArray = @Array.isArray, RegExpPrototypeExec = @RegExp.prototype.exec, ObjectAssign = Object.assign, INVALID_PATH_REGEX = /[^\\u0021-\\u00ff]/;\nvar _defaultHTTPSAgent, kInternalRequest = Symbol(\"kInternalRequest\"), kInternalSocketData = Symbol.for(\"::bunternal::\"), kEmptyBuffer = @Buffer.alloc(0);\n\nclass ERR_INVALID_ARG_TYPE extends TypeError {\n constructor(name, expected, actual) {\n super(`The ${name} argument must be of type ${expected}. Received type ${typeof actual}`);\n this.code = \"ERR_INVALID_ARG_TYPE\";\n }\n}\nvar FakeSocket = class Socket extends Duplex {\n [kInternalSocketData];\n bytesRead = 0;\n bytesWritten = 0;\n connecting = !1;\n remoteAddress = null;\n remotePort;\n timeout = 0;\n isServer = !1;\n address() {\n return {\n address: this.localAddress,\n family: this.localFamily,\n port: this.localPort\n };\n }\n get bufferSize() {\n return this.writableLength;\n }\n connect(port, host, connectListener) {\n return this;\n }\n _destroy(err, callback) {\n }\n _final(callback) {\n }\n get localAddress() {\n return \"127.0.0.1\";\n }\n get localFamily() {\n return \"IPv4\";\n }\n get localPort() {\n return 80;\n }\n get pending() {\n return this.connecting;\n }\n _read(size) {\n }\n get readyState() {\n if (this.connecting)\n return \"opening\";\n if (this.readable)\n return this.writable \? \"open\" : \"readOnly\";\n else\n return this.writable \? \"writeOnly\" : \"closed\";\n }\n ref() {\n }\n get remoteFamily() {\n return \"IPv4\";\n }\n resetAndDestroy() {\n }\n setKeepAlive(enable = !1, initialDelay = 0) {\n }\n setNoDelay(noDelay = !0) {\n return this;\n }\n setTimeout(timeout, callback) {\n return this;\n }\n unref() {\n }\n _write(chunk, encoding, callback) {\n }\n};\n\nclass Agent extends EventEmitter {\n defaultPort = 80;\n protocol = \"http:\";\n options;\n requests;\n sockets;\n freeSockets;\n keepAliveMsecs;\n keepAlive;\n maxSockets;\n maxFreeSockets;\n scheduling;\n maxTotalSockets;\n totalSocketCount;\n #fakeSocket;\n static get globalAgent() {\n return globalAgent;\n }\n static get defaultMaxSockets() {\n return @Infinity;\n }\n constructor(options = kEmptyObject) {\n super();\n if (this.options = options = { ...options, path: null }, options.noDelay === @undefined)\n options.noDelay = !0;\n this.requests = kEmptyObject, this.sockets = kEmptyObject, this.freeSockets = kEmptyObject, this.keepAliveMsecs = options.keepAliveMsecs || 1000, this.keepAlive = options.keepAlive || !1, this.maxSockets = options.maxSockets || Agent.defaultMaxSockets, this.maxFreeSockets = options.maxFreeSockets || 256, this.scheduling = options.scheduling || \"lifo\", this.maxTotalSockets = options.maxTotalSockets, this.totalSocketCount = 0, this.defaultPort = options.defaultPort || 80, this.protocol = options.protocol || \"http:\";\n }\n createConnection() {\n return this.#fakeSocket \?\?= new FakeSocket;\n }\n getName(options = kEmptyObject) {\n let name = `http:${options.host || \"localhost\"}:`;\n if (options.port)\n name += options.port;\n if (name += \":\", options.localAddress)\n name += options.localAddress;\n if (options.family === 4 || options.family === 6)\n name += `:${options.family}`;\n if (options.socketPath)\n name += `:${options.socketPath}`;\n return name;\n }\n addRequest() {\n }\n createSocket(req, options, cb) {\n cb(null, this.#fakeSocket \?\?= new FakeSocket);\n }\n removeSocket() {\n }\n keepSocketAlive() {\n return !0;\n }\n reuseSocket() {\n }\n destroy() {\n }\n}\n\nclass Server extends EventEmitter {\n #server;\n #options;\n #tls;\n #is_tls = !1;\n listening = !1;\n serverName;\n constructor(options, callback) {\n super();\n if (typeof options === \"function\")\n callback = options, options = {};\n else if (options == null || typeof options === \"object\") {\n options = { ...options }, this.#tls = null;\n let key = options.key;\n if (key) {\n if (!isValidTLSArray(key))\n @throwTypeError(\"key argument must be an string, Buffer, TypedArray, BunFile or an array containing string, Buffer, TypedArray or BunFile\");\n this.#is_tls = !0;\n }\n let cert = options.cert;\n if (cert) {\n if (!isValidTLSArray(cert))\n @throwTypeError(\"cert argument must be an string, Buffer, TypedArray, BunFile or an array containing string, Buffer, TypedArray or BunFile\");\n this.#is_tls = !0;\n }\n let ca = options.ca;\n if (ca) {\n if (!isValidTLSArray(ca))\n @throwTypeError(\"ca argument must be an string, Buffer, TypedArray, BunFile or an array containing string, Buffer, TypedArray or BunFile\");\n this.#is_tls = !0;\n }\n let passphrase = options.passphrase;\n if (passphrase && typeof passphrase !== \"string\")\n @throwTypeError(\"passphrase argument must be an string\");\n let serverName = options.servername;\n if (serverName && typeof serverName !== \"string\")\n @throwTypeError(\"servername argument must be an string\");\n let secureOptions = options.secureOptions || 0;\n if (secureOptions && typeof secureOptions !== \"number\")\n @throwTypeError(\"secureOptions argument must be an number\");\n if (this.#is_tls)\n this.#tls = {\n serverName,\n key,\n cert,\n ca,\n passphrase,\n secureOptions\n };\n else\n this.#tls = null;\n } else\n throw new Error(\"bun-http-polyfill: invalid arguments\");\n if (this.#options = options, callback)\n this.on(\"request\", callback);\n }\n closeAllConnections() {\n const server = this.#server;\n if (!server)\n return;\n this.#server = @undefined, server.stop(!0), this.emit(\"close\");\n }\n closeIdleConnections() {\n }\n close(optionalCallback) {\n const server = this.#server;\n if (!server) {\n if (typeof optionalCallback === \"function\")\n process.nextTick(optionalCallback, new Error(\"Server is not running\"));\n return;\n }\n if (this.#server = @undefined, typeof optionalCallback === \"function\")\n this.once(\"close\", optionalCallback);\n server.stop(), this.emit(\"close\");\n }\n address() {\n if (!this.#server)\n return null;\n const address = this.#server.hostname;\n return {\n address,\n family: isIPv6(address) \? \"IPv6\" : \"IPv4\",\n port: this.#server.port\n };\n }\n listen(port, host, backlog, onListen) {\n const server = this;\n let socketPath;\n if (typeof port == \"string\" && !Number.isSafeInteger(Number(port)))\n socketPath = port;\n if (typeof host === \"function\")\n onListen = host, host = @undefined;\n if (typeof port === \"function\")\n onListen = port;\n else if (typeof port === \"object\") {\n if (port\?.signal\?.addEventListener(\"abort\", () => {\n this.close();\n }), host = port\?.host, port = port\?.port, typeof port\?.callback === \"function\")\n onListen = port\?.callback;\n }\n if (typeof backlog === \"function\")\n onListen = backlog;\n const ResponseClass = this.#options.ServerResponse || ServerResponse, RequestClass = this.#options.IncomingMessage || IncomingMessage;\n try {\n const tls = this.#tls;\n if (tls)\n this.serverName = tls.serverName || host || \"localhost\";\n this.#server = Bun.serve({\n tls,\n port,\n hostname: host,\n unix: socketPath,\n websocket: {\n open(ws) {\n ws.data.open(ws);\n },\n message(ws, message) {\n ws.data.message(ws, message);\n },\n close(ws, code, reason) {\n ws.data.close(ws, code, reason);\n },\n drain(ws) {\n ws.data.drain(ws);\n }\n },\n fetch(req, _server) {\n var pendingResponse, pendingError, rejectFunction, resolveFunction, reject = (err) => {\n if (pendingError)\n return;\n if (pendingError = err, rejectFunction)\n rejectFunction(err);\n }, reply = function(resp) {\n if (pendingResponse)\n return;\n if (pendingResponse = resp, resolveFunction)\n resolveFunction(resp);\n };\n const http_req = new RequestClass(req), http_res = new ResponseClass({ reply, req: http_req });\n if (http_req.once(\"error\", (err) => reject(err)), http_res.once(\"error\", (err) => reject(err)), req.headers.get(\"upgrade\")) {\n const socket = http_req.socket;\n socket[kInternalSocketData] = [_server, http_res, req], server.emit(\"upgrade\", http_req, socket, kEmptyBuffer);\n } else\n server.emit(\"request\", http_req, http_res);\n if (pendingError)\n throw pendingError;\n if (pendingResponse)\n return pendingResponse;\n return new @Promise((resolve, reject2) => {\n resolveFunction = resolve, rejectFunction = reject2;\n });\n }\n }), setTimeout(emitListeningNextTick, 1, this, onListen, null, this.#server.hostname, this.#server.port);\n } catch (err) {\n server.emit(\"error\", err);\n }\n return this;\n }\n setTimeout(msecs, callback) {\n }\n}\nclass IncomingMessage extends Readable {\n method;\n complete;\n constructor(req, defaultIncomingOpts) {\n const method = req.method;\n super();\n const url = new URL(req.url);\n var { type = \"request\", [kInternalRequest]: nodeReq } = defaultIncomingOpts || {};\n this.#noBody = type === \"request\" \? method === \"GET\" || method === \"HEAD\" || method === \"TRACE\" || method === \"CONNECT\" || method === \"OPTIONS\" || (parseInt(req.headers.get(\"Content-Length\") || \"\") || 0) === 0 : !1, this.#req = req, this.method = method, this.#type = type, this.complete = !!this.#noBody, this.#bodyStream = @undefined;\n const socket = new FakeSocket;\n if (socket.remoteAddress = url.hostname, socket.remotePort = url.port, url.protocol === \"https:\")\n socket.encrypted = !0;\n this.#fakeSocket = socket, this.url = url.pathname + url.search, this.#nodeReq = this.req = nodeReq, assignHeaders(this, req);\n }\n headers;\n rawHeaders;\n _consuming = !1;\n _dumped = !1;\n #bodyStream;\n #fakeSocket;\n #noBody = !1;\n #aborted = !1;\n #req;\n url;\n #type;\n #nodeReq;\n _construct(callback) {\n if (this.#type === \"response\" || this.#noBody) {\n callback();\n return;\n }\n const contentLength = this.#req.headers.get(\"content-length\");\n if ((contentLength \? parseInt(contentLength, 10) : 0) === 0) {\n this.#noBody = !0, callback();\n return;\n }\n callback();\n }\n async#consumeStream(reader) {\n while (!0) {\n var { done, value } = await reader.readMany();\n if (this.#aborted)\n return;\n if (done) {\n this.push(null), this.destroy();\n break;\n }\n for (var v of value)\n this.push(v);\n }\n }\n _read(size) {\n if (this.#noBody)\n this.push(null), this.complete = !0;\n else if (this.#bodyStream == null) {\n const reader = this.#req.body\?.getReader();\n if (!reader) {\n this.push(null);\n return;\n }\n this.#bodyStream = reader, this.#consumeStream(reader);\n }\n }\n get aborted() {\n return this.#aborted;\n }\n #abort() {\n if (this.#aborted)\n return;\n this.#aborted = !0;\n var bodyStream = this.#bodyStream;\n if (!bodyStream)\n return;\n bodyStream.cancel(), this.complete = !0, this.#bodyStream = @undefined, this.push(null);\n }\n get connection() {\n return this.#fakeSocket;\n }\n get statusCode() {\n return this.#req.status;\n }\n get statusMessage() {\n return STATUS_CODES[this.#req.status];\n }\n get httpVersion() {\n return \"1.1\";\n }\n get rawTrailers() {\n return [];\n }\n get httpVersionMajor() {\n return 1;\n }\n get httpVersionMinor() {\n return 1;\n }\n get trailers() {\n return kEmptyObject;\n }\n get socket() {\n return this.#fakeSocket \?\?= new FakeSocket;\n }\n set socket(val) {\n this.#fakeSocket = val;\n }\n setTimeout(msecs, callback) {\n throw new Error(\"not implemented\");\n }\n}\n\nclass OutgoingMessage extends Writable {\n constructor() {\n super(...arguments);\n }\n #headers;\n headersSent = !1;\n sendDate = !0;\n req;\n timeout;\n #finished = !1;\n [kEndCalled] = !1;\n #fakeSocket;\n #timeoutTimer;\n [kAbortController] = null;\n _implicitHeader() {\n }\n get headers() {\n if (!this.#headers)\n return kEmptyObject;\n return this.#headers.toJSON();\n }\n get shouldKeepAlive() {\n return !0;\n }\n get chunkedEncoding() {\n return !1;\n }\n set chunkedEncoding(value) {\n }\n set shouldKeepAlive(value) {\n }\n get useChunkedEncodingByDefault() {\n return !0;\n }\n set useChunkedEncodingByDefault(value) {\n }\n get socket() {\n return this.#fakeSocket \?\?= new FakeSocket;\n }\n set socket(val) {\n this.#fakeSocket = val;\n }\n get connection() {\n return this.socket;\n }\n get finished() {\n return this.#finished;\n }\n appendHeader(name, value) {\n var headers = this.#headers \?\?= new Headers;\n headers.append(name, value);\n }\n flushHeaders() {\n }\n getHeader(name) {\n return getHeader(this.#headers, name);\n }\n getHeaders() {\n if (!this.#headers)\n return kEmptyObject;\n return this.#headers.toJSON();\n }\n getHeaderNames() {\n var headers = this.#headers;\n if (!headers)\n return [];\n return @Array.from(headers.keys());\n }\n removeHeader(name) {\n if (!this.#headers)\n return;\n this.#headers.delete(name);\n }\n setHeader(name, value) {\n var headers = this.#headers \?\?= new Headers;\n return headers.set(name, value), this;\n }\n hasHeader(name) {\n if (!this.#headers)\n return !1;\n return this.#headers.has(name);\n }\n addTrailers(headers) {\n throw new Error(\"not implemented\");\n }\n [kClearTimeout]() {\n if (this.#timeoutTimer)\n clearTimeout(this.#timeoutTimer), this.removeAllListeners(\"timeout\"), this.#timeoutTimer = @undefined;\n }\n #onTimeout() {\n this.#timeoutTimer = @undefined, this[kAbortController]\?.abort(), this.emit(\"timeout\");\n }\n setTimeout(msecs, callback) {\n if (this.destroyed)\n return this;\n if (this.timeout = msecs = validateMsecs(msecs, \"msecs\"), clearTimeout(this.#timeoutTimer), msecs === 0) {\n if (callback !== @undefined)\n validateFunction(callback, \"callback\"), this.removeListener(\"timeout\", callback);\n this.#timeoutTimer = @undefined;\n } else if (this.#timeoutTimer = setTimeout(this.#onTimeout.bind(this), msecs).unref(), callback !== @undefined)\n validateFunction(callback, \"callback\"), this.once(\"timeout\", callback);\n return this;\n }\n}\nvar OriginalWriteHeadFn, OriginalImplicitHeadFn;\n\nclass ServerResponse extends Writable {\n constructor(c) {\n super();\n if (!c)\n c = {};\n var req = c.req || {}, reply = c.reply;\n if (this.req = req, this._reply = reply, this.sendDate = !0, this.statusCode = 200, this.headersSent = !1, this.statusMessage = @undefined, this.#controller = @undefined, this.#firstWrite = @undefined, this._writableState.decodeStrings = !1, this.#deferred = @undefined, req.method === \"HEAD\")\n this._hasBody = !1;\n }\n req;\n _reply;\n sendDate;\n statusCode;\n #headers;\n headersSent = !1;\n statusMessage;\n #controller;\n #firstWrite;\n _sent100 = !1;\n _defaultKeepAlive = !1;\n _removedConnection = !1;\n _removedContLen = !1;\n _hasBody = !0;\n #deferred = @undefined;\n #finished = !1;\n _implicitHeader() {\n this.writeHead(this.statusCode);\n }\n _write(chunk, encoding, callback) {\n if (!this.#firstWrite && !this.headersSent) {\n this.#firstWrite = chunk, callback();\n return;\n }\n this.#ensureReadableStreamController((controller) => {\n controller.write(chunk), callback();\n });\n }\n _writev(chunks, callback) {\n if (chunks.length === 1 && !this.headersSent && !this.#firstWrite) {\n this.#firstWrite = chunks[0].chunk, callback();\n return;\n }\n this.#ensureReadableStreamController((controller) => {\n for (let chunk of chunks)\n controller.write(chunk.chunk);\n callback();\n });\n }\n #ensureReadableStreamController(run) {\n var thisController = this.#controller;\n if (thisController)\n return run(thisController);\n this.headersSent = !0;\n var firstWrite = this.#firstWrite;\n this.#firstWrite = @undefined, this._reply(new Response(new @ReadableStream({\n type: \"direct\",\n pull: (controller) => {\n if (this.#controller = controller, firstWrite)\n controller.write(firstWrite);\n if (firstWrite = @undefined, run(controller), !this.#finished)\n return new @Promise((resolve) => {\n this.#deferred = resolve;\n });\n }\n }), {\n headers: this.#headers,\n status: this.statusCode,\n statusText: this.statusMessage \?\? STATUS_CODES[this.statusCode]\n }));\n }\n #drainHeadersIfObservable() {\n if (this._implicitHeader === OriginalImplicitHeadFn && this.writeHead === OriginalWriteHeadFn)\n return;\n this._implicitHeader();\n }\n _final(callback) {\n if (!this.headersSent) {\n var data = this.#firstWrite || \"\";\n this.#firstWrite = @undefined, this.#finished = !0, this.#drainHeadersIfObservable(), this._reply(new Response(data, {\n headers: this.#headers,\n status: this.statusCode,\n statusText: this.statusMessage \?\? STATUS_CODES[this.statusCode]\n })), callback && callback();\n return;\n }\n this.#finished = !0, this.#ensureReadableStreamController((controller) => {\n controller.end(), callback();\n var deferred = this.#deferred;\n if (deferred)\n this.#deferred = @undefined, deferred();\n });\n }\n writeProcessing() {\n throw new Error(\"not implemented\");\n }\n addTrailers(headers) {\n throw new Error(\"not implemented\");\n }\n assignSocket(socket) {\n throw new Error(\"not implemented\");\n }\n detachSocket(socket) {\n throw new Error(\"not implemented\");\n }\n writeContinue(callback) {\n throw new Error(\"not implemented\");\n }\n setTimeout(msecs, callback) {\n throw new Error(\"not implemented\");\n }\n get shouldKeepAlive() {\n return !0;\n }\n get chunkedEncoding() {\n return !1;\n }\n set chunkedEncoding(value) {\n }\n set shouldKeepAlive(value) {\n }\n get useChunkedEncodingByDefault() {\n return !0;\n }\n set useChunkedEncodingByDefault(value) {\n }\n appendHeader(name, value) {\n var headers = this.#headers \?\?= new Headers;\n headers.append(name, value);\n }\n flushHeaders() {\n }\n getHeader(name) {\n return getHeader(this.#headers, name);\n }\n getHeaders() {\n var headers = this.#headers;\n if (!headers)\n return kEmptyObject;\n return headers.toJSON();\n }\n getHeaderNames() {\n var headers = this.#headers;\n if (!headers)\n return [];\n return @Array.from(headers.keys());\n }\n removeHeader(name) {\n if (!this.#headers)\n return;\n this.#headers.delete(name);\n }\n setHeader(name, value) {\n var headers = this.#headers \?\?= new Headers;\n return setHeader(headers, name, value), this;\n }\n hasHeader(name) {\n if (!this.#headers)\n return !1;\n return this.#headers.has(name);\n }\n writeHead(statusCode, statusMessage, headers) {\n return _writeHead(statusCode, statusMessage, headers, this), this;\n }\n}\nOriginalWriteHeadFn = ServerResponse.prototype.writeHead;\nOriginalImplicitHeadFn = ServerResponse.prototype._implicitHeader;\n\nclass ClientRequest extends OutgoingMessage {\n #timeout;\n #res = null;\n #upgradeOrConnect = !1;\n #parser = null;\n #maxHeadersCount = null;\n #reusedSocket = !1;\n #host;\n #protocol;\n #method;\n #port;\n #useDefaultPort;\n #joinDuplicateHeaders;\n #maxHeaderSize;\n #agent = globalAgent;\n #path;\n #socketPath;\n #bodyChunks = null;\n #fetchRequest;\n #signal = null;\n [kAbortController] = null;\n #timeoutTimer = @undefined;\n #options;\n #finished;\n get path() {\n return this.#path;\n }\n get port() {\n return this.#port;\n }\n get method() {\n return this.#method;\n }\n get host() {\n return this.#host;\n }\n get protocol() {\n return this.#protocol;\n }\n _write(chunk, encoding, callback) {\n if (!this.#bodyChunks) {\n this.#bodyChunks = [chunk], callback();\n return;\n }\n this.#bodyChunks.push(chunk), callback();\n }\n _writev(chunks, callback) {\n if (!this.#bodyChunks) {\n this.#bodyChunks = chunks, callback();\n return;\n }\n this.#bodyChunks.push(...chunks), callback();\n }\n _final(callback) {\n if (this.#finished = !0, this[kAbortController] = new AbortController, this[kAbortController].signal.addEventListener(\"abort\", () => {\n this[kClearTimeout]();\n }), this.#signal\?.aborted)\n this[kAbortController].abort();\n var method = this.#method, body = this.#bodyChunks\?.length === 1 \? this.#bodyChunks[0] : @Buffer.concat(this.#bodyChunks || []);\n let url, proxy;\n if (this.#path.startsWith(\"http://\") || this.#path.startsWith(\"https://\"))\n url = this.#path, proxy = `${this.#protocol}//${this.#host}${this.#useDefaultPort \? \"\" : \":\" + this.#port}`;\n else\n url = `${this.#protocol}//${this.#host}${this.#useDefaultPort \? \"\" : \":\" + this.#port}${this.#path}`;\n try {\n this.#fetchRequest = fetch(url, {\n method,\n headers: this.getHeaders(),\n body: body && method !== \"GET\" && method !== \"HEAD\" && method !== \"OPTIONS\" \? body : @undefined,\n redirect: \"manual\",\n verbose: !1,\n signal: this[kAbortController].signal,\n proxy,\n timeout: !1,\n decompress: !1\n }).then((response) => {\n var res = this.#res = new IncomingMessage(response, {\n type: \"response\",\n [kInternalRequest]: this\n });\n this.emit(\"response\", res);\n }).catch((err) => {\n this.emit(\"error\", err);\n }).finally(() => {\n this.#fetchRequest = null, this[kClearTimeout]();\n });\n } catch (err) {\n this.emit(\"error\", err);\n } finally {\n callback();\n }\n }\n get aborted() {\n return this.#signal\?.aborted || !!this[kAbortController]\?.signal.aborted;\n }\n abort() {\n if (this.aborted)\n return;\n this[kAbortController].abort();\n }\n constructor(input, options, cb) {\n super();\n if (typeof input === \"string\") {\n const urlStr = input;\n try {\n var urlObject = new URL(urlStr);\n } catch (e) {\n @throwTypeError(`Invalid URL: ${urlStr}`);\n }\n input = urlToHttpOptions(urlObject);\n } else if (input && typeof input === \"object\" && input instanceof URL)\n input = urlToHttpOptions(input);\n else\n cb = options, options = input, input = null;\n if (typeof options === \"function\")\n cb = options, options = input || kEmptyObject;\n else\n options = ObjectAssign(input || {}, options);\n var defaultAgent = options._defaultAgent || Agent.globalAgent;\n let protocol = options.protocol;\n if (!protocol)\n if (options.port === 443)\n protocol = \"https:\";\n else\n protocol = defaultAgent.protocol || \"http:\";\n switch (this.#protocol = protocol, this.#agent\?.protocol) {\n case @undefined:\n break;\n case \"http:\":\n if (protocol === \"https:\") {\n defaultAgent = this.#agent = getDefaultHTTPSAgent();\n break;\n }\n case \"https:\":\n if (protocol === \"https\") {\n defaultAgent = this.#agent = Agent.globalAgent;\n break;\n }\n default:\n break;\n }\n if (options.path) {\n const path = @String(options.path);\n if (RegExpPrototypeExec.call(INVALID_PATH_REGEX, path) !== null)\n throw new Error(\"Path contains unescaped characters\");\n }\n if (protocol !== \"http:\" && protocol !== \"https:\" && protocol) {\n const expectedProtocol = defaultAgent\?.protocol \?\? \"http:\";\n throw new Error(`Protocol mismatch. Expected: ${expectedProtocol}. Got: ${protocol}`);\n }\n const defaultPort = protocol === \"https:\" \? 443 : 80;\n this.#port = options.port || options.defaultPort || this.#agent\?.defaultPort || defaultPort, this.#useDefaultPort = this.#port === defaultPort;\n const host = this.#host = options.host = validateHost(options.hostname, \"hostname\") || validateHost(options.host, \"host\") || \"localhost\";\n this.#socketPath = options.socketPath;\n const signal = options.signal;\n if (signal)\n signal.addEventListener(\"abort\", () => {\n this[kAbortController]\?.abort();\n }), this.#signal = signal;\n let method = options.method;\n const methodIsString = typeof method === \"string\";\n if (method !== null && method !== @undefined && !methodIsString)\n throw new Error(\"ERR_INVALID_ARG_TYPE: options.method\");\n if (methodIsString && method) {\n if (!checkIsHttpToken(method))\n throw new Error(\"ERR_INVALID_HTTP_TOKEN: Method\");\n method = this.#method = StringPrototypeToUpperCase.call(method);\n } else\n method = this.#method = \"GET\";\n const _maxHeaderSize = options.maxHeaderSize;\n this.#maxHeaderSize = _maxHeaderSize;\n var _joinDuplicateHeaders = options.joinDuplicateHeaders;\n if (this.#joinDuplicateHeaders = _joinDuplicateHeaders, this.#path = options.path || \"/\", cb)\n this.once(\"response\", cb);\n this.#finished = !1, this.#res = null, this.#upgradeOrConnect = !1, this.#parser = null, this.#maxHeadersCount = null, this.#reusedSocket = !1, this.#host = host, this.#protocol = protocol;\n var timeout = options.timeout;\n if (timeout !== @undefined && timeout !== 0)\n this.setTimeout(timeout, @undefined);\n if (!ArrayIsArray(headers)) {\n var headers = options.headers;\n if (headers)\n for (let key in headers)\n this.setHeader(key, headers[key]);\n var auth = options.auth;\n if (auth && !this.getHeader(\"Authorization\"))\n this.setHeader(\"Authorization\", \"Basic \" + @Buffer.from(auth).toString(\"base64\"));\n }\n var { signal: _signal, ...optsWithoutSignal } = options;\n this.#options = optsWithoutSignal;\n }\n setSocketKeepAlive(enable = !0, initialDelay = 0) {\n }\n setNoDelay(noDelay = !0) {\n }\n [kClearTimeout]() {\n if (this.#timeoutTimer)\n clearTimeout(this.#timeoutTimer), this.#timeoutTimer = @undefined, this.removeAllListeners(\"timeout\");\n }\n #onTimeout() {\n this.#timeoutTimer = @undefined, this[kAbortController]\?.abort(), this.emit(\"timeout\");\n }\n setTimeout(msecs, callback) {\n if (this.destroyed)\n return this;\n if (this.timeout = msecs = validateMsecs(msecs, \"msecs\"), clearTimeout(this.#timeoutTimer), msecs === 0) {\n if (callback !== @undefined)\n validateFunction(callback, \"callback\"), this.removeListener(\"timeout\", callback);\n this.#timeoutTimer = @undefined;\n } else if (this.#timeoutTimer = setTimeout(this.#onTimeout.bind(this), msecs).unref(), callback !== @undefined)\n validateFunction(callback, \"callback\"), this.once(\"timeout\", callback);\n return this;\n }\n}\nvar tokenRegExp = /^[\\^_`a-zA-Z\\-0-9!#$%&'*+.|~]+$/, METHODS = [\n \"ACL\",\n \"BIND\",\n \"CHECKOUT\",\n \"CONNECT\",\n \"COPY\",\n \"DELETE\",\n \"GET\",\n \"HEAD\",\n \"LINK\",\n \"LOCK\",\n \"M-SEARCH\",\n \"MERGE\",\n \"MKACTIVITY\",\n \"MKCALENDAR\",\n \"MKCOL\",\n \"MOVE\",\n \"NOTIFY\",\n \"OPTIONS\",\n \"PATCH\",\n \"POST\",\n \"PROPFIND\",\n \"PROPPATCH\",\n \"PURGE\",\n \"PUT\",\n \"REBIND\",\n \"REPORT\",\n \"SEARCH\",\n \"SOURCE\",\n \"SUBSCRIBE\",\n \"TRACE\",\n \"UNBIND\",\n \"UNLINK\",\n \"UNLOCK\",\n \"UNSUBSCRIBE\"\n], STATUS_CODES = {\n 100: \"Continue\",\n 101: \"Switching Protocols\",\n 102: \"Processing\",\n 103: \"Early Hints\",\n 200: \"OK\",\n 201: \"Created\",\n 202: \"Accepted\",\n 203: \"Non-Authoritative Information\",\n 204: \"No Content\",\n 205: \"Reset Content\",\n 206: \"Partial Content\",\n 207: \"Multi-Status\",\n 208: \"Already Reported\",\n 226: \"IM Used\",\n 300: \"Multiple Choices\",\n 301: \"Moved Permanently\",\n 302: \"Found\",\n 303: \"See Other\",\n 304: \"Not Modified\",\n 305: \"Use Proxy\",\n 307: \"Temporary Redirect\",\n 308: \"Permanent Redirect\",\n 400: \"Bad Request\",\n 401: \"Unauthorized\",\n 402: \"Payment Required\",\n 403: \"Forbidden\",\n 404: \"Not Found\",\n 405: \"Method Not Allowed\",\n 406: \"Not Acceptable\",\n 407: \"Proxy Authentication Required\",\n 408: \"Request Timeout\",\n 409: \"Conflict\",\n 410: \"Gone\",\n 411: \"Length Required\",\n 412: \"Precondition Failed\",\n 413: \"Payload Too Large\",\n 414: \"URI Too Long\",\n 415: \"Unsupported Media Type\",\n 416: \"Range Not Satisfiable\",\n 417: \"Expectation Failed\",\n 418: \"I'm a Teapot\",\n 421: \"Misdirected Request\",\n 422: \"Unprocessable Entity\",\n 423: \"Locked\",\n 424: \"Failed Dependency\",\n 425: \"Too Early\",\n 426: \"Upgrade Required\",\n 428: \"Precondition Required\",\n 429: \"Too Many Requests\",\n 431: \"Request Header Fields Too Large\",\n 451: \"Unavailable For Legal Reasons\",\n 500: \"Internal Server Error\",\n 501: \"Not Implemented\",\n 502: \"Bad Gateway\",\n 503: \"Service Unavailable\",\n 504: \"Gateway Timeout\",\n 505: \"HTTP Version Not Supported\",\n 506: \"Variant Also Negotiates\",\n 507: \"Insufficient Storage\",\n 508: \"Loop Detected\",\n 509: \"Bandwidth Limit Exceeded\",\n 510: \"Not Extended\",\n 511: \"Network Authentication Required\"\n}, globalAgent = new Agent;\n$ = {\n Agent,\n Server,\n METHODS,\n STATUS_CODES,\n createServer,\n ServerResponse,\n IncomingMessage,\n request,\n get,\n maxHeaderSize: 16384,\n validateHeaderName,\n validateHeaderValue,\n setMaxIdleHTTPParsers(max) {\n },\n globalAgent,\n ClientRequest,\n OutgoingMessage\n};\nreturn $})\n"_s; // // @@ -573,7 +573,7 @@ static constexpr ASCIILiteral NodeFSPromisesCode = "(function (){\"use strict\"; // // -static constexpr ASCIILiteral NodeHttpCode = "(function (){\"use strict\";// src/js/out/tmp/node/http.ts\nvar checkInvalidHeaderChar = function(val) {\n return RegExpPrototypeExec.call(headerCharRegex, val) !== null;\n}, isIPv6 = function(input) {\n return new @RegExp(\"^((\?:(\?:[0-9a-fA-F]{1,4}):){7}(\?:(\?:[0-9a-fA-F]{1,4})|:)|(\?:(\?:[0-9a-fA-F]{1,4}):){6}(\?:((\?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])[.]){3}(\?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])|:(\?:[0-9a-fA-F]{1,4})|:)|(\?:(\?:[0-9a-fA-F]{1,4}):){5}(\?::((\?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])[.]){3}(\?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])|(:(\?:[0-9a-fA-F]{1,4})){1,2}|:)|(\?:(\?:[0-9a-fA-F]{1,4}):){4}(\?:(:(\?:[0-9a-fA-F]{1,4})){0,1}:((\?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])[.]){3}(\?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])|(:(\?:[0-9a-fA-F]{1,4})){1,3}|:)|(\?:(\?:[0-9a-fA-F]{1,4}):){3}(\?:(:(\?:[0-9a-fA-F]{1,4})){0,2}:((\?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])[.]){3}(\?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])|(:(\?:[0-9a-fA-F]{1,4})){1,4}|:)|(\?:(\?:[0-9a-fA-F]{1,4}):){2}(\?:(:(\?:[0-9a-fA-F]{1,4})){0,3}:((\?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])[.]){3}(\?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])|(:(\?:[0-9a-fA-F]{1,4})){1,5}|:)|(\?:(\?:[0-9a-fA-F]{1,4}):){1}(\?:(:(\?:[0-9a-fA-F]{1,4})){0,4}:((\?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])[.]){3}(\?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])|(:(\?:[0-9a-fA-F]{1,4})){1,6}|:)|(\?::((\?::(\?:[0-9a-fA-F]{1,4})){0,5}:((\?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])[.]){3}(\?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])|(\?::(\?:[0-9a-fA-F]{1,4})){1,7}|:)))(%[0-9a-zA-Z-.:]{1,})\?$\").test(input);\n}, isValidTLSArray = function(obj) {\n if (typeof obj === \"string\" || isTypedArray(obj) || obj instanceof @ArrayBuffer || obj instanceof Blob)\n return !0;\n if (@Array.isArray(obj)) {\n for (var i = 0;i < obj.length; i++)\n if (typeof obj !== \"string\" && !isTypedArray(obj) && !(obj instanceof @ArrayBuffer) && !(obj instanceof Blob))\n return !1;\n return !0;\n }\n}, validateMsecs = function(numberlike, field) {\n if (typeof numberlike !== \"number\" || numberlike < 0)\n throw new ERR_INVALID_ARG_TYPE(field, \"number\", numberlike);\n return numberlike;\n}, validateFunction = function(callable, field) {\n if (typeof callable !== \"function\")\n throw new ERR_INVALID_ARG_TYPE(field, \"Function\", callable);\n return callable;\n}, createServer = function(options, callback) {\n return new Server(options, callback);\n}, emitListeningNextTick = function(self, onListen, err, hostname, port) {\n if (typeof onListen === \"function\")\n try {\n onListen(err, hostname, port);\n } catch (err2) {\n self.emit(\"error\", err2);\n }\n if (self.listening = !err, err)\n self.emit(\"error\", err);\n else\n self.emit(\"listening\", hostname, port);\n}, assignHeaders = function(object, req) {\n var headers = req.headers.toJSON();\n const rawHeaders = @newArrayWithSize(req.headers.count * 2);\n var i = 0;\n for (let key in headers)\n rawHeaders[i++] = key, rawHeaders[i++] = headers[key];\n object.headers = headers, object.rawHeaders = rawHeaders;\n};\nvar getDefaultHTTPSAgent = function() {\n return _defaultHTTPSAgent \?\?= new Agent({ defaultPort: 443, protocol: \"https:\" });\n};\nvar urlToHttpOptions = function(url) {\n var { protocol, hostname, hash, search, pathname, href, port, username, password } = url;\n return {\n protocol,\n hostname: typeof hostname === \"string\" && StringPrototypeStartsWith.call(hostname, \"[\") \? StringPrototypeSlice.call(hostname, 1, -1) : hostname,\n hash,\n search,\n pathname,\n path: `${pathname || \"\"}${search || \"\"}`,\n href,\n port: port \? Number(port) : protocol === \"https:\" \? 443 : protocol === \"http:\" \? 80 : @undefined,\n auth: username || password \? `${decodeURIComponent(username)}:${decodeURIComponent(password)}` : @undefined\n };\n}, validateHost = function(host, name) {\n if (host !== null && host !== @undefined && typeof host !== \"string\")\n throw new Error(\"Invalid arg type in options\");\n return host;\n}, checkIsHttpToken = function(val) {\n return RegExpPrototypeExec.call(tokenRegExp, val) !== null;\n};\nvar _writeHead = function(statusCode, reason, obj, response) {\n if (statusCode |= 0, statusCode < 100 || statusCode > 999)\n throw new Error(\"status code must be between 100 and 999\");\n if (typeof reason === \"string\")\n response.statusMessage = reason;\n else {\n if (!response.statusMessage)\n response.statusMessage = STATUS_CODES[statusCode] || \"unknown\";\n obj = reason;\n }\n response.statusCode = statusCode;\n {\n let k;\n if (@Array.isArray(obj)) {\n if (obj.length % 2 !== 0)\n throw new Error(\"raw headers must have an even number of elements\");\n for (let n = 0;n < obj.length; n += 2)\n if (k = obj[n + 0], k)\n response.setHeader(k, obj[n + 1]);\n } else if (obj) {\n const keys = Object.keys(obj);\n for (let i = 0;i < keys.length; i++)\n if (k = keys[i], k)\n response.setHeader(k, obj[k]);\n }\n }\n if (statusCode === 204 || statusCode === 304 || statusCode >= 100 && statusCode <= 199)\n response._hasBody = !1;\n}, request = function(url, options, cb) {\n return new ClientRequest(url, options, cb);\n}, get = function(url, options, cb) {\n const req = request(url, options, cb);\n return req.end(), req;\n}, $, EventEmitter = @getInternalField(@internalModuleRegistry, 18) || @createInternalModuleById(18), { isTypedArray } = @requireNativeModule(\"util/types\"), { Duplex, Readable, Writable } = @getInternalField(@internalModuleRegistry, 37) || @createInternalModuleById(37), { getHeader, setHeader } = @lazy(\"http\"), headerCharRegex = /[^\\t\\x20-\\x7e\\x80-\\xff]/, validateHeaderName = (name, label) => {\n if (typeof name !== \"string\" || !name || !checkIsHttpToken(name))\n throw new Error(\"ERR_INVALID_HTTP_TOKEN\");\n}, validateHeaderValue = (name, value) => {\n if (value === @undefined)\n throw new Error(\"ERR_HTTP_INVALID_HEADER_VALUE\");\n if (checkInvalidHeaderChar(value))\n throw new Error(\"ERR_INVALID_CHAR\");\n}, { URL } = globalThis, globalReportError = globalThis.reportError, setTimeout = globalThis.setTimeout, fetch = Bun.fetch;\nvar kEmptyObject = Object.freeze(Object.create(null)), kOutHeaders = Symbol.for(\"kOutHeaders\"), kEndCalled = Symbol.for(\"kEndCalled\"), kAbortController = Symbol.for(\"kAbortController\"), kClearTimeout = Symbol(\"kClearTimeout\"), kCorked = Symbol.for(\"kCorked\"), searchParamsSymbol = Symbol.for(\"query\"), StringPrototypeSlice = @String.prototype.slice, StringPrototypeStartsWith = @String.prototype.startsWith, StringPrototypeToUpperCase = @String.prototype.toUpperCase, ArrayIsArray = @Array.isArray, RegExpPrototypeExec = @RegExp.prototype.exec, ObjectAssign = Object.assign, INVALID_PATH_REGEX = /[^\\u0021-\\u00ff]/;\nvar _defaultHTTPSAgent, kInternalRequest = Symbol(\"kInternalRequest\"), kInternalSocketData = Symbol.for(\"::bunternal::\"), kEmptyBuffer = @Buffer.alloc(0);\n\nclass ERR_INVALID_ARG_TYPE extends TypeError {\n constructor(name, expected, actual) {\n super(`The ${name} argument must be of type ${expected}. Received type ${typeof actual}`);\n this.code = \"ERR_INVALID_ARG_TYPE\";\n }\n}\nvar FakeSocket = class Socket extends Duplex {\n [kInternalSocketData];\n bytesRead = 0;\n bytesWritten = 0;\n connecting = !1;\n remoteAddress = null;\n remotePort;\n timeout = 0;\n isServer = !1;\n address() {\n return {\n address: this.localAddress,\n family: this.localFamily,\n port: this.localPort\n };\n }\n get bufferSize() {\n return this.writableLength;\n }\n connect(port, host, connectListener) {\n return this;\n }\n _destroy(err, callback) {\n }\n _final(callback) {\n }\n get localAddress() {\n return \"127.0.0.1\";\n }\n get localFamily() {\n return \"IPv4\";\n }\n get localPort() {\n return 80;\n }\n get pending() {\n return this.connecting;\n }\n _read(size) {\n }\n get readyState() {\n if (this.connecting)\n return \"opening\";\n if (this.readable)\n return this.writable \? \"open\" : \"readOnly\";\n else\n return this.writable \? \"writeOnly\" : \"closed\";\n }\n ref() {\n }\n get remoteFamily() {\n return \"IPv4\";\n }\n resetAndDestroy() {\n }\n setKeepAlive(enable = !1, initialDelay = 0) {\n }\n setNoDelay(noDelay = !0) {\n return this;\n }\n setTimeout(timeout, callback) {\n return this;\n }\n unref() {\n }\n _write(chunk, encoding, callback) {\n }\n};\n\nclass Agent extends EventEmitter {\n defaultPort = 80;\n protocol = \"http:\";\n options;\n requests;\n sockets;\n freeSockets;\n keepAliveMsecs;\n keepAlive;\n maxSockets;\n maxFreeSockets;\n scheduling;\n maxTotalSockets;\n totalSocketCount;\n #fakeSocket;\n static get globalAgent() {\n return globalAgent;\n }\n static get defaultMaxSockets() {\n return @Infinity;\n }\n constructor(options = kEmptyObject) {\n super();\n if (this.options = options = { ...options, path: null }, options.noDelay === @undefined)\n options.noDelay = !0;\n this.requests = kEmptyObject, this.sockets = kEmptyObject, this.freeSockets = kEmptyObject, this.keepAliveMsecs = options.keepAliveMsecs || 1000, this.keepAlive = options.keepAlive || !1, this.maxSockets = options.maxSockets || Agent.defaultMaxSockets, this.maxFreeSockets = options.maxFreeSockets || 256, this.scheduling = options.scheduling || \"lifo\", this.maxTotalSockets = options.maxTotalSockets, this.totalSocketCount = 0, this.defaultPort = options.defaultPort || 80, this.protocol = options.protocol || \"http:\";\n }\n createConnection() {\n return this.#fakeSocket \?\?= new FakeSocket;\n }\n getName(options = kEmptyObject) {\n let name = `http:${options.host || \"localhost\"}:`;\n if (options.port)\n name += options.port;\n if (name += \":\", options.localAddress)\n name += options.localAddress;\n if (options.family === 4 || options.family === 6)\n name += `:${options.family}`;\n if (options.socketPath)\n name += `:${options.socketPath}`;\n return name;\n }\n addRequest() {\n }\n createSocket(req, options, cb) {\n cb(null, this.#fakeSocket \?\?= new FakeSocket);\n }\n removeSocket() {\n }\n keepSocketAlive() {\n return !0;\n }\n reuseSocket() {\n }\n destroy() {\n }\n}\n\nclass Server extends EventEmitter {\n #server;\n #options;\n #tls;\n #is_tls = !1;\n listening = !1;\n serverName;\n constructor(options, callback) {\n super();\n if (typeof options === \"function\")\n callback = options, options = {};\n else if (options == null || typeof options === \"object\") {\n options = { ...options }, this.#tls = null;\n let key = options.key;\n if (key) {\n if (!isValidTLSArray(key))\n @throwTypeError(\"key argument must be an string, Buffer, TypedArray, BunFile or an array containing string, Buffer, TypedArray or BunFile\");\n this.#is_tls = !0;\n }\n let cert = options.cert;\n if (cert) {\n if (!isValidTLSArray(cert))\n @throwTypeError(\"cert argument must be an string, Buffer, TypedArray, BunFile or an array containing string, Buffer, TypedArray or BunFile\");\n this.#is_tls = !0;\n }\n let ca = options.ca;\n if (ca) {\n if (!isValidTLSArray(ca))\n @throwTypeError(\"ca argument must be an string, Buffer, TypedArray, BunFile or an array containing string, Buffer, TypedArray or BunFile\");\n this.#is_tls = !0;\n }\n let passphrase = options.passphrase;\n if (passphrase && typeof passphrase !== \"string\")\n @throwTypeError(\"passphrase argument must be an string\");\n let serverName = options.servername;\n if (serverName && typeof serverName !== \"string\")\n @throwTypeError(\"servername argument must be an string\");\n let secureOptions = options.secureOptions || 0;\n if (secureOptions && typeof secureOptions !== \"number\")\n @throwTypeError(\"secureOptions argument must be an number\");\n if (this.#is_tls)\n this.#tls = {\n serverName,\n key,\n cert,\n ca,\n passphrase,\n secureOptions\n };\n else\n this.#tls = null;\n } else\n throw new Error(\"bun-http-polyfill: invalid arguments\");\n if (this.#options = options, callback)\n this.on(\"request\", callback);\n }\n closeAllConnections() {\n const server = this.#server;\n if (!server)\n return;\n this.#server = @undefined, server.stop(!0), this.emit(\"close\");\n }\n closeIdleConnections() {\n }\n close(optionalCallback) {\n const server = this.#server;\n if (!server) {\n if (typeof optionalCallback === \"function\")\n process.nextTick(optionalCallback, new Error(\"Server is not running\"));\n return;\n }\n if (this.#server = @undefined, typeof optionalCallback === \"function\")\n this.once(\"close\", optionalCallback);\n server.stop(), this.emit(\"close\");\n }\n address() {\n if (!this.#server)\n return null;\n const address = this.#server.hostname;\n return {\n address,\n family: isIPv6(address) \? \"IPv6\" : \"IPv4\",\n port: this.#server.port\n };\n }\n listen(port, host, backlog, onListen) {\n const server = this;\n let socketPath;\n if (typeof port == \"string\" && !Number.isSafeInteger(Number(port)))\n socketPath = port;\n if (typeof host === \"function\")\n onListen = host, host = @undefined;\n if (typeof port === \"function\")\n onListen = port;\n else if (typeof port === \"object\") {\n if (port\?.signal\?.addEventListener(\"abort\", () => {\n this.close();\n }), host = port\?.host, port = port\?.port, typeof port\?.callback === \"function\")\n onListen = port\?.callback;\n }\n if (typeof backlog === \"function\")\n onListen = backlog;\n const ResponseClass = this.#options.ServerResponse || ServerResponse, RequestClass = this.#options.IncomingMessage || IncomingMessage;\n try {\n const tls = this.#tls;\n if (tls)\n this.serverName = tls.serverName || host || \"localhost\";\n this.#server = Bun.serve({\n tls,\n port,\n hostname: host,\n unix: socketPath,\n websocket: {\n open(ws) {\n ws.data.open(ws);\n },\n message(ws, message) {\n ws.data.message(ws, message);\n },\n close(ws, code, reason) {\n ws.data.close(ws, code, reason);\n },\n drain(ws) {\n ws.data.drain(ws);\n }\n },\n fetch(req, _server) {\n var pendingResponse, pendingError, rejectFunction, resolveFunction, reject = (err) => {\n if (pendingError)\n return;\n if (pendingError = err, rejectFunction)\n rejectFunction(err);\n }, reply = function(resp) {\n if (pendingResponse)\n return;\n if (pendingResponse = resp, resolveFunction)\n resolveFunction(resp);\n };\n const http_req = new RequestClass(req), http_res = new ResponseClass({ reply, req: http_req });\n if (http_req.once(\"error\", (err) => reject(err)), http_res.once(\"error\", (err) => reject(err)), req.headers.get(\"upgrade\")) {\n const socket = http_req.socket;\n socket[kInternalSocketData] = [_server, http_res, req], server.emit(\"upgrade\", http_req, socket, kEmptyBuffer);\n } else\n server.emit(\"request\", http_req, http_res);\n if (pendingError)\n throw pendingError;\n if (pendingResponse)\n return pendingResponse;\n return new @Promise((resolve, reject2) => {\n resolveFunction = resolve, rejectFunction = reject2;\n });\n }\n }), setTimeout(emitListeningNextTick, 1, this, onListen, null, this.#server.hostname, this.#server.port);\n } catch (err) {\n server.emit(\"error\", err);\n }\n return this;\n }\n setTimeout(msecs, callback) {\n }\n}\nclass IncomingMessage extends Readable {\n method;\n complete;\n constructor(req, defaultIncomingOpts) {\n const method = req.method;\n super();\n const url = new URL(req.url);\n var { type = \"request\", [kInternalRequest]: nodeReq } = defaultIncomingOpts || {};\n this.#noBody = type === \"request\" \? method === \"GET\" || method === \"HEAD\" || method === \"TRACE\" || method === \"CONNECT\" || method === \"OPTIONS\" || (parseInt(req.headers.get(\"Content-Length\") || \"\") || 0) === 0 : !1, this.#req = req, this.method = method, this.#type = type, this.complete = !!this.#noBody, this.#bodyStream = @undefined;\n const socket = new FakeSocket;\n socket.remoteAddress = url.hostname, socket.remotePort = url.port, this.#fakeSocket = socket, this.url = url.pathname + url.search, this.#nodeReq = this.req = nodeReq, assignHeaders(this, req);\n }\n headers;\n rawHeaders;\n _consuming = !1;\n _dumped = !1;\n #bodyStream;\n #fakeSocket;\n #noBody = !1;\n #aborted = !1;\n #req;\n url;\n #type;\n #nodeReq;\n _construct(callback) {\n if (this.#type === \"response\" || this.#noBody) {\n callback();\n return;\n }\n const contentLength = this.#req.headers.get(\"content-length\");\n if ((contentLength \? parseInt(contentLength, 10) : 0) === 0) {\n this.#noBody = !0, callback();\n return;\n }\n callback();\n }\n async#consumeStream(reader) {\n while (!0) {\n var { done, value } = await reader.readMany();\n if (this.#aborted)\n return;\n if (done) {\n this.push(null), this.destroy();\n break;\n }\n for (var v of value)\n this.push(v);\n }\n }\n _read(size) {\n if (this.#noBody)\n this.push(null), this.complete = !0;\n else if (this.#bodyStream == null) {\n const reader = this.#req.body\?.getReader();\n if (!reader) {\n this.push(null);\n return;\n }\n this.#bodyStream = reader, this.#consumeStream(reader);\n }\n }\n get aborted() {\n return this.#aborted;\n }\n #abort() {\n if (this.#aborted)\n return;\n this.#aborted = !0;\n var bodyStream = this.#bodyStream;\n if (!bodyStream)\n return;\n bodyStream.cancel(), this.complete = !0, this.#bodyStream = @undefined, this.push(null);\n }\n get connection() {\n return this.#fakeSocket;\n }\n get statusCode() {\n return this.#req.status;\n }\n get statusMessage() {\n return STATUS_CODES[this.#req.status];\n }\n get httpVersion() {\n return \"1.1\";\n }\n get rawTrailers() {\n return [];\n }\n get httpVersionMajor() {\n return 1;\n }\n get httpVersionMinor() {\n return 1;\n }\n get trailers() {\n return kEmptyObject;\n }\n get socket() {\n return this.#fakeSocket \?\?= new FakeSocket;\n }\n set socket(val) {\n this.#fakeSocket = val;\n }\n setTimeout(msecs, callback) {\n throw new Error(\"not implemented\");\n }\n}\n\nclass OutgoingMessage extends Writable {\n constructor() {\n super(...arguments);\n }\n #headers;\n headersSent = !1;\n sendDate = !0;\n req;\n timeout;\n #finished = !1;\n [kEndCalled] = !1;\n #fakeSocket;\n #timeoutTimer;\n [kAbortController] = null;\n _implicitHeader() {\n }\n get headers() {\n if (!this.#headers)\n return kEmptyObject;\n return this.#headers.toJSON();\n }\n get shouldKeepAlive() {\n return !0;\n }\n get chunkedEncoding() {\n return !1;\n }\n set chunkedEncoding(value) {\n }\n set shouldKeepAlive(value) {\n }\n get useChunkedEncodingByDefault() {\n return !0;\n }\n set useChunkedEncodingByDefault(value) {\n }\n get socket() {\n return this.#fakeSocket \?\?= new FakeSocket;\n }\n set socket(val) {\n this.#fakeSocket = val;\n }\n get connection() {\n return this.socket;\n }\n get finished() {\n return this.#finished;\n }\n appendHeader(name, value) {\n var headers = this.#headers \?\?= new Headers;\n headers.append(name, value);\n }\n flushHeaders() {\n }\n getHeader(name) {\n return getHeader(this.#headers, name);\n }\n getHeaders() {\n if (!this.#headers)\n return kEmptyObject;\n return this.#headers.toJSON();\n }\n getHeaderNames() {\n var headers = this.#headers;\n if (!headers)\n return [];\n return @Array.from(headers.keys());\n }\n removeHeader(name) {\n if (!this.#headers)\n return;\n this.#headers.delete(name);\n }\n setHeader(name, value) {\n var headers = this.#headers \?\?= new Headers;\n return headers.set(name, value), this;\n }\n hasHeader(name) {\n if (!this.#headers)\n return !1;\n return this.#headers.has(name);\n }\n addTrailers(headers) {\n throw new Error(\"not implemented\");\n }\n [kClearTimeout]() {\n if (this.#timeoutTimer)\n clearTimeout(this.#timeoutTimer), this.removeAllListeners(\"timeout\"), this.#timeoutTimer = @undefined;\n }\n #onTimeout() {\n this.#timeoutTimer = @undefined, this[kAbortController]\?.abort(), this.emit(\"timeout\");\n }\n setTimeout(msecs, callback) {\n if (this.destroyed)\n return this;\n if (this.timeout = msecs = validateMsecs(msecs, \"msecs\"), clearTimeout(this.#timeoutTimer), msecs === 0) {\n if (callback !== @undefined)\n validateFunction(callback, \"callback\"), this.removeListener(\"timeout\", callback);\n this.#timeoutTimer = @undefined;\n } else if (this.#timeoutTimer = setTimeout(this.#onTimeout.bind(this), msecs).unref(), callback !== @undefined)\n validateFunction(callback, \"callback\"), this.once(\"timeout\", callback);\n return this;\n }\n}\nvar OriginalWriteHeadFn, OriginalImplicitHeadFn;\n\nclass ServerResponse extends Writable {\n constructor(c) {\n super();\n if (!c)\n c = {};\n var req = c.req || {}, reply = c.reply;\n if (this.req = req, this._reply = reply, this.sendDate = !0, this.statusCode = 200, this.headersSent = !1, this.statusMessage = @undefined, this.#controller = @undefined, this.#firstWrite = @undefined, this._writableState.decodeStrings = !1, this.#deferred = @undefined, req.method === \"HEAD\")\n this._hasBody = !1;\n }\n req;\n _reply;\n sendDate;\n statusCode;\n #headers;\n headersSent = !1;\n statusMessage;\n #controller;\n #firstWrite;\n _sent100 = !1;\n _defaultKeepAlive = !1;\n _removedConnection = !1;\n _removedContLen = !1;\n _hasBody = !0;\n #deferred = @undefined;\n #finished = !1;\n _implicitHeader() {\n this.writeHead(this.statusCode);\n }\n _write(chunk, encoding, callback) {\n if (!this.#firstWrite && !this.headersSent) {\n this.#firstWrite = chunk, callback();\n return;\n }\n this.#ensureReadableStreamController((controller) => {\n controller.write(chunk), callback();\n });\n }\n _writev(chunks, callback) {\n if (chunks.length === 1 && !this.headersSent && !this.#firstWrite) {\n this.#firstWrite = chunks[0].chunk, callback();\n return;\n }\n this.#ensureReadableStreamController((controller) => {\n for (let chunk of chunks)\n controller.write(chunk.chunk);\n callback();\n });\n }\n #ensureReadableStreamController(run) {\n var thisController = this.#controller;\n if (thisController)\n return run(thisController);\n this.headersSent = !0;\n var firstWrite = this.#firstWrite;\n this.#firstWrite = @undefined, this._reply(new Response(new @ReadableStream({\n type: \"direct\",\n pull: (controller) => {\n if (this.#controller = controller, firstWrite)\n controller.write(firstWrite);\n if (firstWrite = @undefined, run(controller), !this.#finished)\n return new @Promise((resolve) => {\n this.#deferred = resolve;\n });\n }\n }), {\n headers: this.#headers,\n status: this.statusCode,\n statusText: this.statusMessage \?\? STATUS_CODES[this.statusCode]\n }));\n }\n #drainHeadersIfObservable() {\n if (this._implicitHeader === OriginalImplicitHeadFn && this.writeHead === OriginalWriteHeadFn)\n return;\n this._implicitHeader();\n }\n _final(callback) {\n if (!this.headersSent) {\n var data = this.#firstWrite || \"\";\n this.#firstWrite = @undefined, this.#finished = !0, this.#drainHeadersIfObservable(), this._reply(new Response(data, {\n headers: this.#headers,\n status: this.statusCode,\n statusText: this.statusMessage \?\? STATUS_CODES[this.statusCode]\n })), callback && callback();\n return;\n }\n this.#finished = !0, this.#ensureReadableStreamController((controller) => {\n controller.end(), callback();\n var deferred = this.#deferred;\n if (deferred)\n this.#deferred = @undefined, deferred();\n });\n }\n writeProcessing() {\n throw new Error(\"not implemented\");\n }\n addTrailers(headers) {\n throw new Error(\"not implemented\");\n }\n assignSocket(socket) {\n throw new Error(\"not implemented\");\n }\n detachSocket(socket) {\n throw new Error(\"not implemented\");\n }\n writeContinue(callback) {\n throw new Error(\"not implemented\");\n }\n setTimeout(msecs, callback) {\n throw new Error(\"not implemented\");\n }\n get shouldKeepAlive() {\n return !0;\n }\n get chunkedEncoding() {\n return !1;\n }\n set chunkedEncoding(value) {\n }\n set shouldKeepAlive(value) {\n }\n get useChunkedEncodingByDefault() {\n return !0;\n }\n set useChunkedEncodingByDefault(value) {\n }\n appendHeader(name, value) {\n var headers = this.#headers \?\?= new Headers;\n headers.append(name, value);\n }\n flushHeaders() {\n }\n getHeader(name) {\n return getHeader(this.#headers, name);\n }\n getHeaders() {\n var headers = this.#headers;\n if (!headers)\n return kEmptyObject;\n return headers.toJSON();\n }\n getHeaderNames() {\n var headers = this.#headers;\n if (!headers)\n return [];\n return @Array.from(headers.keys());\n }\n removeHeader(name) {\n if (!this.#headers)\n return;\n this.#headers.delete(name);\n }\n setHeader(name, value) {\n var headers = this.#headers \?\?= new Headers;\n return setHeader(headers, name, value), this;\n }\n hasHeader(name) {\n if (!this.#headers)\n return !1;\n return this.#headers.has(name);\n }\n writeHead(statusCode, statusMessage, headers) {\n return _writeHead(statusCode, statusMessage, headers, this), this;\n }\n}\nOriginalWriteHeadFn = ServerResponse.prototype.writeHead;\nOriginalImplicitHeadFn = ServerResponse.prototype._implicitHeader;\n\nclass ClientRequest extends OutgoingMessage {\n #timeout;\n #res = null;\n #upgradeOrConnect = !1;\n #parser = null;\n #maxHeadersCount = null;\n #reusedSocket = !1;\n #host;\n #protocol;\n #method;\n #port;\n #useDefaultPort;\n #joinDuplicateHeaders;\n #maxHeaderSize;\n #agent = globalAgent;\n #path;\n #socketPath;\n #bodyChunks = null;\n #fetchRequest;\n #signal = null;\n [kAbortController] = null;\n #timeoutTimer = @undefined;\n #options;\n #finished;\n get path() {\n return this.#path;\n }\n get port() {\n return this.#port;\n }\n get method() {\n return this.#method;\n }\n get host() {\n return this.#host;\n }\n get protocol() {\n return this.#protocol;\n }\n _write(chunk, encoding, callback) {\n if (!this.#bodyChunks) {\n this.#bodyChunks = [chunk], callback();\n return;\n }\n this.#bodyChunks.push(chunk), callback();\n }\n _writev(chunks, callback) {\n if (!this.#bodyChunks) {\n this.#bodyChunks = chunks, callback();\n return;\n }\n this.#bodyChunks.push(...chunks), callback();\n }\n _final(callback) {\n if (this.#finished = !0, this[kAbortController] = new AbortController, this[kAbortController].signal.addEventListener(\"abort\", () => {\n this[kClearTimeout]();\n }), this.#signal\?.aborted)\n this[kAbortController].abort();\n var method = this.#method, body = this.#bodyChunks\?.length === 1 \? this.#bodyChunks[0] : @Buffer.concat(this.#bodyChunks || []);\n let url, proxy;\n if (this.#path.startsWith(\"http://\") || this.#path.startsWith(\"https://\"))\n url = this.#path, proxy = `${this.#protocol}//${this.#host}${this.#useDefaultPort \? \"\" : \":\" + this.#port}`;\n else\n url = `${this.#protocol}//${this.#host}${this.#useDefaultPort \? \"\" : \":\" + this.#port}${this.#path}`;\n try {\n this.#fetchRequest = fetch(url, {\n method,\n headers: this.getHeaders(),\n body: body && method !== \"GET\" && method !== \"HEAD\" && method !== \"OPTIONS\" \? body : @undefined,\n redirect: \"manual\",\n verbose: !1,\n signal: this[kAbortController].signal,\n proxy,\n timeout: !1,\n decompress: !1\n }).then((response) => {\n var res = this.#res = new IncomingMessage(response, {\n type: \"response\",\n [kInternalRequest]: this\n });\n this.emit(\"response\", res);\n }).catch((err) => {\n this.emit(\"error\", err);\n }).finally(() => {\n this.#fetchRequest = null, this[kClearTimeout]();\n });\n } catch (err) {\n this.emit(\"error\", err);\n } finally {\n callback();\n }\n }\n get aborted() {\n return this.#signal\?.aborted || !!this[kAbortController]\?.signal.aborted;\n }\n abort() {\n if (this.aborted)\n return;\n this[kAbortController].abort();\n }\n constructor(input, options, cb) {\n super();\n if (typeof input === \"string\") {\n const urlStr = input;\n try {\n var urlObject = new URL(urlStr);\n } catch (e) {\n @throwTypeError(`Invalid URL: ${urlStr}`);\n }\n input = urlToHttpOptions(urlObject);\n } else if (input && typeof input === \"object\" && input instanceof URL)\n input = urlToHttpOptions(input);\n else\n cb = options, options = input, input = null;\n if (typeof options === \"function\")\n cb = options, options = input || kEmptyObject;\n else\n options = ObjectAssign(input || {}, options);\n var defaultAgent = options._defaultAgent || Agent.globalAgent;\n let protocol = options.protocol;\n if (!protocol)\n if (options.port === 443)\n protocol = \"https:\";\n else\n protocol = defaultAgent.protocol || \"http:\";\n switch (this.#protocol = protocol, this.#agent\?.protocol) {\n case @undefined:\n break;\n case \"http:\":\n if (protocol === \"https:\") {\n defaultAgent = this.#agent = getDefaultHTTPSAgent();\n break;\n }\n case \"https:\":\n if (protocol === \"https\") {\n defaultAgent = this.#agent = Agent.globalAgent;\n break;\n }\n default:\n break;\n }\n if (options.path) {\n const path = @String(options.path);\n if (RegExpPrototypeExec.call(INVALID_PATH_REGEX, path) !== null)\n throw new Error(\"Path contains unescaped characters\");\n }\n if (protocol !== \"http:\" && protocol !== \"https:\" && protocol) {\n const expectedProtocol = defaultAgent\?.protocol \?\? \"http:\";\n throw new Error(`Protocol mismatch. Expected: ${expectedProtocol}. Got: ${protocol}`);\n }\n const defaultPort = protocol === \"https:\" \? 443 : 80;\n this.#port = options.port || options.defaultPort || this.#agent\?.defaultPort || defaultPort, this.#useDefaultPort = this.#port === defaultPort;\n const host = this.#host = options.host = validateHost(options.hostname, \"hostname\") || validateHost(options.host, \"host\") || \"localhost\";\n this.#socketPath = options.socketPath;\n const signal = options.signal;\n if (signal)\n signal.addEventListener(\"abort\", () => {\n this[kAbortController]\?.abort();\n }), this.#signal = signal;\n let method = options.method;\n const methodIsString = typeof method === \"string\";\n if (method !== null && method !== @undefined && !methodIsString)\n throw new Error(\"ERR_INVALID_ARG_TYPE: options.method\");\n if (methodIsString && method) {\n if (!checkIsHttpToken(method))\n throw new Error(\"ERR_INVALID_HTTP_TOKEN: Method\");\n method = this.#method = StringPrototypeToUpperCase.call(method);\n } else\n method = this.#method = \"GET\";\n const _maxHeaderSize = options.maxHeaderSize;\n this.#maxHeaderSize = _maxHeaderSize;\n var _joinDuplicateHeaders = options.joinDuplicateHeaders;\n if (this.#joinDuplicateHeaders = _joinDuplicateHeaders, this.#path = options.path || \"/\", cb)\n this.once(\"response\", cb);\n this.#finished = !1, this.#res = null, this.#upgradeOrConnect = !1, this.#parser = null, this.#maxHeadersCount = null, this.#reusedSocket = !1, this.#host = host, this.#protocol = protocol;\n var timeout = options.timeout;\n if (timeout !== @undefined && timeout !== 0)\n this.setTimeout(timeout, @undefined);\n if (!ArrayIsArray(headers)) {\n var headers = options.headers;\n if (headers)\n for (let key in headers)\n this.setHeader(key, headers[key]);\n var auth = options.auth;\n if (auth && !this.getHeader(\"Authorization\"))\n this.setHeader(\"Authorization\", \"Basic \" + @Buffer.from(auth).toString(\"base64\"));\n }\n var { signal: _signal, ...optsWithoutSignal } = options;\n this.#options = optsWithoutSignal;\n }\n setSocketKeepAlive(enable = !0, initialDelay = 0) {\n }\n setNoDelay(noDelay = !0) {\n }\n [kClearTimeout]() {\n if (this.#timeoutTimer)\n clearTimeout(this.#timeoutTimer), this.#timeoutTimer = @undefined, this.removeAllListeners(\"timeout\");\n }\n #onTimeout() {\n this.#timeoutTimer = @undefined, this[kAbortController]\?.abort(), this.emit(\"timeout\");\n }\n setTimeout(msecs, callback) {\n if (this.destroyed)\n return this;\n if (this.timeout = msecs = validateMsecs(msecs, \"msecs\"), clearTimeout(this.#timeoutTimer), msecs === 0) {\n if (callback !== @undefined)\n validateFunction(callback, \"callback\"), this.removeListener(\"timeout\", callback);\n this.#timeoutTimer = @undefined;\n } else if (this.#timeoutTimer = setTimeout(this.#onTimeout.bind(this), msecs).unref(), callback !== @undefined)\n validateFunction(callback, \"callback\"), this.once(\"timeout\", callback);\n return this;\n }\n}\nvar tokenRegExp = /^[\\^_`a-zA-Z\\-0-9!#$%&'*+.|~]+$/, METHODS = [\n \"ACL\",\n \"BIND\",\n \"CHECKOUT\",\n \"CONNECT\",\n \"COPY\",\n \"DELETE\",\n \"GET\",\n \"HEAD\",\n \"LINK\",\n \"LOCK\",\n \"M-SEARCH\",\n \"MERGE\",\n \"MKACTIVITY\",\n \"MKCALENDAR\",\n \"MKCOL\",\n \"MOVE\",\n \"NOTIFY\",\n \"OPTIONS\",\n \"PATCH\",\n \"POST\",\n \"PROPFIND\",\n \"PROPPATCH\",\n \"PURGE\",\n \"PUT\",\n \"REBIND\",\n \"REPORT\",\n \"SEARCH\",\n \"SOURCE\",\n \"SUBSCRIBE\",\n \"TRACE\",\n \"UNBIND\",\n \"UNLINK\",\n \"UNLOCK\",\n \"UNSUBSCRIBE\"\n], STATUS_CODES = {\n 100: \"Continue\",\n 101: \"Switching Protocols\",\n 102: \"Processing\",\n 103: \"Early Hints\",\n 200: \"OK\",\n 201: \"Created\",\n 202: \"Accepted\",\n 203: \"Non-Authoritative Information\",\n 204: \"No Content\",\n 205: \"Reset Content\",\n 206: \"Partial Content\",\n 207: \"Multi-Status\",\n 208: \"Already Reported\",\n 226: \"IM Used\",\n 300: \"Multiple Choices\",\n 301: \"Moved Permanently\",\n 302: \"Found\",\n 303: \"See Other\",\n 304: \"Not Modified\",\n 305: \"Use Proxy\",\n 307: \"Temporary Redirect\",\n 308: \"Permanent Redirect\",\n 400: \"Bad Request\",\n 401: \"Unauthorized\",\n 402: \"Payment Required\",\n 403: \"Forbidden\",\n 404: \"Not Found\",\n 405: \"Method Not Allowed\",\n 406: \"Not Acceptable\",\n 407: \"Proxy Authentication Required\",\n 408: \"Request Timeout\",\n 409: \"Conflict\",\n 410: \"Gone\",\n 411: \"Length Required\",\n 412: \"Precondition Failed\",\n 413: \"Payload Too Large\",\n 414: \"URI Too Long\",\n 415: \"Unsupported Media Type\",\n 416: \"Range Not Satisfiable\",\n 417: \"Expectation Failed\",\n 418: \"I'm a Teapot\",\n 421: \"Misdirected Request\",\n 422: \"Unprocessable Entity\",\n 423: \"Locked\",\n 424: \"Failed Dependency\",\n 425: \"Too Early\",\n 426: \"Upgrade Required\",\n 428: \"Precondition Required\",\n 429: \"Too Many Requests\",\n 431: \"Request Header Fields Too Large\",\n 451: \"Unavailable For Legal Reasons\",\n 500: \"Internal Server Error\",\n 501: \"Not Implemented\",\n 502: \"Bad Gateway\",\n 503: \"Service Unavailable\",\n 504: \"Gateway Timeout\",\n 505: \"HTTP Version Not Supported\",\n 506: \"Variant Also Negotiates\",\n 507: \"Insufficient Storage\",\n 508: \"Loop Detected\",\n 509: \"Bandwidth Limit Exceeded\",\n 510: \"Not Extended\",\n 511: \"Network Authentication Required\"\n}, globalAgent = new Agent;\n$ = {\n Agent,\n Server,\n METHODS,\n STATUS_CODES,\n createServer,\n ServerResponse,\n IncomingMessage,\n request,\n get,\n maxHeaderSize: 16384,\n validateHeaderName,\n validateHeaderValue,\n setMaxIdleHTTPParsers(max) {\n },\n globalAgent,\n ClientRequest,\n OutgoingMessage\n};\nreturn $})\n"_s; +static constexpr ASCIILiteral NodeHttpCode = "(function (){\"use strict\";// src/js/out/tmp/node/http.ts\nvar checkInvalidHeaderChar = function(val) {\n return RegExpPrototypeExec.call(headerCharRegex, val) !== null;\n}, isIPv6 = function(input) {\n return new @RegExp(\"^((\?:(\?:[0-9a-fA-F]{1,4}):){7}(\?:(\?:[0-9a-fA-F]{1,4})|:)|(\?:(\?:[0-9a-fA-F]{1,4}):){6}(\?:((\?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])[.]){3}(\?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])|:(\?:[0-9a-fA-F]{1,4})|:)|(\?:(\?:[0-9a-fA-F]{1,4}):){5}(\?::((\?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])[.]){3}(\?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])|(:(\?:[0-9a-fA-F]{1,4})){1,2}|:)|(\?:(\?:[0-9a-fA-F]{1,4}):){4}(\?:(:(\?:[0-9a-fA-F]{1,4})){0,1}:((\?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])[.]){3}(\?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])|(:(\?:[0-9a-fA-F]{1,4})){1,3}|:)|(\?:(\?:[0-9a-fA-F]{1,4}):){3}(\?:(:(\?:[0-9a-fA-F]{1,4})){0,2}:((\?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])[.]){3}(\?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])|(:(\?:[0-9a-fA-F]{1,4})){1,4}|:)|(\?:(\?:[0-9a-fA-F]{1,4}):){2}(\?:(:(\?:[0-9a-fA-F]{1,4})){0,3}:((\?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])[.]){3}(\?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])|(:(\?:[0-9a-fA-F]{1,4})){1,5}|:)|(\?:(\?:[0-9a-fA-F]{1,4}):){1}(\?:(:(\?:[0-9a-fA-F]{1,4})){0,4}:((\?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])[.]){3}(\?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])|(:(\?:[0-9a-fA-F]{1,4})){1,6}|:)|(\?::((\?::(\?:[0-9a-fA-F]{1,4})){0,5}:((\?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])[.]){3}(\?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])|(\?::(\?:[0-9a-fA-F]{1,4})){1,7}|:)))(%[0-9a-zA-Z-.:]{1,})\?$\").test(input);\n}, isValidTLSArray = function(obj) {\n if (typeof obj === \"string\" || isTypedArray(obj) || obj instanceof @ArrayBuffer || obj instanceof Blob)\n return !0;\n if (@Array.isArray(obj)) {\n for (var i = 0;i < obj.length; i++)\n if (typeof obj !== \"string\" && !isTypedArray(obj) && !(obj instanceof @ArrayBuffer) && !(obj instanceof Blob))\n return !1;\n return !0;\n }\n}, validateMsecs = function(numberlike, field) {\n if (typeof numberlike !== \"number\" || numberlike < 0)\n throw new ERR_INVALID_ARG_TYPE(field, \"number\", numberlike);\n return numberlike;\n}, validateFunction = function(callable, field) {\n if (typeof callable !== \"function\")\n throw new ERR_INVALID_ARG_TYPE(field, \"Function\", callable);\n return callable;\n}, createServer = function(options, callback) {\n return new Server(options, callback);\n}, emitListeningNextTick = function(self, onListen, err, hostname, port) {\n if (typeof onListen === \"function\")\n try {\n onListen(err, hostname, port);\n } catch (err2) {\n self.emit(\"error\", err2);\n }\n if (self.listening = !err, err)\n self.emit(\"error\", err);\n else\n self.emit(\"listening\", hostname, port);\n}, assignHeaders = function(object, req) {\n var headers = req.headers.toJSON();\n const rawHeaders = @newArrayWithSize(req.headers.count * 2);\n var i = 0;\n for (let key in headers)\n rawHeaders[i++] = key, rawHeaders[i++] = headers[key];\n object.headers = headers, object.rawHeaders = rawHeaders;\n};\nvar getDefaultHTTPSAgent = function() {\n return _defaultHTTPSAgent \?\?= new Agent({ defaultPort: 443, protocol: \"https:\" });\n};\nvar urlToHttpOptions = function(url) {\n var { protocol, hostname, hash, search, pathname, href, port, username, password } = url;\n return {\n protocol,\n hostname: typeof hostname === \"string\" && StringPrototypeStartsWith.call(hostname, \"[\") \? StringPrototypeSlice.call(hostname, 1, -1) : hostname,\n hash,\n search,\n pathname,\n path: `${pathname || \"\"}${search || \"\"}`,\n href,\n port: port \? Number(port) : protocol === \"https:\" \? 443 : protocol === \"http:\" \? 80 : @undefined,\n auth: username || password \? `${decodeURIComponent(username)}:${decodeURIComponent(password)}` : @undefined\n };\n}, validateHost = function(host, name) {\n if (host !== null && host !== @undefined && typeof host !== \"string\")\n throw new Error(\"Invalid arg type in options\");\n return host;\n}, checkIsHttpToken = function(val) {\n return RegExpPrototypeExec.call(tokenRegExp, val) !== null;\n};\nvar _writeHead = function(statusCode, reason, obj, response) {\n if (statusCode |= 0, statusCode < 100 || statusCode > 999)\n throw new Error(\"status code must be between 100 and 999\");\n if (typeof reason === \"string\")\n response.statusMessage = reason;\n else {\n if (!response.statusMessage)\n response.statusMessage = STATUS_CODES[statusCode] || \"unknown\";\n obj = reason;\n }\n response.statusCode = statusCode;\n {\n let k;\n if (@Array.isArray(obj)) {\n if (obj.length % 2 !== 0)\n throw new Error(\"raw headers must have an even number of elements\");\n for (let n = 0;n < obj.length; n += 2)\n if (k = obj[n + 0], k)\n response.setHeader(k, obj[n + 1]);\n } else if (obj) {\n const keys = Object.keys(obj);\n for (let i = 0;i < keys.length; i++)\n if (k = keys[i], k)\n response.setHeader(k, obj[k]);\n }\n }\n if (statusCode === 204 || statusCode === 304 || statusCode >= 100 && statusCode <= 199)\n response._hasBody = !1;\n}, request = function(url, options, cb) {\n return new ClientRequest(url, options, cb);\n}, get = function(url, options, cb) {\n const req = request(url, options, cb);\n return req.end(), req;\n}, $, EventEmitter = @getInternalField(@internalModuleRegistry, 18) || @createInternalModuleById(18), { isTypedArray } = @requireNativeModule(\"util/types\"), { Duplex, Readable, Writable } = @getInternalField(@internalModuleRegistry, 37) || @createInternalModuleById(37), { getHeader, setHeader } = @lazy(\"http\"), headerCharRegex = /[^\\t\\x20-\\x7e\\x80-\\xff]/, validateHeaderName = (name, label) => {\n if (typeof name !== \"string\" || !name || !checkIsHttpToken(name))\n throw new Error(\"ERR_INVALID_HTTP_TOKEN\");\n}, validateHeaderValue = (name, value) => {\n if (value === @undefined)\n throw new Error(\"ERR_HTTP_INVALID_HEADER_VALUE\");\n if (checkInvalidHeaderChar(value))\n throw new Error(\"ERR_INVALID_CHAR\");\n}, { URL } = globalThis, globalReportError = globalThis.reportError, setTimeout = globalThis.setTimeout, fetch = Bun.fetch;\nvar kEmptyObject = Object.freeze(Object.create(null)), kOutHeaders = Symbol.for(\"kOutHeaders\"), kEndCalled = Symbol.for(\"kEndCalled\"), kAbortController = Symbol.for(\"kAbortController\"), kClearTimeout = Symbol(\"kClearTimeout\"), kCorked = Symbol.for(\"kCorked\"), searchParamsSymbol = Symbol.for(\"query\"), StringPrototypeSlice = @String.prototype.slice, StringPrototypeStartsWith = @String.prototype.startsWith, StringPrototypeToUpperCase = @String.prototype.toUpperCase, ArrayIsArray = @Array.isArray, RegExpPrototypeExec = @RegExp.prototype.exec, ObjectAssign = Object.assign, INVALID_PATH_REGEX = /[^\\u0021-\\u00ff]/;\nvar _defaultHTTPSAgent, kInternalRequest = Symbol(\"kInternalRequest\"), kInternalSocketData = Symbol.for(\"::bunternal::\"), kEmptyBuffer = @Buffer.alloc(0);\n\nclass ERR_INVALID_ARG_TYPE extends TypeError {\n constructor(name, expected, actual) {\n super(`The ${name} argument must be of type ${expected}. Received type ${typeof actual}`);\n this.code = \"ERR_INVALID_ARG_TYPE\";\n }\n}\nvar FakeSocket = class Socket extends Duplex {\n [kInternalSocketData];\n bytesRead = 0;\n bytesWritten = 0;\n connecting = !1;\n remoteAddress = null;\n remotePort;\n timeout = 0;\n isServer = !1;\n address() {\n return {\n address: this.localAddress,\n family: this.localFamily,\n port: this.localPort\n };\n }\n get bufferSize() {\n return this.writableLength;\n }\n connect(port, host, connectListener) {\n return this;\n }\n _destroy(err, callback) {\n }\n _final(callback) {\n }\n get localAddress() {\n return \"127.0.0.1\";\n }\n get localFamily() {\n return \"IPv4\";\n }\n get localPort() {\n return 80;\n }\n get pending() {\n return this.connecting;\n }\n _read(size) {\n }\n get readyState() {\n if (this.connecting)\n return \"opening\";\n if (this.readable)\n return this.writable \? \"open\" : \"readOnly\";\n else\n return this.writable \? \"writeOnly\" : \"closed\";\n }\n ref() {\n }\n get remoteFamily() {\n return \"IPv4\";\n }\n resetAndDestroy() {\n }\n setKeepAlive(enable = !1, initialDelay = 0) {\n }\n setNoDelay(noDelay = !0) {\n return this;\n }\n setTimeout(timeout, callback) {\n return this;\n }\n unref() {\n }\n _write(chunk, encoding, callback) {\n }\n};\n\nclass Agent extends EventEmitter {\n defaultPort = 80;\n protocol = \"http:\";\n options;\n requests;\n sockets;\n freeSockets;\n keepAliveMsecs;\n keepAlive;\n maxSockets;\n maxFreeSockets;\n scheduling;\n maxTotalSockets;\n totalSocketCount;\n #fakeSocket;\n static get globalAgent() {\n return globalAgent;\n }\n static get defaultMaxSockets() {\n return @Infinity;\n }\n constructor(options = kEmptyObject) {\n super();\n if (this.options = options = { ...options, path: null }, options.noDelay === @undefined)\n options.noDelay = !0;\n this.requests = kEmptyObject, this.sockets = kEmptyObject, this.freeSockets = kEmptyObject, this.keepAliveMsecs = options.keepAliveMsecs || 1000, this.keepAlive = options.keepAlive || !1, this.maxSockets = options.maxSockets || Agent.defaultMaxSockets, this.maxFreeSockets = options.maxFreeSockets || 256, this.scheduling = options.scheduling || \"lifo\", this.maxTotalSockets = options.maxTotalSockets, this.totalSocketCount = 0, this.defaultPort = options.defaultPort || 80, this.protocol = options.protocol || \"http:\";\n }\n createConnection() {\n return this.#fakeSocket \?\?= new FakeSocket;\n }\n getName(options = kEmptyObject) {\n let name = `http:${options.host || \"localhost\"}:`;\n if (options.port)\n name += options.port;\n if (name += \":\", options.localAddress)\n name += options.localAddress;\n if (options.family === 4 || options.family === 6)\n name += `:${options.family}`;\n if (options.socketPath)\n name += `:${options.socketPath}`;\n return name;\n }\n addRequest() {\n }\n createSocket(req, options, cb) {\n cb(null, this.#fakeSocket \?\?= new FakeSocket);\n }\n removeSocket() {\n }\n keepSocketAlive() {\n return !0;\n }\n reuseSocket() {\n }\n destroy() {\n }\n}\n\nclass Server extends EventEmitter {\n #server;\n #options;\n #tls;\n #is_tls = !1;\n listening = !1;\n serverName;\n constructor(options, callback) {\n super();\n if (typeof options === \"function\")\n callback = options, options = {};\n else if (options == null || typeof options === \"object\") {\n options = { ...options }, this.#tls = null;\n let key = options.key;\n if (key) {\n if (!isValidTLSArray(key))\n @throwTypeError(\"key argument must be an string, Buffer, TypedArray, BunFile or an array containing string, Buffer, TypedArray or BunFile\");\n this.#is_tls = !0;\n }\n let cert = options.cert;\n if (cert) {\n if (!isValidTLSArray(cert))\n @throwTypeError(\"cert argument must be an string, Buffer, TypedArray, BunFile or an array containing string, Buffer, TypedArray or BunFile\");\n this.#is_tls = !0;\n }\n let ca = options.ca;\n if (ca) {\n if (!isValidTLSArray(ca))\n @throwTypeError(\"ca argument must be an string, Buffer, TypedArray, BunFile or an array containing string, Buffer, TypedArray or BunFile\");\n this.#is_tls = !0;\n }\n let passphrase = options.passphrase;\n if (passphrase && typeof passphrase !== \"string\")\n @throwTypeError(\"passphrase argument must be an string\");\n let serverName = options.servername;\n if (serverName && typeof serverName !== \"string\")\n @throwTypeError(\"servername argument must be an string\");\n let secureOptions = options.secureOptions || 0;\n if (secureOptions && typeof secureOptions !== \"number\")\n @throwTypeError(\"secureOptions argument must be an number\");\n if (this.#is_tls)\n this.#tls = {\n serverName,\n key,\n cert,\n ca,\n passphrase,\n secureOptions\n };\n else\n this.#tls = null;\n } else\n throw new Error(\"bun-http-polyfill: invalid arguments\");\n if (this.#options = options, callback)\n this.on(\"request\", callback);\n }\n closeAllConnections() {\n const server = this.#server;\n if (!server)\n return;\n this.#server = @undefined, server.stop(!0), this.emit(\"close\");\n }\n closeIdleConnections() {\n }\n close(optionalCallback) {\n const server = this.#server;\n if (!server) {\n if (typeof optionalCallback === \"function\")\n process.nextTick(optionalCallback, new Error(\"Server is not running\"));\n return;\n }\n if (this.#server = @undefined, typeof optionalCallback === \"function\")\n this.once(\"close\", optionalCallback);\n server.stop(), this.emit(\"close\");\n }\n address() {\n if (!this.#server)\n return null;\n const address = this.#server.hostname;\n return {\n address,\n family: isIPv6(address) \? \"IPv6\" : \"IPv4\",\n port: this.#server.port\n };\n }\n listen(port, host, backlog, onListen) {\n const server = this;\n let socketPath;\n if (typeof port == \"string\" && !Number.isSafeInteger(Number(port)))\n socketPath = port;\n if (typeof host === \"function\")\n onListen = host, host = @undefined;\n if (typeof port === \"function\")\n onListen = port;\n else if (typeof port === \"object\") {\n if (port\?.signal\?.addEventListener(\"abort\", () => {\n this.close();\n }), host = port\?.host, port = port\?.port, typeof port\?.callback === \"function\")\n onListen = port\?.callback;\n }\n if (typeof backlog === \"function\")\n onListen = backlog;\n const ResponseClass = this.#options.ServerResponse || ServerResponse, RequestClass = this.#options.IncomingMessage || IncomingMessage;\n try {\n const tls = this.#tls;\n if (tls)\n this.serverName = tls.serverName || host || \"localhost\";\n this.#server = Bun.serve({\n tls,\n port,\n hostname: host,\n unix: socketPath,\n websocket: {\n open(ws) {\n ws.data.open(ws);\n },\n message(ws, message) {\n ws.data.message(ws, message);\n },\n close(ws, code, reason) {\n ws.data.close(ws, code, reason);\n },\n drain(ws) {\n ws.data.drain(ws);\n }\n },\n fetch(req, _server) {\n var pendingResponse, pendingError, rejectFunction, resolveFunction, reject = (err) => {\n if (pendingError)\n return;\n if (pendingError = err, rejectFunction)\n rejectFunction(err);\n }, reply = function(resp) {\n if (pendingResponse)\n return;\n if (pendingResponse = resp, resolveFunction)\n resolveFunction(resp);\n };\n const http_req = new RequestClass(req), http_res = new ResponseClass({ reply, req: http_req });\n if (http_req.once(\"error\", (err) => reject(err)), http_res.once(\"error\", (err) => reject(err)), req.headers.get(\"upgrade\")) {\n const socket = http_req.socket;\n socket[kInternalSocketData] = [_server, http_res, req], server.emit(\"upgrade\", http_req, socket, kEmptyBuffer);\n } else\n server.emit(\"request\", http_req, http_res);\n if (pendingError)\n throw pendingError;\n if (pendingResponse)\n return pendingResponse;\n return new @Promise((resolve, reject2) => {\n resolveFunction = resolve, rejectFunction = reject2;\n });\n }\n }), setTimeout(emitListeningNextTick, 1, this, onListen, null, this.#server.hostname, this.#server.port);\n } catch (err) {\n server.emit(\"error\", err);\n }\n return this;\n }\n setTimeout(msecs, callback) {\n }\n}\nclass IncomingMessage extends Readable {\n method;\n complete;\n constructor(req, defaultIncomingOpts) {\n const method = req.method;\n super();\n const url = new URL(req.url);\n var { type = \"request\", [kInternalRequest]: nodeReq } = defaultIncomingOpts || {};\n this.#noBody = type === \"request\" \? method === \"GET\" || method === \"HEAD\" || method === \"TRACE\" || method === \"CONNECT\" || method === \"OPTIONS\" || (parseInt(req.headers.get(\"Content-Length\") || \"\") || 0) === 0 : !1, this.#req = req, this.method = method, this.#type = type, this.complete = !!this.#noBody, this.#bodyStream = @undefined;\n const socket = new FakeSocket;\n if (socket.remoteAddress = url.hostname, socket.remotePort = url.port, url.protocol === \"https:\")\n socket.encrypted = !0;\n this.#fakeSocket = socket, this.url = url.pathname + url.search, this.#nodeReq = this.req = nodeReq, assignHeaders(this, req);\n }\n headers;\n rawHeaders;\n _consuming = !1;\n _dumped = !1;\n #bodyStream;\n #fakeSocket;\n #noBody = !1;\n #aborted = !1;\n #req;\n url;\n #type;\n #nodeReq;\n _construct(callback) {\n if (this.#type === \"response\" || this.#noBody) {\n callback();\n return;\n }\n const contentLength = this.#req.headers.get(\"content-length\");\n if ((contentLength \? parseInt(contentLength, 10) : 0) === 0) {\n this.#noBody = !0, callback();\n return;\n }\n callback();\n }\n async#consumeStream(reader) {\n while (!0) {\n var { done, value } = await reader.readMany();\n if (this.#aborted)\n return;\n if (done) {\n this.push(null), this.destroy();\n break;\n }\n for (var v of value)\n this.push(v);\n }\n }\n _read(size) {\n if (this.#noBody)\n this.push(null), this.complete = !0;\n else if (this.#bodyStream == null) {\n const reader = this.#req.body\?.getReader();\n if (!reader) {\n this.push(null);\n return;\n }\n this.#bodyStream = reader, this.#consumeStream(reader);\n }\n }\n get aborted() {\n return this.#aborted;\n }\n #abort() {\n if (this.#aborted)\n return;\n this.#aborted = !0;\n var bodyStream = this.#bodyStream;\n if (!bodyStream)\n return;\n bodyStream.cancel(), this.complete = !0, this.#bodyStream = @undefined, this.push(null);\n }\n get connection() {\n return this.#fakeSocket;\n }\n get statusCode() {\n return this.#req.status;\n }\n get statusMessage() {\n return STATUS_CODES[this.#req.status];\n }\n get httpVersion() {\n return \"1.1\";\n }\n get rawTrailers() {\n return [];\n }\n get httpVersionMajor() {\n return 1;\n }\n get httpVersionMinor() {\n return 1;\n }\n get trailers() {\n return kEmptyObject;\n }\n get socket() {\n return this.#fakeSocket \?\?= new FakeSocket;\n }\n set socket(val) {\n this.#fakeSocket = val;\n }\n setTimeout(msecs, callback) {\n throw new Error(\"not implemented\");\n }\n}\n\nclass OutgoingMessage extends Writable {\n constructor() {\n super(...arguments);\n }\n #headers;\n headersSent = !1;\n sendDate = !0;\n req;\n timeout;\n #finished = !1;\n [kEndCalled] = !1;\n #fakeSocket;\n #timeoutTimer;\n [kAbortController] = null;\n _implicitHeader() {\n }\n get headers() {\n if (!this.#headers)\n return kEmptyObject;\n return this.#headers.toJSON();\n }\n get shouldKeepAlive() {\n return !0;\n }\n get chunkedEncoding() {\n return !1;\n }\n set chunkedEncoding(value) {\n }\n set shouldKeepAlive(value) {\n }\n get useChunkedEncodingByDefault() {\n return !0;\n }\n set useChunkedEncodingByDefault(value) {\n }\n get socket() {\n return this.#fakeSocket \?\?= new FakeSocket;\n }\n set socket(val) {\n this.#fakeSocket = val;\n }\n get connection() {\n return this.socket;\n }\n get finished() {\n return this.#finished;\n }\n appendHeader(name, value) {\n var headers = this.#headers \?\?= new Headers;\n headers.append(name, value);\n }\n flushHeaders() {\n }\n getHeader(name) {\n return getHeader(this.#headers, name);\n }\n getHeaders() {\n if (!this.#headers)\n return kEmptyObject;\n return this.#headers.toJSON();\n }\n getHeaderNames() {\n var headers = this.#headers;\n if (!headers)\n return [];\n return @Array.from(headers.keys());\n }\n removeHeader(name) {\n if (!this.#headers)\n return;\n this.#headers.delete(name);\n }\n setHeader(name, value) {\n var headers = this.#headers \?\?= new Headers;\n return headers.set(name, value), this;\n }\n hasHeader(name) {\n if (!this.#headers)\n return !1;\n return this.#headers.has(name);\n }\n addTrailers(headers) {\n throw new Error(\"not implemented\");\n }\n [kClearTimeout]() {\n if (this.#timeoutTimer)\n clearTimeout(this.#timeoutTimer), this.removeAllListeners(\"timeout\"), this.#timeoutTimer = @undefined;\n }\n #onTimeout() {\n this.#timeoutTimer = @undefined, this[kAbortController]\?.abort(), this.emit(\"timeout\");\n }\n setTimeout(msecs, callback) {\n if (this.destroyed)\n return this;\n if (this.timeout = msecs = validateMsecs(msecs, \"msecs\"), clearTimeout(this.#timeoutTimer), msecs === 0) {\n if (callback !== @undefined)\n validateFunction(callback, \"callback\"), this.removeListener(\"timeout\", callback);\n this.#timeoutTimer = @undefined;\n } else if (this.#timeoutTimer = setTimeout(this.#onTimeout.bind(this), msecs).unref(), callback !== @undefined)\n validateFunction(callback, \"callback\"), this.once(\"timeout\", callback);\n return this;\n }\n}\nvar OriginalWriteHeadFn, OriginalImplicitHeadFn;\n\nclass ServerResponse extends Writable {\n constructor(c) {\n super();\n if (!c)\n c = {};\n var req = c.req || {}, reply = c.reply;\n if (this.req = req, this._reply = reply, this.sendDate = !0, this.statusCode = 200, this.headersSent = !1, this.statusMessage = @undefined, this.#controller = @undefined, this.#firstWrite = @undefined, this._writableState.decodeStrings = !1, this.#deferred = @undefined, req.method === \"HEAD\")\n this._hasBody = !1;\n }\n req;\n _reply;\n sendDate;\n statusCode;\n #headers;\n headersSent = !1;\n statusMessage;\n #controller;\n #firstWrite;\n _sent100 = !1;\n _defaultKeepAlive = !1;\n _removedConnection = !1;\n _removedContLen = !1;\n _hasBody = !0;\n #deferred = @undefined;\n #finished = !1;\n _implicitHeader() {\n this.writeHead(this.statusCode);\n }\n _write(chunk, encoding, callback) {\n if (!this.#firstWrite && !this.headersSent) {\n this.#firstWrite = chunk, callback();\n return;\n }\n this.#ensureReadableStreamController((controller) => {\n controller.write(chunk), callback();\n });\n }\n _writev(chunks, callback) {\n if (chunks.length === 1 && !this.headersSent && !this.#firstWrite) {\n this.#firstWrite = chunks[0].chunk, callback();\n return;\n }\n this.#ensureReadableStreamController((controller) => {\n for (let chunk of chunks)\n controller.write(chunk.chunk);\n callback();\n });\n }\n #ensureReadableStreamController(run) {\n var thisController = this.#controller;\n if (thisController)\n return run(thisController);\n this.headersSent = !0;\n var firstWrite = this.#firstWrite;\n this.#firstWrite = @undefined, this._reply(new Response(new @ReadableStream({\n type: \"direct\",\n pull: (controller) => {\n if (this.#controller = controller, firstWrite)\n controller.write(firstWrite);\n if (firstWrite = @undefined, run(controller), !this.#finished)\n return new @Promise((resolve) => {\n this.#deferred = resolve;\n });\n }\n }), {\n headers: this.#headers,\n status: this.statusCode,\n statusText: this.statusMessage \?\? STATUS_CODES[this.statusCode]\n }));\n }\n #drainHeadersIfObservable() {\n if (this._implicitHeader === OriginalImplicitHeadFn && this.writeHead === OriginalWriteHeadFn)\n return;\n this._implicitHeader();\n }\n _final(callback) {\n if (!this.headersSent) {\n var data = this.#firstWrite || \"\";\n this.#firstWrite = @undefined, this.#finished = !0, this.#drainHeadersIfObservable(), this._reply(new Response(data, {\n headers: this.#headers,\n status: this.statusCode,\n statusText: this.statusMessage \?\? STATUS_CODES[this.statusCode]\n })), callback && callback();\n return;\n }\n this.#finished = !0, this.#ensureReadableStreamController((controller) => {\n controller.end(), callback();\n var deferred = this.#deferred;\n if (deferred)\n this.#deferred = @undefined, deferred();\n });\n }\n writeProcessing() {\n throw new Error(\"not implemented\");\n }\n addTrailers(headers) {\n throw new Error(\"not implemented\");\n }\n assignSocket(socket) {\n throw new Error(\"not implemented\");\n }\n detachSocket(socket) {\n throw new Error(\"not implemented\");\n }\n writeContinue(callback) {\n throw new Error(\"not implemented\");\n }\n setTimeout(msecs, callback) {\n throw new Error(\"not implemented\");\n }\n get shouldKeepAlive() {\n return !0;\n }\n get chunkedEncoding() {\n return !1;\n }\n set chunkedEncoding(value) {\n }\n set shouldKeepAlive(value) {\n }\n get useChunkedEncodingByDefault() {\n return !0;\n }\n set useChunkedEncodingByDefault(value) {\n }\n appendHeader(name, value) {\n var headers = this.#headers \?\?= new Headers;\n headers.append(name, value);\n }\n flushHeaders() {\n }\n getHeader(name) {\n return getHeader(this.#headers, name);\n }\n getHeaders() {\n var headers = this.#headers;\n if (!headers)\n return kEmptyObject;\n return headers.toJSON();\n }\n getHeaderNames() {\n var headers = this.#headers;\n if (!headers)\n return [];\n return @Array.from(headers.keys());\n }\n removeHeader(name) {\n if (!this.#headers)\n return;\n this.#headers.delete(name);\n }\n setHeader(name, value) {\n var headers = this.#headers \?\?= new Headers;\n return setHeader(headers, name, value), this;\n }\n hasHeader(name) {\n if (!this.#headers)\n return !1;\n return this.#headers.has(name);\n }\n writeHead(statusCode, statusMessage, headers) {\n return _writeHead(statusCode, statusMessage, headers, this), this;\n }\n}\nOriginalWriteHeadFn = ServerResponse.prototype.writeHead;\nOriginalImplicitHeadFn = ServerResponse.prototype._implicitHeader;\n\nclass ClientRequest extends OutgoingMessage {\n #timeout;\n #res = null;\n #upgradeOrConnect = !1;\n #parser = null;\n #maxHeadersCount = null;\n #reusedSocket = !1;\n #host;\n #protocol;\n #method;\n #port;\n #useDefaultPort;\n #joinDuplicateHeaders;\n #maxHeaderSize;\n #agent = globalAgent;\n #path;\n #socketPath;\n #bodyChunks = null;\n #fetchRequest;\n #signal = null;\n [kAbortController] = null;\n #timeoutTimer = @undefined;\n #options;\n #finished;\n get path() {\n return this.#path;\n }\n get port() {\n return this.#port;\n }\n get method() {\n return this.#method;\n }\n get host() {\n return this.#host;\n }\n get protocol() {\n return this.#protocol;\n }\n _write(chunk, encoding, callback) {\n if (!this.#bodyChunks) {\n this.#bodyChunks = [chunk], callback();\n return;\n }\n this.#bodyChunks.push(chunk), callback();\n }\n _writev(chunks, callback) {\n if (!this.#bodyChunks) {\n this.#bodyChunks = chunks, callback();\n return;\n }\n this.#bodyChunks.push(...chunks), callback();\n }\n _final(callback) {\n if (this.#finished = !0, this[kAbortController] = new AbortController, this[kAbortController].signal.addEventListener(\"abort\", () => {\n this[kClearTimeout]();\n }), this.#signal\?.aborted)\n this[kAbortController].abort();\n var method = this.#method, body = this.#bodyChunks\?.length === 1 \? this.#bodyChunks[0] : @Buffer.concat(this.#bodyChunks || []);\n let url, proxy;\n if (this.#path.startsWith(\"http://\") || this.#path.startsWith(\"https://\"))\n url = this.#path, proxy = `${this.#protocol}//${this.#host}${this.#useDefaultPort \? \"\" : \":\" + this.#port}`;\n else\n url = `${this.#protocol}//${this.#host}${this.#useDefaultPort \? \"\" : \":\" + this.#port}${this.#path}`;\n try {\n this.#fetchRequest = fetch(url, {\n method,\n headers: this.getHeaders(),\n body: body && method !== \"GET\" && method !== \"HEAD\" && method !== \"OPTIONS\" \? body : @undefined,\n redirect: \"manual\",\n verbose: !1,\n signal: this[kAbortController].signal,\n proxy,\n timeout: !1,\n decompress: !1\n }).then((response) => {\n var res = this.#res = new IncomingMessage(response, {\n type: \"response\",\n [kInternalRequest]: this\n });\n this.emit(\"response\", res);\n }).catch((err) => {\n this.emit(\"error\", err);\n }).finally(() => {\n this.#fetchRequest = null, this[kClearTimeout]();\n });\n } catch (err) {\n this.emit(\"error\", err);\n } finally {\n callback();\n }\n }\n get aborted() {\n return this.#signal\?.aborted || !!this[kAbortController]\?.signal.aborted;\n }\n abort() {\n if (this.aborted)\n return;\n this[kAbortController].abort();\n }\n constructor(input, options, cb) {\n super();\n if (typeof input === \"string\") {\n const urlStr = input;\n try {\n var urlObject = new URL(urlStr);\n } catch (e) {\n @throwTypeError(`Invalid URL: ${urlStr}`);\n }\n input = urlToHttpOptions(urlObject);\n } else if (input && typeof input === \"object\" && input instanceof URL)\n input = urlToHttpOptions(input);\n else\n cb = options, options = input, input = null;\n if (typeof options === \"function\")\n cb = options, options = input || kEmptyObject;\n else\n options = ObjectAssign(input || {}, options);\n var defaultAgent = options._defaultAgent || Agent.globalAgent;\n let protocol = options.protocol;\n if (!protocol)\n if (options.port === 443)\n protocol = \"https:\";\n else\n protocol = defaultAgent.protocol || \"http:\";\n switch (this.#protocol = protocol, this.#agent\?.protocol) {\n case @undefined:\n break;\n case \"http:\":\n if (protocol === \"https:\") {\n defaultAgent = this.#agent = getDefaultHTTPSAgent();\n break;\n }\n case \"https:\":\n if (protocol === \"https\") {\n defaultAgent = this.#agent = Agent.globalAgent;\n break;\n }\n default:\n break;\n }\n if (options.path) {\n const path = @String(options.path);\n if (RegExpPrototypeExec.call(INVALID_PATH_REGEX, path) !== null)\n throw new Error(\"Path contains unescaped characters\");\n }\n if (protocol !== \"http:\" && protocol !== \"https:\" && protocol) {\n const expectedProtocol = defaultAgent\?.protocol \?\? \"http:\";\n throw new Error(`Protocol mismatch. Expected: ${expectedProtocol}. Got: ${protocol}`);\n }\n const defaultPort = protocol === \"https:\" \? 443 : 80;\n this.#port = options.port || options.defaultPort || this.#agent\?.defaultPort || defaultPort, this.#useDefaultPort = this.#port === defaultPort;\n const host = this.#host = options.host = validateHost(options.hostname, \"hostname\") || validateHost(options.host, \"host\") || \"localhost\";\n this.#socketPath = options.socketPath;\n const signal = options.signal;\n if (signal)\n signal.addEventListener(\"abort\", () => {\n this[kAbortController]\?.abort();\n }), this.#signal = signal;\n let method = options.method;\n const methodIsString = typeof method === \"string\";\n if (method !== null && method !== @undefined && !methodIsString)\n throw new Error(\"ERR_INVALID_ARG_TYPE: options.method\");\n if (methodIsString && method) {\n if (!checkIsHttpToken(method))\n throw new Error(\"ERR_INVALID_HTTP_TOKEN: Method\");\n method = this.#method = StringPrototypeToUpperCase.call(method);\n } else\n method = this.#method = \"GET\";\n const _maxHeaderSize = options.maxHeaderSize;\n this.#maxHeaderSize = _maxHeaderSize;\n var _joinDuplicateHeaders = options.joinDuplicateHeaders;\n if (this.#joinDuplicateHeaders = _joinDuplicateHeaders, this.#path = options.path || \"/\", cb)\n this.once(\"response\", cb);\n this.#finished = !1, this.#res = null, this.#upgradeOrConnect = !1, this.#parser = null, this.#maxHeadersCount = null, this.#reusedSocket = !1, this.#host = host, this.#protocol = protocol;\n var timeout = options.timeout;\n if (timeout !== @undefined && timeout !== 0)\n this.setTimeout(timeout, @undefined);\n if (!ArrayIsArray(headers)) {\n var headers = options.headers;\n if (headers)\n for (let key in headers)\n this.setHeader(key, headers[key]);\n var auth = options.auth;\n if (auth && !this.getHeader(\"Authorization\"))\n this.setHeader(\"Authorization\", \"Basic \" + @Buffer.from(auth).toString(\"base64\"));\n }\n var { signal: _signal, ...optsWithoutSignal } = options;\n this.#options = optsWithoutSignal;\n }\n setSocketKeepAlive(enable = !0, initialDelay = 0) {\n }\n setNoDelay(noDelay = !0) {\n }\n [kClearTimeout]() {\n if (this.#timeoutTimer)\n clearTimeout(this.#timeoutTimer), this.#timeoutTimer = @undefined, this.removeAllListeners(\"timeout\");\n }\n #onTimeout() {\n this.#timeoutTimer = @undefined, this[kAbortController]\?.abort(), this.emit(\"timeout\");\n }\n setTimeout(msecs, callback) {\n if (this.destroyed)\n return this;\n if (this.timeout = msecs = validateMsecs(msecs, \"msecs\"), clearTimeout(this.#timeoutTimer), msecs === 0) {\n if (callback !== @undefined)\n validateFunction(callback, \"callback\"), this.removeListener(\"timeout\", callback);\n this.#timeoutTimer = @undefined;\n } else if (this.#timeoutTimer = setTimeout(this.#onTimeout.bind(this), msecs).unref(), callback !== @undefined)\n validateFunction(callback, \"callback\"), this.once(\"timeout\", callback);\n return this;\n }\n}\nvar tokenRegExp = /^[\\^_`a-zA-Z\\-0-9!#$%&'*+.|~]+$/, METHODS = [\n \"ACL\",\n \"BIND\",\n \"CHECKOUT\",\n \"CONNECT\",\n \"COPY\",\n \"DELETE\",\n \"GET\",\n \"HEAD\",\n \"LINK\",\n \"LOCK\",\n \"M-SEARCH\",\n \"MERGE\",\n \"MKACTIVITY\",\n \"MKCALENDAR\",\n \"MKCOL\",\n \"MOVE\",\n \"NOTIFY\",\n \"OPTIONS\",\n \"PATCH\",\n \"POST\",\n \"PROPFIND\",\n \"PROPPATCH\",\n \"PURGE\",\n \"PUT\",\n \"REBIND\",\n \"REPORT\",\n \"SEARCH\",\n \"SOURCE\",\n \"SUBSCRIBE\",\n \"TRACE\",\n \"UNBIND\",\n \"UNLINK\",\n \"UNLOCK\",\n \"UNSUBSCRIBE\"\n], STATUS_CODES = {\n 100: \"Continue\",\n 101: \"Switching Protocols\",\n 102: \"Processing\",\n 103: \"Early Hints\",\n 200: \"OK\",\n 201: \"Created\",\n 202: \"Accepted\",\n 203: \"Non-Authoritative Information\",\n 204: \"No Content\",\n 205: \"Reset Content\",\n 206: \"Partial Content\",\n 207: \"Multi-Status\",\n 208: \"Already Reported\",\n 226: \"IM Used\",\n 300: \"Multiple Choices\",\n 301: \"Moved Permanently\",\n 302: \"Found\",\n 303: \"See Other\",\n 304: \"Not Modified\",\n 305: \"Use Proxy\",\n 307: \"Temporary Redirect\",\n 308: \"Permanent Redirect\",\n 400: \"Bad Request\",\n 401: \"Unauthorized\",\n 402: \"Payment Required\",\n 403: \"Forbidden\",\n 404: \"Not Found\",\n 405: \"Method Not Allowed\",\n 406: \"Not Acceptable\",\n 407: \"Proxy Authentication Required\",\n 408: \"Request Timeout\",\n 409: \"Conflict\",\n 410: \"Gone\",\n 411: \"Length Required\",\n 412: \"Precondition Failed\",\n 413: \"Payload Too Large\",\n 414: \"URI Too Long\",\n 415: \"Unsupported Media Type\",\n 416: \"Range Not Satisfiable\",\n 417: \"Expectation Failed\",\n 418: \"I'm a Teapot\",\n 421: \"Misdirected Request\",\n 422: \"Unprocessable Entity\",\n 423: \"Locked\",\n 424: \"Failed Dependency\",\n 425: \"Too Early\",\n 426: \"Upgrade Required\",\n 428: \"Precondition Required\",\n 429: \"Too Many Requests\",\n 431: \"Request Header Fields Too Large\",\n 451: \"Unavailable For Legal Reasons\",\n 500: \"Internal Server Error\",\n 501: \"Not Implemented\",\n 502: \"Bad Gateway\",\n 503: \"Service Unavailable\",\n 504: \"Gateway Timeout\",\n 505: \"HTTP Version Not Supported\",\n 506: \"Variant Also Negotiates\",\n 507: \"Insufficient Storage\",\n 508: \"Loop Detected\",\n 509: \"Bandwidth Limit Exceeded\",\n 510: \"Not Extended\",\n 511: \"Network Authentication Required\"\n}, globalAgent = new Agent;\n$ = {\n Agent,\n Server,\n METHODS,\n STATUS_CODES,\n createServer,\n ServerResponse,\n IncomingMessage,\n request,\n get,\n maxHeaderSize: 16384,\n validateHeaderName,\n validateHeaderValue,\n setMaxIdleHTTPParsers(max) {\n },\n globalAgent,\n ClientRequest,\n OutgoingMessage\n};\nreturn $})\n"_s; // // diff --git a/src/js/out/WebCoreJSBuiltins.cpp b/src/js/out/WebCoreJSBuiltins.cpp index 4e927c00d..dede8fd01 100644 --- a/src/js/out/WebCoreJSBuiltins.cpp +++ b/src/js/out/WebCoreJSBuiltins.cpp @@ -9,38 +9,38 @@ namespace Zig { class GlobalObject; } namespace WebCore { -/* BundlerPlugin.ts */ -// runSetupFunction -const JSC::ConstructAbility s_bundlerPluginRunSetupFunctionCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; -const JSC::ConstructorKind s_bundlerPluginRunSetupFunctionCodeConstructorKind = JSC::ConstructorKind::None; -const JSC::ImplementationVisibility s_bundlerPluginRunSetupFunctionCodeImplementationVisibility = JSC::ImplementationVisibility::Public; -const int s_bundlerPluginRunSetupFunctionCodeLength = 4001; -static const JSC::Intrinsic s_bundlerPluginRunSetupFunctionCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_bundlerPluginRunSetupFunctionCode = "(function (setup, config) {\"use strict\";\n var onLoadPlugins = new Map, onResolvePlugins = new Map;\n function validate(filterObject, callback, map) {\n if (!filterObject || !@isObject(filterObject))\n @throwTypeError('Expected an object with \"filter\" RegExp');\n if (!callback || !@isCallable(callback))\n @throwTypeError(\"callback must be a function\");\n var { filter, namespace = \"file\" } = filterObject;\n if (!filter)\n @throwTypeError('Expected an object with \"filter\" RegExp');\n if (!@isRegExpObject(filter))\n @throwTypeError(\"filter must be a RegExp\");\n if (namespace && typeof namespace !== \"string\")\n @throwTypeError(\"namespace must be a string\");\n if ((namespace\?.length \?\? 0) === 0)\n namespace = \"file\";\n if (!/^([/@a-zA-Z0-9_\\\\-]+)$/.test(namespace))\n @throwTypeError(\"namespace can only contain $a-zA-Z0-9_\\\\-\");\n var callbacks = map.@get(namespace);\n if (!callbacks)\n map.@set(namespace, [[filter, callback]]);\n else\n @arrayPush(callbacks, [filter, callback]);\n }\n function onLoad(filterObject, callback) {\n validate(filterObject, callback, onLoadPlugins);\n }\n function onResolve(filterObject, callback) {\n validate(filterObject, callback, onResolvePlugins);\n }\n const processSetupResult = () => {\n var anyOnLoad = !1, anyOnResolve = !1;\n for (var [namespace, callbacks] of onLoadPlugins.entries())\n for (var [filter] of callbacks)\n this.addFilter(filter, namespace, 1), anyOnLoad = !0;\n for (var [namespace, callbacks] of onResolvePlugins.entries())\n for (var [filter] of callbacks)\n this.addFilter(filter, namespace, 0), anyOnResolve = !0;\n if (anyOnResolve) {\n var onResolveObject = this.onResolve;\n if (!onResolveObject)\n this.onResolve = onResolvePlugins;\n else\n for (var [namespace, callbacks] of onResolvePlugins.entries()) {\n var existing = onResolveObject.@get(namespace);\n if (!existing)\n onResolveObject.@set(namespace, callbacks);\n else\n onResolveObject.@set(namespace, existing.concat(callbacks));\n }\n }\n if (anyOnLoad) {\n var onLoadObject = this.onLoad;\n if (!onLoadObject)\n this.onLoad = onLoadPlugins;\n else\n for (var [namespace, callbacks] of onLoadPlugins.entries()) {\n var existing = onLoadObject.@get(namespace);\n if (!existing)\n onLoadObject.@set(namespace, callbacks);\n else\n onLoadObject.@set(namespace, existing.concat(callbacks));\n }\n }\n return anyOnLoad || anyOnResolve;\n };\n var setupResult = setup({\n config,\n onDispose: () => @throwTypeError(\"@{@2} is not implemented yet. See https://github.com/oven-sh/bun/issues/@1\"),\n onEnd: () => @throwTypeError(\"@{@2} is not implemented yet. See https://github.com/oven-sh/bun/issues/@1\"),\n onLoad,\n onResolve,\n onStart: () => @throwTypeError(\"@{@2} is not implemented yet. See https://github.com/oven-sh/bun/issues/@1\"),\n resolve: () => @throwTypeError(\"@{@2} is not implemented yet. See https://github.com/oven-sh/bun/issues/@1\"),\n initialOptions: {\n ...config,\n bundle: !0,\n entryPoints: config.entrypoints \?\? config.entryPoints \?\? [],\n minify: typeof config.minify === \"boolean\" \? config.minify : !1,\n minifyIdentifiers: config.minify === !0 || config.minify\?.identifiers,\n minifyWhitespace: config.minify === !0 || config.minify\?.whitespace,\n minifySyntax: config.minify === !0 || config.minify\?.syntax,\n outbase: config.root,\n platform: config.target === \"bun\" \? \"node\" : config.target\n },\n esbuild: {}\n });\n if (setupResult && @isPromise(setupResult))\n if (@getPromiseInternalField(setupResult, @promiseFieldFlags) & @promiseStateFulfilled)\n setupResult = @getPromiseInternalField(setupResult, @promiseFieldReactionsOrResult);\n else\n return setupResult.@then(processSetupResult);\n return processSetupResult();\n})\n"; +/* CountQueuingStrategy.ts */ +// highWaterMark +const JSC::ConstructAbility s_countQueuingStrategyHighWaterMarkCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; +const JSC::ConstructorKind s_countQueuingStrategyHighWaterMarkCodeConstructorKind = JSC::ConstructorKind::None; +const JSC::ImplementationVisibility s_countQueuingStrategyHighWaterMarkCodeImplementationVisibility = JSC::ImplementationVisibility::Public; +const int s_countQueuingStrategyHighWaterMarkCodeLength = 264; +static const JSC::Intrinsic s_countQueuingStrategyHighWaterMarkCodeIntrinsic = JSC::NoIntrinsic; +const char* const s_countQueuingStrategyHighWaterMarkCode = "(function () {\"use strict\";\n const highWaterMark = @getByIdDirectPrivate(this, \"highWaterMark\");\n if (highWaterMark === @undefined)\n @throwTypeError(\"CountQueuingStrategy.highWaterMark getter called on incompatible |this| value.\");\n return highWaterMark;\n})\n"; -// runOnResolvePlugins -const JSC::ConstructAbility s_bundlerPluginRunOnResolvePluginsCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; -const JSC::ConstructorKind s_bundlerPluginRunOnResolvePluginsCodeConstructorKind = JSC::ConstructorKind::None; -const JSC::ImplementationVisibility s_bundlerPluginRunOnResolvePluginsCodeImplementationVisibility = JSC::ImplementationVisibility::Public; -const int s_bundlerPluginRunOnResolvePluginsCodeLength = 3000; -static const JSC::Intrinsic s_bundlerPluginRunOnResolvePluginsCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_bundlerPluginRunOnResolvePluginsCode = "(function (specifier, inputNamespace, importer, internalID, kindId) {\"use strict\";\n const kind = [\"entry-point\", \"import-statement\", \"require-call\", \"dynamic-import\", \"require-resolve\", \"import-rule\", \"url-token\", \"internal\"][kindId];\n var promiseResult = (async (inputPath, inputNamespace2, importer2, kind2) => {\n var { onResolve, onLoad } = this, results = onResolve.@get(inputNamespace2);\n if (!results)\n return this.onResolveAsync(internalID, null, null, null), null;\n for (let [filter, callback] of results)\n if (filter.test(inputPath)) {\n var result = callback({\n path: inputPath,\n importer: importer2,\n namespace: inputNamespace2,\n kind: kind2\n });\n while (result && @isPromise(result) && (@getPromiseInternalField(result, @promiseFieldFlags) & @promiseStateMask) === @promiseStateFulfilled)\n result = @getPromiseInternalField(result, @promiseFieldReactionsOrResult);\n if (result && @isPromise(result))\n result = await result;\n if (!result || !@isObject(result))\n continue;\n var { path, namespace: userNamespace = inputNamespace2, external } = result;\n if (typeof path !== \"string\" || typeof userNamespace !== \"string\")\n @throwTypeError(\"onResolve plugins must return an object with a string 'path' and string 'loader' field\");\n if (!path)\n continue;\n if (!userNamespace)\n userNamespace = inputNamespace2;\n if (typeof external !== \"boolean\" && !@isUndefinedOrNull(external))\n @throwTypeError('onResolve plugins \"external\" field must be boolean or unspecified');\n if (!external) {\n if (userNamespace === \"file\") {\n if (process.platform !== \"win32\") {\n if (path[0] !== \"/\" || path.includes(\"..\"))\n @throwTypeError('onResolve plugin \"path\" must be absolute when the namespace is \"file\"');\n }\n }\n if (userNamespace === \"dataurl\") {\n if (!path.startsWith(\"data:\"))\n @throwTypeError('onResolve plugin \"path\" must start with \"data:\" when the namespace is \"dataurl\"');\n }\n if (userNamespace && userNamespace !== \"file\" && (!onLoad || !onLoad.@has(userNamespace)))\n @throwTypeError(`Expected onLoad plugin for namespace ${userNamespace} to exist`);\n }\n return this.onResolveAsync(internalID, path, userNamespace, external), null;\n }\n return this.onResolveAsync(internalID, null, null, null), null;\n })(specifier, inputNamespace, importer, kind);\n while (promiseResult && @isPromise(promiseResult) && (@getPromiseInternalField(promiseResult, @promiseFieldFlags) & @promiseStateMask) === @promiseStateFulfilled)\n promiseResult = @getPromiseInternalField(promiseResult, @promiseFieldReactionsOrResult);\n if (promiseResult && @isPromise(promiseResult))\n promiseResult.then(() => {\n }, (e) => {\n this.addError(internalID, e, 0);\n });\n})\n"; +// size +const JSC::ConstructAbility s_countQueuingStrategySizeCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; +const JSC::ConstructorKind s_countQueuingStrategySizeCodeConstructorKind = JSC::ConstructorKind::None; +const JSC::ImplementationVisibility s_countQueuingStrategySizeCodeImplementationVisibility = JSC::ImplementationVisibility::Public; +const int s_countQueuingStrategySizeCodeLength = 43; +static const JSC::Intrinsic s_countQueuingStrategySizeCodeIntrinsic = JSC::NoIntrinsic; +const char* const s_countQueuingStrategySizeCode = "(function () {\"use strict\";\n return 1;\n})\n"; -// runOnLoadPlugins -const JSC::ConstructAbility s_bundlerPluginRunOnLoadPluginsCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; -const JSC::ConstructorKind s_bundlerPluginRunOnLoadPluginsCodeConstructorKind = JSC::ConstructorKind::None; -const JSC::ImplementationVisibility s_bundlerPluginRunOnLoadPluginsCodeImplementationVisibility = JSC::ImplementationVisibility::Public; -const int s_bundlerPluginRunOnLoadPluginsCodeLength = 2268; -static const JSC::Intrinsic s_bundlerPluginRunOnLoadPluginsCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_bundlerPluginRunOnLoadPluginsCode = "(function (internalID, path, namespace, defaultLoaderId) {\"use strict\";\n const LOADERS_MAP = { 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 }, loaderName = [\"jsx\", \"js\", \"ts\", \"tsx\", \"css\", \"file\", \"json\", \"toml\", \"wasm\", \"napi\", \"base64\", \"dataurl\", \"text\"][defaultLoaderId];\n var promiseResult = (async (internalID2, path2, namespace2, defaultLoader) => {\n var results = this.onLoad.@get(namespace2);\n if (!results)\n return this.onLoadAsync(internalID2, null, null), null;\n for (let [filter, callback] of results)\n if (filter.test(path2)) {\n var result = callback({\n path: path2,\n namespace: namespace2,\n loader: defaultLoader\n });\n while (result && @isPromise(result) && (@getPromiseInternalField(result, @promiseFieldFlags) & @promiseStateMask) === @promiseStateFulfilled)\n result = @getPromiseInternalField(result, @promiseFieldReactionsOrResult);\n if (result && @isPromise(result))\n result = await result;\n if (!result || !@isObject(result))\n continue;\n var { contents, loader = defaultLoader } = result;\n if (typeof contents !== \"string\" && !@isTypedArrayView(contents))\n @throwTypeError('onLoad plugins must return an object with \"contents\" as a string or Uint8Array');\n if (typeof loader !== \"string\")\n @throwTypeError('onLoad plugins must return an object with \"loader\" as a string');\n const chosenLoader = LOADERS_MAP[loader];\n if (chosenLoader === @undefined)\n @throwTypeError(`Loader ${loader} is not supported.`);\n return this.onLoadAsync(internalID2, contents, chosenLoader), null;\n }\n return this.onLoadAsync(internalID2, null, null), null;\n })(internalID, path, namespace, loaderName);\n while (promiseResult && @isPromise(promiseResult) && (@getPromiseInternalField(promiseResult, @promiseFieldFlags) & @promiseStateMask) === @promiseStateFulfilled)\n promiseResult = @getPromiseInternalField(promiseResult, @promiseFieldReactionsOrResult);\n if (promiseResult && @isPromise(promiseResult))\n promiseResult.then(() => {\n }, (e) => {\n this.addError(internalID, e, 1);\n });\n})\n"; +// initializeCountQueuingStrategy +const JSC::ConstructAbility s_countQueuingStrategyInitializeCountQueuingStrategyCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; +const JSC::ConstructorKind s_countQueuingStrategyInitializeCountQueuingStrategyCodeConstructorKind = JSC::ConstructorKind::None; +const JSC::ImplementationVisibility s_countQueuingStrategyInitializeCountQueuingStrategyCodeImplementationVisibility = JSC::ImplementationVisibility::Public; +const int s_countQueuingStrategyInitializeCountQueuingStrategyCodeLength = 147; +static const JSC::Intrinsic s_countQueuingStrategyInitializeCountQueuingStrategyCodeIntrinsic = JSC::NoIntrinsic; +const char* const s_countQueuingStrategyInitializeCountQueuingStrategyCode = "(function (parameters) {\"use strict\";\n @putByIdDirectPrivate(this, \"highWaterMark\", @extractHighWaterMarkFromQueuingStrategyInit(parameters));\n})\n"; #define DEFINE_BUILTIN_GENERATOR(codeName, functionName, overriddenName, argumentCount) \ JSC::FunctionExecutable* codeName##Generator(JSC::VM& vm) \ {\ JSVMClientData* clientData = static_cast(vm.clientData); \ - return clientData->builtinFunctions().bundlerPluginBuiltins().codeName##Executable()->link(vm, nullptr, clientData->builtinFunctions().bundlerPluginBuiltins().codeName##Source(), std::nullopt, s_##codeName##Intrinsic); \ + return clientData->builtinFunctions().countQueuingStrategyBuiltins().codeName##Executable()->link(vm, nullptr, clientData->builtinFunctions().countQueuingStrategyBuiltins().codeName##Source(), std::nullopt, s_##codeName##Intrinsic); \ } -WEBCORE_FOREACH_BUNDLERPLUGIN_BUILTIN_CODE(DEFINE_BUILTIN_GENERATOR) +WEBCORE_FOREACH_COUNTQUEUINGSTRATEGY_BUILTIN_CODE(DEFINE_BUILTIN_GENERATOR) #undef DEFINE_BUILTIN_GENERATOR /* ByteLengthQueuingStrategy.ts */ @@ -77,560 +77,526 @@ JSC::FunctionExecutable* codeName##Generator(JSC::VM& vm) \ WEBCORE_FOREACH_BYTELENGTHQUEUINGSTRATEGY_BUILTIN_CODE(DEFINE_BUILTIN_GENERATOR) #undef DEFINE_BUILTIN_GENERATOR -/* WritableStreamInternals.ts */ -// isWritableStream -const JSC::ConstructAbility s_writableStreamInternalsIsWritableStreamCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; -const JSC::ConstructorKind s_writableStreamInternalsIsWritableStreamCodeConstructorKind = JSC::ConstructorKind::None; -const JSC::ImplementationVisibility s_writableStreamInternalsIsWritableStreamCodeImplementationVisibility = JSC::ImplementationVisibility::Public; -const int s_writableStreamInternalsIsWritableStreamCodeLength = 118; -static const JSC::Intrinsic s_writableStreamInternalsIsWritableStreamCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_writableStreamInternalsIsWritableStreamCode = "(function (stream) {\"use strict\";\n return @isObject(stream) && !!@getByIdDirectPrivate(stream, \"underlyingSink\");\n})\n"; - -// isWritableStreamDefaultWriter -const JSC::ConstructAbility s_writableStreamInternalsIsWritableStreamDefaultWriterCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; -const JSC::ConstructorKind s_writableStreamInternalsIsWritableStreamDefaultWriterCodeConstructorKind = JSC::ConstructorKind::None; -const JSC::ImplementationVisibility s_writableStreamInternalsIsWritableStreamDefaultWriterCodeImplementationVisibility = JSC::ImplementationVisibility::Public; -const int s_writableStreamInternalsIsWritableStreamDefaultWriterCodeLength = 117; -static const JSC::Intrinsic s_writableStreamInternalsIsWritableStreamDefaultWriterCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_writableStreamInternalsIsWritableStreamDefaultWriterCode = "(function (writer) {\"use strict\";\n return @isObject(writer) && !!@getByIdDirectPrivate(writer, \"closedPromise\");\n})\n"; +/* WritableStreamDefaultWriter.ts */ +// initializeWritableStreamDefaultWriter +const JSC::ConstructAbility s_writableStreamDefaultWriterInitializeWritableStreamDefaultWriterCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; +const JSC::ConstructorKind s_writableStreamDefaultWriterInitializeWritableStreamDefaultWriterCodeConstructorKind = JSC::ConstructorKind::None; +const JSC::ImplementationVisibility s_writableStreamDefaultWriterInitializeWritableStreamDefaultWriterCodeImplementationVisibility = JSC::ImplementationVisibility::Public; +const int s_writableStreamDefaultWriterInitializeWritableStreamDefaultWriterCodeLength = 334; +static const JSC::Intrinsic s_writableStreamDefaultWriterInitializeWritableStreamDefaultWriterCodeIntrinsic = JSC::NoIntrinsic; +const char* const s_writableStreamDefaultWriterInitializeWritableStreamDefaultWriterCode = "(function (stream) {\"use strict\";\n const internalStream = @getInternalWritableStream(stream);\n if (internalStream)\n stream = internalStream;\n if (!@isWritableStream(stream))\n @throwTypeError(\"WritableStreamDefaultWriter constructor takes a WritableStream\");\n return @setUpWritableStreamDefaultWriter(this, stream), this;\n})\n"; -// acquireWritableStreamDefaultWriter -const JSC::ConstructAbility s_writableStreamInternalsAcquireWritableStreamDefaultWriterCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; -const JSC::ConstructorKind s_writableStreamInternalsAcquireWritableStreamDefaultWriterCodeConstructorKind = JSC::ConstructorKind::None; -const JSC::ImplementationVisibility s_writableStreamInternalsAcquireWritableStreamDefaultWriterCodeImplementationVisibility = JSC::ImplementationVisibility::Public; -const int s_writableStreamInternalsAcquireWritableStreamDefaultWriterCodeLength = 88; -static const JSC::Intrinsic s_writableStreamInternalsAcquireWritableStreamDefaultWriterCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_writableStreamInternalsAcquireWritableStreamDefaultWriterCode = "(function (stream) {\"use strict\";\n return new @WritableStreamDefaultWriter(stream);\n})\n"; +// closed +const JSC::ConstructAbility s_writableStreamDefaultWriterClosedCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; +const JSC::ConstructorKind s_writableStreamDefaultWriterClosedCodeConstructorKind = JSC::ConstructorKind::None; +const JSC::ImplementationVisibility s_writableStreamDefaultWriterClosedCodeImplementationVisibility = JSC::ImplementationVisibility::Public; +const int s_writableStreamDefaultWriterClosedCodeLength = 231; +static const JSC::Intrinsic s_writableStreamDefaultWriterClosedCodeIntrinsic = JSC::NoIntrinsic; +const char* const s_writableStreamDefaultWriterClosedCode = "(function () {\"use strict\";\n if (!@isWritableStreamDefaultWriter(this))\n return @Promise.@reject(@makeGetterTypeError(\"WritableStreamDefaultWriter\", \"closed\"));\n return @getByIdDirectPrivate(this, \"closedPromise\").promise;\n})\n"; -// createWritableStream -const JSC::ConstructAbility s_writableStreamInternalsCreateWritableStreamCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; -const JSC::ConstructorKind s_writableStreamInternalsCreateWritableStreamCodeConstructorKind = JSC::ConstructorKind::None; -const JSC::ImplementationVisibility s_writableStreamInternalsCreateWritableStreamCodeImplementationVisibility = JSC::ImplementationVisibility::Public; -const int s_writableStreamInternalsCreateWritableStreamCodeLength = 486; -static const JSC::Intrinsic s_writableStreamInternalsCreateWritableStreamCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_writableStreamInternalsCreateWritableStreamCode = "(function (startAlgorithm, writeAlgorithm, closeAlgorithm, abortAlgorithm, highWaterMark, sizeAlgorithm) {\"use strict\";\n const internalStream = {};\n @initializeWritableStreamSlots(internalStream, {});\n const controller = new @WritableStreamDefaultController;\n return @setUpWritableStreamDefaultController(internalStream, controller, startAlgorithm, writeAlgorithm, closeAlgorithm, abortAlgorithm, highWaterMark, sizeAlgorithm), @createWritableStreamFromInternal(internalStream);\n})\n"; +// desiredSize +const JSC::ConstructAbility s_writableStreamDefaultWriterDesiredSizeCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; +const JSC::ConstructorKind s_writableStreamDefaultWriterDesiredSizeCodeConstructorKind = JSC::ConstructorKind::None; +const JSC::ImplementationVisibility s_writableStreamDefaultWriterDesiredSizeCodeImplementationVisibility = JSC::ImplementationVisibility::Public; +const int s_writableStreamDefaultWriterDesiredSizeCodeLength = 337; +static const JSC::Intrinsic s_writableStreamDefaultWriterDesiredSizeCodeIntrinsic = JSC::NoIntrinsic; +const char* const s_writableStreamDefaultWriterDesiredSizeCode = "(function () {\"use strict\";\n if (!@isWritableStreamDefaultWriter(this))\n throw @makeThisTypeError(\"WritableStreamDefaultWriter\", \"desiredSize\");\n if (@getByIdDirectPrivate(this, \"stream\") === @undefined)\n @throwTypeError(\"WritableStreamDefaultWriter has no stream\");\n return @writableStreamDefaultWriterGetDesiredSize(this);\n})\n"; -// createInternalWritableStreamFromUnderlyingSink -const JSC::ConstructAbility s_writableStreamInternalsCreateInternalWritableStreamFromUnderlyingSinkCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; -const JSC::ConstructorKind s_writableStreamInternalsCreateInternalWritableStreamFromUnderlyingSinkCodeConstructorKind = JSC::ConstructorKind::None; -const JSC::ImplementationVisibility s_writableStreamInternalsCreateInternalWritableStreamFromUnderlyingSinkCodeImplementationVisibility = JSC::ImplementationVisibility::Public; -const int s_writableStreamInternalsCreateInternalWritableStreamFromUnderlyingSinkCodeLength = 1576; -static const JSC::Intrinsic s_writableStreamInternalsCreateInternalWritableStreamFromUnderlyingSinkCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_writableStreamInternalsCreateInternalWritableStreamFromUnderlyingSinkCode = "(function (underlyingSink, strategy) {\"use strict\";\n const stream = {};\n if (underlyingSink === @undefined)\n underlyingSink = {};\n if (strategy === @undefined)\n strategy = {};\n if (!@isObject(underlyingSink))\n @throwTypeError(\"WritableStream constructor takes an object as first argument\");\n if (\"type\" in underlyingSink)\n @throwRangeError(\"Invalid type is specified\");\n const sizeAlgorithm = @extractSizeAlgorithm(strategy), highWaterMark = @extractHighWaterMark(strategy, 1), underlyingSinkDict = {};\n if (\"start\" in underlyingSink) {\n if (underlyingSinkDict.start = underlyingSink.start, typeof underlyingSinkDict.start !== \"function\")\n @throwTypeError(\"underlyingSink.start should be a function\");\n }\n if (\"write\" in underlyingSink) {\n if (underlyingSinkDict.write = underlyingSink.write, typeof underlyingSinkDict.write !== \"function\")\n @throwTypeError(\"underlyingSink.write should be a function\");\n }\n if (\"close\" in underlyingSink) {\n if (underlyingSinkDict.close = underlyingSink.close, typeof underlyingSinkDict.close !== \"function\")\n @throwTypeError(\"underlyingSink.close should be a function\");\n }\n if (\"abort\" in underlyingSink) {\n if (underlyingSinkDict.abort = underlyingSink.abort, typeof underlyingSinkDict.abort !== \"function\")\n @throwTypeError(\"underlyingSink.abort should be a function\");\n }\n return @initializeWritableStreamSlots(stream, underlyingSink), @setUpWritableStreamDefaultControllerFromUnderlyingSink(stream, underlyingSink, underlyingSinkDict, highWaterMark, sizeAlgorithm), stream;\n})\n"; +// ready +const JSC::ConstructAbility s_writableStreamDefaultWriterReadyCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; +const JSC::ConstructorKind s_writableStreamDefaultWriterReadyCodeConstructorKind = JSC::ConstructorKind::None; +const JSC::ImplementationVisibility s_writableStreamDefaultWriterReadyCodeImplementationVisibility = JSC::ImplementationVisibility::Public; +const int s_writableStreamDefaultWriterReadyCodeLength = 227; +static const JSC::Intrinsic s_writableStreamDefaultWriterReadyCodeIntrinsic = JSC::NoIntrinsic; +const char* const s_writableStreamDefaultWriterReadyCode = "(function () {\"use strict\";\n if (!@isWritableStreamDefaultWriter(this))\n return @Promise.@reject(@makeThisTypeError(\"WritableStreamDefaultWriter\", \"ready\"));\n return @getByIdDirectPrivate(this, \"readyPromise\").promise;\n})\n"; -// initializeWritableStreamSlots -const JSC::ConstructAbility s_writableStreamInternalsInitializeWritableStreamSlotsCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; -const JSC::ConstructorKind s_writableStreamInternalsInitializeWritableStreamSlotsCodeConstructorKind = JSC::ConstructorKind::None; -const JSC::ImplementationVisibility s_writableStreamInternalsInitializeWritableStreamSlotsCodeImplementationVisibility = JSC::ImplementationVisibility::Public; -const int s_writableStreamInternalsInitializeWritableStreamSlotsCodeLength = 713; -static const JSC::Intrinsic s_writableStreamInternalsInitializeWritableStreamSlotsCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_writableStreamInternalsInitializeWritableStreamSlotsCode = "(function (stream, underlyingSink) {\"use strict\";\n @putByIdDirectPrivate(stream, \"state\", \"writable\"), @putByIdDirectPrivate(stream, \"storedError\", @undefined), @putByIdDirectPrivate(stream, \"writer\", @undefined), @putByIdDirectPrivate(stream, \"controller\", @undefined), @putByIdDirectPrivate(stream, \"inFlightWriteRequest\", @undefined), @putByIdDirectPrivate(stream, \"closeRequest\", @undefined), @putByIdDirectPrivate(stream, \"inFlightCloseRequest\", @undefined), @putByIdDirectPrivate(stream, \"pendingAbortRequest\", @undefined), @putByIdDirectPrivate(stream, \"writeRequests\", @createFIFO()), @putByIdDirectPrivate(stream, \"backpressure\", !1), @putByIdDirectPrivate(stream, \"underlyingSink\", underlyingSink);\n})\n"; +// abort +const JSC::ConstructAbility s_writableStreamDefaultWriterAbortCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; +const JSC::ConstructorKind s_writableStreamDefaultWriterAbortCodeConstructorKind = JSC::ConstructorKind::None; +const JSC::ImplementationVisibility s_writableStreamDefaultWriterAbortCodeImplementationVisibility = JSC::ImplementationVisibility::Public; +const int s_writableStreamDefaultWriterAbortCodeLength = 379; +static const JSC::Intrinsic s_writableStreamDefaultWriterAbortCodeIntrinsic = JSC::NoIntrinsic; +const char* const s_writableStreamDefaultWriterAbortCode = "(function (reason) {\"use strict\";\n if (!@isWritableStreamDefaultWriter(this))\n return @Promise.@reject(@makeThisTypeError(\"WritableStreamDefaultWriter\", \"abort\"));\n if (@getByIdDirectPrivate(this, \"stream\") === @undefined)\n return @Promise.@reject(@makeTypeError(\"WritableStreamDefaultWriter has no stream\"));\n return @writableStreamDefaultWriterAbort(this, reason);\n})\n"; -// writableStreamCloseForBindings -const JSC::ConstructAbility s_writableStreamInternalsWritableStreamCloseForBindingsCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; -const JSC::ConstructorKind s_writableStreamInternalsWritableStreamCloseForBindingsCodeConstructorKind = JSC::ConstructorKind::None; -const JSC::ImplementationVisibility s_writableStreamInternalsWritableStreamCloseForBindingsCodeImplementationVisibility = JSC::ImplementationVisibility::Public; -const int s_writableStreamInternalsWritableStreamCloseForBindingsCodeLength = 414; -static const JSC::Intrinsic s_writableStreamInternalsWritableStreamCloseForBindingsCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_writableStreamInternalsWritableStreamCloseForBindingsCode = "(function (stream) {\"use strict\";\n if (@isWritableStreamLocked(stream))\n return @Promise.@reject(@makeTypeError(\"WritableStream.close method can only be used on non locked WritableStream\"));\n if (@writableStreamCloseQueuedOrInFlight(stream))\n return @Promise.@reject(@makeTypeError(\"WritableStream.close method can only be used on a being close WritableStream\"));\n return @writableStreamClose(stream);\n})\n"; +// close +const JSC::ConstructAbility s_writableStreamDefaultWriterCloseCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; +const JSC::ConstructorKind s_writableStreamDefaultWriterCloseCodeConstructorKind = JSC::ConstructorKind::None; +const JSC::ImplementationVisibility s_writableStreamDefaultWriterCloseCodeImplementationVisibility = JSC::ImplementationVisibility::Public; +const int s_writableStreamDefaultWriterCloseCodeLength = 534; +static const JSC::Intrinsic s_writableStreamDefaultWriterCloseCodeIntrinsic = JSC::NoIntrinsic; +const char* const s_writableStreamDefaultWriterCloseCode = "(function () {\"use strict\";\n if (!@isWritableStreamDefaultWriter(this))\n return @Promise.@reject(@makeThisTypeError(\"WritableStreamDefaultWriter\", \"close\"));\n const stream = @getByIdDirectPrivate(this, \"stream\");\n if (stream === @undefined)\n return @Promise.@reject(@makeTypeError(\"WritableStreamDefaultWriter has no stream\"));\n if (@writableStreamCloseQueuedOrInFlight(stream))\n return @Promise.@reject(@makeTypeError(\"WritableStreamDefaultWriter is being closed\"));\n return @writableStreamDefaultWriterClose(this);\n})\n"; -// writableStreamAbortForBindings -const JSC::ConstructAbility s_writableStreamInternalsWritableStreamAbortForBindingsCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; -const JSC::ConstructorKind s_writableStreamInternalsWritableStreamAbortForBindingsCodeConstructorKind = JSC::ConstructorKind::None; -const JSC::ImplementationVisibility s_writableStreamInternalsWritableStreamAbortForBindingsCodeImplementationVisibility = JSC::ImplementationVisibility::Public; -const int s_writableStreamInternalsWritableStreamAbortForBindingsCodeLength = 253; -static const JSC::Intrinsic s_writableStreamInternalsWritableStreamAbortForBindingsCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_writableStreamInternalsWritableStreamAbortForBindingsCode = "(function (stream, reason) {\"use strict\";\n if (@isWritableStreamLocked(stream))\n return @Promise.@reject(@makeTypeError(\"WritableStream.abort method can only be used on non locked WritableStream\"));\n return @writableStreamAbort(stream, reason);\n})\n"; +// releaseLock +const JSC::ConstructAbility s_writableStreamDefaultWriterReleaseLockCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; +const JSC::ConstructorKind s_writableStreamDefaultWriterReleaseLockCodeConstructorKind = JSC::ConstructorKind::None; +const JSC::ImplementationVisibility s_writableStreamDefaultWriterReleaseLockCodeImplementationVisibility = JSC::ImplementationVisibility::Public; +const int s_writableStreamDefaultWriterReleaseLockCodeLength = 269; +static const JSC::Intrinsic s_writableStreamDefaultWriterReleaseLockCodeIntrinsic = JSC::NoIntrinsic; +const char* const s_writableStreamDefaultWriterReleaseLockCode = "(function () {\"use strict\";\n if (!@isWritableStreamDefaultWriter(this))\n throw @makeThisTypeError(\"WritableStreamDefaultWriter\", \"releaseLock\");\n if (@getByIdDirectPrivate(this, \"stream\") === @undefined)\n return;\n @writableStreamDefaultWriterRelease(this);\n})\n"; -// isWritableStreamLocked -const JSC::ConstructAbility s_writableStreamInternalsIsWritableStreamLockedCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; -const JSC::ConstructorKind s_writableStreamInternalsIsWritableStreamLockedCodeConstructorKind = JSC::ConstructorKind::None; -const JSC::ImplementationVisibility s_writableStreamInternalsIsWritableStreamLockedCodeImplementationVisibility = JSC::ImplementationVisibility::Public; -const int s_writableStreamInternalsIsWritableStreamLockedCodeLength = 102; -static const JSC::Intrinsic s_writableStreamInternalsIsWritableStreamLockedCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_writableStreamInternalsIsWritableStreamLockedCode = "(function (stream) {\"use strict\";\n return @getByIdDirectPrivate(stream, \"writer\") !== @undefined;\n})\n"; +// write +const JSC::ConstructAbility s_writableStreamDefaultWriterWriteCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; +const JSC::ConstructorKind s_writableStreamDefaultWriterWriteCodeConstructorKind = JSC::ConstructorKind::None; +const JSC::ImplementationVisibility s_writableStreamDefaultWriterWriteCodeImplementationVisibility = JSC::ImplementationVisibility::Public; +const int s_writableStreamDefaultWriterWriteCodeLength = 377; +static const JSC::Intrinsic s_writableStreamDefaultWriterWriteCodeIntrinsic = JSC::NoIntrinsic; +const char* const s_writableStreamDefaultWriterWriteCode = "(function (chunk) {\"use strict\";\n if (!@isWritableStreamDefaultWriter(this))\n return @Promise.@reject(@makeThisTypeError(\"WritableStreamDefaultWriter\", \"write\"));\n if (@getByIdDirectPrivate(this, \"stream\") === @undefined)\n return @Promise.@reject(@makeTypeError(\"WritableStreamDefaultWriter has no stream\"));\n return @writableStreamDefaultWriterWrite(this, chunk);\n})\n"; -// setUpWritableStreamDefaultWriter -const JSC::ConstructAbility s_writableStreamInternalsSetUpWritableStreamDefaultWriterCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; -const JSC::ConstructorKind s_writableStreamInternalsSetUpWritableStreamDefaultWriterCodeConstructorKind = JSC::ConstructorKind::None; -const JSC::ImplementationVisibility s_writableStreamInternalsSetUpWritableStreamDefaultWriterCodeImplementationVisibility = JSC::ImplementationVisibility::Public; -const int s_writableStreamInternalsSetUpWritableStreamDefaultWriterCodeLength = 1368; -static const JSC::Intrinsic s_writableStreamInternalsSetUpWritableStreamDefaultWriterCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_writableStreamInternalsSetUpWritableStreamDefaultWriterCode = "(function (writer, stream) {\"use strict\";\n if (@isWritableStreamLocked(stream))\n @throwTypeError(\"WritableStream is locked\");\n @putByIdDirectPrivate(writer, \"stream\", stream), @putByIdDirectPrivate(stream, \"writer\", writer);\n const readyPromiseCapability = @newPromiseCapability(@Promise), closedPromiseCapability = @newPromiseCapability(@Promise);\n @putByIdDirectPrivate(writer, \"readyPromise\", readyPromiseCapability), @putByIdDirectPrivate(writer, \"closedPromise\", closedPromiseCapability);\n const state = @getByIdDirectPrivate(stream, \"state\");\n if (state === \"writable\") {\n if (@writableStreamCloseQueuedOrInFlight(stream) || !@getByIdDirectPrivate(stream, \"backpressure\"))\n readyPromiseCapability.resolve.@call();\n } else if (state === \"erroring\")\n readyPromiseCapability.reject.@call(@undefined, @getByIdDirectPrivate(stream, \"storedError\")), @markPromiseAsHandled(readyPromiseCapability.promise);\n else if (state === \"closed\")\n readyPromiseCapability.resolve.@call(), closedPromiseCapability.resolve.@call();\n else {\n const storedError = @getByIdDirectPrivate(stream, \"storedError\");\n readyPromiseCapability.reject.@call(@undefined, storedError), @markPromiseAsHandled(readyPromiseCapability.promise), closedPromiseCapability.reject.@call(@undefined, storedError), @markPromiseAsHandled(closedPromiseCapability.promise);\n }\n})\n"; +#define DEFINE_BUILTIN_GENERATOR(codeName, functionName, overriddenName, argumentCount) \ +JSC::FunctionExecutable* codeName##Generator(JSC::VM& vm) \ +{\ + JSVMClientData* clientData = static_cast(vm.clientData); \ + return clientData->builtinFunctions().writableStreamDefaultWriterBuiltins().codeName##Executable()->link(vm, nullptr, clientData->builtinFunctions().writableStreamDefaultWriterBuiltins().codeName##Source(), std::nullopt, s_##codeName##Intrinsic); \ +} +WEBCORE_FOREACH_WRITABLESTREAMDEFAULTWRITER_BUILTIN_CODE(DEFINE_BUILTIN_GENERATOR) +#undef DEFINE_BUILTIN_GENERATOR -// writableStreamAbort -const JSC::ConstructAbility s_writableStreamInternalsWritableStreamAbortCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; -const JSC::ConstructorKind s_writableStreamInternalsWritableStreamAbortCodeConstructorKind = JSC::ConstructorKind::None; -const JSC::ImplementationVisibility s_writableStreamInternalsWritableStreamAbortCodeImplementationVisibility = JSC::ImplementationVisibility::Public; -const int s_writableStreamInternalsWritableStreamAbortCodeLength = 782; -static const JSC::Intrinsic s_writableStreamInternalsWritableStreamAbortCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_writableStreamInternalsWritableStreamAbortCode = "(function (stream, reason) {\"use strict\";\n const state = @getByIdDirectPrivate(stream, \"state\");\n if (state === \"closed\" || state === \"errored\")\n return @Promise.@resolve();\n const pendingAbortRequest = @getByIdDirectPrivate(stream, \"pendingAbortRequest\");\n if (pendingAbortRequest !== @undefined)\n return pendingAbortRequest.promise.promise;\n let wasAlreadyErroring = !1;\n if (state === \"erroring\")\n wasAlreadyErroring = !0, reason = @undefined;\n const abortPromiseCapability = @newPromiseCapability(@Promise);\n if (@putByIdDirectPrivate(stream, \"pendingAbortRequest\", {\n promise: abortPromiseCapability,\n reason,\n wasAlreadyErroring\n }), !wasAlreadyErroring)\n @writableStreamStartErroring(stream, reason);\n return abortPromiseCapability.promise;\n})\n"; +/* ReadableByteStreamInternals.ts */ +// privateInitializeReadableByteStreamController +const JSC::ConstructAbility s_readableByteStreamInternalsPrivateInitializeReadableByteStreamControllerCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; +const JSC::ConstructorKind s_readableByteStreamInternalsPrivateInitializeReadableByteStreamControllerCodeConstructorKind = JSC::ConstructorKind::None; +const JSC::ImplementationVisibility s_readableByteStreamInternalsPrivateInitializeReadableByteStreamControllerCodeImplementationVisibility = JSC::ImplementationVisibility::Public; +const int s_readableByteStreamInternalsPrivateInitializeReadableByteStreamControllerCodeLength = 2063; +static const JSC::Intrinsic s_readableByteStreamInternalsPrivateInitializeReadableByteStreamControllerCodeIntrinsic = JSC::NoIntrinsic; +const char* const s_readableByteStreamInternalsPrivateInitializeReadableByteStreamControllerCode = "(function (stream, underlyingByteSource, highWaterMark) {\"use strict\";\n if (!@isReadableStream(stream))\n @throwTypeError(\"ReadableByteStreamController needs a ReadableStream\");\n if (@getByIdDirectPrivate(stream, \"readableStreamController\") !== null)\n @throwTypeError(\"ReadableStream already has a controller\");\n @putByIdDirectPrivate(this, \"controlledReadableStream\", stream), @putByIdDirectPrivate(this, \"underlyingByteSource\", underlyingByteSource), @putByIdDirectPrivate(this, \"pullAgain\", !1), @putByIdDirectPrivate(this, \"pulling\", !1), @readableByteStreamControllerClearPendingPullIntos(this), @putByIdDirectPrivate(this, \"queue\", @newQueue()), @putByIdDirectPrivate(this, \"started\", 0), @putByIdDirectPrivate(this, \"closeRequested\", !1);\n let hwm = @toNumber(highWaterMark);\n if (hwm !== hwm || hwm < 0)\n @throwRangeError(\"highWaterMark value is negative or not a number\");\n @putByIdDirectPrivate(this, \"strategyHWM\", hwm);\n let autoAllocateChunkSize = underlyingByteSource.autoAllocateChunkSize;\n if (autoAllocateChunkSize !== @undefined) {\n if (autoAllocateChunkSize = @toNumber(autoAllocateChunkSize), autoAllocateChunkSize <= 0 || autoAllocateChunkSize === @Infinity || autoAllocateChunkSize === -@Infinity)\n @throwRangeError(\"autoAllocateChunkSize value is negative or equal to positive or negative infinity\");\n }\n @putByIdDirectPrivate(this, \"autoAllocateChunkSize\", autoAllocateChunkSize), @putByIdDirectPrivate(this, \"pendingPullIntos\", @createFIFO());\n const controller = this;\n return @promiseInvokeOrNoopNoCatch(@getByIdDirectPrivate(controller, \"underlyingByteSource\"), \"start\", [controller]).@then(() => {\n @putByIdDirectPrivate(controller, \"started\", 1), @readableByteStreamControllerCallPullIfNeeded(controller);\n }, (error) => {\n if (@getByIdDirectPrivate(stream, \"state\") === 4)\n @readableByteStreamControllerError(controller, error);\n }), @putByIdDirectPrivate(this, \"cancel\", @readableByteStreamControllerCancel), @putByIdDirectPrivate(this, \"pull\", @readableByteStreamControllerPull), this;\n})\n"; -// writableStreamClose -const JSC::ConstructAbility s_writableStreamInternalsWritableStreamCloseCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; -const JSC::ConstructorKind s_writableStreamInternalsWritableStreamCloseCodeConstructorKind = JSC::ConstructorKind::None; -const JSC::ImplementationVisibility s_writableStreamInternalsWritableStreamCloseCodeImplementationVisibility = JSC::ImplementationVisibility::Public; -const int s_writableStreamInternalsWritableStreamCloseCodeLength = 738; -static const JSC::Intrinsic s_writableStreamInternalsWritableStreamCloseCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_writableStreamInternalsWritableStreamCloseCode = "(function (stream) {\"use strict\";\n const state = @getByIdDirectPrivate(stream, \"state\");\n if (state === \"closed\" || state === \"errored\")\n return @Promise.@reject(@makeTypeError(\"Cannot close a writable stream that is closed or errored\"));\n const closePromiseCapability = @newPromiseCapability(@Promise);\n @putByIdDirectPrivate(stream, \"closeRequest\", closePromiseCapability);\n const writer = @getByIdDirectPrivate(stream, \"writer\");\n if (writer !== @undefined && @getByIdDirectPrivate(stream, \"backpressure\") && state === \"writable\")\n @getByIdDirectPrivate(writer, \"readyPromise\").resolve.@call();\n return @writableStreamDefaultControllerClose(@getByIdDirectPrivate(stream, \"controller\")), closePromiseCapability.promise;\n})\n"; +// readableStreamByteStreamControllerStart +const JSC::ConstructAbility s_readableByteStreamInternalsReadableStreamByteStreamControllerStartCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; +const JSC::ConstructorKind s_readableByteStreamInternalsReadableStreamByteStreamControllerStartCodeConstructorKind = JSC::ConstructorKind::None; +const JSC::ImplementationVisibility s_readableByteStreamInternalsReadableStreamByteStreamControllerStartCodeImplementationVisibility = JSC::ImplementationVisibility::Public; +const int s_readableByteStreamInternalsReadableStreamByteStreamControllerStartCodeLength = 99; +static const JSC::Intrinsic s_readableByteStreamInternalsReadableStreamByteStreamControllerStartCodeIntrinsic = JSC::NoIntrinsic; +const char* const s_readableByteStreamInternalsReadableStreamByteStreamControllerStartCode = "(function (controller) {\"use strict\";\n @putByIdDirectPrivate(controller, \"start\", @undefined);\n})\n"; -// writableStreamAddWriteRequest -const JSC::ConstructAbility s_writableStreamInternalsWritableStreamAddWriteRequestCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; -const JSC::ConstructorKind s_writableStreamInternalsWritableStreamAddWriteRequestCodeConstructorKind = JSC::ConstructorKind::None; -const JSC::ImplementationVisibility s_writableStreamInternalsWritableStreamAddWriteRequestCodeImplementationVisibility = JSC::ImplementationVisibility::Public; -const int s_writableStreamInternalsWritableStreamAddWriteRequestCodeLength = 221; -static const JSC::Intrinsic s_writableStreamInternalsWritableStreamAddWriteRequestCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_writableStreamInternalsWritableStreamAddWriteRequestCode = "(function (stream) {\"use strict\";\n const writePromiseCapability = @newPromiseCapability(@Promise);\n return @getByIdDirectPrivate(stream, \"writeRequests\").push(writePromiseCapability), writePromiseCapability.promise;\n})\n"; +// privateInitializeReadableStreamBYOBRequest +const JSC::ConstructAbility s_readableByteStreamInternalsPrivateInitializeReadableStreamBYOBRequestCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; +const JSC::ConstructorKind s_readableByteStreamInternalsPrivateInitializeReadableStreamBYOBRequestCodeConstructorKind = JSC::ConstructorKind::None; +const JSC::ImplementationVisibility s_readableByteStreamInternalsPrivateInitializeReadableStreamBYOBRequestCodeImplementationVisibility = JSC::ImplementationVisibility::Public; +const int s_readableByteStreamInternalsPrivateInitializeReadableStreamBYOBRequestCodeLength = 175; +static const JSC::Intrinsic s_readableByteStreamInternalsPrivateInitializeReadableStreamBYOBRequestCodeIntrinsic = JSC::NoIntrinsic; +const char* const s_readableByteStreamInternalsPrivateInitializeReadableStreamBYOBRequestCode = "(function (controller, view) {\"use strict\";\n @putByIdDirectPrivate(this, \"associatedReadableByteStreamController\", controller), @putByIdDirectPrivate(this, \"view\", view);\n})\n"; -// writableStreamCloseQueuedOrInFlight -const JSC::ConstructAbility s_writableStreamInternalsWritableStreamCloseQueuedOrInFlightCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; -const JSC::ConstructorKind s_writableStreamInternalsWritableStreamCloseQueuedOrInFlightCodeConstructorKind = JSC::ConstructorKind::None; -const JSC::ImplementationVisibility s_writableStreamInternalsWritableStreamCloseQueuedOrInFlightCodeImplementationVisibility = JSC::ImplementationVisibility::Public; -const int s_writableStreamInternalsWritableStreamCloseQueuedOrInFlightCodeLength = 180; -static const JSC::Intrinsic s_writableStreamInternalsWritableStreamCloseQueuedOrInFlightCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_writableStreamInternalsWritableStreamCloseQueuedOrInFlightCode = "(function (stream) {\"use strict\";\n return @getByIdDirectPrivate(stream, \"closeRequest\") !== @undefined || @getByIdDirectPrivate(stream, \"inFlightCloseRequest\") !== @undefined;\n})\n"; +// isReadableByteStreamController +const JSC::ConstructAbility s_readableByteStreamInternalsIsReadableByteStreamControllerCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; +const JSC::ConstructorKind s_readableByteStreamInternalsIsReadableByteStreamControllerCodeConstructorKind = JSC::ConstructorKind::None; +const JSC::ImplementationVisibility s_readableByteStreamInternalsIsReadableByteStreamControllerCodeImplementationVisibility = JSC::ImplementationVisibility::Public; +const int s_readableByteStreamInternalsIsReadableByteStreamControllerCodeLength = 136; +static const JSC::Intrinsic s_readableByteStreamInternalsIsReadableByteStreamControllerCodeIntrinsic = JSC::NoIntrinsic; +const char* const s_readableByteStreamInternalsIsReadableByteStreamControllerCode = "(function (controller) {\"use strict\";\n return @isObject(controller) && !!@getByIdDirectPrivate(controller, \"underlyingByteSource\");\n})\n"; -// writableStreamDealWithRejection -const JSC::ConstructAbility s_writableStreamInternalsWritableStreamDealWithRejectionCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; -const JSC::ConstructorKind s_writableStreamInternalsWritableStreamDealWithRejectionCodeConstructorKind = JSC::ConstructorKind::None; -const JSC::ImplementationVisibility s_writableStreamInternalsWritableStreamDealWithRejectionCodeImplementationVisibility = JSC::ImplementationVisibility::Public; -const int s_writableStreamInternalsWritableStreamDealWithRejectionCodeLength = 213; -static const JSC::Intrinsic s_writableStreamInternalsWritableStreamDealWithRejectionCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_writableStreamInternalsWritableStreamDealWithRejectionCode = "(function (stream, error) {\"use strict\";\n if (@getByIdDirectPrivate(stream, \"state\") === \"writable\") {\n @writableStreamStartErroring(stream, error);\n return;\n }\n @writableStreamFinishErroring(stream);\n})\n"; +// isReadableStreamBYOBRequest +const JSC::ConstructAbility s_readableByteStreamInternalsIsReadableStreamBYOBRequestCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; +const JSC::ConstructorKind s_readableByteStreamInternalsIsReadableStreamBYOBRequestCodeConstructorKind = JSC::ConstructorKind::None; +const JSC::ImplementationVisibility s_readableByteStreamInternalsIsReadableStreamBYOBRequestCodeImplementationVisibility = JSC::ImplementationVisibility::Public; +const int s_readableByteStreamInternalsIsReadableStreamBYOBRequestCodeLength = 157; +static const JSC::Intrinsic s_readableByteStreamInternalsIsReadableStreamBYOBRequestCodeIntrinsic = JSC::NoIntrinsic; +const char* const s_readableByteStreamInternalsIsReadableStreamBYOBRequestCode = "(function (byobRequest) {\"use strict\";\n return @isObject(byobRequest) && !!@getByIdDirectPrivate(byobRequest, \"associatedReadableByteStreamController\");\n})\n"; -// writableStreamFinishErroring -const JSC::ConstructAbility s_writableStreamInternalsWritableStreamFinishErroringCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; -const JSC::ConstructorKind s_writableStreamInternalsWritableStreamFinishErroringCodeConstructorKind = JSC::ConstructorKind::None; -const JSC::ImplementationVisibility s_writableStreamInternalsWritableStreamFinishErroringCodeImplementationVisibility = JSC::ImplementationVisibility::Public; -const int s_writableStreamInternalsWritableStreamFinishErroringCodeLength = 1323; -static const JSC::Intrinsic s_writableStreamInternalsWritableStreamFinishErroringCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_writableStreamInternalsWritableStreamFinishErroringCode = "(function (stream) {\"use strict\";\n @putByIdDirectPrivate(stream, \"state\", \"errored\");\n const controller = @getByIdDirectPrivate(stream, \"controller\");\n @getByIdDirectPrivate(controller, \"errorSteps\").@call();\n const storedError = @getByIdDirectPrivate(stream, \"storedError\"), requests = @getByIdDirectPrivate(stream, \"writeRequests\");\n for (var request = requests.shift();request; request = requests.shift())\n request.reject.@call(@undefined, storedError);\n @putByIdDirectPrivate(stream, \"writeRequests\", @createFIFO());\n const abortRequest = @getByIdDirectPrivate(stream, \"pendingAbortRequest\");\n if (abortRequest === @undefined) {\n @writableStreamRejectCloseAndClosedPromiseIfNeeded(stream);\n return;\n }\n if (@putByIdDirectPrivate(stream, \"pendingAbortRequest\", @undefined), abortRequest.wasAlreadyErroring) {\n abortRequest.promise.reject.@call(@undefined, storedError), @writableStreamRejectCloseAndClosedPromiseIfNeeded(stream);\n return;\n }\n @getByIdDirectPrivate(controller, \"abortSteps\").@call(@undefined, abortRequest.reason).@then(() => {\n abortRequest.promise.resolve.@call(), @writableStreamRejectCloseAndClosedPromiseIfNeeded(stream);\n }, (reason) => {\n abortRequest.promise.reject.@call(@undefined, reason), @writableStreamRejectCloseAndClosedPromiseIfNeeded(stream);\n });\n})\n"; - -// writableStreamFinishInFlightClose -const JSC::ConstructAbility s_writableStreamInternalsWritableStreamFinishInFlightCloseCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; -const JSC::ConstructorKind s_writableStreamInternalsWritableStreamFinishInFlightCloseCodeConstructorKind = JSC::ConstructorKind::None; -const JSC::ImplementationVisibility s_writableStreamInternalsWritableStreamFinishInFlightCloseCodeImplementationVisibility = JSC::ImplementationVisibility::Public; -const int s_writableStreamInternalsWritableStreamFinishInFlightCloseCodeLength = 737; -static const JSC::Intrinsic s_writableStreamInternalsWritableStreamFinishInFlightCloseCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_writableStreamInternalsWritableStreamFinishInFlightCloseCode = "(function (stream) {\"use strict\";\n if (@getByIdDirectPrivate(stream, \"inFlightCloseRequest\").resolve.@call(), @putByIdDirectPrivate(stream, \"inFlightCloseRequest\", @undefined), @getByIdDirectPrivate(stream, \"state\") === \"erroring\") {\n @putByIdDirectPrivate(stream, \"storedError\", @undefined);\n const abortRequest = @getByIdDirectPrivate(stream, \"pendingAbortRequest\");\n if (abortRequest !== @undefined)\n abortRequest.promise.resolve.@call(), @putByIdDirectPrivate(stream, \"pendingAbortRequest\", @undefined);\n }\n @putByIdDirectPrivate(stream, \"state\", \"closed\");\n const writer = @getByIdDirectPrivate(stream, \"writer\");\n if (writer !== @undefined)\n @getByIdDirectPrivate(writer, \"closedPromise\").resolve.@call();\n})\n"; - -// writableStreamFinishInFlightCloseWithError -const JSC::ConstructAbility s_writableStreamInternalsWritableStreamFinishInFlightCloseWithErrorCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; -const JSC::ConstructorKind s_writableStreamInternalsWritableStreamFinishInFlightCloseWithErrorCodeConstructorKind = JSC::ConstructorKind::None; -const JSC::ImplementationVisibility s_writableStreamInternalsWritableStreamFinishInFlightCloseWithErrorCodeImplementationVisibility = JSC::ImplementationVisibility::Public; -const int s_writableStreamInternalsWritableStreamFinishInFlightCloseWithErrorCodeLength = 535; -static const JSC::Intrinsic s_writableStreamInternalsWritableStreamFinishInFlightCloseWithErrorCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_writableStreamInternalsWritableStreamFinishInFlightCloseWithErrorCode = "(function (stream, error) {\"use strict\";\n @getByIdDirectPrivate(stream, \"inFlightCloseRequest\").reject.@call(@undefined, error), @putByIdDirectPrivate(stream, \"inFlightCloseRequest\", @undefined);\n const state = @getByIdDirectPrivate(stream, \"state\"), abortRequest = @getByIdDirectPrivate(stream, \"pendingAbortRequest\");\n if (abortRequest !== @undefined)\n abortRequest.promise.reject.@call(@undefined, error), @putByIdDirectPrivate(stream, \"pendingAbortRequest\", @undefined);\n @writableStreamDealWithRejection(stream, error);\n})\n"; - -// writableStreamFinishInFlightWrite -const JSC::ConstructAbility s_writableStreamInternalsWritableStreamFinishInFlightWriteCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; -const JSC::ConstructorKind s_writableStreamInternalsWritableStreamFinishInFlightWriteCodeConstructorKind = JSC::ConstructorKind::None; -const JSC::ImplementationVisibility s_writableStreamInternalsWritableStreamFinishInFlightWriteCodeImplementationVisibility = JSC::ImplementationVisibility::Public; -const int s_writableStreamInternalsWritableStreamFinishInFlightWriteCodeLength = 177; -static const JSC::Intrinsic s_writableStreamInternalsWritableStreamFinishInFlightWriteCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_writableStreamInternalsWritableStreamFinishInFlightWriteCode = "(function (stream) {\"use strict\";\n @getByIdDirectPrivate(stream, \"inFlightWriteRequest\").resolve.@call(), @putByIdDirectPrivate(stream, \"inFlightWriteRequest\", @undefined);\n})\n"; +// isReadableStreamBYOBReader +const JSC::ConstructAbility s_readableByteStreamInternalsIsReadableStreamBYOBReaderCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; +const JSC::ConstructorKind s_readableByteStreamInternalsIsReadableStreamBYOBReaderCodeConstructorKind = JSC::ConstructorKind::None; +const JSC::ImplementationVisibility s_readableByteStreamInternalsIsReadableStreamBYOBReaderCodeImplementationVisibility = JSC::ImplementationVisibility::Public; +const int s_readableByteStreamInternalsIsReadableStreamBYOBReaderCodeLength = 120; +static const JSC::Intrinsic s_readableByteStreamInternalsIsReadableStreamBYOBReaderCodeIntrinsic = JSC::NoIntrinsic; +const char* const s_readableByteStreamInternalsIsReadableStreamBYOBReaderCode = "(function (reader) {\"use strict\";\n return @isObject(reader) && !!@getByIdDirectPrivate(reader, \"readIntoRequests\");\n})\n"; -// writableStreamFinishInFlightWriteWithError -const JSC::ConstructAbility s_writableStreamInternalsWritableStreamFinishInFlightWriteWithErrorCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; -const JSC::ConstructorKind s_writableStreamInternalsWritableStreamFinishInFlightWriteWithErrorCodeConstructorKind = JSC::ConstructorKind::None; -const JSC::ImplementationVisibility s_writableStreamInternalsWritableStreamFinishInFlightWriteWithErrorCodeImplementationVisibility = JSC::ImplementationVisibility::Public; -const int s_writableStreamInternalsWritableStreamFinishInFlightWriteWithErrorCodeLength = 307; -static const JSC::Intrinsic s_writableStreamInternalsWritableStreamFinishInFlightWriteWithErrorCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_writableStreamInternalsWritableStreamFinishInFlightWriteWithErrorCode = "(function (stream, error) {\"use strict\";\n @getByIdDirectPrivate(stream, \"inFlightWriteRequest\").reject.@call(@undefined, error), @putByIdDirectPrivate(stream, \"inFlightWriteRequest\", @undefined);\n const state = @getByIdDirectPrivate(stream, \"state\");\n @writableStreamDealWithRejection(stream, error);\n})\n"; +// readableByteStreamControllerCancel +const JSC::ConstructAbility s_readableByteStreamInternalsReadableByteStreamControllerCancelCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; +const JSC::ConstructorKind s_readableByteStreamInternalsReadableByteStreamControllerCancelCodeConstructorKind = JSC::ConstructorKind::None; +const JSC::ImplementationVisibility s_readableByteStreamInternalsReadableByteStreamControllerCancelCodeImplementationVisibility = JSC::ImplementationVisibility::Public; +const int s_readableByteStreamInternalsReadableByteStreamControllerCancelCodeLength = 369; +static const JSC::Intrinsic s_readableByteStreamInternalsReadableByteStreamControllerCancelCodeIntrinsic = JSC::NoIntrinsic; +const char* const s_readableByteStreamInternalsReadableByteStreamControllerCancelCode = "(function (controller, reason) {\"use strict\";\n var pendingPullIntos = @getByIdDirectPrivate(controller, \"pendingPullIntos\"), first = pendingPullIntos.peek();\n if (first)\n first.bytesFilled = 0;\n return @putByIdDirectPrivate(controller, \"queue\", @newQueue()), @promiseInvokeOrNoop(@getByIdDirectPrivate(controller, \"underlyingByteSource\"), \"cancel\", [reason]);\n})\n"; -// writableStreamHasOperationMarkedInFlight -const JSC::ConstructAbility s_writableStreamInternalsWritableStreamHasOperationMarkedInFlightCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; -const JSC::ConstructorKind s_writableStreamInternalsWritableStreamHasOperationMarkedInFlightCodeConstructorKind = JSC::ConstructorKind::None; -const JSC::ImplementationVisibility s_writableStreamInternalsWritableStreamHasOperationMarkedInFlightCodeImplementationVisibility = JSC::ImplementationVisibility::Public; -const int s_writableStreamInternalsWritableStreamHasOperationMarkedInFlightCodeLength = 188; -static const JSC::Intrinsic s_writableStreamInternalsWritableStreamHasOperationMarkedInFlightCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_writableStreamInternalsWritableStreamHasOperationMarkedInFlightCode = "(function (stream) {\"use strict\";\n return @getByIdDirectPrivate(stream, \"inFlightWriteRequest\") !== @undefined || @getByIdDirectPrivate(stream, \"inFlightCloseRequest\") !== @undefined;\n})\n"; +// readableByteStreamControllerError +const JSC::ConstructAbility s_readableByteStreamInternalsReadableByteStreamControllerErrorCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; +const JSC::ConstructorKind s_readableByteStreamInternalsReadableByteStreamControllerErrorCodeConstructorKind = JSC::ConstructorKind::None; +const JSC::ImplementationVisibility s_readableByteStreamInternalsReadableByteStreamControllerErrorCodeImplementationVisibility = JSC::ImplementationVisibility::Public; +const int s_readableByteStreamInternalsReadableByteStreamControllerErrorCodeLength = 255; +static const JSC::Intrinsic s_readableByteStreamInternalsReadableByteStreamControllerErrorCodeIntrinsic = JSC::NoIntrinsic; +const char* const s_readableByteStreamInternalsReadableByteStreamControllerErrorCode = "(function (controller, e) {\"use strict\";\n @readableByteStreamControllerClearPendingPullIntos(controller), @putByIdDirectPrivate(controller, \"queue\", @newQueue()), @readableStreamError(@getByIdDirectPrivate(controller, \"controlledReadableStream\"), e);\n})\n"; -// writableStreamMarkCloseRequestInFlight -const JSC::ConstructAbility s_writableStreamInternalsWritableStreamMarkCloseRequestInFlightCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; -const JSC::ConstructorKind s_writableStreamInternalsWritableStreamMarkCloseRequestInFlightCodeConstructorKind = JSC::ConstructorKind::None; -const JSC::ImplementationVisibility s_writableStreamInternalsWritableStreamMarkCloseRequestInFlightCodeImplementationVisibility = JSC::ImplementationVisibility::Public; -const int s_writableStreamInternalsWritableStreamMarkCloseRequestInFlightCodeLength = 237; -static const JSC::Intrinsic s_writableStreamInternalsWritableStreamMarkCloseRequestInFlightCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_writableStreamInternalsWritableStreamMarkCloseRequestInFlightCode = "(function (stream) {\"use strict\";\n const closeRequest = @getByIdDirectPrivate(stream, \"closeRequest\");\n @putByIdDirectPrivate(stream, \"inFlightCloseRequest\", closeRequest), @putByIdDirectPrivate(stream, \"closeRequest\", @undefined);\n})\n"; +// readableByteStreamControllerClose +const JSC::ConstructAbility s_readableByteStreamInternalsReadableByteStreamControllerCloseCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; +const JSC::ConstructorKind s_readableByteStreamInternalsReadableByteStreamControllerCloseCodeConstructorKind = JSC::ConstructorKind::None; +const JSC::ImplementationVisibility s_readableByteStreamInternalsReadableByteStreamControllerCloseCodeImplementationVisibility = JSC::ImplementationVisibility::Public; +const int s_readableByteStreamInternalsReadableByteStreamControllerCloseCodeLength = 551; +static const JSC::Intrinsic s_readableByteStreamInternalsReadableByteStreamControllerCloseCodeIntrinsic = JSC::NoIntrinsic; +const char* const s_readableByteStreamInternalsReadableByteStreamControllerCloseCode = "(function (controller) {\"use strict\";\n if (@getByIdDirectPrivate(controller, \"queue\").size > 0) {\n @putByIdDirectPrivate(controller, \"closeRequested\", !0);\n return;\n }\n var first = @getByIdDirectPrivate(controller, \"pendingPullIntos\")\?.peek();\n if (first) {\n if (first.bytesFilled > 0) {\n const e = @makeTypeError(\"Close requested while there remain pending bytes\");\n throw @readableByteStreamControllerError(controller, e), e;\n }\n }\n @readableStreamClose(@getByIdDirectPrivate(controller, \"controlledReadableStream\"));\n})\n"; -// writableStreamMarkFirstWriteRequestInFlight -const JSC::ConstructAbility s_writableStreamInternalsWritableStreamMarkFirstWriteRequestInFlightCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; -const JSC::ConstructorKind s_writableStreamInternalsWritableStreamMarkFirstWriteRequestInFlightCodeConstructorKind = JSC::ConstructorKind::None; -const JSC::ImplementationVisibility s_writableStreamInternalsWritableStreamMarkFirstWriteRequestInFlightCodeImplementationVisibility = JSC::ImplementationVisibility::Public; -const int s_writableStreamInternalsWritableStreamMarkFirstWriteRequestInFlightCodeLength = 187; -static const JSC::Intrinsic s_writableStreamInternalsWritableStreamMarkFirstWriteRequestInFlightCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_writableStreamInternalsWritableStreamMarkFirstWriteRequestInFlightCode = "(function (stream) {\"use strict\";\n const writeRequest = @getByIdDirectPrivate(stream, \"writeRequests\").shift();\n @putByIdDirectPrivate(stream, \"inFlightWriteRequest\", writeRequest);\n})\n"; +// readableByteStreamControllerClearPendingPullIntos +const JSC::ConstructAbility s_readableByteStreamInternalsReadableByteStreamControllerClearPendingPullIntosCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; +const JSC::ConstructorKind s_readableByteStreamInternalsReadableByteStreamControllerClearPendingPullIntosCodeConstructorKind = JSC::ConstructorKind::None; +const JSC::ImplementationVisibility s_readableByteStreamInternalsReadableByteStreamControllerClearPendingPullIntosCodeImplementationVisibility = JSC::ImplementationVisibility::Public; +const int s_readableByteStreamInternalsReadableByteStreamControllerClearPendingPullIntosCodeLength = 313; +static const JSC::Intrinsic s_readableByteStreamInternalsReadableByteStreamControllerClearPendingPullIntosCodeIntrinsic = JSC::NoIntrinsic; +const char* const s_readableByteStreamInternalsReadableByteStreamControllerClearPendingPullIntosCode = "(function (controller) {\"use strict\";\n @readableByteStreamControllerInvalidateBYOBRequest(controller);\n var existing = @getByIdDirectPrivate(controller, \"pendingPullIntos\");\n if (existing !== @undefined)\n existing.clear();\n else\n @putByIdDirectPrivate(controller, \"pendingPullIntos\", @createFIFO());\n})\n"; -// writableStreamRejectCloseAndClosedPromiseIfNeeded -const JSC::ConstructAbility s_writableStreamInternalsWritableStreamRejectCloseAndClosedPromiseIfNeededCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; -const JSC::ConstructorKind s_writableStreamInternalsWritableStreamRejectCloseAndClosedPromiseIfNeededCodeConstructorKind = JSC::ConstructorKind::None; -const JSC::ImplementationVisibility s_writableStreamInternalsWritableStreamRejectCloseAndClosedPromiseIfNeededCodeImplementationVisibility = JSC::ImplementationVisibility::Public; -const int s_writableStreamInternalsWritableStreamRejectCloseAndClosedPromiseIfNeededCodeLength = 587; -static const JSC::Intrinsic s_writableStreamInternalsWritableStreamRejectCloseAndClosedPromiseIfNeededCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_writableStreamInternalsWritableStreamRejectCloseAndClosedPromiseIfNeededCode = "(function (stream) {\"use strict\";\n const storedError = @getByIdDirectPrivate(stream, \"storedError\"), closeRequest = @getByIdDirectPrivate(stream, \"closeRequest\");\n if (closeRequest !== @undefined)\n closeRequest.reject.@call(@undefined, storedError), @putByIdDirectPrivate(stream, \"closeRequest\", @undefined);\n const writer = @getByIdDirectPrivate(stream, \"writer\");\n if (writer !== @undefined) {\n const closedPromise = @getByIdDirectPrivate(writer, \"closedPromise\");\n closedPromise.reject.@call(@undefined, storedError), @markPromiseAsHandled(closedPromise.promise);\n }\n})\n"; +// readableByteStreamControllerGetDesiredSize +const JSC::ConstructAbility s_readableByteStreamInternalsReadableByteStreamControllerGetDesiredSizeCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; +const JSC::ConstructorKind s_readableByteStreamInternalsReadableByteStreamControllerGetDesiredSizeCodeConstructorKind = JSC::ConstructorKind::None; +const JSC::ImplementationVisibility s_readableByteStreamInternalsReadableByteStreamControllerGetDesiredSizeCodeImplementationVisibility = JSC::ImplementationVisibility::Public; +const int s_readableByteStreamInternalsReadableByteStreamControllerGetDesiredSizeCodeLength = 347; +static const JSC::Intrinsic s_readableByteStreamInternalsReadableByteStreamControllerGetDesiredSizeCodeIntrinsic = JSC::NoIntrinsic; +const char* const s_readableByteStreamInternalsReadableByteStreamControllerGetDesiredSizeCode = "(function (controller) {\"use strict\";\n const stream = @getByIdDirectPrivate(controller, \"controlledReadableStream\"), state = @getByIdDirectPrivate(stream, \"state\");\n if (state === 3)\n return null;\n if (state === 1)\n return 0;\n return @getByIdDirectPrivate(controller, \"strategyHWM\") - @getByIdDirectPrivate(controller, \"queue\").size;\n})\n"; -// writableStreamStartErroring -const JSC::ConstructAbility s_writableStreamInternalsWritableStreamStartErroringCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; -const JSC::ConstructorKind s_writableStreamInternalsWritableStreamStartErroringCodeConstructorKind = JSC::ConstructorKind::None; -const JSC::ImplementationVisibility s_writableStreamInternalsWritableStreamStartErroringCodeImplementationVisibility = JSC::ImplementationVisibility::Public; -const int s_writableStreamInternalsWritableStreamStartErroringCodeLength = 537; -static const JSC::Intrinsic s_writableStreamInternalsWritableStreamStartErroringCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_writableStreamInternalsWritableStreamStartErroringCode = "(function (stream, reason) {\"use strict\";\n const controller = @getByIdDirectPrivate(stream, \"controller\");\n @putByIdDirectPrivate(stream, \"state\", \"erroring\"), @putByIdDirectPrivate(stream, \"storedError\", reason);\n const writer = @getByIdDirectPrivate(stream, \"writer\");\n if (writer !== @undefined)\n @writableStreamDefaultWriterEnsureReadyPromiseRejected(writer, reason);\n if (!@writableStreamHasOperationMarkedInFlight(stream) && @getByIdDirectPrivate(controller, \"started\") === 1)\n @writableStreamFinishErroring(stream);\n})\n"; +// readableStreamHasBYOBReader +const JSC::ConstructAbility s_readableByteStreamInternalsReadableStreamHasBYOBReaderCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; +const JSC::ConstructorKind s_readableByteStreamInternalsReadableStreamHasBYOBReaderCodeConstructorKind = JSC::ConstructorKind::None; +const JSC::ImplementationVisibility s_readableByteStreamInternalsReadableStreamHasBYOBReaderCodeImplementationVisibility = JSC::ImplementationVisibility::Public; +const int s_readableByteStreamInternalsReadableStreamHasBYOBReaderCodeLength = 166; +static const JSC::Intrinsic s_readableByteStreamInternalsReadableStreamHasBYOBReaderCodeIntrinsic = JSC::NoIntrinsic; +const char* const s_readableByteStreamInternalsReadableStreamHasBYOBReaderCode = "(function (stream) {\"use strict\";\n const reader = @getByIdDirectPrivate(stream, \"reader\");\n return reader !== @undefined && @isReadableStreamBYOBReader(reader);\n})\n"; -// writableStreamUpdateBackpressure -const JSC::ConstructAbility s_writableStreamInternalsWritableStreamUpdateBackpressureCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; -const JSC::ConstructorKind s_writableStreamInternalsWritableStreamUpdateBackpressureCodeConstructorKind = JSC::ConstructorKind::None; -const JSC::ImplementationVisibility s_writableStreamInternalsWritableStreamUpdateBackpressureCodeImplementationVisibility = JSC::ImplementationVisibility::Public; -const int s_writableStreamInternalsWritableStreamUpdateBackpressureCodeLength = 453; -static const JSC::Intrinsic s_writableStreamInternalsWritableStreamUpdateBackpressureCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_writableStreamInternalsWritableStreamUpdateBackpressureCode = "(function (stream, backpressure) {\"use strict\";\n const writer = @getByIdDirectPrivate(stream, \"writer\");\n if (writer !== @undefined && backpressure !== @getByIdDirectPrivate(stream, \"backpressure\"))\n if (backpressure)\n @putByIdDirectPrivate(writer, \"readyPromise\", @newPromiseCapability(@Promise));\n else\n @getByIdDirectPrivate(writer, \"readyPromise\").resolve.@call();\n @putByIdDirectPrivate(stream, \"backpressure\", backpressure);\n})\n"; +// readableStreamHasDefaultReader +const JSC::ConstructAbility s_readableByteStreamInternalsReadableStreamHasDefaultReaderCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; +const JSC::ConstructorKind s_readableByteStreamInternalsReadableStreamHasDefaultReaderCodeConstructorKind = JSC::ConstructorKind::None; +const JSC::ImplementationVisibility s_readableByteStreamInternalsReadableStreamHasDefaultReaderCodeImplementationVisibility = JSC::ImplementationVisibility::Public; +const int s_readableByteStreamInternalsReadableStreamHasDefaultReaderCodeLength = 169; +static const JSC::Intrinsic s_readableByteStreamInternalsReadableStreamHasDefaultReaderCodeIntrinsic = JSC::NoIntrinsic; +const char* const s_readableByteStreamInternalsReadableStreamHasDefaultReaderCode = "(function (stream) {\"use strict\";\n const reader = @getByIdDirectPrivate(stream, \"reader\");\n return reader !== @undefined && @isReadableStreamDefaultReader(reader);\n})\n"; -// writableStreamDefaultWriterAbort -const JSC::ConstructAbility s_writableStreamInternalsWritableStreamDefaultWriterAbortCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; -const JSC::ConstructorKind s_writableStreamInternalsWritableStreamDefaultWriterAbortCodeConstructorKind = JSC::ConstructorKind::None; -const JSC::ImplementationVisibility s_writableStreamInternalsWritableStreamDefaultWriterAbortCodeImplementationVisibility = JSC::ImplementationVisibility::Public; -const int s_writableStreamInternalsWritableStreamDefaultWriterAbortCodeLength = 150; -static const JSC::Intrinsic s_writableStreamInternalsWritableStreamDefaultWriterAbortCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_writableStreamInternalsWritableStreamDefaultWriterAbortCode = "(function (writer, reason) {\"use strict\";\n const stream = @getByIdDirectPrivate(writer, \"stream\");\n return @writableStreamAbort(stream, reason);\n})\n"; +// readableByteStreamControllerHandleQueueDrain +const JSC::ConstructAbility s_readableByteStreamInternalsReadableByteStreamControllerHandleQueueDrainCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; +const JSC::ConstructorKind s_readableByteStreamInternalsReadableByteStreamControllerHandleQueueDrainCodeConstructorKind = JSC::ConstructorKind::None; +const JSC::ImplementationVisibility s_readableByteStreamInternalsReadableByteStreamControllerHandleQueueDrainCodeImplementationVisibility = JSC::ImplementationVisibility::Public; +const int s_readableByteStreamInternalsReadableByteStreamControllerHandleQueueDrainCodeLength = 311; +static const JSC::Intrinsic s_readableByteStreamInternalsReadableByteStreamControllerHandleQueueDrainCodeIntrinsic = JSC::NoIntrinsic; +const char* const s_readableByteStreamInternalsReadableByteStreamControllerHandleQueueDrainCode = "(function (controller) {\"use strict\";\n if (!@getByIdDirectPrivate(controller, \"queue\").size && @getByIdDirectPrivate(controller, \"closeRequested\"))\n @readableStreamClose(@getByIdDirectPrivate(controller, \"controlledReadableStream\"));\n else\n @readableByteStreamControllerCallPullIfNeeded(controller);\n})\n"; -// writableStreamDefaultWriterClose -const JSC::ConstructAbility s_writableStreamInternalsWritableStreamDefaultWriterCloseCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; -const JSC::ConstructorKind s_writableStreamInternalsWritableStreamDefaultWriterCloseCodeConstructorKind = JSC::ConstructorKind::None; -const JSC::ImplementationVisibility s_writableStreamInternalsWritableStreamDefaultWriterCloseCodeImplementationVisibility = JSC::ImplementationVisibility::Public; -const int s_writableStreamInternalsWritableStreamDefaultWriterCloseCodeLength = 134; -static const JSC::Intrinsic s_writableStreamInternalsWritableStreamDefaultWriterCloseCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_writableStreamInternalsWritableStreamDefaultWriterCloseCode = "(function (writer) {\"use strict\";\n const stream = @getByIdDirectPrivate(writer, \"stream\");\n return @writableStreamClose(stream);\n})\n"; +// readableByteStreamControllerPull +const JSC::ConstructAbility s_readableByteStreamInternalsReadableByteStreamControllerPullCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; +const JSC::ConstructorKind s_readableByteStreamInternalsReadableByteStreamControllerPullCodeConstructorKind = JSC::ConstructorKind::None; +const JSC::ImplementationVisibility s_readableByteStreamInternalsReadableByteStreamControllerPullCodeImplementationVisibility = JSC::ImplementationVisibility::Public; +const int s_readableByteStreamInternalsReadableByteStreamControllerPullCodeLength = 1397; +static const JSC::Intrinsic s_readableByteStreamInternalsReadableByteStreamControllerPullCodeIntrinsic = JSC::NoIntrinsic; +const char* const s_readableByteStreamInternalsReadableByteStreamControllerPullCode = "(function (controller) {\"use strict\";\n const stream = @getByIdDirectPrivate(controller, \"controlledReadableStream\");\n if (@getByIdDirectPrivate(controller, \"queue\").content\?.isNotEmpty()) {\n const entry = @getByIdDirectPrivate(controller, \"queue\").content.shift();\n @getByIdDirectPrivate(controller, \"queue\").size -= entry.byteLength, @readableByteStreamControllerHandleQueueDrain(controller);\n let view;\n try {\n view = new @Uint8Array(entry.buffer, entry.byteOffset, entry.byteLength);\n } catch (error) {\n return @Promise.@reject(error);\n }\n return @createFulfilledPromise({ value: view, done: !1 });\n }\n if (@getByIdDirectPrivate(controller, \"autoAllocateChunkSize\") !== @undefined) {\n let buffer;\n try {\n buffer = @createUninitializedArrayBuffer(@getByIdDirectPrivate(controller, \"autoAllocateChunkSize\"));\n } catch (error) {\n return @Promise.@reject(error);\n }\n const pullIntoDescriptor = {\n buffer,\n byteOffset: 0,\n byteLength: @getByIdDirectPrivate(controller, \"autoAllocateChunkSize\"),\n bytesFilled: 0,\n elementSize: 1,\n ctor: @Uint8Array,\n readerType: \"default\"\n };\n @getByIdDirectPrivate(controller, \"pendingPullIntos\").push(pullIntoDescriptor);\n }\n const promise = @readableStreamAddReadRequest(stream);\n return @readableByteStreamControllerCallPullIfNeeded(controller), promise;\n})\n"; -// writableStreamDefaultWriterCloseWithErrorPropagation -const JSC::ConstructAbility s_writableStreamInternalsWritableStreamDefaultWriterCloseWithErrorPropagationCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; -const JSC::ConstructorKind s_writableStreamInternalsWritableStreamDefaultWriterCloseWithErrorPropagationCodeConstructorKind = JSC::ConstructorKind::None; -const JSC::ImplementationVisibility s_writableStreamInternalsWritableStreamDefaultWriterCloseWithErrorPropagationCodeImplementationVisibility = JSC::ImplementationVisibility::Public; -const int s_writableStreamInternalsWritableStreamDefaultWriterCloseWithErrorPropagationCodeLength = 403; -static const JSC::Intrinsic s_writableStreamInternalsWritableStreamDefaultWriterCloseWithErrorPropagationCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_writableStreamInternalsWritableStreamDefaultWriterCloseWithErrorPropagationCode = "(function (writer) {\"use strict\";\n const stream = @getByIdDirectPrivate(writer, \"stream\"), state = @getByIdDirectPrivate(stream, \"state\");\n if (@writableStreamCloseQueuedOrInFlight(stream) || state === \"closed\")\n return @Promise.@resolve();\n if (state === \"errored\")\n return @Promise.@reject(@getByIdDirectPrivate(stream, \"storedError\"));\n return @writableStreamDefaultWriterClose(writer);\n})\n"; +// readableByteStreamControllerShouldCallPull +const JSC::ConstructAbility s_readableByteStreamInternalsReadableByteStreamControllerShouldCallPullCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; +const JSC::ConstructorKind s_readableByteStreamInternalsReadableByteStreamControllerShouldCallPullCodeConstructorKind = JSC::ConstructorKind::None; +const JSC::ImplementationVisibility s_readableByteStreamInternalsReadableByteStreamControllerShouldCallPullCodeImplementationVisibility = JSC::ImplementationVisibility::Public; +const int s_readableByteStreamInternalsReadableByteStreamControllerShouldCallPullCodeLength = 793; +static const JSC::Intrinsic s_readableByteStreamInternalsReadableByteStreamControllerShouldCallPullCodeIntrinsic = JSC::NoIntrinsic; +const char* const s_readableByteStreamInternalsReadableByteStreamControllerShouldCallPullCode = "(function (controller) {\"use strict\";\n const stream = @getByIdDirectPrivate(controller, \"controlledReadableStream\");\n if (@getByIdDirectPrivate(stream, \"state\") !== 4)\n return !1;\n if (@getByIdDirectPrivate(controller, \"closeRequested\"))\n return !1;\n if (!(@getByIdDirectPrivate(controller, \"started\") > 0))\n return !1;\n const reader = @getByIdDirectPrivate(stream, \"reader\");\n if (reader && (@getByIdDirectPrivate(reader, \"readRequests\")\?.isNotEmpty() || !!@getByIdDirectPrivate(reader, \"bunNativePtr\")))\n return !0;\n if (@readableStreamHasBYOBReader(stream) && @getByIdDirectPrivate(@getByIdDirectPrivate(stream, \"reader\"), \"readIntoRequests\")\?.isNotEmpty())\n return !0;\n if (@readableByteStreamControllerGetDesiredSize(controller) > 0)\n return !0;\n return !1;\n})\n"; -// writableStreamDefaultWriterEnsureClosedPromiseRejected -const JSC::ConstructAbility s_writableStreamInternalsWritableStreamDefaultWriterEnsureClosedPromiseRejectedCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; -const JSC::ConstructorKind s_writableStreamInternalsWritableStreamDefaultWriterEnsureClosedPromiseRejectedCodeConstructorKind = JSC::ConstructorKind::None; -const JSC::ImplementationVisibility s_writableStreamInternalsWritableStreamDefaultWriterEnsureClosedPromiseRejectedCodeImplementationVisibility = JSC::ImplementationVisibility::Public; -const int s_writableStreamInternalsWritableStreamDefaultWriterEnsureClosedPromiseRejectedCodeLength = 569; -static const JSC::Intrinsic s_writableStreamInternalsWritableStreamDefaultWriterEnsureClosedPromiseRejectedCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_writableStreamInternalsWritableStreamDefaultWriterEnsureClosedPromiseRejectedCode = "(function (writer, error) {\"use strict\";\n let closedPromiseCapability = @getByIdDirectPrivate(writer, \"closedPromise\"), closedPromise = closedPromiseCapability.promise;\n if ((@getPromiseInternalField(closedPromise, @promiseFieldFlags) & @promiseStateMask) !== @promiseStatePending)\n closedPromiseCapability = @newPromiseCapability(@Promise), closedPromise = closedPromiseCapability.promise, @putByIdDirectPrivate(writer, \"closedPromise\", closedPromiseCapability);\n closedPromiseCapability.reject.@call(@undefined, error), @markPromiseAsHandled(closedPromise);\n})\n"; +// readableByteStreamControllerCallPullIfNeeded +const JSC::ConstructAbility s_readableByteStreamInternalsReadableByteStreamControllerCallPullIfNeededCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; +const JSC::ConstructorKind s_readableByteStreamInternalsReadableByteStreamControllerCallPullIfNeededCodeConstructorKind = JSC::ConstructorKind::None; +const JSC::ImplementationVisibility s_readableByteStreamInternalsReadableByteStreamControllerCallPullIfNeededCodeImplementationVisibility = JSC::ImplementationVisibility::Public; +const int s_readableByteStreamInternalsReadableByteStreamControllerCallPullIfNeededCodeLength = 828; +static const JSC::Intrinsic s_readableByteStreamInternalsReadableByteStreamControllerCallPullIfNeededCodeIntrinsic = JSC::NoIntrinsic; +const char* const s_readableByteStreamInternalsReadableByteStreamControllerCallPullIfNeededCode = "(function (controller) {\"use strict\";\n if (!@readableByteStreamControllerShouldCallPull(controller))\n return;\n if (@getByIdDirectPrivate(controller, \"pulling\")) {\n @putByIdDirectPrivate(controller, \"pullAgain\", !0);\n return;\n }\n @putByIdDirectPrivate(controller, \"pulling\", !0), @promiseInvokeOrNoop(@getByIdDirectPrivate(controller, \"underlyingByteSource\"), \"pull\", [controller]).@then(() => {\n if (@putByIdDirectPrivate(controller, \"pulling\", !1), @getByIdDirectPrivate(controller, \"pullAgain\"))\n @putByIdDirectPrivate(controller, \"pullAgain\", !1), @readableByteStreamControllerCallPullIfNeeded(controller);\n }, (error) => {\n if (@getByIdDirectPrivate(@getByIdDirectPrivate(controller, \"controlledReadableStream\"), \"state\") === 4)\n @readableByteStreamControllerError(controller, error);\n });\n})\n"; -// writableStreamDefaultWriterEnsureReadyPromiseRejected -const JSC::ConstructAbility s_writableStreamInternalsWritableStreamDefaultWriterEnsureReadyPromiseRejectedCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; -const JSC::ConstructorKind s_writableStreamInternalsWritableStreamDefaultWriterEnsureReadyPromiseRejectedCodeConstructorKind = JSC::ConstructorKind::None; -const JSC::ImplementationVisibility s_writableStreamInternalsWritableStreamDefaultWriterEnsureReadyPromiseRejectedCodeImplementationVisibility = JSC::ImplementationVisibility::Public; -const int s_writableStreamInternalsWritableStreamDefaultWriterEnsureReadyPromiseRejectedCodeLength = 557; -static const JSC::Intrinsic s_writableStreamInternalsWritableStreamDefaultWriterEnsureReadyPromiseRejectedCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_writableStreamInternalsWritableStreamDefaultWriterEnsureReadyPromiseRejectedCode = "(function (writer, error) {\"use strict\";\n let readyPromiseCapability = @getByIdDirectPrivate(writer, \"readyPromise\"), readyPromise = readyPromiseCapability.promise;\n if ((@getPromiseInternalField(readyPromise, @promiseFieldFlags) & @promiseStateMask) !== @promiseStatePending)\n readyPromiseCapability = @newPromiseCapability(@Promise), readyPromise = readyPromiseCapability.promise, @putByIdDirectPrivate(writer, \"readyPromise\", readyPromiseCapability);\n readyPromiseCapability.reject.@call(@undefined, error), @markPromiseAsHandled(readyPromise);\n})\n"; +// transferBufferToCurrentRealm +const JSC::ConstructAbility s_readableByteStreamInternalsTransferBufferToCurrentRealmCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; +const JSC::ConstructorKind s_readableByteStreamInternalsTransferBufferToCurrentRealmCodeConstructorKind = JSC::ConstructorKind::None; +const JSC::ImplementationVisibility s_readableByteStreamInternalsTransferBufferToCurrentRealmCodeImplementationVisibility = JSC::ImplementationVisibility::Public; +const int s_readableByteStreamInternalsTransferBufferToCurrentRealmCodeLength = 54; +static const JSC::Intrinsic s_readableByteStreamInternalsTransferBufferToCurrentRealmCodeIntrinsic = JSC::NoIntrinsic; +const char* const s_readableByteStreamInternalsTransferBufferToCurrentRealmCode = "(function (buffer) {\"use strict\";\n return buffer;\n})\n"; -// writableStreamDefaultWriterGetDesiredSize -const JSC::ConstructAbility s_writableStreamInternalsWritableStreamDefaultWriterGetDesiredSizeCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; -const JSC::ConstructorKind s_writableStreamInternalsWritableStreamDefaultWriterGetDesiredSizeCodeConstructorKind = JSC::ConstructorKind::None; -const JSC::ImplementationVisibility s_writableStreamInternalsWritableStreamDefaultWriterGetDesiredSizeCodeImplementationVisibility = JSC::ImplementationVisibility::Public; -const int s_writableStreamInternalsWritableStreamDefaultWriterGetDesiredSizeCodeLength = 353; -static const JSC::Intrinsic s_writableStreamInternalsWritableStreamDefaultWriterGetDesiredSizeCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_writableStreamInternalsWritableStreamDefaultWriterGetDesiredSizeCode = "(function (writer) {\"use strict\";\n const stream = @getByIdDirectPrivate(writer, \"stream\"), state = @getByIdDirectPrivate(stream, \"state\");\n if (state === \"errored\" || state === \"erroring\")\n return null;\n if (state === \"closed\")\n return 0;\n return @writableStreamDefaultControllerGetDesiredSize(@getByIdDirectPrivate(stream, \"controller\"));\n})\n"; +// readableStreamReaderKind +const JSC::ConstructAbility s_readableByteStreamInternalsReadableStreamReaderKindCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; +const JSC::ConstructorKind s_readableByteStreamInternalsReadableStreamReaderKindCodeConstructorKind = JSC::ConstructorKind::None; +const JSC::ImplementationVisibility s_readableByteStreamInternalsReadableStreamReaderKindCodeImplementationVisibility = JSC::ImplementationVisibility::Public; +const int s_readableByteStreamInternalsReadableStreamReaderKindCodeLength = 239; +static const JSC::Intrinsic s_readableByteStreamInternalsReadableStreamReaderKindCodeIntrinsic = JSC::NoIntrinsic; +const char* const s_readableByteStreamInternalsReadableStreamReaderKindCode = "(function (reader) {\"use strict\";\n if (@getByIdDirectPrivate(reader, \"readRequests\"))\n return @getByIdDirectPrivate(reader, \"bunNativePtr\") \? 3 : 1;\n if (@getByIdDirectPrivate(reader, \"readIntoRequests\"))\n return 2;\n return 0;\n})\n"; -// writableStreamDefaultWriterRelease -const JSC::ConstructAbility s_writableStreamInternalsWritableStreamDefaultWriterReleaseCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; -const JSC::ConstructorKind s_writableStreamInternalsWritableStreamDefaultWriterReleaseCodeConstructorKind = JSC::ConstructorKind::None; -const JSC::ImplementationVisibility s_writableStreamInternalsWritableStreamDefaultWriterReleaseCodeImplementationVisibility = JSC::ImplementationVisibility::Public; -const int s_writableStreamInternalsWritableStreamDefaultWriterReleaseCodeLength = 432; -static const JSC::Intrinsic s_writableStreamInternalsWritableStreamDefaultWriterReleaseCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_writableStreamInternalsWritableStreamDefaultWriterReleaseCode = "(function (writer) {\"use strict\";\n const stream = @getByIdDirectPrivate(writer, \"stream\"), releasedError = @makeTypeError(\"writableStreamDefaultWriterRelease\");\n @writableStreamDefaultWriterEnsureReadyPromiseRejected(writer, releasedError), @writableStreamDefaultWriterEnsureClosedPromiseRejected(writer, releasedError), @putByIdDirectPrivate(stream, \"writer\", @undefined), @putByIdDirectPrivate(writer, \"stream\", @undefined);\n})\n"; +// readableByteStreamControllerEnqueue +const JSC::ConstructAbility s_readableByteStreamInternalsReadableByteStreamControllerEnqueueCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; +const JSC::ConstructorKind s_readableByteStreamInternalsReadableByteStreamControllerEnqueueCodeConstructorKind = JSC::ConstructorKind::None; +const JSC::ImplementationVisibility s_readableByteStreamInternalsReadableByteStreamControllerEnqueueCodeImplementationVisibility = JSC::ImplementationVisibility::Public; +const int s_readableByteStreamInternalsReadableByteStreamControllerEnqueueCodeLength = 1217; +static const JSC::Intrinsic s_readableByteStreamInternalsReadableByteStreamControllerEnqueueCodeIntrinsic = JSC::NoIntrinsic; +const char* const s_readableByteStreamInternalsReadableByteStreamControllerEnqueueCode = "(function (controller, chunk) {\"use strict\";\n const stream = @getByIdDirectPrivate(controller, \"controlledReadableStream\");\n switch (@getByIdDirectPrivate(stream, \"reader\") \? @readableStreamReaderKind(@getByIdDirectPrivate(stream, \"reader\")) : 0) {\n case 1: {\n if (!@getByIdDirectPrivate(@getByIdDirectPrivate(stream, \"reader\"), \"readRequests\")\?.isNotEmpty())\n @readableByteStreamControllerEnqueueChunk(controller, @transferBufferToCurrentRealm(chunk.buffer), chunk.byteOffset, chunk.byteLength);\n else {\n const transferredView = chunk.constructor === @Uint8Array \? chunk : new @Uint8Array(chunk.buffer, chunk.byteOffset, chunk.byteLength);\n @readableStreamFulfillReadRequest(stream, transferredView, !1);\n }\n break;\n }\n case 2: {\n @readableByteStreamControllerEnqueueChunk(controller, @transferBufferToCurrentRealm(chunk.buffer), chunk.byteOffset, chunk.byteLength), @readableByteStreamControllerProcessPullDescriptors(controller);\n break;\n }\n case 3:\n break;\n default: {\n @readableByteStreamControllerEnqueueChunk(controller, @transferBufferToCurrentRealm(chunk.buffer), chunk.byteOffset, chunk.byteLength);\n break;\n }\n }\n})\n"; -// writableStreamDefaultWriterWrite -const JSC::ConstructAbility s_writableStreamInternalsWritableStreamDefaultWriterWriteCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; -const JSC::ConstructorKind s_writableStreamInternalsWritableStreamDefaultWriterWriteCodeConstructorKind = JSC::ConstructorKind::None; -const JSC::ImplementationVisibility s_writableStreamInternalsWritableStreamDefaultWriterWriteCodeImplementationVisibility = JSC::ImplementationVisibility::Public; -const int s_writableStreamInternalsWritableStreamDefaultWriterWriteCodeLength = 1079; -static const JSC::Intrinsic s_writableStreamInternalsWritableStreamDefaultWriterWriteCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_writableStreamInternalsWritableStreamDefaultWriterWriteCode = "(function (writer, chunk) {\"use strict\";\n const stream = @getByIdDirectPrivate(writer, \"stream\"), controller = @getByIdDirectPrivate(stream, \"controller\"), chunkSize = @writableStreamDefaultControllerGetChunkSize(controller, chunk);\n if (stream !== @getByIdDirectPrivate(writer, \"stream\"))\n return @Promise.@reject(@makeTypeError(\"writer is not stream's writer\"));\n const state = @getByIdDirectPrivate(stream, \"state\");\n if (state === \"errored\")\n return @Promise.@reject(@getByIdDirectPrivate(stream, \"storedError\"));\n if (@writableStreamCloseQueuedOrInFlight(stream) || state === \"closed\")\n return @Promise.@reject(@makeTypeError(\"stream is closing or closed\"));\n if (@writableStreamCloseQueuedOrInFlight(stream) || state === \"closed\")\n return @Promise.@reject(@makeTypeError(\"stream is closing or closed\"));\n if (state === \"erroring\")\n return @Promise.@reject(@getByIdDirectPrivate(stream, \"storedError\"));\n const promise = @writableStreamAddWriteRequest(stream);\n return @writableStreamDefaultControllerWrite(controller, chunk, chunkSize), promise;\n})\n"; +// readableByteStreamControllerEnqueueChunk +const JSC::ConstructAbility s_readableByteStreamInternalsReadableByteStreamControllerEnqueueChunkCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; +const JSC::ConstructorKind s_readableByteStreamInternalsReadableByteStreamControllerEnqueueChunkCodeConstructorKind = JSC::ConstructorKind::None; +const JSC::ImplementationVisibility s_readableByteStreamInternalsReadableByteStreamControllerEnqueueChunkCodeImplementationVisibility = JSC::ImplementationVisibility::Public; +const int s_readableByteStreamInternalsReadableByteStreamControllerEnqueueChunkCodeLength = 245; +static const JSC::Intrinsic s_readableByteStreamInternalsReadableByteStreamControllerEnqueueChunkCodeIntrinsic = JSC::NoIntrinsic; +const char* const s_readableByteStreamInternalsReadableByteStreamControllerEnqueueChunkCode = "(function (controller, buffer, byteOffset, byteLength) {\"use strict\";\n @getByIdDirectPrivate(controller, \"queue\").content.push({\n buffer,\n byteOffset,\n byteLength\n }), @getByIdDirectPrivate(controller, \"queue\").size += byteLength;\n})\n"; -// setUpWritableStreamDefaultController -const JSC::ConstructAbility s_writableStreamInternalsSetUpWritableStreamDefaultControllerCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; -const JSC::ConstructorKind s_writableStreamInternalsSetUpWritableStreamDefaultControllerCodeConstructorKind = JSC::ConstructorKind::None; -const JSC::ImplementationVisibility s_writableStreamInternalsSetUpWritableStreamDefaultControllerCodeImplementationVisibility = JSC::ImplementationVisibility::Public; -const int s_writableStreamInternalsSetUpWritableStreamDefaultControllerCodeLength = 972; -static const JSC::Intrinsic s_writableStreamInternalsSetUpWritableStreamDefaultControllerCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_writableStreamInternalsSetUpWritableStreamDefaultControllerCode = "(function (stream, controller, startAlgorithm, writeAlgorithm, closeAlgorithm, abortAlgorithm, highWaterMark, sizeAlgorithm) {\"use strict\";\n @putByIdDirectPrivate(controller, \"stream\", stream), @putByIdDirectPrivate(stream, \"controller\", controller), @resetQueue(@getByIdDirectPrivate(controller, \"queue\")), @putByIdDirectPrivate(controller, \"started\", -1), @putByIdDirectPrivate(controller, \"startAlgorithm\", startAlgorithm), @putByIdDirectPrivate(controller, \"strategySizeAlgorithm\", sizeAlgorithm), @putByIdDirectPrivate(controller, \"strategyHWM\", highWaterMark), @putByIdDirectPrivate(controller, \"writeAlgorithm\", writeAlgorithm), @putByIdDirectPrivate(controller, \"closeAlgorithm\", closeAlgorithm), @putByIdDirectPrivate(controller, \"abortAlgorithm\", abortAlgorithm);\n const backpressure = @writableStreamDefaultControllerGetBackpressure(controller);\n @writableStreamUpdateBackpressure(stream, backpressure), @writableStreamDefaultControllerStart(controller);\n})\n"; +// readableByteStreamControllerRespondWithNewView +const JSC::ConstructAbility s_readableByteStreamInternalsReadableByteStreamControllerRespondWithNewViewCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; +const JSC::ConstructorKind s_readableByteStreamInternalsReadableByteStreamControllerRespondWithNewViewCodeConstructorKind = JSC::ConstructorKind::None; +const JSC::ImplementationVisibility s_readableByteStreamInternalsReadableByteStreamControllerRespondWithNewViewCodeImplementationVisibility = JSC::ImplementationVisibility::Public; +const int s_readableByteStreamInternalsReadableByteStreamControllerRespondWithNewViewCodeLength = 504; +static const JSC::Intrinsic s_readableByteStreamInternalsReadableByteStreamControllerRespondWithNewViewCodeIntrinsic = JSC::NoIntrinsic; +const char* const s_readableByteStreamInternalsReadableByteStreamControllerRespondWithNewViewCode = "(function (controller, view) {\"use strict\";\n let firstDescriptor = @getByIdDirectPrivate(controller, \"pendingPullIntos\").peek();\n if (firstDescriptor.byteOffset + firstDescriptor.bytesFilled !== view.byteOffset)\n @throwRangeError(\"Invalid value for view.byteOffset\");\n if (firstDescriptor.byteLength !== view.byteLength)\n @throwRangeError(\"Invalid value for view.byteLength\");\n firstDescriptor.buffer = view.buffer, @readableByteStreamControllerRespondInternal(controller, view.byteLength);\n})\n"; -// writableStreamDefaultControllerStart -const JSC::ConstructAbility s_writableStreamInternalsWritableStreamDefaultControllerStartCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; -const JSC::ConstructorKind s_writableStreamInternalsWritableStreamDefaultControllerStartCodeConstructorKind = JSC::ConstructorKind::None; -const JSC::ImplementationVisibility s_writableStreamInternalsWritableStreamDefaultControllerStartCodeImplementationVisibility = JSC::ImplementationVisibility::Public; -const int s_writableStreamInternalsWritableStreamDefaultControllerStartCodeLength = 796; -static const JSC::Intrinsic s_writableStreamInternalsWritableStreamDefaultControllerStartCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_writableStreamInternalsWritableStreamDefaultControllerStartCode = "(function (controller) {\"use strict\";\n if (@getByIdDirectPrivate(controller, \"started\") !== -1)\n return;\n @putByIdDirectPrivate(controller, \"started\", 0);\n const startAlgorithm = @getByIdDirectPrivate(controller, \"startAlgorithm\");\n @putByIdDirectPrivate(controller, \"startAlgorithm\", @undefined);\n const stream = @getByIdDirectPrivate(controller, \"stream\");\n return @Promise.@resolve(startAlgorithm.@call()).@then(() => {\n const state = @getByIdDirectPrivate(stream, \"state\");\n @putByIdDirectPrivate(controller, \"started\", 1), @writableStreamDefaultControllerAdvanceQueueIfNeeded(controller);\n }, (error) => {\n const state = @getByIdDirectPrivate(stream, \"state\");\n @putByIdDirectPrivate(controller, \"started\", 1), @writableStreamDealWithRejection(stream, error);\n });\n})\n"; +// readableByteStreamControllerRespond +const JSC::ConstructAbility s_readableByteStreamInternalsReadableByteStreamControllerRespondCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; +const JSC::ConstructorKind s_readableByteStreamInternalsReadableByteStreamControllerRespondCodeConstructorKind = JSC::ConstructorKind::None; +const JSC::ImplementationVisibility s_readableByteStreamInternalsReadableByteStreamControllerRespondCodeImplementationVisibility = JSC::ImplementationVisibility::Public; +const int s_readableByteStreamInternalsReadableByteStreamControllerRespondCodeLength = 317; +static const JSC::Intrinsic s_readableByteStreamInternalsReadableByteStreamControllerRespondCodeIntrinsic = JSC::NoIntrinsic; +const char* const s_readableByteStreamInternalsReadableByteStreamControllerRespondCode = "(function (controller, bytesWritten) {\"use strict\";\n if (bytesWritten = @toNumber(bytesWritten), bytesWritten !== bytesWritten || bytesWritten === @Infinity || bytesWritten < 0)\n @throwRangeError(\"bytesWritten has an incorrect value\");\n @readableByteStreamControllerRespondInternal(controller, bytesWritten);\n})\n"; -// setUpWritableStreamDefaultControllerFromUnderlyingSink -const JSC::ConstructAbility s_writableStreamInternalsSetUpWritableStreamDefaultControllerFromUnderlyingSinkCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; -const JSC::ConstructorKind s_writableStreamInternalsSetUpWritableStreamDefaultControllerFromUnderlyingSinkCodeConstructorKind = JSC::ConstructorKind::None; -const JSC::ImplementationVisibility s_writableStreamInternalsSetUpWritableStreamDefaultControllerFromUnderlyingSinkCodeImplementationVisibility = JSC::ImplementationVisibility::Public; -const int s_writableStreamInternalsSetUpWritableStreamDefaultControllerFromUnderlyingSinkCodeLength = 1314; -static const JSC::Intrinsic s_writableStreamInternalsSetUpWritableStreamDefaultControllerFromUnderlyingSinkCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_writableStreamInternalsSetUpWritableStreamDefaultControllerFromUnderlyingSinkCode = "(function (stream, underlyingSink, underlyingSinkDict, highWaterMark, sizeAlgorithm) {\"use strict\";\n const controller = new @WritableStreamDefaultController;\n let startAlgorithm = () => {\n }, writeAlgorithm = () => {\n return @Promise.@resolve();\n }, closeAlgorithm = () => {\n return @Promise.@resolve();\n }, abortAlgorithm = () => {\n return @Promise.@resolve();\n };\n if (\"start\" in underlyingSinkDict) {\n const startMethod = underlyingSinkDict.start;\n startAlgorithm = () => @promiseInvokeOrNoopMethodNoCatch(underlyingSink, startMethod, [controller]);\n }\n if (\"write\" in underlyingSinkDict) {\n const writeMethod = underlyingSinkDict.write;\n writeAlgorithm = (chunk) => @promiseInvokeOrNoopMethod(underlyingSink, writeMethod, [chunk, controller]);\n }\n if (\"close\" in underlyingSinkDict) {\n const closeMethod = underlyingSinkDict.close;\n closeAlgorithm = () => @promiseInvokeOrNoopMethod(underlyingSink, closeMethod, []);\n }\n if (\"abort\" in underlyingSinkDict) {\n const abortMethod = underlyingSinkDict.abort;\n abortAlgorithm = (reason) => @promiseInvokeOrNoopMethod(underlyingSink, abortMethod, [reason]);\n }\n @setUpWritableStreamDefaultController(stream, controller, startAlgorithm, writeAlgorithm, closeAlgorithm, abortAlgorithm, highWaterMark, sizeAlgorithm);\n})\n"; +// readableByteStreamControllerRespondInternal +const JSC::ConstructAbility s_readableByteStreamInternalsReadableByteStreamControllerRespondInternalCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; +const JSC::ConstructorKind s_readableByteStreamInternalsReadableByteStreamControllerRespondInternalCodeConstructorKind = JSC::ConstructorKind::None; +const JSC::ImplementationVisibility s_readableByteStreamInternalsReadableByteStreamControllerRespondInternalCodeImplementationVisibility = JSC::ImplementationVisibility::Public; +const int s_readableByteStreamInternalsReadableByteStreamControllerRespondInternalCodeLength = 576; +static const JSC::Intrinsic s_readableByteStreamInternalsReadableByteStreamControllerRespondInternalCodeIntrinsic = JSC::NoIntrinsic; +const char* const s_readableByteStreamInternalsReadableByteStreamControllerRespondInternalCode = "(function (controller, bytesWritten) {\"use strict\";\n let firstDescriptor = @getByIdDirectPrivate(controller, \"pendingPullIntos\").peek(), stream = @getByIdDirectPrivate(controller, \"controlledReadableStream\");\n if (@getByIdDirectPrivate(stream, \"state\") === 1) {\n if (bytesWritten !== 0)\n @throwTypeError(\"bytesWritten is different from 0 even though stream is closed\");\n @readableByteStreamControllerRespondInClosedState(controller, firstDescriptor);\n } else\n @readableByteStreamControllerRespondInReadableState(controller, bytesWritten, firstDescriptor);\n})\n"; -// writableStreamDefaultControllerAdvanceQueueIfNeeded -const JSC::ConstructAbility s_writableStreamInternalsWritableStreamDefaultControllerAdvanceQueueIfNeededCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; -const JSC::ConstructorKind s_writableStreamInternalsWritableStreamDefaultControllerAdvanceQueueIfNeededCodeConstructorKind = JSC::ConstructorKind::None; -const JSC::ImplementationVisibility s_writableStreamInternalsWritableStreamDefaultControllerAdvanceQueueIfNeededCodeImplementationVisibility = JSC::ImplementationVisibility::Public; -const int s_writableStreamInternalsWritableStreamDefaultControllerAdvanceQueueIfNeededCodeLength = 705; -static const JSC::Intrinsic s_writableStreamInternalsWritableStreamDefaultControllerAdvanceQueueIfNeededCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_writableStreamInternalsWritableStreamDefaultControllerAdvanceQueueIfNeededCode = "(function (controller) {\"use strict\";\n const stream = @getByIdDirectPrivate(controller, \"stream\");\n if (@getByIdDirectPrivate(controller, \"started\") !== 1)\n return;\n if (@getByIdDirectPrivate(stream, \"inFlightWriteRequest\") !== @undefined)\n return;\n if (@getByIdDirectPrivate(stream, \"state\") === \"erroring\") {\n @writableStreamFinishErroring(stream);\n return;\n }\n const queue = @getByIdDirectPrivate(controller, \"queue\");\n if (queue.content\?.isEmpty() \?\? !1)\n return;\n const value = @peekQueueValue(queue);\n if (value === @isCloseSentinel)\n @writableStreamDefaultControllerProcessClose(controller);\n else\n @writableStreamDefaultControllerProcessWrite(controller, value);\n})\n"; +// readableByteStreamControllerRespondInReadableState +const JSC::ConstructAbility s_readableByteStreamInternalsReadableByteStreamControllerRespondInReadableStateCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; +const JSC::ConstructorKind s_readableByteStreamInternalsReadableByteStreamControllerRespondInReadableStateCodeConstructorKind = JSC::ConstructorKind::None; +const JSC::ImplementationVisibility s_readableByteStreamInternalsReadableByteStreamControllerRespondInReadableStateCodeImplementationVisibility = JSC::ImplementationVisibility::Public; +const int s_readableByteStreamInternalsReadableByteStreamControllerRespondInReadableStateCodeLength = 1200; +static const JSC::Intrinsic s_readableByteStreamInternalsReadableByteStreamControllerRespondInReadableStateCodeIntrinsic = JSC::NoIntrinsic; +const char* const s_readableByteStreamInternalsReadableByteStreamControllerRespondInReadableStateCode = "(function (controller, bytesWritten, pullIntoDescriptor) {\"use strict\";\n if (pullIntoDescriptor.bytesFilled + bytesWritten > pullIntoDescriptor.byteLength)\n @throwRangeError(\"bytesWritten value is too great\");\n if (@readableByteStreamControllerInvalidateBYOBRequest(controller), pullIntoDescriptor.bytesFilled += bytesWritten, pullIntoDescriptor.bytesFilled < pullIntoDescriptor.elementSize)\n return;\n @readableByteStreamControllerShiftPendingDescriptor(controller);\n const remainderSize = pullIntoDescriptor.bytesFilled % pullIntoDescriptor.elementSize;\n if (remainderSize > 0) {\n const end = pullIntoDescriptor.byteOffset + pullIntoDescriptor.bytesFilled, remainder = @cloneArrayBuffer(pullIntoDescriptor.buffer, end - remainderSize, remainderSize);\n @readableByteStreamControllerEnqueueChunk(controller, remainder, 0, remainder.byteLength);\n }\n pullIntoDescriptor.buffer = @transferBufferToCurrentRealm(pullIntoDescriptor.buffer), pullIntoDescriptor.bytesFilled -= remainderSize, @readableByteStreamControllerCommitDescriptor(@getByIdDirectPrivate(controller, \"controlledReadableStream\"), pullIntoDescriptor), @readableByteStreamControllerProcessPullDescriptors(controller);\n})\n"; -// isCloseSentinel -const JSC::ConstructAbility s_writableStreamInternalsIsCloseSentinelCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; -const JSC::ConstructorKind s_writableStreamInternalsIsCloseSentinelCodeConstructorKind = JSC::ConstructorKind::None; -const JSC::ImplementationVisibility s_writableStreamInternalsIsCloseSentinelCodeImplementationVisibility = JSC::ImplementationVisibility::Public; -const int s_writableStreamInternalsIsCloseSentinelCodeLength = 31; -static const JSC::Intrinsic s_writableStreamInternalsIsCloseSentinelCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_writableStreamInternalsIsCloseSentinelCode = "(function () {\"use strict\";\n})\n"; +// readableByteStreamControllerRespondInClosedState +const JSC::ConstructAbility s_readableByteStreamInternalsReadableByteStreamControllerRespondInClosedStateCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; +const JSC::ConstructorKind s_readableByteStreamInternalsReadableByteStreamControllerRespondInClosedStateCodeConstructorKind = JSC::ConstructorKind::None; +const JSC::ImplementationVisibility s_readableByteStreamInternalsReadableByteStreamControllerRespondInClosedStateCodeImplementationVisibility = JSC::ImplementationVisibility::Public; +const int s_readableByteStreamInternalsReadableByteStreamControllerRespondInClosedStateCodeLength = 641; +static const JSC::Intrinsic s_readableByteStreamInternalsReadableByteStreamControllerRespondInClosedStateCodeIntrinsic = JSC::NoIntrinsic; +const char* const s_readableByteStreamInternalsReadableByteStreamControllerRespondInClosedStateCode = "(function (controller, firstDescriptor) {\"use strict\";\n if (firstDescriptor.buffer = @transferBufferToCurrentRealm(firstDescriptor.buffer), @readableStreamHasBYOBReader(@getByIdDirectPrivate(controller, \"controlledReadableStream\")))\n while (@getByIdDirectPrivate(@getByIdDirectPrivate(@getByIdDirectPrivate(controller, \"controlledReadableStream\"), \"reader\"), \"readIntoRequests\")\?.isNotEmpty()) {\n let pullIntoDescriptor = @readableByteStreamControllerShiftPendingDescriptor(controller);\n @readableByteStreamControllerCommitDescriptor(@getByIdDirectPrivate(controller, \"controlledReadableStream\"), pullIntoDescriptor);\n }\n})\n"; -// writableStreamDefaultControllerClearAlgorithms -const JSC::ConstructAbility s_writableStreamInternalsWritableStreamDefaultControllerClearAlgorithmsCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; -const JSC::ConstructorKind s_writableStreamInternalsWritableStreamDefaultControllerClearAlgorithmsCodeConstructorKind = JSC::ConstructorKind::None; -const JSC::ImplementationVisibility s_writableStreamInternalsWritableStreamDefaultControllerClearAlgorithmsCodeImplementationVisibility = JSC::ImplementationVisibility::Public; -const int s_writableStreamInternalsWritableStreamDefaultControllerClearAlgorithmsCodeLength = 310; -static const JSC::Intrinsic s_writableStreamInternalsWritableStreamDefaultControllerClearAlgorithmsCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_writableStreamInternalsWritableStreamDefaultControllerClearAlgorithmsCode = "(function (controller) {\"use strict\";\n @putByIdDirectPrivate(controller, \"writeAlgorithm\", @undefined), @putByIdDirectPrivate(controller, \"closeAlgorithm\", @undefined), @putByIdDirectPrivate(controller, \"abortAlgorithm\", @undefined), @putByIdDirectPrivate(controller, \"strategySizeAlgorithm\", @undefined);\n})\n"; +// readableByteStreamControllerProcessPullDescriptors +const JSC::ConstructAbility s_readableByteStreamInternalsReadableByteStreamControllerProcessPullDescriptorsCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; +const JSC::ConstructorKind s_readableByteStreamInternalsReadableByteStreamControllerProcessPullDescriptorsCodeConstructorKind = JSC::ConstructorKind::None; +const JSC::ImplementationVisibility s_readableByteStreamInternalsReadableByteStreamControllerProcessPullDescriptorsCodeImplementationVisibility = JSC::ImplementationVisibility::Public; +const int s_readableByteStreamInternalsReadableByteStreamControllerProcessPullDescriptorsCodeLength = 587; +static const JSC::Intrinsic s_readableByteStreamInternalsReadableByteStreamControllerProcessPullDescriptorsCodeIntrinsic = JSC::NoIntrinsic; +const char* const s_readableByteStreamInternalsReadableByteStreamControllerProcessPullDescriptorsCode = "(function (controller) {\"use strict\";\n while (@getByIdDirectPrivate(controller, \"pendingPullIntos\").isNotEmpty()) {\n if (@getByIdDirectPrivate(controller, \"queue\").size === 0)\n return;\n let pullIntoDescriptor = @getByIdDirectPrivate(controller, \"pendingPullIntos\").peek();\n if (@readableByteStreamControllerFillDescriptorFromQueue(controller, pullIntoDescriptor))\n @readableByteStreamControllerShiftPendingDescriptor(controller), @readableByteStreamControllerCommitDescriptor(@getByIdDirectPrivate(controller, \"controlledReadableStream\"), pullIntoDescriptor);\n }\n})\n"; -// writableStreamDefaultControllerClose -const JSC::ConstructAbility s_writableStreamInternalsWritableStreamDefaultControllerCloseCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; -const JSC::ConstructorKind s_writableStreamInternalsWritableStreamDefaultControllerCloseCodeConstructorKind = JSC::ConstructorKind::None; -const JSC::ImplementationVisibility s_writableStreamInternalsWritableStreamDefaultControllerCloseCodeImplementationVisibility = JSC::ImplementationVisibility::Public; -const int s_writableStreamInternalsWritableStreamDefaultControllerCloseCodeLength = 197; -static const JSC::Intrinsic s_writableStreamInternalsWritableStreamDefaultControllerCloseCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_writableStreamInternalsWritableStreamDefaultControllerCloseCode = "(function (controller) {\"use strict\";\n @enqueueValueWithSize(@getByIdDirectPrivate(controller, \"queue\"), @isCloseSentinel, 0), @writableStreamDefaultControllerAdvanceQueueIfNeeded(controller);\n})\n"; +// readableByteStreamControllerFillDescriptorFromQueue +const JSC::ConstructAbility s_readableByteStreamInternalsReadableByteStreamControllerFillDescriptorFromQueueCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; +const JSC::ConstructorKind s_readableByteStreamInternalsReadableByteStreamControllerFillDescriptorFromQueueCodeConstructorKind = JSC::ConstructorKind::None; +const JSC::ImplementationVisibility s_readableByteStreamInternalsReadableByteStreamControllerFillDescriptorFromQueueCodeImplementationVisibility = JSC::ImplementationVisibility::Public; +const int s_readableByteStreamInternalsReadableByteStreamControllerFillDescriptorFromQueueCodeLength = 1695; +static const JSC::Intrinsic s_readableByteStreamInternalsReadableByteStreamControllerFillDescriptorFromQueueCodeIntrinsic = JSC::NoIntrinsic; +const char* const s_readableByteStreamInternalsReadableByteStreamControllerFillDescriptorFromQueueCode = "(function (controller, pullIntoDescriptor) {\"use strict\";\n const currentAlignedBytes = pullIntoDescriptor.bytesFilled - pullIntoDescriptor.bytesFilled % pullIntoDescriptor.elementSize, maxBytesToCopy = @getByIdDirectPrivate(controller, \"queue\").size < pullIntoDescriptor.byteLength - pullIntoDescriptor.bytesFilled \? @getByIdDirectPrivate(controller, \"queue\").size : pullIntoDescriptor.byteLength - pullIntoDescriptor.bytesFilled, maxBytesFilled = pullIntoDescriptor.bytesFilled + maxBytesToCopy, maxAlignedBytes = maxBytesFilled - maxBytesFilled % pullIntoDescriptor.elementSize;\n let totalBytesToCopyRemaining = maxBytesToCopy, ready = !1;\n if (maxAlignedBytes > currentAlignedBytes)\n totalBytesToCopyRemaining = maxAlignedBytes - pullIntoDescriptor.bytesFilled, ready = !0;\n while (totalBytesToCopyRemaining > 0) {\n let headOfQueue = @getByIdDirectPrivate(controller, \"queue\").content.peek();\n const bytesToCopy = totalBytesToCopyRemaining < headOfQueue.byteLength \? totalBytesToCopyRemaining : headOfQueue.byteLength, destStart = pullIntoDescriptor.byteOffset + pullIntoDescriptor.bytesFilled;\n if (new @Uint8Array(pullIntoDescriptor.buffer).set(new @Uint8Array(headOfQueue.buffer, headOfQueue.byteOffset, bytesToCopy), destStart), headOfQueue.byteLength === bytesToCopy)\n @getByIdDirectPrivate(controller, \"queue\").content.shift();\n else\n headOfQueue.byteOffset += bytesToCopy, headOfQueue.byteLength -= bytesToCopy;\n @getByIdDirectPrivate(controller, \"queue\").size -= bytesToCopy, @readableByteStreamControllerInvalidateBYOBRequest(controller), pullIntoDescriptor.bytesFilled += bytesToCopy, totalBytesToCopyRemaining -= bytesToCopy;\n }\n return ready;\n})\n"; -// writableStreamDefaultControllerError -const JSC::ConstructAbility s_writableStreamInternalsWritableStreamDefaultControllerErrorCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; -const JSC::ConstructorKind s_writableStreamInternalsWritableStreamDefaultControllerErrorCodeConstructorKind = JSC::ConstructorKind::None; -const JSC::ImplementationVisibility s_writableStreamInternalsWritableStreamDefaultControllerErrorCodeImplementationVisibility = JSC::ImplementationVisibility::Public; -const int s_writableStreamInternalsWritableStreamDefaultControllerErrorCodeLength = 218; -static const JSC::Intrinsic s_writableStreamInternalsWritableStreamDefaultControllerErrorCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_writableStreamInternalsWritableStreamDefaultControllerErrorCode = "(function (controller, error) {\"use strict\";\n const stream = @getByIdDirectPrivate(controller, \"stream\");\n @writableStreamDefaultControllerClearAlgorithms(controller), @writableStreamStartErroring(stream, error);\n})\n"; +// readableByteStreamControllerShiftPendingDescriptor +const JSC::ConstructAbility s_readableByteStreamInternalsReadableByteStreamControllerShiftPendingDescriptorCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; +const JSC::ConstructorKind s_readableByteStreamInternalsReadableByteStreamControllerShiftPendingDescriptorCodeConstructorKind = JSC::ConstructorKind::None; +const JSC::ImplementationVisibility s_readableByteStreamInternalsReadableByteStreamControllerShiftPendingDescriptorCodeImplementationVisibility = JSC::ImplementationVisibility::Public; +const int s_readableByteStreamInternalsReadableByteStreamControllerShiftPendingDescriptorCodeLength = 208; +static const JSC::Intrinsic s_readableByteStreamInternalsReadableByteStreamControllerShiftPendingDescriptorCodeIntrinsic = JSC::NoIntrinsic; +const char* const s_readableByteStreamInternalsReadableByteStreamControllerShiftPendingDescriptorCode = "(function (controller) {\"use strict\";\n let descriptor = @getByIdDirectPrivate(controller, \"pendingPullIntos\").shift();\n return @readableByteStreamControllerInvalidateBYOBRequest(controller), descriptor;\n})\n"; -// writableStreamDefaultControllerErrorIfNeeded -const JSC::ConstructAbility s_writableStreamInternalsWritableStreamDefaultControllerErrorIfNeededCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; -const JSC::ConstructorKind s_writableStreamInternalsWritableStreamDefaultControllerErrorIfNeededCodeConstructorKind = JSC::ConstructorKind::None; -const JSC::ImplementationVisibility s_writableStreamInternalsWritableStreamDefaultControllerErrorIfNeededCodeImplementationVisibility = JSC::ImplementationVisibility::Public; -const int s_writableStreamInternalsWritableStreamDefaultControllerErrorIfNeededCodeLength = 233; -static const JSC::Intrinsic s_writableStreamInternalsWritableStreamDefaultControllerErrorIfNeededCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_writableStreamInternalsWritableStreamDefaultControllerErrorIfNeededCode = "(function (controller, error) {\"use strict\";\n const stream = @getByIdDirectPrivate(controller, \"stream\");\n if (@getByIdDirectPrivate(stream, \"state\") === \"writable\")\n @writableStreamDefaultControllerError(controller, error);\n})\n"; +// readableByteStreamControllerInvalidateBYOBRequest +const JSC::ConstructAbility s_readableByteStreamInternalsReadableByteStreamControllerInvalidateBYOBRequestCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; +const JSC::ConstructorKind s_readableByteStreamInternalsReadableByteStreamControllerInvalidateBYOBRequestCodeConstructorKind = JSC::ConstructorKind::None; +const JSC::ImplementationVisibility s_readableByteStreamInternalsReadableByteStreamControllerInvalidateBYOBRequestCodeImplementationVisibility = JSC::ImplementationVisibility::Public; +const int s_readableByteStreamInternalsReadableByteStreamControllerInvalidateBYOBRequestCodeLength = 406; +static const JSC::Intrinsic s_readableByteStreamInternalsReadableByteStreamControllerInvalidateBYOBRequestCodeIntrinsic = JSC::NoIntrinsic; +const char* const s_readableByteStreamInternalsReadableByteStreamControllerInvalidateBYOBRequestCode = "(function (controller) {\"use strict\";\n if (@getByIdDirectPrivate(controller, \"byobRequest\") === @undefined)\n return;\n const byobRequest = @getByIdDirectPrivate(controller, \"byobRequest\");\n @putByIdDirectPrivate(byobRequest, \"associatedReadableByteStreamController\", @undefined), @putByIdDirectPrivate(byobRequest, \"view\", @undefined), @putByIdDirectPrivate(controller, \"byobRequest\", @undefined);\n})\n"; -// writableStreamDefaultControllerGetBackpressure -const JSC::ConstructAbility s_writableStreamInternalsWritableStreamDefaultControllerGetBackpressureCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; -const JSC::ConstructorKind s_writableStreamInternalsWritableStreamDefaultControllerGetBackpressureCodeConstructorKind = JSC::ConstructorKind::None; -const JSC::ImplementationVisibility s_writableStreamInternalsWritableStreamDefaultControllerGetBackpressureCodeImplementationVisibility = JSC::ImplementationVisibility::Public; -const int s_writableStreamInternalsWritableStreamDefaultControllerGetBackpressureCodeLength = 115; -static const JSC::Intrinsic s_writableStreamInternalsWritableStreamDefaultControllerGetBackpressureCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_writableStreamInternalsWritableStreamDefaultControllerGetBackpressureCode = "(function (controller) {\"use strict\";\n return @writableStreamDefaultControllerGetDesiredSize(controller) <= 0;\n})\n"; +// readableByteStreamControllerCommitDescriptor +const JSC::ConstructAbility s_readableByteStreamInternalsReadableByteStreamControllerCommitDescriptorCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; +const JSC::ConstructorKind s_readableByteStreamInternalsReadableByteStreamControllerCommitDescriptorCodeConstructorKind = JSC::ConstructorKind::None; +const JSC::ImplementationVisibility s_readableByteStreamInternalsReadableByteStreamControllerCommitDescriptorCodeImplementationVisibility = JSC::ImplementationVisibility::Public; +const int s_readableByteStreamInternalsReadableByteStreamControllerCommitDescriptorCodeLength = 420; +static const JSC::Intrinsic s_readableByteStreamInternalsReadableByteStreamControllerCommitDescriptorCodeIntrinsic = JSC::NoIntrinsic; +const char* const s_readableByteStreamInternalsReadableByteStreamControllerCommitDescriptorCode = "(function (stream, pullIntoDescriptor) {\"use strict\";\n let done = !1;\n if (@getByIdDirectPrivate(stream, \"state\") === 1)\n done = !0;\n let filledView = @readableByteStreamControllerConvertDescriptor(pullIntoDescriptor);\n if (pullIntoDescriptor.readerType === \"default\")\n @readableStreamFulfillReadRequest(stream, filledView, done);\n else\n @readableStreamFulfillReadIntoRequest(stream, filledView, done);\n})\n"; -// writableStreamDefaultControllerGetChunkSize -const JSC::ConstructAbility s_writableStreamInternalsWritableStreamDefaultControllerGetChunkSizeCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; -const JSC::ConstructorKind s_writableStreamInternalsWritableStreamDefaultControllerGetChunkSizeCodeConstructorKind = JSC::ConstructorKind::None; -const JSC::ImplementationVisibility s_writableStreamInternalsWritableStreamDefaultControllerGetChunkSizeCodeImplementationVisibility = JSC::ImplementationVisibility::Public; -const int s_writableStreamInternalsWritableStreamDefaultControllerGetChunkSizeCodeLength = 248; -static const JSC::Intrinsic s_writableStreamInternalsWritableStreamDefaultControllerGetChunkSizeCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_writableStreamInternalsWritableStreamDefaultControllerGetChunkSizeCode = "(function (controller, chunk) {\"use strict\";\n try {\n return @getByIdDirectPrivate(controller, \"strategySizeAlgorithm\").@call(@undefined, chunk);\n } catch (e) {\n return @writableStreamDefaultControllerErrorIfNeeded(controller, e), 1;\n }\n})\n"; +// readableByteStreamControllerConvertDescriptor +const JSC::ConstructAbility s_readableByteStreamInternalsReadableByteStreamControllerConvertDescriptorCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; +const JSC::ConstructorKind s_readableByteStreamInternalsReadableByteStreamControllerConvertDescriptorCodeConstructorKind = JSC::ConstructorKind::None; +const JSC::ImplementationVisibility s_readableByteStreamInternalsReadableByteStreamControllerConvertDescriptorCodeImplementationVisibility = JSC::ImplementationVisibility::Public; +const int s_readableByteStreamInternalsReadableByteStreamControllerConvertDescriptorCodeLength = 210; +static const JSC::Intrinsic s_readableByteStreamInternalsReadableByteStreamControllerConvertDescriptorCodeIntrinsic = JSC::NoIntrinsic; +const char* const s_readableByteStreamInternalsReadableByteStreamControllerConvertDescriptorCode = "(function (pullIntoDescriptor) {\"use strict\";\n return new pullIntoDescriptor.ctor(pullIntoDescriptor.buffer, pullIntoDescriptor.byteOffset, pullIntoDescriptor.bytesFilled / pullIntoDescriptor.elementSize);\n})\n"; -// writableStreamDefaultControllerGetDesiredSize -const JSC::ConstructAbility s_writableStreamInternalsWritableStreamDefaultControllerGetDesiredSizeCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; -const JSC::ConstructorKind s_writableStreamInternalsWritableStreamDefaultControllerGetDesiredSizeCodeConstructorKind = JSC::ConstructorKind::None; -const JSC::ImplementationVisibility s_writableStreamInternalsWritableStreamDefaultControllerGetDesiredSizeCodeImplementationVisibility = JSC::ImplementationVisibility::Public; -const int s_writableStreamInternalsWritableStreamDefaultControllerGetDesiredSizeCodeLength = 150; -static const JSC::Intrinsic s_writableStreamInternalsWritableStreamDefaultControllerGetDesiredSizeCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_writableStreamInternalsWritableStreamDefaultControllerGetDesiredSizeCode = "(function (controller) {\"use strict\";\n return @getByIdDirectPrivate(controller, \"strategyHWM\") - @getByIdDirectPrivate(controller, \"queue\").size;\n})\n"; +// readableStreamFulfillReadIntoRequest +const JSC::ConstructAbility s_readableByteStreamInternalsReadableStreamFulfillReadIntoRequestCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; +const JSC::ConstructorKind s_readableByteStreamInternalsReadableStreamFulfillReadIntoRequestCodeConstructorKind = JSC::ConstructorKind::None; +const JSC::ImplementationVisibility s_readableByteStreamInternalsReadableStreamFulfillReadIntoRequestCodeImplementationVisibility = JSC::ImplementationVisibility::Public; +const int s_readableByteStreamInternalsReadableStreamFulfillReadIntoRequestCodeLength = 228; +static const JSC::Intrinsic s_readableByteStreamInternalsReadableStreamFulfillReadIntoRequestCodeIntrinsic = JSC::NoIntrinsic; +const char* const s_readableByteStreamInternalsReadableStreamFulfillReadIntoRequestCode = "(function (stream, chunk, done) {\"use strict\";\n const readIntoRequest = @getByIdDirectPrivate(@getByIdDirectPrivate(stream, \"reader\"), \"readIntoRequests\").shift();\n @fulfillPromise(readIntoRequest, { value: chunk, done });\n})\n"; -// writableStreamDefaultControllerProcessClose -const JSC::ConstructAbility s_writableStreamInternalsWritableStreamDefaultControllerProcessCloseCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; -const JSC::ConstructorKind s_writableStreamInternalsWritableStreamDefaultControllerProcessCloseCodeConstructorKind = JSC::ConstructorKind::None; -const JSC::ImplementationVisibility s_writableStreamInternalsWritableStreamDefaultControllerProcessCloseCodeImplementationVisibility = JSC::ImplementationVisibility::Public; -const int s_writableStreamInternalsWritableStreamDefaultControllerProcessCloseCodeLength = 533; -static const JSC::Intrinsic s_writableStreamInternalsWritableStreamDefaultControllerProcessCloseCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_writableStreamInternalsWritableStreamDefaultControllerProcessCloseCode = "(function (controller) {\"use strict\";\n const stream = @getByIdDirectPrivate(controller, \"stream\");\n @writableStreamMarkCloseRequestInFlight(stream), @dequeueValue(@getByIdDirectPrivate(controller, \"queue\"));\n const sinkClosePromise = @getByIdDirectPrivate(controller, \"closeAlgorithm\").@call();\n @writableStreamDefaultControllerClearAlgorithms(controller), sinkClosePromise.@then(() => {\n @writableStreamFinishInFlightClose(stream);\n }, (reason) => {\n @writableStreamFinishInFlightCloseWithError(stream, reason);\n });\n})\n"; +// readableStreamBYOBReaderRead +const JSC::ConstructAbility s_readableByteStreamInternalsReadableStreamBYOBReaderReadCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; +const JSC::ConstructorKind s_readableByteStreamInternalsReadableStreamBYOBReaderReadCodeConstructorKind = JSC::ConstructorKind::None; +const JSC::ImplementationVisibility s_readableByteStreamInternalsReadableStreamBYOBReaderReadCodeImplementationVisibility = JSC::ImplementationVisibility::Public; +const int s_readableByteStreamInternalsReadableStreamBYOBReaderReadCodeLength = 402; +static const JSC::Intrinsic s_readableByteStreamInternalsReadableStreamBYOBReaderReadCodeIntrinsic = JSC::NoIntrinsic; +const char* const s_readableByteStreamInternalsReadableStreamBYOBReaderReadCode = "(function (reader, view) {\"use strict\";\n const stream = @getByIdDirectPrivate(reader, \"ownerReadableStream\");\n if (@putByIdDirectPrivate(stream, \"disturbed\", !0), @getByIdDirectPrivate(stream, \"state\") === 3)\n return @Promise.@reject(@getByIdDirectPrivate(stream, \"storedError\"));\n return @readableByteStreamControllerPullInto(@getByIdDirectPrivate(stream, \"readableStreamController\"), view);\n})\n"; -// writableStreamDefaultControllerProcessWrite -const JSC::ConstructAbility s_writableStreamInternalsWritableStreamDefaultControllerProcessWriteCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; -const JSC::ConstructorKind s_writableStreamInternalsWritableStreamDefaultControllerProcessWriteCodeConstructorKind = JSC::ConstructorKind::None; -const JSC::ImplementationVisibility s_writableStreamInternalsWritableStreamDefaultControllerProcessWriteCodeImplementationVisibility = JSC::ImplementationVisibility::Public; -const int s_writableStreamInternalsWritableStreamDefaultControllerProcessWriteCodeLength = 950; -static const JSC::Intrinsic s_writableStreamInternalsWritableStreamDefaultControllerProcessWriteCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_writableStreamInternalsWritableStreamDefaultControllerProcessWriteCode = "(function (controller, chunk) {\"use strict\";\n const stream = @getByIdDirectPrivate(controller, \"stream\");\n @writableStreamMarkFirstWriteRequestInFlight(stream), @getByIdDirectPrivate(controller, \"writeAlgorithm\").@call(@undefined, chunk).@then(() => {\n @writableStreamFinishInFlightWrite(stream);\n const state = @getByIdDirectPrivate(stream, \"state\");\n if (@dequeueValue(@getByIdDirectPrivate(controller, \"queue\")), !@writableStreamCloseQueuedOrInFlight(stream) && state === \"writable\") {\n const backpressure = @writableStreamDefaultControllerGetBackpressure(controller);\n @writableStreamUpdateBackpressure(stream, backpressure);\n }\n @writableStreamDefaultControllerAdvanceQueueIfNeeded(controller);\n }, (reason) => {\n if (@getByIdDirectPrivate(stream, \"state\") === \"writable\")\n @writableStreamDefaultControllerClearAlgorithms(controller);\n @writableStreamFinishInFlightWriteWithError(stream, reason);\n });\n})\n"; +// readableByteStreamControllerPullInto +const JSC::ConstructAbility s_readableByteStreamInternalsReadableByteStreamControllerPullIntoCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; +const JSC::ConstructorKind s_readableByteStreamInternalsReadableByteStreamControllerPullIntoCodeConstructorKind = JSC::ConstructorKind::None; +const JSC::ImplementationVisibility s_readableByteStreamInternalsReadableByteStreamControllerPullIntoCodeImplementationVisibility = JSC::ImplementationVisibility::Public; +const int s_readableByteStreamInternalsReadableByteStreamControllerPullIntoCodeLength = 1871; +static const JSC::Intrinsic s_readableByteStreamInternalsReadableByteStreamControllerPullIntoCodeIntrinsic = JSC::NoIntrinsic; +const char* const s_readableByteStreamInternalsReadableByteStreamControllerPullIntoCode = "(function (controller, view) {\"use strict\";\n const stream = @getByIdDirectPrivate(controller, \"controlledReadableStream\");\n let elementSize = 1;\n if (view.BYTES_PER_ELEMENT !== @undefined)\n elementSize = view.BYTES_PER_ELEMENT;\n const ctor = view.constructor, pullIntoDescriptor = {\n buffer: view.buffer,\n byteOffset: view.byteOffset,\n byteLength: view.byteLength,\n bytesFilled: 0,\n elementSize,\n ctor,\n readerType: \"byob\"\n };\n var pending = @getByIdDirectPrivate(controller, \"pendingPullIntos\");\n if (pending\?.isNotEmpty())\n return pullIntoDescriptor.buffer = @transferBufferToCurrentRealm(pullIntoDescriptor.buffer), pending.push(pullIntoDescriptor), @readableStreamAddReadIntoRequest(stream);\n if (@getByIdDirectPrivate(stream, \"state\") === 1) {\n const emptyView = new ctor(pullIntoDescriptor.buffer, pullIntoDescriptor.byteOffset, 0);\n return @createFulfilledPromise({ value: emptyView, done: !0 });\n }\n if (@getByIdDirectPrivate(controller, \"queue\").size > 0) {\n if (@readableByteStreamControllerFillDescriptorFromQueue(controller, pullIntoDescriptor)) {\n const filledView = @readableByteStreamControllerConvertDescriptor(pullIntoDescriptor);\n return @readableByteStreamControllerHandleQueueDrain(controller), @createFulfilledPromise({ value: filledView, done: !1 });\n }\n if (@getByIdDirectPrivate(controller, \"closeRequested\")) {\n const e = @makeTypeError(\"Closing stream has been requested\");\n return @readableByteStreamControllerError(controller, e), @Promise.@reject(e);\n }\n }\n pullIntoDescriptor.buffer = @transferBufferToCurrentRealm(pullIntoDescriptor.buffer), @getByIdDirectPrivate(controller, \"pendingPullIntos\").push(pullIntoDescriptor);\n const promise = @readableStreamAddReadIntoRequest(stream);\n return @readableByteStreamControllerCallPullIfNeeded(controller), promise;\n})\n"; -// writableStreamDefaultControllerWrite -const JSC::ConstructAbility s_writableStreamInternalsWritableStreamDefaultControllerWriteCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; -const JSC::ConstructorKind s_writableStreamInternalsWritableStreamDefaultControllerWriteCodeConstructorKind = JSC::ConstructorKind::None; -const JSC::ImplementationVisibility s_writableStreamInternalsWritableStreamDefaultControllerWriteCodeImplementationVisibility = JSC::ImplementationVisibility::Public; -const int s_writableStreamInternalsWritableStreamDefaultControllerWriteCodeLength = 662; -static const JSC::Intrinsic s_writableStreamInternalsWritableStreamDefaultControllerWriteCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_writableStreamInternalsWritableStreamDefaultControllerWriteCode = "(function (controller, chunk, chunkSize) {\"use strict\";\n try {\n @enqueueValueWithSize(@getByIdDirectPrivate(controller, \"queue\"), chunk, chunkSize);\n const stream = @getByIdDirectPrivate(controller, \"stream\"), state = @getByIdDirectPrivate(stream, \"state\");\n if (!@writableStreamCloseQueuedOrInFlight(stream) && state === \"writable\") {\n const backpressure = @writableStreamDefaultControllerGetBackpressure(controller);\n @writableStreamUpdateBackpressure(stream, backpressure);\n }\n @writableStreamDefaultControllerAdvanceQueueIfNeeded(controller);\n } catch (e) {\n @writableStreamDefaultControllerErrorIfNeeded(controller, e);\n }\n})\n"; +// readableStreamAddReadIntoRequest +const JSC::ConstructAbility s_readableByteStreamInternalsReadableStreamAddReadIntoRequestCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; +const JSC::ConstructorKind s_readableByteStreamInternalsReadableStreamAddReadIntoRequestCodeConstructorKind = JSC::ConstructorKind::None; +const JSC::ImplementationVisibility s_readableByteStreamInternalsReadableStreamAddReadIntoRequestCodeImplementationVisibility = JSC::ImplementationVisibility::Public; +const int s_readableByteStreamInternalsReadableStreamAddReadIntoRequestCodeLength = 198; +static const JSC::Intrinsic s_readableByteStreamInternalsReadableStreamAddReadIntoRequestCodeIntrinsic = JSC::NoIntrinsic; +const char* const s_readableByteStreamInternalsReadableStreamAddReadIntoRequestCode = "(function (stream) {\"use strict\";\n const readRequest = @newPromise();\n return @getByIdDirectPrivate(@getByIdDirectPrivate(stream, \"reader\"), \"readIntoRequests\").push(readRequest), readRequest;\n})\n"; #define DEFINE_BUILTIN_GENERATOR(codeName, functionName, overriddenName, argumentCount) \ JSC::FunctionExecutable* codeName##Generator(JSC::VM& vm) \ {\ JSVMClientData* clientData = static_cast(vm.clientData); \ - return clientData->builtinFunctions().writableStreamInternalsBuiltins().codeName##Executable()->link(vm, nullptr, clientData->builtinFunctions().writableStreamInternalsBuiltins().codeName##Source(), std::nullopt, s_##codeName##Intrinsic); \ + return clientData->builtinFunctions().readableByteStreamInternalsBuiltins().codeName##Executable()->link(vm, nullptr, clientData->builtinFunctions().readableByteStreamInternalsBuiltins().codeName##Source(), std::nullopt, s_##codeName##Intrinsic); \ } -WEBCORE_FOREACH_WRITABLESTREAMINTERNALS_BUILTIN_CODE(DEFINE_BUILTIN_GENERATOR) +WEBCORE_FOREACH_READABLEBYTESTREAMINTERNALS_BUILTIN_CODE(DEFINE_BUILTIN_GENERATOR) #undef DEFINE_BUILTIN_GENERATOR -/* TransformStreamInternals.ts */ -// isTransformStream -const JSC::ConstructAbility s_transformStreamInternalsIsTransformStreamCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; -const JSC::ConstructorKind s_transformStreamInternalsIsTransformStreamCodeConstructorKind = JSC::ConstructorKind::None; -const JSC::ImplementationVisibility s_transformStreamInternalsIsTransformStreamCodeImplementationVisibility = JSC::ImplementationVisibility::Public; -const int s_transformStreamInternalsIsTransformStreamCodeLength = 112; -static const JSC::Intrinsic s_transformStreamInternalsIsTransformStreamCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_transformStreamInternalsIsTransformStreamCode = "(function (stream) {\"use strict\";\n return @isObject(stream) && !!@getByIdDirectPrivate(stream, \"readable\");\n})\n"; - -// isTransformStreamDefaultController -const JSC::ConstructAbility s_transformStreamInternalsIsTransformStreamDefaultControllerCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; -const JSC::ConstructorKind s_transformStreamInternalsIsTransformStreamDefaultControllerCodeConstructorKind = JSC::ConstructorKind::None; -const JSC::ImplementationVisibility s_transformStreamInternalsIsTransformStreamDefaultControllerCodeImplementationVisibility = JSC::ImplementationVisibility::Public; -const int s_transformStreamInternalsIsTransformStreamDefaultControllerCodeLength = 134; -static const JSC::Intrinsic s_transformStreamInternalsIsTransformStreamDefaultControllerCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_transformStreamInternalsIsTransformStreamDefaultControllerCode = "(function (controller) {\"use strict\";\n return @isObject(controller) && !!@getByIdDirectPrivate(controller, \"transformAlgorithm\");\n})\n"; +/* ImportMetaObject.ts */ +// loadCJS2ESM +const JSC::ConstructAbility s_importMetaObjectLoadCJS2ESMCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; +const JSC::ConstructorKind s_importMetaObjectLoadCJS2ESMCodeConstructorKind = JSC::ConstructorKind::None; +const JSC::ImplementationVisibility s_importMetaObjectLoadCJS2ESMCodeImplementationVisibility = JSC::ImplementationVisibility::Public; +const int s_importMetaObjectLoadCJS2ESMCodeLength = 2569; +static const JSC::Intrinsic s_importMetaObjectLoadCJS2ESMCodeIntrinsic = JSC::NoIntrinsic; +const char* const s_importMetaObjectLoadCJS2ESMCode = "(function (resolvedSpecifier) {\"use strict\";\n var loader = @Loader, queue = @createFIFO(), key = resolvedSpecifier;\n while (key) {\n var entry = loader.registry.@get(key);\n if ((entry\?.state \?\? 0) <= @ModuleFetch)\n @fulfillModuleSync(key), entry = loader.registry.@get(key);\n var sourceCodeObject = @getPromiseInternalField(entry.fetch, @promiseFieldReactionsOrResult), moduleRecordPromise = loader.parseModule(key, sourceCodeObject), mod = entry.module;\n if (moduleRecordPromise && @isPromise(moduleRecordPromise)) {\n var reactionsOrResult = @getPromiseInternalField(moduleRecordPromise, @promiseFieldReactionsOrResult), flags = @getPromiseInternalField(moduleRecordPromise, @promiseFieldFlags), state = flags & @promiseStateMask;\n if (state === @promiseStatePending || reactionsOrResult && @isPromise(reactionsOrResult))\n @throwTypeError(`require() async module \"${key}\" is unsupported. use \"await import()\" instead.`);\n else if (state === @promiseStateRejected) {\n if (!reactionsOrResult\?.message)\n @throwTypeError(`${reactionsOrResult + \"\" \? reactionsOrResult : \"An error occurred\"} occurred while parsing module \\\"${key}\\\"`);\n throw reactionsOrResult;\n }\n entry.module = mod = reactionsOrResult;\n } else if (moduleRecordPromise && !mod)\n entry.module = mod = moduleRecordPromise;\n @setStateToMax(entry, @ModuleLink);\n var dependenciesMap = mod.dependenciesMap, requestedModules = loader.requestedModules(mod), dependencies = @newArrayWithSize(requestedModules.length);\n for (var i = 0, length = requestedModules.length;i < length; ++i) {\n var depName = requestedModules[i], depKey = depName[0] === \"/\" \? depName : loader.resolve(depName, key), depEntry = loader.ensureRegistered(depKey);\n if (depEntry.state < @ModuleLink)\n queue.push(depKey);\n @putByValDirect(dependencies, i, depEntry), dependenciesMap.@set(depName, depEntry);\n }\n entry.dependencies = dependencies, entry.instantiate = @Promise.@resolve(entry), entry.satisfy = @Promise.@resolve(entry), entry.isSatisfied = !0, key = queue.shift();\n while (key && (loader.registry.@get(key)\?.state \?\? @ModuleFetch) >= @ModuleLink)\n key = queue.shift();\n }\n var linkAndEvaluateResult = loader.linkAndEvaluateModule(resolvedSpecifier, @undefined);\n if (linkAndEvaluateResult && @isPromise(linkAndEvaluateResult))\n @throwTypeError(`require() async module \\\"${resolvedSpecifier}\\\" is unsupported. use \"await import()\" instead.`);\n return loader.registry.@get(resolvedSpecifier);\n})\n"; -// createTransformStream -const JSC::ConstructAbility s_transformStreamInternalsCreateTransformStreamCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; -const JSC::ConstructorKind s_transformStreamInternalsCreateTransformStreamCodeConstructorKind = JSC::ConstructorKind::None; -const JSC::ImplementationVisibility s_transformStreamInternalsCreateTransformStreamCodeImplementationVisibility = JSC::ImplementationVisibility::Public; -const int s_transformStreamInternalsCreateTransformStreamCodeLength = 1170; -static const JSC::Intrinsic s_transformStreamInternalsCreateTransformStreamCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_transformStreamInternalsCreateTransformStreamCode = "(function (startAlgorithm, transformAlgorithm, flushAlgorithm, writableHighWaterMark, writableSizeAlgorithm, readableHighWaterMark, readableSizeAlgorithm) {\"use strict\";\n if (writableHighWaterMark === @undefined)\n writableHighWaterMark = 1;\n if (writableSizeAlgorithm === @undefined)\n writableSizeAlgorithm = () => 1;\n if (readableHighWaterMark === @undefined)\n readableHighWaterMark = 0;\n if (readableSizeAlgorithm === @undefined)\n readableSizeAlgorithm = () => 1;\n const transform = {};\n @putByIdDirectPrivate(transform, \"TransformStream\", !0);\n const stream = new @TransformStream(transform), startPromiseCapability = @newPromiseCapability(@Promise);\n @initializeTransformStream(stream, startPromiseCapability.promise, writableHighWaterMark, writableSizeAlgorithm, readableHighWaterMark, readableSizeAlgorithm);\n const controller = new @TransformStreamDefaultController;\n return @setUpTransformStreamDefaultController(stream, controller, transformAlgorithm, flushAlgorithm), startAlgorithm().@then(() => {\n startPromiseCapability.resolve.@call();\n }, (error) => {\n startPromiseCapability.reject.@call(@undefined, error);\n }), stream;\n})\n"; +// requireESM +const JSC::ConstructAbility s_importMetaObjectRequireESMCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; +const JSC::ConstructorKind s_importMetaObjectRequireESMCodeConstructorKind = JSC::ConstructorKind::None; +const JSC::ImplementationVisibility s_importMetaObjectRequireESMCodeImplementationVisibility = JSC::ImplementationVisibility::Public; +const int s_importMetaObjectRequireESMCodeLength = 406; +static const JSC::Intrinsic s_importMetaObjectRequireESMCodeIntrinsic = JSC::NoIntrinsic; +const char* const s_importMetaObjectRequireESMCode = "(function (resolved) {\"use strict\";\n var entry = @Loader.registry.@get(resolved);\n if (!entry || !entry.evaluated)\n entry = @loadCJS2ESM(resolved);\n if (!entry || !entry.evaluated || !entry.module)\n @throwTypeError(`require() failed to evaluate module \"${resolved}\". This is an internal consistentency error.`);\n var exports = @Loader.getModuleNamespaceObject(entry.module);\n return exports;\n})\n"; -// initializeTransformStream -const JSC::ConstructAbility s_transformStreamInternalsInitializeTransformStreamCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; -const JSC::ConstructorKind s_transformStreamInternalsInitializeTransformStreamCodeConstructorKind = JSC::ConstructorKind::None; -const JSC::ImplementationVisibility s_transformStreamInternalsInitializeTransformStreamCodeImplementationVisibility = JSC::ImplementationVisibility::Public; -const int s_transformStreamInternalsInitializeTransformStreamCodeLength = 1754; -static const JSC::Intrinsic s_transformStreamInternalsInitializeTransformStreamCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_transformStreamInternalsInitializeTransformStreamCode = "(function (stream, startPromise, writableHighWaterMark, writableSizeAlgorithm, readableHighWaterMark, readableSizeAlgorithm) {\"use strict\";\n const startAlgorithm = () => {\n return startPromise;\n }, writeAlgorithm = (chunk) => {\n return @transformStreamDefaultSinkWriteAlgorithm(stream, chunk);\n }, abortAlgorithm = (reason) => {\n return @transformStreamDefaultSinkAbortAlgorithm(stream, reason);\n }, closeAlgorithm = () => {\n return @transformStreamDefaultSinkCloseAlgorithm(stream);\n }, writable = @createWritableStream(startAlgorithm, writeAlgorithm, closeAlgorithm, abortAlgorithm, writableHighWaterMark, writableSizeAlgorithm), pullAlgorithm = () => {\n return @transformStreamDefaultSourcePullAlgorithm(stream);\n }, cancelAlgorithm = (reason) => {\n return @transformStreamErrorWritableAndUnblockWrite(stream, reason), @Promise.@resolve();\n }, underlyingSource = {};\n @putByIdDirectPrivate(underlyingSource, \"start\", startAlgorithm), @putByIdDirectPrivate(underlyingSource, \"pull\", pullAlgorithm), @putByIdDirectPrivate(underlyingSource, \"cancel\", cancelAlgorithm);\n const options = {};\n @putByIdDirectPrivate(options, \"size\", readableSizeAlgorithm), @putByIdDirectPrivate(options, \"highWaterMark\", readableHighWaterMark);\n const readable = new @ReadableStream(underlyingSource, options);\n @putByIdDirectPrivate(stream, \"writable\", writable), @putByIdDirectPrivate(stream, \"internalWritable\", @getInternalWritableStream(writable)), @putByIdDirectPrivate(stream, \"readable\", readable), @putByIdDirectPrivate(stream, \"backpressure\", @undefined), @putByIdDirectPrivate(stream, \"backpressureChangePromise\", @undefined), @transformStreamSetBackpressure(stream, !0), @putByIdDirectPrivate(stream, \"controller\", @undefined);\n})\n"; +// internalRequire +const JSC::ConstructAbility s_importMetaObjectInternalRequireCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; +const JSC::ConstructorKind s_importMetaObjectInternalRequireCodeConstructorKind = JSC::ConstructorKind::None; +const JSC::ImplementationVisibility s_importMetaObjectInternalRequireCodeImplementationVisibility = JSC::ImplementationVisibility::Public; +const int s_importMetaObjectInternalRequireCodeLength = 1010; +static const JSC::Intrinsic s_importMetaObjectInternalRequireCodeIntrinsic = JSC::NoIntrinsic; +const char* const s_importMetaObjectInternalRequireCode = "(function (id) {\"use strict\";\n var cached = @requireMap.@get(id);\n const last5 = id.substring(id.length - 5);\n if (cached)\n return cached.exports;\n if (last5 === \".json\") {\n var fs = globalThis[Symbol.for(\"_fs\")] ||= Bun.fs(), exports = JSON.parse(fs.readFileSync(id, \"utf8\"));\n return @requireMap.@set(id, @createCommonJSModule(id, exports, !0)), exports;\n } else if (last5 === \".node\") {\n const module = @createCommonJSModule(id, {}, !0);\n return process.dlopen(module, id), @requireMap.@set(id, module), module.exports;\n } else if (last5 === \".toml\") {\n var fs = globalThis[Symbol.for(\"_fs\")] ||= Bun.fs(), exports = Bun.TOML.parse(fs.readFileSync(id, \"utf8\"));\n return @requireMap.@set(id, @createCommonJSModule(id, exports, !0)), exports;\n } else {\n var exports = @requireESM(id);\n const cachedModule = @requireMap.@get(id);\n if (cachedModule)\n return cachedModule.exports;\n return @requireMap.@set(id, @createCommonJSModule(id, exports, !0)), exports;\n }\n})\n"; -// transformStreamError -const JSC::ConstructAbility s_transformStreamInternalsTransformStreamErrorCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; -const JSC::ConstructorKind s_transformStreamInternalsTransformStreamErrorCodeConstructorKind = JSC::ConstructorKind::None; -const JSC::ImplementationVisibility s_transformStreamInternalsTransformStreamErrorCodeImplementationVisibility = JSC::ImplementationVisibility::Public; -const int s_transformStreamInternalsTransformStreamErrorCodeLength = 305; -static const JSC::Intrinsic s_transformStreamInternalsTransformStreamErrorCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_transformStreamInternalsTransformStreamErrorCode = "(function (stream, e) {\"use strict\";\n const readable = @getByIdDirectPrivate(stream, \"readable\"), readableController = @getByIdDirectPrivate(readable, \"readableStreamController\");\n @readableStreamDefaultControllerError(readableController, e), @transformStreamErrorWritableAndUnblockWrite(stream, e);\n})\n"; +// createRequireCache +const JSC::ConstructAbility s_importMetaObjectCreateRequireCacheCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; +const JSC::ConstructorKind s_importMetaObjectCreateRequireCacheCodeConstructorKind = JSC::ConstructorKind::None; +const JSC::ImplementationVisibility s_importMetaObjectCreateRequireCacheCodeImplementationVisibility = JSC::ImplementationVisibility::Public; +const int s_importMetaObjectCreateRequireCacheCodeLength = 1321; +static const JSC::Intrinsic s_importMetaObjectCreateRequireCacheCodeIntrinsic = JSC::NoIntrinsic; +const char* const s_importMetaObjectCreateRequireCacheCode = "(function () {\"use strict\";\n var moduleMap = new Map, inner = {};\n return new Proxy(inner, {\n get(target, key) {\n const entry = @requireMap.@get(key);\n if (entry)\n return entry;\n const esm = @Loader.registry.@get(key);\n if (esm\?.evaluated) {\n const namespace = @Loader.getModuleNamespaceObject(esm.module), mod = @createCommonJSModule(key, namespace, !0);\n return @requireMap.@set(key, mod), mod;\n }\n return inner[key];\n },\n set(target, key, value) {\n return @requireMap.@set(key, value), !0;\n },\n has(target, key) {\n return @requireMap.@has(key) || @Loader.registry.@has(key);\n },\n deleteProperty(target, key) {\n return moduleMap.@delete(key), @requireMap.@delete(key), @Loader.registry.@delete(key), !0;\n },\n ownKeys(target) {\n var array = [...@requireMap.@keys()];\n for (let key of @Loader.registry.@keys())\n if (!array.includes(key) && @Loader.registry.@get(key)\?.evaluated)\n @arrayPush(array, key);\n return array;\n },\n getPrototypeOf(target) {\n return null;\n },\n getOwnPropertyDescriptor(target, key) {\n if (@requireMap.@has(key) || @Loader.registry.@get(key)\?.evaluated)\n return {\n configurable: !0,\n enumerable: !0\n };\n }\n });\n})\n"; -// transformStreamErrorWritableAndUnblockWrite -const JSC::ConstructAbility s_transformStreamInternalsTransformStreamErrorWritableAndUnblockWriteCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; -const JSC::ConstructorKind s_transformStreamInternalsTransformStreamErrorWritableAndUnblockWriteCodeConstructorKind = JSC::ConstructorKind::None; -const JSC::ImplementationVisibility s_transformStreamInternalsTransformStreamErrorWritableAndUnblockWriteCodeImplementationVisibility = JSC::ImplementationVisibility::Public; -const int s_transformStreamInternalsTransformStreamErrorWritableAndUnblockWriteCodeLength = 406; -static const JSC::Intrinsic s_transformStreamInternalsTransformStreamErrorWritableAndUnblockWriteCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_transformStreamInternalsTransformStreamErrorWritableAndUnblockWriteCode = "(function (stream, e) {\"use strict\";\n @transformStreamDefaultControllerClearAlgorithms(@getByIdDirectPrivate(stream, \"controller\"));\n const writable = @getByIdDirectPrivate(stream, \"internalWritable\");\n if (@writableStreamDefaultControllerErrorIfNeeded(@getByIdDirectPrivate(writable, \"controller\"), e), @getByIdDirectPrivate(stream, \"backpressure\"))\n @transformStreamSetBackpressure(stream, !1);\n})\n"; +// main +const JSC::ConstructAbility s_importMetaObjectMainCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; +const JSC::ConstructorKind s_importMetaObjectMainCodeConstructorKind = JSC::ConstructorKind::None; +const JSC::ImplementationVisibility s_importMetaObjectMainCodeImplementationVisibility = JSC::ImplementationVisibility::Public; +const int s_importMetaObjectMainCodeLength = 84; +static const JSC::Intrinsic s_importMetaObjectMainCodeIntrinsic = JSC::NoIntrinsic; +const char* const s_importMetaObjectMainCode = "(function () {\"use strict\";\n return this.path === Bun.main && Bun.isMainThread;\n})\n"; -// transformStreamSetBackpressure -const JSC::ConstructAbility s_transformStreamInternalsTransformStreamSetBackpressureCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; -const JSC::ConstructorKind s_transformStreamInternalsTransformStreamSetBackpressureCodeConstructorKind = JSC::ConstructorKind::None; -const JSC::ImplementationVisibility s_transformStreamInternalsTransformStreamSetBackpressureCodeImplementationVisibility = JSC::ImplementationVisibility::Public; -const int s_transformStreamInternalsTransformStreamSetBackpressureCodeLength = 398; -static const JSC::Intrinsic s_transformStreamInternalsTransformStreamSetBackpressureCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_transformStreamInternalsTransformStreamSetBackpressureCode = "(function (stream, backpressure) {\"use strict\";\n const backpressureChangePromise = @getByIdDirectPrivate(stream, \"backpressureChangePromise\");\n if (backpressureChangePromise !== @undefined)\n backpressureChangePromise.resolve.@call();\n @putByIdDirectPrivate(stream, \"backpressureChangePromise\", @newPromiseCapability(@Promise)), @putByIdDirectPrivate(stream, \"backpressure\", backpressure);\n})\n"; +#define DEFINE_BUILTIN_GENERATOR(codeName, functionName, overriddenName, argumentCount) \ +JSC::FunctionExecutable* codeName##Generator(JSC::VM& vm) \ +{\ + JSVMClientData* clientData = static_cast(vm.clientData); \ + return clientData->builtinFunctions().importMetaObjectBuiltins().codeName##Executable()->link(vm, nullptr, clientData->builtinFunctions().importMetaObjectBuiltins().codeName##Source(), std::nullopt, s_##codeName##Intrinsic); \ +} +WEBCORE_FOREACH_IMPORTMETAOBJECT_BUILTIN_CODE(DEFINE_BUILTIN_GENERATOR) +#undef DEFINE_BUILTIN_GENERATOR -// setUpTransformStreamDefaultController -const JSC::ConstructAbility s_transformStreamInternalsSetUpTransformStreamDefaultControllerCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; -const JSC::ConstructorKind s_transformStreamInternalsSetUpTransformStreamDefaultControllerCodeConstructorKind = JSC::ConstructorKind::None; -const JSC::ImplementationVisibility s_transformStreamInternalsSetUpTransformStreamDefaultControllerCodeImplementationVisibility = JSC::ImplementationVisibility::Public; -const int s_transformStreamInternalsSetUpTransformStreamDefaultControllerCodeLength = 343; -static const JSC::Intrinsic s_transformStreamInternalsSetUpTransformStreamDefaultControllerCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_transformStreamInternalsSetUpTransformStreamDefaultControllerCode = "(function (stream, controller, transformAlgorithm, flushAlgorithm) {\"use strict\";\n @putByIdDirectPrivate(controller, \"stream\", stream), @putByIdDirectPrivate(stream, \"controller\", controller), @putByIdDirectPrivate(controller, \"transformAlgorithm\", transformAlgorithm), @putByIdDirectPrivate(controller, \"flushAlgorithm\", flushAlgorithm);\n})\n"; +/* ReadableStreamDefaultReader.ts */ +// initializeReadableStreamDefaultReader +const JSC::ConstructAbility s_readableStreamDefaultReaderInitializeReadableStreamDefaultReaderCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; +const JSC::ConstructorKind s_readableStreamDefaultReaderInitializeReadableStreamDefaultReaderCodeConstructorKind = JSC::ConstructorKind::None; +const JSC::ImplementationVisibility s_readableStreamDefaultReaderInitializeReadableStreamDefaultReaderCodeImplementationVisibility = JSC::ImplementationVisibility::Public; +const int s_readableStreamDefaultReaderInitializeReadableStreamDefaultReaderCodeLength = 363; +static const JSC::Intrinsic s_readableStreamDefaultReaderInitializeReadableStreamDefaultReaderCodeIntrinsic = JSC::NoIntrinsic; +const char* const s_readableStreamDefaultReaderInitializeReadableStreamDefaultReaderCode = "(function (stream) {\"use strict\";\n if (!@isReadableStream(stream))\n @throwTypeError(\"ReadableStreamDefaultReader needs a ReadableStream\");\n if (@isReadableStreamLocked(stream))\n @throwTypeError(\"ReadableStream is locked\");\n return @readableStreamReaderGenericInitialize(this, stream), @putByIdDirectPrivate(this, \"readRequests\", @createFIFO()), this;\n})\n"; -// setUpTransformStreamDefaultControllerFromTransformer -const JSC::ConstructAbility s_transformStreamInternalsSetUpTransformStreamDefaultControllerFromTransformerCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; -const JSC::ConstructorKind s_transformStreamInternalsSetUpTransformStreamDefaultControllerFromTransformerCodeConstructorKind = JSC::ConstructorKind::None; -const JSC::ImplementationVisibility s_transformStreamInternalsSetUpTransformStreamDefaultControllerFromTransformerCodeImplementationVisibility = JSC::ImplementationVisibility::Public; -const int s_transformStreamInternalsSetUpTransformStreamDefaultControllerFromTransformerCodeLength = 845; -static const JSC::Intrinsic s_transformStreamInternalsSetUpTransformStreamDefaultControllerFromTransformerCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_transformStreamInternalsSetUpTransformStreamDefaultControllerFromTransformerCode = "(function (stream, transformer, transformerDict) {\"use strict\";\n const controller = new @TransformStreamDefaultController;\n let transformAlgorithm = (chunk) => {\n try {\n @transformStreamDefaultControllerEnqueue(controller, chunk);\n } catch (e) {\n return @Promise.@reject(e);\n }\n return @Promise.@resolve();\n }, flushAlgorithm = () => {\n return @Promise.@resolve();\n };\n if (\"transform\" in transformerDict)\n transformAlgorithm = (chunk) => {\n return @promiseInvokeOrNoopMethod(transformer, transformerDict.transform, [chunk, controller]);\n };\n if (\"flush\" in transformerDict)\n flushAlgorithm = () => {\n return @promiseInvokeOrNoopMethod(transformer, transformerDict.flush, [controller]);\n };\n @setUpTransformStreamDefaultController(stream, controller, transformAlgorithm, flushAlgorithm);\n})\n"; +// cancel +const JSC::ConstructAbility s_readableStreamDefaultReaderCancelCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; +const JSC::ConstructorKind s_readableStreamDefaultReaderCancelCodeConstructorKind = JSC::ConstructorKind::None; +const JSC::ImplementationVisibility s_readableStreamDefaultReaderCancelCodeImplementationVisibility = JSC::ImplementationVisibility::Public; +const int s_readableStreamDefaultReaderCancelCodeLength = 394; +static const JSC::Intrinsic s_readableStreamDefaultReaderCancelCodeIntrinsic = JSC::NoIntrinsic; +const char* const s_readableStreamDefaultReaderCancelCode = "(function (reason) {\"use strict\";\n if (!@isReadableStreamDefaultReader(this))\n return @Promise.@reject(@makeThisTypeError(\"ReadableStreamDefaultReader\", \"cancel\"));\n if (!@getByIdDirectPrivate(this, \"ownerReadableStream\"))\n return @Promise.@reject(@makeTypeError(\"cancel() called on a reader owned by no readable stream\"));\n return @readableStreamReaderGenericCancel(this, reason);\n})\n"; -// transformStreamDefaultControllerClearAlgorithms -const JSC::ConstructAbility s_transformStreamInternalsTransformStreamDefaultControllerClearAlgorithmsCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; -const JSC::ConstructorKind s_transformStreamInternalsTransformStreamDefaultControllerClearAlgorithmsCodeConstructorKind = JSC::ConstructorKind::None; -const JSC::ImplementationVisibility s_transformStreamInternalsTransformStreamDefaultControllerClearAlgorithmsCodeImplementationVisibility = JSC::ImplementationVisibility::Public; -const int s_transformStreamInternalsTransformStreamDefaultControllerClearAlgorithmsCodeLength = 169; -static const JSC::Intrinsic s_transformStreamInternalsTransformStreamDefaultControllerClearAlgorithmsCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_transformStreamInternalsTransformStreamDefaultControllerClearAlgorithmsCode = "(function (controller) {\"use strict\";\n @putByIdDirectPrivate(controller, \"transformAlgorithm\", !0), @putByIdDirectPrivate(controller, \"flushAlgorithm\", @undefined);\n})\n"; +// readMany +const JSC::ConstructAbility s_readableStreamDefaultReaderReadManyCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; +const JSC::ConstructorKind s_readableStreamDefaultReaderReadManyCodeConstructorKind = JSC::ConstructorKind::None; +const JSC::ImplementationVisibility s_readableStreamDefaultReaderReadManyCodeImplementationVisibility = JSC::ImplementationVisibility::Public; +const int s_readableStreamDefaultReaderReadManyCodeLength = 3873; +static const JSC::Intrinsic s_readableStreamDefaultReaderReadManyCodeIntrinsic = JSC::NoIntrinsic; +const char* const s_readableStreamDefaultReaderReadManyCode = "(function () {\"use strict\";\n if (!@isReadableStreamDefaultReader(this))\n @throwTypeError(\"ReadableStreamDefaultReader.readMany() should not be called directly\");\n const stream = @getByIdDirectPrivate(this, \"ownerReadableStream\");\n if (!stream)\n @throwTypeError(\"readMany() called on a reader owned by no readable stream\");\n const state = @getByIdDirectPrivate(stream, \"state\");\n if (@putByIdDirectPrivate(stream, \"disturbed\", !0), state === 1)\n return { value: [], size: 0, done: !0 };\n else if (state === 3)\n throw @getByIdDirectPrivate(stream, \"storedError\");\n var controller = @getByIdDirectPrivate(stream, \"readableStreamController\"), queue = @getByIdDirectPrivate(controller, \"queue\");\n if (!queue)\n return controller.@pull(controller).@then(function({ done, value }) {\n return done \? { done: !0, value: [], size: 0 } : { value: [value], size: 1, done: !1 };\n });\n const content = queue.content;\n var size = queue.size, values = content.toArray(!1), length = values.length;\n if (length > 0) {\n var outValues = @newArrayWithSize(length);\n if (@isReadableByteStreamController(controller)) {\n {\n const buf = values[0];\n if (!(@ArrayBuffer.@isView(buf) || buf instanceof @ArrayBuffer))\n @putByValDirect(outValues, 0, new @Uint8Array(buf.buffer, buf.byteOffset, buf.byteLength));\n else\n @putByValDirect(outValues, 0, buf);\n }\n for (var i = 1;i < length; i++) {\n const buf = values[i];\n if (!(@ArrayBuffer.@isView(buf) || buf instanceof @ArrayBuffer))\n @putByValDirect(outValues, i, new @Uint8Array(buf.buffer, buf.byteOffset, buf.byteLength));\n else\n @putByValDirect(outValues, i, buf);\n }\n } else {\n @putByValDirect(outValues, 0, values[0].value);\n for (var i = 1;i < length; i++)\n @putByValDirect(outValues, i, values[i].value);\n }\n if (@resetQueue(@getByIdDirectPrivate(controller, \"queue\")), @getByIdDirectPrivate(controller, \"closeRequested\"))\n @readableStreamClose(@getByIdDirectPrivate(controller, \"controlledReadableStream\"));\n else if (@isReadableStreamDefaultController(controller))\n @readableStreamDefaultControllerCallPullIfNeeded(controller);\n else if (@isReadableByteStreamController(controller))\n @readableByteStreamControllerCallPullIfNeeded(controller);\n return { value: outValues, size, done: !1 };\n }\n var onPullMany = (result) => {\n if (result.done)\n return { value: [], size: 0, done: !0 };\n var controller2 = @getByIdDirectPrivate(stream, \"readableStreamController\"), queue2 = @getByIdDirectPrivate(controller2, \"queue\"), value = [result.value].concat(queue2.content.toArray(!1)), length2 = value.length;\n if (@isReadableByteStreamController(controller2))\n for (var i2 = 0;i2 < length2; i2++) {\n const buf = value[i2];\n if (!(@ArrayBuffer.@isView(buf) || buf instanceof @ArrayBuffer)) {\n const { buffer, byteOffset, byteLength } = buf;\n @putByValDirect(value, i2, new @Uint8Array(buffer, byteOffset, byteLength));\n }\n }\n else\n for (var i2 = 1;i2 < length2; i2++)\n @putByValDirect(value, i2, value[i2].value);\n var size2 = queue2.size;\n if (@resetQueue(queue2), @getByIdDirectPrivate(controller2, \"closeRequested\"))\n @readableStreamClose(@getByIdDirectPrivate(controller2, \"controlledReadableStream\"));\n else if (@isReadableStreamDefaultController(controller2))\n @readableStreamDefaultControllerCallPullIfNeeded(controller2);\n else if (@isReadableByteStreamController(controller2))\n @readableByteStreamControllerCallPullIfNeeded(controller2);\n return { value, size: size2, done: !1 };\n }, pullResult = controller.@pull(controller);\n if (pullResult && @isPromise(pullResult))\n return pullResult.@then(onPullMany);\n return onPullMany(pullResult);\n})\n"; -// transformStreamDefaultControllerEnqueue -const JSC::ConstructAbility s_transformStreamInternalsTransformStreamDefaultControllerEnqueueCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; -const JSC::ConstructorKind s_transformStreamInternalsTransformStreamDefaultControllerEnqueueCodeConstructorKind = JSC::ConstructorKind::None; -const JSC::ImplementationVisibility s_transformStreamInternalsTransformStreamDefaultControllerEnqueueCodeImplementationVisibility = JSC::ImplementationVisibility::Public; -const int s_transformStreamInternalsTransformStreamDefaultControllerEnqueueCodeLength = 786; -static const JSC::Intrinsic s_transformStreamInternalsTransformStreamDefaultControllerEnqueueCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_transformStreamInternalsTransformStreamDefaultControllerEnqueueCode = "(function (controller, chunk) {\"use strict\";\n const stream = @getByIdDirectPrivate(controller, \"stream\"), readable = @getByIdDirectPrivate(stream, \"readable\"), readableController = @getByIdDirectPrivate(readable, \"readableStreamController\");\n if (!@readableStreamDefaultControllerCanCloseOrEnqueue(readableController))\n @throwTypeError(\"TransformStream.readable cannot close or enqueue\");\n try {\n @readableStreamDefaultControllerEnqueue(readableController, chunk);\n } catch (e) {\n throw @transformStreamErrorWritableAndUnblockWrite(stream, e), @getByIdDirectPrivate(readable, \"storedError\");\n }\n if (!@readableStreamDefaultControllerShouldCallPull(readableController) !== @getByIdDirectPrivate(stream, \"backpressure\"))\n @transformStreamSetBackpressure(stream, !0);\n})\n"; +// read +const JSC::ConstructAbility s_readableStreamDefaultReaderReadCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; +const JSC::ConstructorKind s_readableStreamDefaultReaderReadCodeConstructorKind = JSC::ConstructorKind::None; +const JSC::ImplementationVisibility s_readableStreamDefaultReaderReadCodeImplementationVisibility = JSC::ImplementationVisibility::Public; +const int s_readableStreamDefaultReaderReadCodeLength = 374; +static const JSC::Intrinsic s_readableStreamDefaultReaderReadCodeIntrinsic = JSC::NoIntrinsic; +const char* const s_readableStreamDefaultReaderReadCode = "(function () {\"use strict\";\n if (!@isReadableStreamDefaultReader(this))\n return @Promise.@reject(@makeThisTypeError(\"ReadableStreamDefaultReader\", \"read\"));\n if (!@getByIdDirectPrivate(this, \"ownerReadableStream\"))\n return @Promise.@reject(@makeTypeError(\"read() called on a reader owned by no readable stream\"));\n return @readableStreamDefaultReaderRead(this);\n})\n"; -// transformStreamDefaultControllerError -const JSC::ConstructAbility s_transformStreamInternalsTransformStreamDefaultControllerErrorCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; -const JSC::ConstructorKind s_transformStreamInternalsTransformStreamDefaultControllerErrorCodeConstructorKind = JSC::ConstructorKind::None; -const JSC::ImplementationVisibility s_transformStreamInternalsTransformStreamDefaultControllerErrorCodeImplementationVisibility = JSC::ImplementationVisibility::Public; -const int s_transformStreamInternalsTransformStreamDefaultControllerErrorCodeLength = 117; -static const JSC::Intrinsic s_transformStreamInternalsTransformStreamDefaultControllerErrorCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_transformStreamInternalsTransformStreamDefaultControllerErrorCode = "(function (controller, e) {\"use strict\";\n @transformStreamError(@getByIdDirectPrivate(controller, \"stream\"), e);\n})\n"; +// releaseLock +const JSC::ConstructAbility s_readableStreamDefaultReaderReleaseLockCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; +const JSC::ConstructorKind s_readableStreamDefaultReaderReleaseLockCodeConstructorKind = JSC::ConstructorKind::None; +const JSC::ImplementationVisibility s_readableStreamDefaultReaderReleaseLockCodeImplementationVisibility = JSC::ImplementationVisibility::Public; +const int s_readableStreamDefaultReaderReleaseLockCodeLength = 420; +static const JSC::Intrinsic s_readableStreamDefaultReaderReleaseLockCodeIntrinsic = JSC::NoIntrinsic; +const char* const s_readableStreamDefaultReaderReleaseLockCode = "(function () {\"use strict\";\n if (!@isReadableStreamDefaultReader(this))\n throw @makeThisTypeError(\"ReadableStreamDefaultReader\", \"releaseLock\");\n if (!@getByIdDirectPrivate(this, \"ownerReadableStream\"))\n return;\n if (@getByIdDirectPrivate(this, \"readRequests\")\?.isNotEmpty())\n @throwTypeError(\"There are still pending read requests, cannot release the lock\");\n @readableStreamReaderGenericRelease(this);\n})\n"; -// transformStreamDefaultControllerPerformTransform -const JSC::ConstructAbility s_transformStreamInternalsTransformStreamDefaultControllerPerformTransformCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; -const JSC::ConstructorKind s_transformStreamInternalsTransformStreamDefaultControllerPerformTransformCodeConstructorKind = JSC::ConstructorKind::None; -const JSC::ImplementationVisibility s_transformStreamInternalsTransformStreamDefaultControllerPerformTransformCodeImplementationVisibility = JSC::ImplementationVisibility::Public; -const int s_transformStreamInternalsTransformStreamDefaultControllerPerformTransformCodeLength = 415; -static const JSC::Intrinsic s_transformStreamInternalsTransformStreamDefaultControllerPerformTransformCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_transformStreamInternalsTransformStreamDefaultControllerPerformTransformCode = "(function (controller, chunk) {\"use strict\";\n const promiseCapability = @newPromiseCapability(@Promise);\n return @getByIdDirectPrivate(controller, \"transformAlgorithm\").@call(@undefined, chunk).@then(() => {\n promiseCapability.resolve();\n }, (r) => {\n @transformStreamError(@getByIdDirectPrivate(controller, \"stream\"), r), promiseCapability.reject.@call(@undefined, r);\n }), promiseCapability.promise;\n})\n"; +// closed +const JSC::ConstructAbility s_readableStreamDefaultReaderClosedCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; +const JSC::ConstructorKind s_readableStreamDefaultReaderClosedCodeConstructorKind = JSC::ConstructorKind::None; +const JSC::ImplementationVisibility s_readableStreamDefaultReaderClosedCodeImplementationVisibility = JSC::ImplementationVisibility::Public; +const int s_readableStreamDefaultReaderClosedCodeLength = 241; +static const JSC::Intrinsic s_readableStreamDefaultReaderClosedCodeIntrinsic = JSC::NoIntrinsic; +const char* const s_readableStreamDefaultReaderClosedCode = "(function () {\"use strict\";\n if (!@isReadableStreamDefaultReader(this))\n return @Promise.@reject(@makeGetterTypeError(\"ReadableStreamDefaultReader\", \"closed\"));\n return @getByIdDirectPrivate(this, \"closedPromiseCapability\").promise;\n})\n"; -// transformStreamDefaultControllerTerminate -const JSC::ConstructAbility s_transformStreamInternalsTransformStreamDefaultControllerTerminateCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; -const JSC::ConstructorKind s_transformStreamInternalsTransformStreamDefaultControllerTerminateCodeConstructorKind = JSC::ConstructorKind::None; -const JSC::ImplementationVisibility s_transformStreamInternalsTransformStreamDefaultControllerTerminateCodeImplementationVisibility = JSC::ImplementationVisibility::Public; -const int s_transformStreamInternalsTransformStreamDefaultControllerTerminateCodeLength = 508; -static const JSC::Intrinsic s_transformStreamInternalsTransformStreamDefaultControllerTerminateCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_transformStreamInternalsTransformStreamDefaultControllerTerminateCode = "(function (controller) {\"use strict\";\n const stream = @getByIdDirectPrivate(controller, \"stream\"), readable = @getByIdDirectPrivate(stream, \"readable\"), readableController = @getByIdDirectPrivate(readable, \"readableStreamController\");\n if (@readableStreamDefaultControllerCanCloseOrEnqueue(readableController))\n @readableStreamDefaultControllerClose(readableController);\n const error = @makeTypeError(\"the stream has been terminated\");\n @transformStreamErrorWritableAndUnblockWrite(stream, error);\n})\n"; +#define DEFINE_BUILTIN_GENERATOR(codeName, functionName, overriddenName, argumentCount) \ +JSC::FunctionExecutable* codeName##Generator(JSC::VM& vm) \ +{\ + JSVMClientData* clientData = static_cast(vm.clientData); \ + return clientData->builtinFunctions().readableStreamDefaultReaderBuiltins().codeName##Executable()->link(vm, nullptr, clientData->builtinFunctions().readableStreamDefaultReaderBuiltins().codeName##Source(), std::nullopt, s_##codeName##Intrinsic); \ +} +WEBCORE_FOREACH_READABLESTREAMDEFAULTREADER_BUILTIN_CODE(DEFINE_BUILTIN_GENERATOR) +#undef DEFINE_BUILTIN_GENERATOR -// transformStreamDefaultSinkWriteAlgorithm -const JSC::ConstructAbility s_transformStreamInternalsTransformStreamDefaultSinkWriteAlgorithmCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; -const JSC::ConstructorKind s_transformStreamInternalsTransformStreamDefaultSinkWriteAlgorithmCodeConstructorKind = JSC::ConstructorKind::None; -const JSC::ImplementationVisibility s_transformStreamInternalsTransformStreamDefaultSinkWriteAlgorithmCodeImplementationVisibility = JSC::ImplementationVisibility::Public; -const int s_transformStreamInternalsTransformStreamDefaultSinkWriteAlgorithmCodeLength = 971; -static const JSC::Intrinsic s_transformStreamInternalsTransformStreamDefaultSinkWriteAlgorithmCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_transformStreamInternalsTransformStreamDefaultSinkWriteAlgorithmCode = "(function (stream, chunk) {\"use strict\";\n const writable = @getByIdDirectPrivate(stream, \"internalWritable\"), controller = @getByIdDirectPrivate(stream, \"controller\");\n if (@getByIdDirectPrivate(stream, \"backpressure\")) {\n const promiseCapability = @newPromiseCapability(@Promise);\n return @getByIdDirectPrivate(stream, \"backpressureChangePromise\").promise.@then(() => {\n if (@getByIdDirectPrivate(writable, \"state\") === \"erroring\") {\n promiseCapability.reject.@call(@undefined, @getByIdDirectPrivate(writable, \"storedError\"));\n return;\n }\n @transformStreamDefaultControllerPerformTransform(controller, chunk).@then(() => {\n promiseCapability.resolve();\n }, (e) => {\n promiseCapability.reject.@call(@undefined, e);\n });\n }, (e) => {\n promiseCapability.reject.@call(@undefined, e);\n }), promiseCapability.promise;\n }\n return @transformStreamDefaultControllerPerformTransform(controller, chunk);\n})\n"; +/* ReadableStreamBYOBRequest.ts */ +// initializeReadableStreamBYOBRequest +const JSC::ConstructAbility s_readableStreamBYOBRequestInitializeReadableStreamBYOBRequestCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; +const JSC::ConstructorKind s_readableStreamBYOBRequestInitializeReadableStreamBYOBRequestCodeConstructorKind = JSC::ConstructorKind::None; +const JSC::ImplementationVisibility s_readableStreamBYOBRequestInitializeReadableStreamBYOBRequestCodeImplementationVisibility = JSC::ImplementationVisibility::Public; +const int s_readableStreamBYOBRequestInitializeReadableStreamBYOBRequestCodeLength = 291; +static const JSC::Intrinsic s_readableStreamBYOBRequestInitializeReadableStreamBYOBRequestCodeIntrinsic = JSC::NoIntrinsic; +const char* const s_readableStreamBYOBRequestInitializeReadableStreamBYOBRequestCode = "(function (controller, view) {\"use strict\";\n if (arguments.length !== 3 && arguments[2] !== @isReadableStream)\n @throwTypeError(\"ReadableStreamBYOBRequest constructor should not be called directly\");\n return @privateInitializeReadableStreamBYOBRequest.@call(this, controller, view);\n})\n"; -// transformStreamDefaultSinkAbortAlgorithm -const JSC::ConstructAbility s_transformStreamInternalsTransformStreamDefaultSinkAbortAlgorithmCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; -const JSC::ConstructorKind s_transformStreamInternalsTransformStreamDefaultSinkAbortAlgorithmCodeConstructorKind = JSC::ConstructorKind::None; -const JSC::ImplementationVisibility s_transformStreamInternalsTransformStreamDefaultSinkAbortAlgorithmCodeImplementationVisibility = JSC::ImplementationVisibility::Public; -const int s_transformStreamInternalsTransformStreamDefaultSinkAbortAlgorithmCodeLength = 114; -static const JSC::Intrinsic s_transformStreamInternalsTransformStreamDefaultSinkAbortAlgorithmCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_transformStreamInternalsTransformStreamDefaultSinkAbortAlgorithmCode = "(function (stream, reason) {\"use strict\";\n return @transformStreamError(stream, reason), @Promise.@resolve();\n})\n"; +// respond +const JSC::ConstructAbility s_readableStreamBYOBRequestRespondCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; +const JSC::ConstructorKind s_readableStreamBYOBRequestRespondCodeConstructorKind = JSC::ConstructorKind::None; +const JSC::ImplementationVisibility s_readableStreamBYOBRequestRespondCodeImplementationVisibility = JSC::ImplementationVisibility::Public; +const int s_readableStreamBYOBRequestRespondCodeLength = 482; +static const JSC::Intrinsic s_readableStreamBYOBRequestRespondCodeIntrinsic = JSC::NoIntrinsic; +const char* const s_readableStreamBYOBRequestRespondCode = "(function (bytesWritten) {\"use strict\";\n if (!@isReadableStreamBYOBRequest(this))\n throw @makeThisTypeError(\"ReadableStreamBYOBRequest\", \"respond\");\n if (@getByIdDirectPrivate(this, \"associatedReadableByteStreamController\") === @undefined)\n @throwTypeError(\"ReadableStreamBYOBRequest.associatedReadableByteStreamController is undefined\");\n return @readableByteStreamControllerRespond(@getByIdDirectPrivate(this, \"associatedReadableByteStreamController\"), bytesWritten);\n})\n"; -// transformStreamDefaultSinkCloseAlgorithm -const JSC::ConstructAbility s_transformStreamInternalsTransformStreamDefaultSinkCloseAlgorithmCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; -const JSC::ConstructorKind s_transformStreamInternalsTransformStreamDefaultSinkCloseAlgorithmCodeConstructorKind = JSC::ConstructorKind::None; -const JSC::ImplementationVisibility s_transformStreamInternalsTransformStreamDefaultSinkCloseAlgorithmCodeImplementationVisibility = JSC::ImplementationVisibility::Public; -const int s_transformStreamInternalsTransformStreamDefaultSinkCloseAlgorithmCodeLength = 1113; -static const JSC::Intrinsic s_transformStreamInternalsTransformStreamDefaultSinkCloseAlgorithmCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_transformStreamInternalsTransformStreamDefaultSinkCloseAlgorithmCode = "(function (stream) {\"use strict\";\n const readable = @getByIdDirectPrivate(stream, \"readable\"), controller = @getByIdDirectPrivate(stream, \"controller\"), readableController = @getByIdDirectPrivate(readable, \"readableStreamController\"), flushAlgorithm = @getByIdDirectPrivate(controller, \"flushAlgorithm\"), flushPromise = @getByIdDirectPrivate(controller, \"flushAlgorithm\").@call();\n @transformStreamDefaultControllerClearAlgorithms(controller);\n const promiseCapability = @newPromiseCapability(@Promise);\n return flushPromise.@then(() => {\n if (@getByIdDirectPrivate(readable, \"state\") === 3) {\n promiseCapability.reject.@call(@undefined, @getByIdDirectPrivate(readable, \"storedError\"));\n return;\n }\n if (@readableStreamDefaultControllerCanCloseOrEnqueue(readableController))\n @readableStreamDefaultControllerClose(readableController);\n promiseCapability.resolve();\n }, (r) => {\n @transformStreamError(@getByIdDirectPrivate(controller, \"stream\"), r), promiseCapability.reject.@call(@undefined, @getByIdDirectPrivate(readable, \"storedError\"));\n }), promiseCapability.promise;\n})\n"; +// respondWithNewView +const JSC::ConstructAbility s_readableStreamBYOBRequestRespondWithNewViewCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; +const JSC::ConstructorKind s_readableStreamBYOBRequestRespondWithNewViewCodeConstructorKind = JSC::ConstructorKind::None; +const JSC::ImplementationVisibility s_readableStreamBYOBRequestRespondWithNewViewCodeImplementationVisibility = JSC::ImplementationVisibility::Public; +const int s_readableStreamBYOBRequestRespondWithNewViewCodeLength = 655; +static const JSC::Intrinsic s_readableStreamBYOBRequestRespondWithNewViewCodeIntrinsic = JSC::NoIntrinsic; +const char* const s_readableStreamBYOBRequestRespondWithNewViewCode = "(function (view) {\"use strict\";\n if (!@isReadableStreamBYOBRequest(this))\n throw @makeThisTypeError(\"ReadableStreamBYOBRequest\", \"respond\");\n if (@getByIdDirectPrivate(this, \"associatedReadableByteStreamController\") === @undefined)\n @throwTypeError(\"ReadableStreamBYOBRequest.associatedReadableByteStreamController is undefined\");\n if (!@isObject(view))\n @throwTypeError(\"Provided view is not an object\");\n if (!@ArrayBuffer.@isView(view))\n @throwTypeError(\"Provided view is not an ArrayBufferView\");\n return @readableByteStreamControllerRespondWithNewView(@getByIdDirectPrivate(this, \"associatedReadableByteStreamController\"), view);\n})\n"; -// transformStreamDefaultSourcePullAlgorithm -const JSC::ConstructAbility s_transformStreamInternalsTransformStreamDefaultSourcePullAlgorithmCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; -const JSC::ConstructorKind s_transformStreamInternalsTransformStreamDefaultSourcePullAlgorithmCodeConstructorKind = JSC::ConstructorKind::None; -const JSC::ImplementationVisibility s_transformStreamInternalsTransformStreamDefaultSourcePullAlgorithmCodeImplementationVisibility = JSC::ImplementationVisibility::Public; -const int s_transformStreamInternalsTransformStreamDefaultSourcePullAlgorithmCodeLength = 159; -static const JSC::Intrinsic s_transformStreamInternalsTransformStreamDefaultSourcePullAlgorithmCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_transformStreamInternalsTransformStreamDefaultSourcePullAlgorithmCode = "(function (stream) {\"use strict\";\n return @transformStreamSetBackpressure(stream, !1), @getByIdDirectPrivate(stream, \"backpressureChangePromise\").promise;\n})\n"; +// view +const JSC::ConstructAbility s_readableStreamBYOBRequestViewCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; +const JSC::ConstructorKind s_readableStreamBYOBRequestViewCodeConstructorKind = JSC::ConstructorKind::None; +const JSC::ImplementationVisibility s_readableStreamBYOBRequestViewCodeImplementationVisibility = JSC::ImplementationVisibility::Public; +const int s_readableStreamBYOBRequestViewCodeLength = 189; +static const JSC::Intrinsic s_readableStreamBYOBRequestViewCodeIntrinsic = JSC::NoIntrinsic; +const char* const s_readableStreamBYOBRequestViewCode = "(function () {\"use strict\";\n if (!@isReadableStreamBYOBRequest(this))\n throw @makeGetterTypeError(\"ReadableStreamBYOBRequest\", \"view\");\n return @getByIdDirectPrivate(this, \"view\");\n})\n"; #define DEFINE_BUILTIN_GENERATOR(codeName, functionName, overriddenName, argumentCount) \ JSC::FunctionExecutable* codeName##Generator(JSC::VM& vm) \ {\ JSVMClientData* clientData = static_cast(vm.clientData); \ - return clientData->builtinFunctions().transformStreamInternalsBuiltins().codeName##Executable()->link(vm, nullptr, clientData->builtinFunctions().transformStreamInternalsBuiltins().codeName##Source(), std::nullopt, s_##codeName##Intrinsic); \ + return clientData->builtinFunctions().readableStreamBYOBRequestBuiltins().codeName##Executable()->link(vm, nullptr, clientData->builtinFunctions().readableStreamBYOBRequestBuiltins().codeName##Source(), std::nullopt, s_##codeName##Intrinsic); \ } -WEBCORE_FOREACH_TRANSFORMSTREAMINTERNALS_BUILTIN_CODE(DEFINE_BUILTIN_GENERATOR) +WEBCORE_FOREACH_READABLESTREAMBYOBREQUEST_BUILTIN_CODE(DEFINE_BUILTIN_GENERATOR) #undef DEFINE_BUILTIN_GENERATOR /* ProcessObjectInternals.ts */ @@ -667,702 +633,782 @@ JSC::FunctionExecutable* codeName##Generator(JSC::VM& vm) \ WEBCORE_FOREACH_PROCESSOBJECTINTERNALS_BUILTIN_CODE(DEFINE_BUILTIN_GENERATOR) #undef DEFINE_BUILTIN_GENERATOR -/* TransformStream.ts */ -// initializeTransformStream -const JSC::ConstructAbility s_transformStreamInitializeTransformStreamCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; -const JSC::ConstructorKind s_transformStreamInitializeTransformStreamCodeConstructorKind = JSC::ConstructorKind::None; -const JSC::ImplementationVisibility s_transformStreamInitializeTransformStreamCodeImplementationVisibility = JSC::ImplementationVisibility::Public; -const int s_transformStreamInitializeTransformStreamCodeLength = 2355; -static const JSC::Intrinsic s_transformStreamInitializeTransformStreamCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_transformStreamInitializeTransformStreamCode = "(function () {\"use strict\";\n let transformer = arguments[0];\n if (@isObject(transformer) && @getByIdDirectPrivate(transformer, \"TransformStream\"))\n return this;\n let writableStrategy = arguments[1], readableStrategy = arguments[2];\n if (transformer === @undefined)\n transformer = null;\n if (readableStrategy === @undefined)\n readableStrategy = {};\n if (writableStrategy === @undefined)\n writableStrategy = {};\n let transformerDict = {};\n if (transformer !== null) {\n if (\"start\" in transformer) {\n if (transformerDict.start = transformer.start, typeof transformerDict.start !== \"function\")\n @throwTypeError(\"transformer.start should be a function\");\n }\n if (\"transform\" in transformer) {\n if (transformerDict.transform = transformer.transform, typeof transformerDict.transform !== \"function\")\n @throwTypeError(\"transformer.transform should be a function\");\n }\n if (\"flush\" in transformer) {\n if (transformerDict.flush = transformer.flush, typeof transformerDict.flush !== \"function\")\n @throwTypeError(\"transformer.flush should be a function\");\n }\n if (\"readableType\" in transformer)\n @throwRangeError(\"TransformStream transformer has a readableType\");\n if (\"writableType\" in transformer)\n @throwRangeError(\"TransformStream transformer has a writableType\");\n }\n const readableHighWaterMark = @extractHighWaterMark(readableStrategy, 0), readableSizeAlgorithm = @extractSizeAlgorithm(readableStrategy), writableHighWaterMark = @extractHighWaterMark(writableStrategy, 1), writableSizeAlgorithm = @extractSizeAlgorithm(writableStrategy), startPromiseCapability = @newPromiseCapability(@Promise);\n if (@initializeTransformStream(this, startPromiseCapability.promise, writableHighWaterMark, writableSizeAlgorithm, readableHighWaterMark, readableSizeAlgorithm), @setUpTransformStreamDefaultControllerFromTransformer(this, transformer, transformerDict), (\"start\" in transformerDict)) {\n const controller = @getByIdDirectPrivate(this, \"controller\");\n (() => @promiseInvokeOrNoopMethodNoCatch(transformer, transformerDict.start, [controller]))().@then(() => {\n startPromiseCapability.resolve.@call();\n }, (error) => {\n startPromiseCapability.reject.@call(@undefined, error);\n });\n } else\n startPromiseCapability.resolve.@call();\n return this;\n})\n"; +/* WritableStreamInternals.ts */ +// isWritableStream +const JSC::ConstructAbility s_writableStreamInternalsIsWritableStreamCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; +const JSC::ConstructorKind s_writableStreamInternalsIsWritableStreamCodeConstructorKind = JSC::ConstructorKind::None; +const JSC::ImplementationVisibility s_writableStreamInternalsIsWritableStreamCodeImplementationVisibility = JSC::ImplementationVisibility::Public; +const int s_writableStreamInternalsIsWritableStreamCodeLength = 118; +static const JSC::Intrinsic s_writableStreamInternalsIsWritableStreamCodeIntrinsic = JSC::NoIntrinsic; +const char* const s_writableStreamInternalsIsWritableStreamCode = "(function (stream) {\"use strict\";\n return @isObject(stream) && !!@getByIdDirectPrivate(stream, \"underlyingSink\");\n})\n"; -// readable -const JSC::ConstructAbility s_transformStreamReadableCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; -const JSC::ConstructorKind s_transformStreamReadableCodeConstructorKind = JSC::ConstructorKind::None; -const JSC::ImplementationVisibility s_transformStreamReadableCodeImplementationVisibility = JSC::ImplementationVisibility::Public; -const int s_transformStreamReadableCodeLength = 175; -static const JSC::Intrinsic s_transformStreamReadableCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_transformStreamReadableCode = "(function () {\"use strict\";\n if (!@isTransformStream(this))\n throw @makeThisTypeError(\"TransformStream\", \"readable\");\n return @getByIdDirectPrivate(this, \"readable\");\n})\n"; +// isWritableStreamDefaultWriter +const JSC::ConstructAbility s_writableStreamInternalsIsWritableStreamDefaultWriterCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; +const JSC::ConstructorKind s_writableStreamInternalsIsWritableStreamDefaultWriterCodeConstructorKind = JSC::ConstructorKind::None; +const JSC::ImplementationVisibility s_writableStreamInternalsIsWritableStreamDefaultWriterCodeImplementationVisibility = JSC::ImplementationVisibility::Public; +const int s_writableStreamInternalsIsWritableStreamDefaultWriterCodeLength = 117; +static const JSC::Intrinsic s_writableStreamInternalsIsWritableStreamDefaultWriterCodeIntrinsic = JSC::NoIntrinsic; +const char* const s_writableStreamInternalsIsWritableStreamDefaultWriterCode = "(function (writer) {\"use strict\";\n return @isObject(writer) && !!@getByIdDirectPrivate(writer, \"closedPromise\");\n})\n"; -// writable -const JSC::ConstructAbility s_transformStreamWritableCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; -const JSC::ConstructorKind s_transformStreamWritableCodeConstructorKind = JSC::ConstructorKind::None; -const JSC::ImplementationVisibility s_transformStreamWritableCodeImplementationVisibility = JSC::ImplementationVisibility::Public; -const int s_transformStreamWritableCodeLength = 175; -static const JSC::Intrinsic s_transformStreamWritableCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_transformStreamWritableCode = "(function () {\"use strict\";\n if (!@isTransformStream(this))\n throw @makeThisTypeError(\"TransformStream\", \"writable\");\n return @getByIdDirectPrivate(this, \"writable\");\n})\n"; +// acquireWritableStreamDefaultWriter +const JSC::ConstructAbility s_writableStreamInternalsAcquireWritableStreamDefaultWriterCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; +const JSC::ConstructorKind s_writableStreamInternalsAcquireWritableStreamDefaultWriterCodeConstructorKind = JSC::ConstructorKind::None; +const JSC::ImplementationVisibility s_writableStreamInternalsAcquireWritableStreamDefaultWriterCodeImplementationVisibility = JSC::ImplementationVisibility::Public; +const int s_writableStreamInternalsAcquireWritableStreamDefaultWriterCodeLength = 88; +static const JSC::Intrinsic s_writableStreamInternalsAcquireWritableStreamDefaultWriterCodeIntrinsic = JSC::NoIntrinsic; +const char* const s_writableStreamInternalsAcquireWritableStreamDefaultWriterCode = "(function (stream) {\"use strict\";\n return new @WritableStreamDefaultWriter(stream);\n})\n"; + +// createWritableStream +const JSC::ConstructAbility s_writableStreamInternalsCreateWritableStreamCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; +const JSC::ConstructorKind s_writableStreamInternalsCreateWritableStreamCodeConstructorKind = JSC::ConstructorKind::None; +const JSC::ImplementationVisibility s_writableStreamInternalsCreateWritableStreamCodeImplementationVisibility = JSC::ImplementationVisibility::Public; +const int s_writableStreamInternalsCreateWritableStreamCodeLength = 486; +static const JSC::Intrinsic s_writableStreamInternalsCreateWritableStreamCodeIntrinsic = JSC::NoIntrinsic; +const char* const s_writableStreamInternalsCreateWritableStreamCode = "(function (startAlgorithm, writeAlgorithm, closeAlgorithm, abortAlgorithm, highWaterMark, sizeAlgorithm) {\"use strict\";\n const internalStream = {};\n @initializeWritableStreamSlots(internalStream, {});\n const controller = new @WritableStreamDefaultController;\n return @setUpWritableStreamDefaultController(internalStream, controller, startAlgorithm, writeAlgorithm, closeAlgorithm, abortAlgorithm, highWaterMark, sizeAlgorithm), @createWritableStreamFromInternal(internalStream);\n})\n"; + +// createInternalWritableStreamFromUnderlyingSink +const JSC::ConstructAbility s_writableStreamInternalsCreateInternalWritableStreamFromUnderlyingSinkCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; +const JSC::ConstructorKind s_writableStreamInternalsCreateInternalWritableStreamFromUnderlyingSinkCodeConstructorKind = JSC::ConstructorKind::None; +const JSC::ImplementationVisibility s_writableStreamInternalsCreateInternalWritableStreamFromUnderlyingSinkCodeImplementationVisibility = JSC::ImplementationVisibility::Public; +const int s_writableStreamInternalsCreateInternalWritableStreamFromUnderlyingSinkCodeLength = 1576; +static const JSC::Intrinsic s_writableStreamInternalsCreateInternalWritableStreamFromUnderlyingSinkCodeIntrinsic = JSC::NoIntrinsic; +const char* const s_writableStreamInternalsCreateInternalWritableStreamFromUnderlyingSinkCode = "(function (underlyingSink, strategy) {\"use strict\";\n const stream = {};\n if (underlyingSink === @undefined)\n underlyingSink = {};\n if (strategy === @undefined)\n strategy = {};\n if (!@isObject(underlyingSink))\n @throwTypeError(\"WritableStream constructor takes an object as first argument\");\n if (\"type\" in underlyingSink)\n @throwRangeError(\"Invalid type is specified\");\n const sizeAlgorithm = @extractSizeAlgorithm(strategy), highWaterMark = @extractHighWaterMark(strategy, 1), underlyingSinkDict = {};\n if (\"start\" in underlyingSink) {\n if (underlyingSinkDict.start = underlyingSink.start, typeof underlyingSinkDict.start !== \"function\")\n @throwTypeError(\"underlyingSink.start should be a function\");\n }\n if (\"write\" in underlyingSink) {\n if (underlyingSinkDict.write = underlyingSink.write, typeof underlyingSinkDict.write !== \"function\")\n @throwTypeError(\"underlyingSink.write should be a function\");\n }\n if (\"close\" in underlyingSink) {\n if (underlyingSinkDict.close = underlyingSink.close, typeof underlyingSinkDict.close !== \"function\")\n @throwTypeError(\"underlyingSink.close should be a function\");\n }\n if (\"abort\" in underlyingSink) {\n if (underlyingSinkDict.abort = underlyingSink.abort, typeof underlyingSinkDict.abort !== \"function\")\n @throwTypeError(\"underlyingSink.abort should be a function\");\n }\n return @initializeWritableStreamSlots(stream, underlyingSink), @setUpWritableStreamDefaultControllerFromUnderlyingSink(stream, underlyingSink, underlyingSinkDict, highWaterMark, sizeAlgorithm), stream;\n})\n"; + +// initializeWritableStreamSlots +const JSC::ConstructAbility s_writableStreamInternalsInitializeWritableStreamSlotsCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; +const JSC::ConstructorKind s_writableStreamInternalsInitializeWritableStreamSlotsCodeConstructorKind = JSC::ConstructorKind::None; +const JSC::ImplementationVisibility s_writableStreamInternalsInitializeWritableStreamSlotsCodeImplementationVisibility = JSC::ImplementationVisibility::Public; +const int s_writableStreamInternalsInitializeWritableStreamSlotsCodeLength = 713; +static const JSC::Intrinsic s_writableStreamInternalsInitializeWritableStreamSlotsCodeIntrinsic = JSC::NoIntrinsic; +const char* const s_writableStreamInternalsInitializeWritableStreamSlotsCode = "(function (stream, underlyingSink) {\"use strict\";\n @putByIdDirectPrivate(stream, \"state\", \"writable\"), @putByIdDirectPrivate(stream, \"storedError\", @undefined), @putByIdDirectPrivate(stream, \"writer\", @undefined), @putByIdDirectPrivate(stream, \"controller\", @undefined), @putByIdDirectPrivate(stream, \"inFlightWriteRequest\", @undefined), @putByIdDirectPrivate(stream, \"closeRequest\", @undefined), @putByIdDirectPrivate(stream, \"inFlightCloseRequest\", @undefined), @putByIdDirectPrivate(stream, \"pendingAbortRequest\", @undefined), @putByIdDirectPrivate(stream, \"writeRequests\", @createFIFO()), @putByIdDirectPrivate(stream, \"backpressure\", !1), @putByIdDirectPrivate(stream, \"underlyingSink\", underlyingSink);\n})\n"; + +// writableStreamCloseForBindings +const JSC::ConstructAbility s_writableStreamInternalsWritableStreamCloseForBindingsCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; +const JSC::ConstructorKind s_writableStreamInternalsWritableStreamCloseForBindingsCodeConstructorKind = JSC::ConstructorKind::None; +const JSC::ImplementationVisibility s_writableStreamInternalsWritableStreamCloseForBindingsCodeImplementationVisibility = JSC::ImplementationVisibility::Public; +const int s_writableStreamInternalsWritableStreamCloseForBindingsCodeLength = 414; +static const JSC::Intrinsic s_writableStreamInternalsWritableStreamCloseForBindingsCodeIntrinsic = JSC::NoIntrinsic; +const char* const s_writableStreamInternalsWritableStreamCloseForBindingsCode = "(function (stream) {\"use strict\";\n if (@isWritableStreamLocked(stream))\n return @Promise.@reject(@makeTypeError(\"WritableStream.close method can only be used on non locked WritableStream\"));\n if (@writableStreamCloseQueuedOrInFlight(stream))\n return @Promise.@reject(@makeTypeError(\"WritableStream.close method can only be used on a being close WritableStream\"));\n return @writableStreamClose(stream);\n})\n"; + +// writableStreamAbortForBindings +const JSC::ConstructAbility s_writableStreamInternalsWritableStreamAbortForBindingsCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; +const JSC::ConstructorKind s_writableStreamInternalsWritableStreamAbortForBindingsCodeConstructorKind = JSC::ConstructorKind::None; +const JSC::ImplementationVisibility s_writableStreamInternalsWritableStreamAbortForBindingsCodeImplementationVisibility = JSC::ImplementationVisibility::Public; +const int s_writableStreamInternalsWritableStreamAbortForBindingsCodeLength = 253; +static const JSC::Intrinsic s_writableStreamInternalsWritableStreamAbortForBindingsCodeIntrinsic = JSC::NoIntrinsic; +const char* const s_writableStreamInternalsWritableStreamAbortForBindingsCode = "(function (stream, reason) {\"use strict\";\n if (@isWritableStreamLocked(stream))\n return @Promise.@reject(@makeTypeError(\"WritableStream.abort method can only be used on non locked WritableStream\"));\n return @writableStreamAbort(stream, reason);\n})\n"; + +// isWritableStreamLocked +const JSC::ConstructAbility s_writableStreamInternalsIsWritableStreamLockedCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; +const JSC::ConstructorKind s_writableStreamInternalsIsWritableStreamLockedCodeConstructorKind = JSC::ConstructorKind::None; +const JSC::ImplementationVisibility s_writableStreamInternalsIsWritableStreamLockedCodeImplementationVisibility = JSC::ImplementationVisibility::Public; +const int s_writableStreamInternalsIsWritableStreamLockedCodeLength = 102; +static const JSC::Intrinsic s_writableStreamInternalsIsWritableStreamLockedCodeIntrinsic = JSC::NoIntrinsic; +const char* const s_writableStreamInternalsIsWritableStreamLockedCode = "(function (stream) {\"use strict\";\n return @getByIdDirectPrivate(stream, \"writer\") !== @undefined;\n})\n"; + +// setUpWritableStreamDefaultWriter +const JSC::ConstructAbility s_writableStreamInternalsSetUpWritableStreamDefaultWriterCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; +const JSC::ConstructorKind s_writableStreamInternalsSetUpWritableStreamDefaultWriterCodeConstructorKind = JSC::ConstructorKind::None; +const JSC::ImplementationVisibility s_writableStreamInternalsSetUpWritableStreamDefaultWriterCodeImplementationVisibility = JSC::ImplementationVisibility::Public; +const int s_writableStreamInternalsSetUpWritableStreamDefaultWriterCodeLength = 1368; +static const JSC::Intrinsic s_writableStreamInternalsSetUpWritableStreamDefaultWriterCodeIntrinsic = JSC::NoIntrinsic; +const char* const s_writableStreamInternalsSetUpWritableStreamDefaultWriterCode = "(function (writer, stream) {\"use strict\";\n if (@isWritableStreamLocked(stream))\n @throwTypeError(\"WritableStream is locked\");\n @putByIdDirectPrivate(writer, \"stream\", stream), @putByIdDirectPrivate(stream, \"writer\", writer);\n const readyPromiseCapability = @newPromiseCapability(@Promise), closedPromiseCapability = @newPromiseCapability(@Promise);\n @putByIdDirectPrivate(writer, \"readyPromise\", readyPromiseCapability), @putByIdDirectPrivate(writer, \"closedPromise\", closedPromiseCapability);\n const state = @getByIdDirectPrivate(stream, \"state\");\n if (state === \"writable\") {\n if (@writableStreamCloseQueuedOrInFlight(stream) || !@getByIdDirectPrivate(stream, \"backpressure\"))\n readyPromiseCapability.resolve.@call();\n } else if (state === \"erroring\")\n readyPromiseCapability.reject.@call(@undefined, @getByIdDirectPrivate(stream, \"storedError\")), @markPromiseAsHandled(readyPromiseCapability.promise);\n else if (state === \"closed\")\n readyPromiseCapability.resolve.@call(), closedPromiseCapability.resolve.@call();\n else {\n const storedError = @getByIdDirectPrivate(stream, \"storedError\");\n readyPromiseCapability.reject.@call(@undefined, storedError), @markPromiseAsHandled(readyPromiseCapability.promise), closedPromiseCapability.reject.@call(@undefined, storedError), @markPromiseAsHandled(closedPromiseCapability.promise);\n }\n})\n"; + +// writableStreamAbort +const JSC::ConstructAbility s_writableStreamInternalsWritableStreamAbortCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; +const JSC::ConstructorKind s_writableStreamInternalsWritableStreamAbortCodeConstructorKind = JSC::ConstructorKind::None; +const JSC::ImplementationVisibility s_writableStreamInternalsWritableStreamAbortCodeImplementationVisibility = JSC::ImplementationVisibility::Public; +const int s_writableStreamInternalsWritableStreamAbortCodeLength = 782; +static const JSC::Intrinsic s_writableStreamInternalsWritableStreamAbortCodeIntrinsic = JSC::NoIntrinsic; +const char* const s_writableStreamInternalsWritableStreamAbortCode = "(function (stream, reason) {\"use strict\";\n const state = @getByIdDirectPrivate(stream, \"state\");\n if (state === \"closed\" || state === \"errored\")\n return @Promise.@resolve();\n const pendingAbortRequest = @getByIdDirectPrivate(stream, \"pendingAbortRequest\");\n if (pendingAbortRequest !== @undefined)\n return pendingAbortRequest.promise.promise;\n let wasAlreadyErroring = !1;\n if (state === \"erroring\")\n wasAlreadyErroring = !0, reason = @undefined;\n const abortPromiseCapability = @newPromiseCapability(@Promise);\n if (@putByIdDirectPrivate(stream, \"pendingAbortRequest\", {\n promise: abortPromiseCapability,\n reason,\n wasAlreadyErroring\n }), !wasAlreadyErroring)\n @writableStreamStartErroring(stream, reason);\n return abortPromiseCapability.promise;\n})\n"; + +// writableStreamClose +const JSC::ConstructAbility s_writableStreamInternalsWritableStreamCloseCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; +const JSC::ConstructorKind s_writableStreamInternalsWritableStreamCloseCodeConstructorKind = JSC::ConstructorKind::None; +const JSC::ImplementationVisibility s_writableStreamInternalsWritableStreamCloseCodeImplementationVisibility = JSC::ImplementationVisibility::Public; +const int s_writableStreamInternalsWritableStreamCloseCodeLength = 738; +static const JSC::Intrinsic s_writableStreamInternalsWritableStreamCloseCodeIntrinsic = JSC::NoIntrinsic; +const char* const s_writableStreamInternalsWritableStreamCloseCode = "(function (stream) {\"use strict\";\n const state = @getByIdDirectPrivate(stream, \"state\");\n if (state === \"closed\" || state === \"errored\")\n return @Promise.@reject(@makeTypeError(\"Cannot close a writable stream that is closed or errored\"));\n const closePromiseCapability = @newPromiseCapability(@Promise);\n @putByIdDirectPrivate(stream, \"closeRequest\", closePromiseCapability);\n const writer = @getByIdDirectPrivate(stream, \"writer\");\n if (writer !== @undefined && @getByIdDirectPrivate(stream, \"backpressure\") && state === \"writable\")\n @getByIdDirectPrivate(writer, \"readyPromise\").resolve.@call();\n return @writableStreamDefaultControllerClose(@getByIdDirectPrivate(stream, \"controller\")), closePromiseCapability.promise;\n})\n"; + +// writableStreamAddWriteRequest +const JSC::ConstructAbility s_writableStreamInternalsWritableStreamAddWriteRequestCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; +const JSC::ConstructorKind s_writableStreamInternalsWritableStreamAddWriteRequestCodeConstructorKind = JSC::ConstructorKind::None; +const JSC::ImplementationVisibility s_writableStreamInternalsWritableStreamAddWriteRequestCodeImplementationVisibility = JSC::ImplementationVisibility::Public; +const int s_writableStreamInternalsWritableStreamAddWriteRequestCodeLength = 221; +static const JSC::Intrinsic s_writableStreamInternalsWritableStreamAddWriteRequestCodeIntrinsic = JSC::NoIntrinsic; +const char* const s_writableStreamInternalsWritableStreamAddWriteRequestCode = "(function (stream) {\"use strict\";\n const writePromiseCapability = @newPromiseCapability(@Promise);\n return @getByIdDirectPrivate(stream, \"writeRequests\").push(writePromiseCapability), writePromiseCapability.promise;\n})\n"; -#define DEFINE_BUILTIN_GENERATOR(codeName, functionName, overriddenName, argumentCount) \ -JSC::FunctionExecutable* codeName##Generator(JSC::VM& vm) \ -{\ - JSVMClientData* clientData = static_cast(vm.clientData); \ - return clientData->builtinFunctions().transformStreamBuiltins().codeName##Executable()->link(vm, nullptr, clientData->builtinFunctions().transformStreamBuiltins().codeName##Source(), std::nullopt, s_##codeName##Intrinsic); \ -} -WEBCORE_FOREACH_TRANSFORMSTREAM_BUILTIN_CODE(DEFINE_BUILTIN_GENERATOR) -#undef DEFINE_BUILTIN_GENERATOR +// writableStreamCloseQueuedOrInFlight +const JSC::ConstructAbility s_writableStreamInternalsWritableStreamCloseQueuedOrInFlightCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; +const JSC::ConstructorKind s_writableStreamInternalsWritableStreamCloseQueuedOrInFlightCodeConstructorKind = JSC::ConstructorKind::None; +const JSC::ImplementationVisibility s_writableStreamInternalsWritableStreamCloseQueuedOrInFlightCodeImplementationVisibility = JSC::ImplementationVisibility::Public; +const int s_writableStreamInternalsWritableStreamCloseQueuedOrInFlightCodeLength = 180; +static const JSC::Intrinsic s_writableStreamInternalsWritableStreamCloseQueuedOrInFlightCodeIntrinsic = JSC::NoIntrinsic; +const char* const s_writableStreamInternalsWritableStreamCloseQueuedOrInFlightCode = "(function (stream) {\"use strict\";\n return @getByIdDirectPrivate(stream, \"closeRequest\") !== @undefined || @getByIdDirectPrivate(stream, \"inFlightCloseRequest\") !== @undefined;\n})\n"; -/* Module.ts */ -// main -const JSC::ConstructAbility s_moduleMainCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; -const JSC::ConstructorKind s_moduleMainCodeConstructorKind = JSC::ConstructorKind::None; -const JSC::ImplementationVisibility s_moduleMainCodeImplementationVisibility = JSC::ImplementationVisibility::Public; -const int s_moduleMainCodeLength = 68; -static const JSC::Intrinsic s_moduleMainCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_moduleMainCode = "(function () {\"use strict\";\n return @requireMap.@get(Bun.main);\n})\n"; +// writableStreamDealWithRejection +const JSC::ConstructAbility s_writableStreamInternalsWritableStreamDealWithRejectionCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; +const JSC::ConstructorKind s_writableStreamInternalsWritableStreamDealWithRejectionCodeConstructorKind = JSC::ConstructorKind::None; +const JSC::ImplementationVisibility s_writableStreamInternalsWritableStreamDealWithRejectionCodeImplementationVisibility = JSC::ImplementationVisibility::Public; +const int s_writableStreamInternalsWritableStreamDealWithRejectionCodeLength = 213; +static const JSC::Intrinsic s_writableStreamInternalsWritableStreamDealWithRejectionCodeIntrinsic = JSC::NoIntrinsic; +const char* const s_writableStreamInternalsWritableStreamDealWithRejectionCode = "(function (stream, error) {\"use strict\";\n if (@getByIdDirectPrivate(stream, \"state\") === \"writable\") {\n @writableStreamStartErroring(stream, error);\n return;\n }\n @writableStreamFinishErroring(stream);\n})\n"; -// require -const JSC::ConstructAbility s_moduleRequireCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; -const JSC::ConstructorKind s_moduleRequireCodeConstructorKind = JSC::ConstructorKind::None; -const JSC::ImplementationVisibility s_moduleRequireCodeImplementationVisibility = JSC::ImplementationVisibility::Public; -const int s_moduleRequireCodeLength = 882; -static const JSC::Intrinsic s_moduleRequireCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_moduleRequireCode = "(function (id) {\"use strict\";\n const existing = @requireMap.@get(id) || @requireMap.@get(id = @resolveSync(id, this.path, !1));\n if (existing)\n return @evaluateCommonJSModule(existing), existing.exports;\n if (id.endsWith(\".node\"))\n return @internalRequire(id);\n const mod = @createCommonJSModule(id, {}, !1);\n @requireMap.@set(id, mod);\n var out = this.@require(id, mod);\n if (out === -1) {\n try {\n out = @requireESM(id);\n } catch (exception) {\n throw @requireMap.@delete(id), exception;\n }\n const esm = @Loader.registry.@get(id);\n if (esm\?.evaluated && (esm.state \?\? 0) >= @ModuleReady) {\n const namespace = @Loader.getModuleNamespaceObject(esm.module);\n return mod.exports = namespace.__esModule \? namespace : Object.create(namespace, { __esModule: { value: !0 } });\n }\n }\n return @evaluateCommonJSModule(mod), mod.exports;\n})\n"; +// writableStreamFinishErroring +const JSC::ConstructAbility s_writableStreamInternalsWritableStreamFinishErroringCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; +const JSC::ConstructorKind s_writableStreamInternalsWritableStreamFinishErroringCodeConstructorKind = JSC::ConstructorKind::None; +const JSC::ImplementationVisibility s_writableStreamInternalsWritableStreamFinishErroringCodeImplementationVisibility = JSC::ImplementationVisibility::Public; +const int s_writableStreamInternalsWritableStreamFinishErroringCodeLength = 1323; +static const JSC::Intrinsic s_writableStreamInternalsWritableStreamFinishErroringCodeIntrinsic = JSC::NoIntrinsic; +const char* const s_writableStreamInternalsWritableStreamFinishErroringCode = "(function (stream) {\"use strict\";\n @putByIdDirectPrivate(stream, \"state\", \"errored\");\n const controller = @getByIdDirectPrivate(stream, \"controller\");\n @getByIdDirectPrivate(controller, \"errorSteps\").@call();\n const storedError = @getByIdDirectPrivate(stream, \"storedError\"), requests = @getByIdDirectPrivate(stream, \"writeRequests\");\n for (var request = requests.shift();request; request = requests.shift())\n request.reject.@call(@undefined, storedError);\n @putByIdDirectPrivate(stream, \"writeRequests\", @createFIFO());\n const abortRequest = @getByIdDirectPrivate(stream, \"pendingAbortRequest\");\n if (abortRequest === @undefined) {\n @writableStreamRejectCloseAndClosedPromiseIfNeeded(stream);\n return;\n }\n if (@putByIdDirectPrivate(stream, \"pendingAbortRequest\", @undefined), abortRequest.wasAlreadyErroring) {\n abortRequest.promise.reject.@call(@undefined, storedError), @writableStreamRejectCloseAndClosedPromiseIfNeeded(stream);\n return;\n }\n @getByIdDirectPrivate(controller, \"abortSteps\").@call(@undefined, abortRequest.reason).@then(() => {\n abortRequest.promise.resolve.@call(), @writableStreamRejectCloseAndClosedPromiseIfNeeded(stream);\n }, (reason) => {\n abortRequest.promise.reject.@call(@undefined, reason), @writableStreamRejectCloseAndClosedPromiseIfNeeded(stream);\n });\n})\n"; -// requireResolve -const JSC::ConstructAbility s_moduleRequireResolveCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; -const JSC::ConstructorKind s_moduleRequireResolveCodeConstructorKind = JSC::ConstructorKind::None; -const JSC::ImplementationVisibility s_moduleRequireResolveCodeImplementationVisibility = JSC::ImplementationVisibility::Public; -const int s_moduleRequireResolveCodeLength = 110; -static const JSC::Intrinsic s_moduleRequireResolveCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_moduleRequireResolveCode = "(function (id) {\"use strict\";\n return @resolveSync(id, typeof this === \"string\" \? this : this\?.path, !1);\n})\n"; +// writableStreamFinishInFlightClose +const JSC::ConstructAbility s_writableStreamInternalsWritableStreamFinishInFlightCloseCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; +const JSC::ConstructorKind s_writableStreamInternalsWritableStreamFinishInFlightCloseCodeConstructorKind = JSC::ConstructorKind::None; +const JSC::ImplementationVisibility s_writableStreamInternalsWritableStreamFinishInFlightCloseCodeImplementationVisibility = JSC::ImplementationVisibility::Public; +const int s_writableStreamInternalsWritableStreamFinishInFlightCloseCodeLength = 737; +static const JSC::Intrinsic s_writableStreamInternalsWritableStreamFinishInFlightCloseCodeIntrinsic = JSC::NoIntrinsic; +const char* const s_writableStreamInternalsWritableStreamFinishInFlightCloseCode = "(function (stream) {\"use strict\";\n if (@getByIdDirectPrivate(stream, \"inFlightCloseRequest\").resolve.@call(), @putByIdDirectPrivate(stream, \"inFlightCloseRequest\", @undefined), @getByIdDirectPrivate(stream, \"state\") === \"erroring\") {\n @putByIdDirectPrivate(stream, \"storedError\", @undefined);\n const abortRequest = @getByIdDirectPrivate(stream, \"pendingAbortRequest\");\n if (abortRequest !== @undefined)\n abortRequest.promise.resolve.@call(), @putByIdDirectPrivate(stream, \"pendingAbortRequest\", @undefined);\n }\n @putByIdDirectPrivate(stream, \"state\", \"closed\");\n const writer = @getByIdDirectPrivate(stream, \"writer\");\n if (writer !== @undefined)\n @getByIdDirectPrivate(writer, \"closedPromise\").resolve.@call();\n})\n"; -// requireNativeModule -const JSC::ConstructAbility s_moduleRequireNativeModuleCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; -const JSC::ConstructorKind s_moduleRequireNativeModuleCodeConstructorKind = JSC::ConstructorKind::None; -const JSC::ImplementationVisibility s_moduleRequireNativeModuleCodeImplementationVisibility = JSC::ImplementationVisibility::Public; -const int s_moduleRequireNativeModuleCodeLength = 229; -static const JSC::Intrinsic s_moduleRequireNativeModuleCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_moduleRequireNativeModuleCode = "(function (id) {\"use strict\";\n let esm = @Loader.registry.@get(id);\n if (esm\?.evaluated && (esm.state \?\? 0) >= @ModuleReady)\n return @Loader.getModuleNamespaceObject(esm.module).default;\n return @requireESM(id).default;\n})\n"; +// writableStreamFinishInFlightCloseWithError +const JSC::ConstructAbility s_writableStreamInternalsWritableStreamFinishInFlightCloseWithErrorCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; +const JSC::ConstructorKind s_writableStreamInternalsWritableStreamFinishInFlightCloseWithErrorCodeConstructorKind = JSC::ConstructorKind::None; +const JSC::ImplementationVisibility s_writableStreamInternalsWritableStreamFinishInFlightCloseWithErrorCodeImplementationVisibility = JSC::ImplementationVisibility::Public; +const int s_writableStreamInternalsWritableStreamFinishInFlightCloseWithErrorCodeLength = 535; +static const JSC::Intrinsic s_writableStreamInternalsWritableStreamFinishInFlightCloseWithErrorCodeIntrinsic = JSC::NoIntrinsic; +const char* const s_writableStreamInternalsWritableStreamFinishInFlightCloseWithErrorCode = "(function (stream, error) {\"use strict\";\n @getByIdDirectPrivate(stream, \"inFlightCloseRequest\").reject.@call(@undefined, error), @putByIdDirectPrivate(stream, \"inFlightCloseRequest\", @undefined);\n const state = @getByIdDirectPrivate(stream, \"state\"), abortRequest = @getByIdDirectPrivate(stream, \"pendingAbortRequest\");\n if (abortRequest !== @undefined)\n abortRequest.promise.reject.@call(@undefined, error), @putByIdDirectPrivate(stream, \"pendingAbortRequest\", @undefined);\n @writableStreamDealWithRejection(stream, error);\n})\n"; -#define DEFINE_BUILTIN_GENERATOR(codeName, functionName, overriddenName, argumentCount) \ -JSC::FunctionExecutable* codeName##Generator(JSC::VM& vm) \ -{\ - JSVMClientData* clientData = static_cast(vm.clientData); \ - return clientData->builtinFunctions().moduleBuiltins().codeName##Executable()->link(vm, nullptr, clientData->builtinFunctions().moduleBuiltins().codeName##Source(), std::nullopt, s_##codeName##Intrinsic); \ -} -WEBCORE_FOREACH_MODULE_BUILTIN_CODE(DEFINE_BUILTIN_GENERATOR) -#undef DEFINE_BUILTIN_GENERATOR +// writableStreamFinishInFlightWrite +const JSC::ConstructAbility s_writableStreamInternalsWritableStreamFinishInFlightWriteCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; +const JSC::ConstructorKind s_writableStreamInternalsWritableStreamFinishInFlightWriteCodeConstructorKind = JSC::ConstructorKind::None; +const JSC::ImplementationVisibility s_writableStreamInternalsWritableStreamFinishInFlightWriteCodeImplementationVisibility = JSC::ImplementationVisibility::Public; +const int s_writableStreamInternalsWritableStreamFinishInFlightWriteCodeLength = 177; +static const JSC::Intrinsic s_writableStreamInternalsWritableStreamFinishInFlightWriteCodeIntrinsic = JSC::NoIntrinsic; +const char* const s_writableStreamInternalsWritableStreamFinishInFlightWriteCode = "(function (stream) {\"use strict\";\n @getByIdDirectPrivate(stream, \"inFlightWriteRequest\").resolve.@call(), @putByIdDirectPrivate(stream, \"inFlightWriteRequest\", @undefined);\n})\n"; -/* JSBufferPrototype.ts */ -// setBigUint64 -const JSC::ConstructAbility s_jsBufferPrototypeSetBigUint64CodeConstructAbility = JSC::ConstructAbility::CannotConstruct; -const JSC::ConstructorKind s_jsBufferPrototypeSetBigUint64CodeConstructorKind = JSC::ConstructorKind::None; -const JSC::ImplementationVisibility s_jsBufferPrototypeSetBigUint64CodeImplementationVisibility = JSC::ImplementationVisibility::Public; -const int s_jsBufferPrototypeSetBigUint64CodeLength = 171; -static const JSC::Intrinsic s_jsBufferPrototypeSetBigUint64CodeIntrinsic = JSC::NoIntrinsic; -const char* const s_jsBufferPrototypeSetBigUint64Code = "(function (offset, value, le) {\"use strict\";\n return (this.@dataView ||= new DataView(this.buffer, this.byteOffset, this.byteLength)).setBigUint64(offset, value, le);\n})\n"; +// writableStreamFinishInFlightWriteWithError +const JSC::ConstructAbility s_writableStreamInternalsWritableStreamFinishInFlightWriteWithErrorCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; +const JSC::ConstructorKind s_writableStreamInternalsWritableStreamFinishInFlightWriteWithErrorCodeConstructorKind = JSC::ConstructorKind::None; +const JSC::ImplementationVisibility s_writableStreamInternalsWritableStreamFinishInFlightWriteWithErrorCodeImplementationVisibility = JSC::ImplementationVisibility::Public; +const int s_writableStreamInternalsWritableStreamFinishInFlightWriteWithErrorCodeLength = 307; +static const JSC::Intrinsic s_writableStreamInternalsWritableStreamFinishInFlightWriteWithErrorCodeIntrinsic = JSC::NoIntrinsic; +const char* const s_writableStreamInternalsWritableStreamFinishInFlightWriteWithErrorCode = "(function (stream, error) {\"use strict\";\n @getByIdDirectPrivate(stream, \"inFlightWriteRequest\").reject.@call(@undefined, error), @putByIdDirectPrivate(stream, \"inFlightWriteRequest\", @undefined);\n const state = @getByIdDirectPrivate(stream, \"state\");\n @writableStreamDealWithRejection(stream, error);\n})\n"; -// readInt8 -const JSC::ConstructAbility s_jsBufferPrototypeReadInt8CodeConstructAbility = JSC::ConstructAbility::CannotConstruct; -const JSC::ConstructorKind s_jsBufferPrototypeReadInt8CodeConstructorKind = JSC::ConstructorKind::None; -const JSC::ImplementationVisibility s_jsBufferPrototypeReadInt8CodeImplementationVisibility = JSC::ImplementationVisibility::Public; -const int s_jsBufferPrototypeReadInt8CodeLength = 144; -static const JSC::Intrinsic s_jsBufferPrototypeReadInt8CodeIntrinsic = JSC::NoIntrinsic; -const char* const s_jsBufferPrototypeReadInt8Code = "(function (offset) {\"use strict\";\n return (this.@dataView ||= new DataView(this.buffer, this.byteOffset, this.byteLength)).getInt8(offset);\n})\n"; +// writableStreamHasOperationMarkedInFlight +const JSC::ConstructAbility s_writableStreamInternalsWritableStreamHasOperationMarkedInFlightCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; +const JSC::ConstructorKind s_writableStreamInternalsWritableStreamHasOperationMarkedInFlightCodeConstructorKind = JSC::ConstructorKind::None; +const JSC::ImplementationVisibility s_writableStreamInternalsWritableStreamHasOperationMarkedInFlightCodeImplementationVisibility = JSC::ImplementationVisibility::Public; +const int s_writableStreamInternalsWritableStreamHasOperationMarkedInFlightCodeLength = 188; +static const JSC::Intrinsic s_writableStreamInternalsWritableStreamHasOperationMarkedInFlightCodeIntrinsic = JSC::NoIntrinsic; +const char* const s_writableStreamInternalsWritableStreamHasOperationMarkedInFlightCode = "(function (stream) {\"use strict\";\n return @getByIdDirectPrivate(stream, \"inFlightWriteRequest\") !== @undefined || @getByIdDirectPrivate(stream, \"inFlightCloseRequest\") !== @undefined;\n})\n"; -// readUInt8 -const JSC::ConstructAbility s_jsBufferPrototypeReadUInt8CodeConstructAbility = JSC::ConstructAbility::CannotConstruct; -const JSC::ConstructorKind s_jsBufferPrototypeReadUInt8CodeConstructorKind = JSC::ConstructorKind::None; -const JSC::ImplementationVisibility s_jsBufferPrototypeReadUInt8CodeImplementationVisibility = JSC::ImplementationVisibility::Public; -const int s_jsBufferPrototypeReadUInt8CodeLength = 145; -static const JSC::Intrinsic s_jsBufferPrototypeReadUInt8CodeIntrinsic = JSC::NoIntrinsic; -const char* const s_jsBufferPrototypeReadUInt8Code = "(function (offset) {\"use strict\";\n return (this.@dataView ||= new DataView(this.buffer, this.byteOffset, this.byteLength)).getUint8(offset);\n})\n"; +// writableStreamMarkCloseRequestInFlight +const JSC::ConstructAbility s_writableStreamInternalsWritableStreamMarkCloseRequestInFlightCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; +const JSC::ConstructorKind s_writableStreamInternalsWritableStreamMarkCloseRequestInFlightCodeConstructorKind = JSC::ConstructorKind::None; +const JSC::ImplementationVisibility s_writableStreamInternalsWritableStreamMarkCloseRequestInFlightCodeImplementationVisibility = JSC::ImplementationVisibility::Public; +const int s_writableStreamInternalsWritableStreamMarkCloseRequestInFlightCodeLength = 237; +static const JSC::Intrinsic s_writableStreamInternalsWritableStreamMarkCloseRequestInFlightCodeIntrinsic = JSC::NoIntrinsic; +const char* const s_writableStreamInternalsWritableStreamMarkCloseRequestInFlightCode = "(function (stream) {\"use strict\";\n const closeRequest = @getByIdDirectPrivate(stream, \"closeRequest\");\n @putByIdDirectPrivate(stream, \"inFlightCloseRequest\", closeRequest), @putByIdDirectPrivate(stream, \"closeRequest\", @undefined);\n})\n"; -// readInt16LE -const JSC::ConstructAbility s_jsBufferPrototypeReadInt16LECodeConstructAbility = JSC::ConstructAbility::CannotConstruct; -const JSC::ConstructorKind s_jsBufferPrototypeReadInt16LECodeConstructorKind = JSC::ConstructorKind::None; -const JSC::ImplementationVisibility s_jsBufferPrototypeReadInt16LECodeImplementationVisibility = JSC::ImplementationVisibility::Public; -const int s_jsBufferPrototypeReadInt16LECodeLength = 149; -static const JSC::Intrinsic s_jsBufferPrototypeReadInt16LECodeIntrinsic = JSC::NoIntrinsic; -const char* const s_jsBufferPrototypeReadInt16LECode = "(function (offset) {\"use strict\";\n return (this.@dataView ||= new DataView(this.buffer, this.byteOffset, this.byteLength)).getInt16(offset, !0);\n})\n"; +// writableStreamMarkFirstWriteRequestInFlight +const JSC::ConstructAbility s_writableStreamInternalsWritableStreamMarkFirstWriteRequestInFlightCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; +const JSC::ConstructorKind s_writableStreamInternalsWritableStreamMarkFirstWriteRequestInFlightCodeConstructorKind = JSC::ConstructorKind::None; +const JSC::ImplementationVisibility s_writableStreamInternalsWritableStreamMarkFirstWriteRequestInFlightCodeImplementationVisibility = JSC::ImplementationVisibility::Public; +const int s_writableStreamInternalsWritableStreamMarkFirstWriteRequestInFlightCodeLength = 187; +static const JSC::Intrinsic s_writableStreamInternalsWritableStreamMarkFirstWriteRequestInFlightCodeIntrinsic = JSC::NoIntrinsic; +const char* const s_writableStreamInternalsWritableStreamMarkFirstWriteRequestInFlightCode = "(function (stream) {\"use strict\";\n const writeRequest = @getByIdDirectPrivate(stream, \"writeRequests\").shift();\n @putByIdDirectPrivate(stream, \"inFlightWriteRequest\", writeRequest);\n})\n"; -// readInt16BE -const JSC::ConstructAbility s_jsBufferPrototypeReadInt16BECodeConstructAbility = JSC::ConstructAbility::CannotConstruct; -const JSC::ConstructorKind s_jsBufferPrototypeReadInt16BECodeConstructorKind = JSC::ConstructorKind::None; -const JSC::ImplementationVisibility s_jsBufferPrototypeReadInt16BECodeImplementationVisibility = JSC::ImplementationVisibility::Public; -const int s_jsBufferPrototypeReadInt16BECodeLength = 149; -static const JSC::Intrinsic s_jsBufferPrototypeReadInt16BECodeIntrinsic = JSC::NoIntrinsic; -const char* const s_jsBufferPrototypeReadInt16BECode = "(function (offset) {\"use strict\";\n return (this.@dataView ||= new DataView(this.buffer, this.byteOffset, this.byteLength)).getInt16(offset, !1);\n})\n"; +// writableStreamRejectCloseAndClosedPromiseIfNeeded +const JSC::ConstructAbility s_writableStreamInternalsWritableStreamRejectCloseAndClosedPromiseIfNeededCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; +const JSC::ConstructorKind s_writableStreamInternalsWritableStreamRejectCloseAndClosedPromiseIfNeededCodeConstructorKind = JSC::ConstructorKind::None; +const JSC::ImplementationVisibility s_writableStreamInternalsWritableStreamRejectCloseAndClosedPromiseIfNeededCodeImplementationVisibility = JSC::ImplementationVisibility::Public; +const int s_writableStreamInternalsWritableStreamRejectCloseAndClosedPromiseIfNeededCodeLength = 587; +static const JSC::Intrinsic s_writableStreamInternalsWritableStreamRejectCloseAndClosedPromiseIfNeededCodeIntrinsic = JSC::NoIntrinsic; +const char* const s_writableStreamInternalsWritableStreamRejectCloseAndClosedPromiseIfNeededCode = "(function (stream) {\"use strict\";\n const storedError = @getByIdDirectPrivate(stream, \"storedError\"), closeRequest = @getByIdDirectPrivate(stream, \"closeRequest\");\n if (closeRequest !== @undefined)\n closeRequest.reject.@call(@undefined, storedError), @putByIdDirectPrivate(stream, \"closeRequest\", @undefined);\n const writer = @getByIdDirectPrivate(stream, \"writer\");\n if (writer !== @undefined) {\n const closedPromise = @getByIdDirectPrivate(writer, \"closedPromise\");\n closedPromise.reject.@call(@undefined, storedError), @markPromiseAsHandled(closedPromise.promise);\n }\n})\n"; -// readUInt16LE -const JSC::ConstructAbility s_jsBufferPrototypeReadUInt16LECodeConstructAbility = JSC::ConstructAbility::CannotConstruct; -const JSC::ConstructorKind s_jsBufferPrototypeReadUInt16LECodeConstructorKind = JSC::ConstructorKind::None; -const JSC::ImplementationVisibility s_jsBufferPrototypeReadUInt16LECodeImplementationVisibility = JSC::ImplementationVisibility::Public; -const int s_jsBufferPrototypeReadUInt16LECodeLength = 150; -static const JSC::Intrinsic s_jsBufferPrototypeReadUInt16LECodeIntrinsic = JSC::NoIntrinsic; -const char* const s_jsBufferPrototypeReadUInt16LECode = "(function (offset) {\"use strict\";\n return (this.@dataView ||= new DataView(this.buffer, this.byteOffset, this.byteLength)).getUint16(offset, !0);\n})\n"; +// writableStreamStartErroring +const JSC::ConstructAbility s_writableStreamInternalsWritableStreamStartErroringCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; +const JSC::ConstructorKind s_writableStreamInternalsWritableStreamStartErroringCodeConstructorKind = JSC::ConstructorKind::None; +const JSC::ImplementationVisibility s_writableStreamInternalsWritableStreamStartErroringCodeImplementationVisibility = JSC::ImplementationVisibility::Public; +const int s_writableStreamInternalsWritableStreamStartErroringCodeLength = 537; +static const JSC::Intrinsic s_writableStreamInternalsWritableStreamStartErroringCodeIntrinsic = JSC::NoIntrinsic; +const char* const s_writableStreamInternalsWritableStreamStartErroringCode = "(function (stream, reason) {\"use strict\";\n const controller = @getByIdDirectPrivate(stream, \"controller\");\n @putByIdDirectPrivate(stream, \"state\", \"erroring\"), @putByIdDirectPrivate(stream, \"storedError\", reason);\n const writer = @getByIdDirectPrivate(stream, \"writer\");\n if (writer !== @undefined)\n @writableStreamDefaultWriterEnsureReadyPromiseRejected(writer, reason);\n if (!@writableStreamHasOperationMarkedInFlight(stream) && @getByIdDirectPrivate(controller, \"started\") === 1)\n @writableStreamFinishErroring(stream);\n})\n"; -// readUInt16BE -const JSC::ConstructAbility s_jsBufferPrototypeReadUInt16BECodeConstructAbility = JSC::ConstructAbility::CannotConstruct; -const JSC::ConstructorKind s_jsBufferPrototypeReadUInt16BECodeConstructorKind = JSC::ConstructorKind::None; -const JSC::ImplementationVisibility s_jsBufferPrototypeReadUInt16BECodeImplementationVisibility = JSC::ImplementationVisibility::Public; -const int s_jsBufferPrototypeReadUInt16BECodeLength = 150; -static const JSC::Intrinsic s_jsBufferPrototypeReadUInt16BECodeIntrinsic = JSC::NoIntrinsic; -const char* const s_jsBufferPrototypeReadUInt16BECode = "(function (offset) {\"use strict\";\n return (this.@dataView ||= new DataView(this.buffer, this.byteOffset, this.byteLength)).getUint16(offset, !1);\n})\n"; +// writableStreamUpdateBackpressure +const JSC::ConstructAbility s_writableStreamInternalsWritableStreamUpdateBackpressureCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; +const JSC::ConstructorKind s_writableStreamInternalsWritableStreamUpdateBackpressureCodeConstructorKind = JSC::ConstructorKind::None; +const JSC::ImplementationVisibility s_writableStreamInternalsWritableStreamUpdateBackpressureCodeImplementationVisibility = JSC::ImplementationVisibility::Public; +const int s_writableStreamInternalsWritableStreamUpdateBackpressureCodeLength = 453; +static const JSC::Intrinsic s_writableStreamInternalsWritableStreamUpdateBackpressureCodeIntrinsic = JSC::NoIntrinsic; +const char* const s_writableStreamInternalsWritableStreamUpdateBackpressureCode = "(function (stream, backpressure) {\"use strict\";\n const writer = @getByIdDirectPrivate(stream, \"writer\");\n if (writer !== @undefined && backpressure !== @getByIdDirectPrivate(stream, \"backpressure\"))\n if (backpressure)\n @putByIdDirectPrivate(writer, \"readyPromise\", @newPromiseCapability(@Promise));\n else\n @getByIdDirectPrivate(writer, \"readyPromise\").resolve.@call();\n @putByIdDirectPrivate(stream, \"backpressure\", backpressure);\n})\n"; -// readInt32LE -const JSC::ConstructAbility s_jsBufferPrototypeReadInt32LECodeConstructAbility = JSC::ConstructAbility::CannotConstruct; -const JSC::ConstructorKind s_jsBufferPrototypeReadInt32LECodeConstructorKind = JSC::ConstructorKind::None; -const JSC::ImplementationVisibility s_jsBufferPrototypeReadInt32LECodeImplementationVisibility = JSC::ImplementationVisibility::Public; -const int s_jsBufferPrototypeReadInt32LECodeLength = 149; -static const JSC::Intrinsic s_jsBufferPrototypeReadInt32LECodeIntrinsic = JSC::NoIntrinsic; -const char* const s_jsBufferPrototypeReadInt32LECode = "(function (offset) {\"use strict\";\n return (this.@dataView ||= new DataView(this.buffer, this.byteOffset, this.byteLength)).getInt32(offset, !0);\n})\n"; +// writableStreamDefaultWriterAbort +const JSC::ConstructAbility s_writableStreamInternalsWritableStreamDefaultWriterAbortCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; +const JSC::ConstructorKind s_writableStreamInternalsWritableStreamDefaultWriterAbortCodeConstructorKind = JSC::ConstructorKind::None; +const JSC::ImplementationVisibility s_writableStreamInternalsWritableStreamDefaultWriterAbortCodeImplementationVisibility = JSC::ImplementationVisibility::Public; +const int s_writableStreamInternalsWritableStreamDefaultWriterAbortCodeLength = 150; +static const JSC::Intrinsic s_writableStreamInternalsWritableStreamDefaultWriterAbortCodeIntrinsic = JSC::NoIntrinsic; +const char* const s_writableStreamInternalsWritableStreamDefaultWriterAbortCode = "(function (writer, reason) {\"use strict\";\n const stream = @getByIdDirectPrivate(writer, \"stream\");\n return @writableStreamAbort(stream, reason);\n})\n"; -// readInt32BE -const JSC::ConstructAbility s_jsBufferPrototypeReadInt32BECodeConstructAbility = JSC::ConstructAbility::CannotConstruct; -const JSC::ConstructorKind s_jsBufferPrototypeReadInt32BECodeConstructorKind = JSC::ConstructorKind::None; -const JSC::ImplementationVisibility s_jsBufferPrototypeReadInt32BECodeImplementationVisibility = JSC::ImplementationVisibility::Public; -const int s_jsBufferPrototypeReadInt32BECodeLength = 149; -static const JSC::Intrinsic s_jsBufferPrototypeReadInt32BECodeIntrinsic = JSC::NoIntrinsic; -const char* const s_jsBufferPrototypeReadInt32BECode = "(function (offset) {\"use strict\";\n return (this.@dataView ||= new DataView(this.buffer, this.byteOffset, this.byteLength)).getInt32(offset, !1);\n})\n"; +// writableStreamDefaultWriterClose +const JSC::ConstructAbility s_writableStreamInternalsWritableStreamDefaultWriterCloseCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; +const JSC::ConstructorKind s_writableStreamInternalsWritableStreamDefaultWriterCloseCodeConstructorKind = JSC::ConstructorKind::None; +const JSC::ImplementationVisibility s_writableStreamInternalsWritableStreamDefaultWriterCloseCodeImplementationVisibility = JSC::ImplementationVisibility::Public; +const int s_writableStreamInternalsWritableStreamDefaultWriterCloseCodeLength = 134; +static const JSC::Intrinsic s_writableStreamInternalsWritableStreamDefaultWriterCloseCodeIntrinsic = JSC::NoIntrinsic; +const char* const s_writableStreamInternalsWritableStreamDefaultWriterCloseCode = "(function (writer) {\"use strict\";\n const stream = @getByIdDirectPrivate(writer, \"stream\");\n return @writableStreamClose(stream);\n})\n"; -// readUInt32LE -const JSC::ConstructAbility s_jsBufferPrototypeReadUInt32LECodeConstructAbility = JSC::ConstructAbility::CannotConstruct; -const JSC::ConstructorKind s_jsBufferPrototypeReadUInt32LECodeConstructorKind = JSC::ConstructorKind::None; -const JSC::ImplementationVisibility s_jsBufferPrototypeReadUInt32LECodeImplementationVisibility = JSC::ImplementationVisibility::Public; -const int s_jsBufferPrototypeReadUInt32LECodeLength = 150; -static const JSC::Intrinsic s_jsBufferPrototypeReadUInt32LECodeIntrinsic = JSC::NoIntrinsic; -const char* const s_jsBufferPrototypeReadUInt32LECode = "(function (offset) {\"use strict\";\n return (this.@dataView ||= new DataView(this.buffer, this.byteOffset, this.byteLength)).getUint32(offset, !0);\n})\n"; +// writableStreamDefaultWriterCloseWithErrorPropagation +const JSC::ConstructAbility s_writableStreamInternalsWritableStreamDefaultWriterCloseWithErrorPropagationCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; +const JSC::ConstructorKind s_writableStreamInternalsWritableStreamDefaultWriterCloseWithErrorPropagationCodeConstructorKind = JSC::ConstructorKind::None; +const JSC::ImplementationVisibility s_writableStreamInternalsWritableStreamDefaultWriterCloseWithErrorPropagationCodeImplementationVisibility = JSC::ImplementationVisibility::Public; +const int s_writableStreamInternalsWritableStreamDefaultWriterCloseWithErrorPropagationCodeLength = 403; +static const JSC::Intrinsic s_writableStreamInternalsWritableStreamDefaultWriterCloseWithErrorPropagationCodeIntrinsic = JSC::NoIntrinsic; +const char* const s_writableStreamInternalsWritableStreamDefaultWriterCloseWithErrorPropagationCode = "(function (writer) {\"use strict\";\n const stream = @getByIdDirectPrivate(writer, \"stream\"), state = @getByIdDirectPrivate(stream, \"state\");\n if (@writableStreamCloseQueuedOrInFlight(stream) || state === \"closed\")\n return @Promise.@resolve();\n if (state === \"errored\")\n return @Promise.@reject(@getByIdDirectPrivate(stream, \"storedError\"));\n return @writableStreamDefaultWriterClose(writer);\n})\n"; -// readUInt32BE -const JSC::ConstructAbility s_jsBufferPrototypeReadUInt32BECodeConstructAbility = JSC::ConstructAbility::CannotConstruct; -const JSC::ConstructorKind s_jsBufferPrototypeReadUInt32BECodeConstructorKind = JSC::ConstructorKind::None; -const JSC::ImplementationVisibility s_jsBufferPrototypeReadUInt32BECodeImplementationVisibility = JSC::ImplementationVisibility::Public; -const int s_jsBufferPrototypeReadUInt32BECodeLength = 150; -static const JSC::Intrinsic s_jsBufferPrototypeReadUInt32BECodeIntrinsic = JSC::NoIntrinsic; -const char* const s_jsBufferPrototypeReadUInt32BECode = "(function (offset) {\"use strict\";\n return (this.@dataView ||= new DataView(this.buffer, this.byteOffset, this.byteLength)).getUint32(offset, !1);\n})\n"; +// writableStreamDefaultWriterEnsureClosedPromiseRejected +const JSC::ConstructAbility s_writableStreamInternalsWritableStreamDefaultWriterEnsureClosedPromiseRejectedCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; +const JSC::ConstructorKind s_writableStreamInternalsWritableStreamDefaultWriterEnsureClosedPromiseRejectedCodeConstructorKind = JSC::ConstructorKind::None; +const JSC::ImplementationVisibility s_writableStreamInternalsWritableStreamDefaultWriterEnsureClosedPromiseRejectedCodeImplementationVisibility = JSC::ImplementationVisibility::Public; +const int s_writableStreamInternalsWritableStreamDefaultWriterEnsureClosedPromiseRejectedCodeLength = 569; +static const JSC::Intrinsic s_writableStreamInternalsWritableStreamDefaultWriterEnsureClosedPromiseRejectedCodeIntrinsic = JSC::NoIntrinsic; +const char* const s_writableStreamInternalsWritableStreamDefaultWriterEnsureClosedPromiseRejectedCode = "(function (writer, error) {\"use strict\";\n let closedPromiseCapability = @getByIdDirectPrivate(writer, \"closedPromise\"), closedPromise = closedPromiseCapability.promise;\n if ((@getPromiseInternalField(closedPromise, @promiseFieldFlags) & @promiseStateMask) !== @promiseStatePending)\n closedPromiseCapability = @newPromiseCapability(@Promise), closedPromise = closedPromiseCapability.promise, @putByIdDirectPrivate(writer, \"closedPromise\", closedPromiseCapability);\n closedPromiseCapability.reject.@call(@undefined, error), @markPromiseAsHandled(closedPromise);\n})\n"; -// readIntLE -const JSC::ConstructAbility s_jsBufferPrototypeReadIntLECodeConstructAbility = JSC::ConstructAbility::CannotConstruct; -const JSC::ConstructorKind s_jsBufferPrototypeReadIntLECodeConstructorKind = JSC::ConstructorKind::None; -const JSC::ImplementationVisibility s_jsBufferPrototypeReadIntLECodeImplementationVisibility = JSC::ImplementationVisibility::Public; -const int s_jsBufferPrototypeReadIntLECodeLength = 838; -static const JSC::Intrinsic s_jsBufferPrototypeReadIntLECodeIntrinsic = JSC::NoIntrinsic; -const char* const s_jsBufferPrototypeReadIntLECode = "(function (offset, byteLength) {\"use strict\";\n const view = this.@dataView ||= new DataView(this.buffer, this.byteOffset, this.byteLength);\n switch (byteLength) {\n case 1:\n return view.getInt8(offset);\n case 2:\n return view.getInt16(offset, !0);\n case 3: {\n const val = view.getUint16(offset, !0) + view.getUint8(offset + 2) * 65536;\n return val | (val & 8388608) * 510;\n }\n case 4:\n return view.getInt32(offset, !0);\n case 5: {\n const last = view.getUint8(offset + 4);\n return (last | (last & 128) * 33554430) * 4294967296 + view.getUint32(offset, !0);\n }\n case 6: {\n const last = view.getUint16(offset + 4, !0);\n return (last | (last & 32768) * 131070) * 4294967296 + view.getUint32(offset, !0);\n }\n }\n @throwRangeError(\"byteLength must be >= 1 and <= 6\");\n})\n"; +// writableStreamDefaultWriterEnsureReadyPromiseRejected +const JSC::ConstructAbility s_writableStreamInternalsWritableStreamDefaultWriterEnsureReadyPromiseRejectedCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; +const JSC::ConstructorKind s_writableStreamInternalsWritableStreamDefaultWriterEnsureReadyPromiseRejectedCodeConstructorKind = JSC::ConstructorKind::None; +const JSC::ImplementationVisibility s_writableStreamInternalsWritableStreamDefaultWriterEnsureReadyPromiseRejectedCodeImplementationVisibility = JSC::ImplementationVisibility::Public; +const int s_writableStreamInternalsWritableStreamDefaultWriterEnsureReadyPromiseRejectedCodeLength = 557; +static const JSC::Intrinsic s_writableStreamInternalsWritableStreamDefaultWriterEnsureReadyPromiseRejectedCodeIntrinsic = JSC::NoIntrinsic; +const char* const s_writableStreamInternalsWritableStreamDefaultWriterEnsureReadyPromiseRejectedCode = "(function (writer, error) {\"use strict\";\n let readyPromiseCapability = @getByIdDirectPrivate(writer, \"readyPromise\"), readyPromise = readyPromiseCapability.promise;\n if ((@getPromiseInternalField(readyPromise, @promiseFieldFlags) & @promiseStateMask) !== @promiseStatePending)\n readyPromiseCapability = @newPromiseCapability(@Promise), readyPromise = readyPromiseCapability.promise, @putByIdDirectPrivate(writer, \"readyPromise\", readyPromiseCapability);\n readyPromiseCapability.reject.@call(@undefined, error), @markPromiseAsHandled(readyPromise);\n})\n"; -// readIntBE -const JSC::ConstructAbility s_jsBufferPrototypeReadIntBECodeConstructAbility = JSC::ConstructAbility::CannotConstruct; -const JSC::ConstructorKind s_jsBufferPrototypeReadIntBECodeConstructorKind = JSC::ConstructorKind::None; -const JSC::ImplementationVisibility s_jsBufferPrototypeReadIntBECodeImplementationVisibility = JSC::ImplementationVisibility::Public; -const int s_jsBufferPrototypeReadIntBECodeLength = 838; -static const JSC::Intrinsic s_jsBufferPrototypeReadIntBECodeIntrinsic = JSC::NoIntrinsic; -const char* const s_jsBufferPrototypeReadIntBECode = "(function (offset, byteLength) {\"use strict\";\n const view = this.@dataView ||= new DataView(this.buffer, this.byteOffset, this.byteLength);\n switch (byteLength) {\n case 1:\n return view.getInt8(offset);\n case 2:\n return view.getInt16(offset, !1);\n case 3: {\n const val = view.getUint16(offset + 1, !1) + view.getUint8(offset) * 65536;\n return val | (val & 8388608) * 510;\n }\n case 4:\n return view.getInt32(offset, !1);\n case 5: {\n const last = view.getUint8(offset);\n return (last | (last & 128) * 33554430) * 4294967296 + view.getUint32(offset + 1, !1);\n }\n case 6: {\n const last = view.getUint16(offset, !1);\n return (last | (last & 32768) * 131070) * 4294967296 + view.getUint32(offset + 2, !1);\n }\n }\n @throwRangeError(\"byteLength must be >= 1 and <= 6\");\n})\n"; +// writableStreamDefaultWriterGetDesiredSize +const JSC::ConstructAbility s_writableStreamInternalsWritableStreamDefaultWriterGetDesiredSizeCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; +const JSC::ConstructorKind s_writableStreamInternalsWritableStreamDefaultWriterGetDesiredSizeCodeConstructorKind = JSC::ConstructorKind::None; +const JSC::ImplementationVisibility s_writableStreamInternalsWritableStreamDefaultWriterGetDesiredSizeCodeImplementationVisibility = JSC::ImplementationVisibility::Public; +const int s_writableStreamInternalsWritableStreamDefaultWriterGetDesiredSizeCodeLength = 353; +static const JSC::Intrinsic s_writableStreamInternalsWritableStreamDefaultWriterGetDesiredSizeCodeIntrinsic = JSC::NoIntrinsic; +const char* const s_writableStreamInternalsWritableStreamDefaultWriterGetDesiredSizeCode = "(function (writer) {\"use strict\";\n const stream = @getByIdDirectPrivate(writer, \"stream\"), state = @getByIdDirectPrivate(stream, \"state\");\n if (state === \"errored\" || state === \"erroring\")\n return null;\n if (state === \"closed\")\n return 0;\n return @writableStreamDefaultControllerGetDesiredSize(@getByIdDirectPrivate(stream, \"controller\"));\n})\n"; -// readUIntLE -const JSC::ConstructAbility s_jsBufferPrototypeReadUIntLECodeConstructAbility = JSC::ConstructAbility::CannotConstruct; -const JSC::ConstructorKind s_jsBufferPrototypeReadUIntLECodeConstructorKind = JSC::ConstructorKind::None; -const JSC::ImplementationVisibility s_jsBufferPrototypeReadUIntLECodeImplementationVisibility = JSC::ImplementationVisibility::Public; -const int s_jsBufferPrototypeReadUIntLECodeLength = 664; -static const JSC::Intrinsic s_jsBufferPrototypeReadUIntLECodeIntrinsic = JSC::NoIntrinsic; -const char* const s_jsBufferPrototypeReadUIntLECode = "(function (offset, byteLength) {\"use strict\";\n const view = this.@dataView ||= new DataView(this.buffer, this.byteOffset, this.byteLength);\n switch (byteLength) {\n case 1:\n return view.getUint8(offset);\n case 2:\n return view.getUint16(offset, !0);\n case 3:\n return view.getUint16(offset, !0) + view.getUint8(offset + 2) * 65536;\n case 4:\n return view.getUint32(offset, !0);\n case 5:\n return view.getUint8(offset + 4) * 4294967296 + view.getUint32(offset, !0);\n case 6:\n return view.getUint16(offset + 4, !0) * 4294967296 + view.getUint32(offset, !0);\n }\n @throwRangeError(\"byteLength must be >= 1 and <= 6\");\n})\n"; +// writableStreamDefaultWriterRelease +const JSC::ConstructAbility s_writableStreamInternalsWritableStreamDefaultWriterReleaseCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; +const JSC::ConstructorKind s_writableStreamInternalsWritableStreamDefaultWriterReleaseCodeConstructorKind = JSC::ConstructorKind::None; +const JSC::ImplementationVisibility s_writableStreamInternalsWritableStreamDefaultWriterReleaseCodeImplementationVisibility = JSC::ImplementationVisibility::Public; +const int s_writableStreamInternalsWritableStreamDefaultWriterReleaseCodeLength = 432; +static const JSC::Intrinsic s_writableStreamInternalsWritableStreamDefaultWriterReleaseCodeIntrinsic = JSC::NoIntrinsic; +const char* const s_writableStreamInternalsWritableStreamDefaultWriterReleaseCode = "(function (writer) {\"use strict\";\n const stream = @getByIdDirectPrivate(writer, \"stream\"), releasedError = @makeTypeError(\"writableStreamDefaultWriterRelease\");\n @writableStreamDefaultWriterEnsureReadyPromiseRejected(writer, releasedError), @writableStreamDefaultWriterEnsureClosedPromiseRejected(writer, releasedError), @putByIdDirectPrivate(stream, \"writer\", @undefined), @putByIdDirectPrivate(writer, \"stream\", @undefined);\n})\n"; -// readUIntBE -const JSC::ConstructAbility s_jsBufferPrototypeReadUIntBECodeConstructAbility = JSC::ConstructAbility::CannotConstruct; -const JSC::ConstructorKind s_jsBufferPrototypeReadUIntBECodeConstructorKind = JSC::ConstructorKind::None; -const JSC::ImplementationVisibility s_jsBufferPrototypeReadUIntBECodeImplementationVisibility = JSC::ImplementationVisibility::Public; -const int s_jsBufferPrototypeReadUIntBECodeLength = 786; -static const JSC::Intrinsic s_jsBufferPrototypeReadUIntBECodeIntrinsic = JSC::NoIntrinsic; -const char* const s_jsBufferPrototypeReadUIntBECode = "(function (offset, byteLength) {\"use strict\";\n const view = this.@dataView ||= new DataView(this.buffer, this.byteOffset, this.byteLength);\n switch (byteLength) {\n case 1:\n return view.getUint8(offset);\n case 2:\n return view.getUint16(offset, !1);\n case 3:\n return view.getUint16(offset + 1, !1) + view.getUint8(offset) * 65536;\n case 4:\n return view.getUint32(offset, !1);\n case 5: {\n const last = view.getUint8(offset);\n return (last | (last & 128) * 33554430) * 4294967296 + view.getUint32(offset + 1, !1);\n }\n case 6: {\n const last = view.getUint16(offset, !1);\n return (last | (last & 32768) * 131070) * 4294967296 + view.getUint32(offset + 2, !1);\n }\n }\n @throwRangeError(\"byteLength must be >= 1 and <= 6\");\n})\n"; +// writableStreamDefaultWriterWrite +const JSC::ConstructAbility s_writableStreamInternalsWritableStreamDefaultWriterWriteCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; +const JSC::ConstructorKind s_writableStreamInternalsWritableStreamDefaultWriterWriteCodeConstructorKind = JSC::ConstructorKind::None; +const JSC::ImplementationVisibility s_writableStreamInternalsWritableStreamDefaultWriterWriteCodeImplementationVisibility = JSC::ImplementationVisibility::Public; +const int s_writableStreamInternalsWritableStreamDefaultWriterWriteCodeLength = 1079; +static const JSC::Intrinsic s_writableStreamInternalsWritableStreamDefaultWriterWriteCodeIntrinsic = JSC::NoIntrinsic; +const char* const s_writableStreamInternalsWritableStreamDefaultWriterWriteCode = "(function (writer, chunk) {\"use strict\";\n const stream = @getByIdDirectPrivate(writer, \"stream\"), controller = @getByIdDirectPrivate(stream, \"controller\"), chunkSize = @writableStreamDefaultControllerGetChunkSize(controller, chunk);\n if (stream !== @getByIdDirectPrivate(writer, \"stream\"))\n return @Promise.@reject(@makeTypeError(\"writer is not stream's writer\"));\n const state = @getByIdDirectPrivate(stream, \"state\");\n if (state === \"errored\")\n return @Promise.@reject(@getByIdDirectPrivate(stream, \"storedError\"));\n if (@writableStreamCloseQueuedOrInFlight(stream) || state === \"closed\")\n return @Promise.@reject(@makeTypeError(\"stream is closing or closed\"));\n if (@writableStreamCloseQueuedOrInFlight(stream) || state === \"closed\")\n return @Promise.@reject(@makeTypeError(\"stream is closing or closed\"));\n if (state === \"erroring\")\n return @Promise.@reject(@getByIdDirectPrivate(stream, \"storedError\"));\n const promise = @writableStreamAddWriteRequest(stream);\n return @writableStreamDefaultControllerWrite(controller, chunk, chunkSize), promise;\n})\n"; -// readFloatLE -const JSC::ConstructAbility s_jsBufferPrototypeReadFloatLECodeConstructAbility = JSC::ConstructAbility::CannotConstruct; -const JSC::ConstructorKind s_jsBufferPrototypeReadFloatLECodeConstructorKind = JSC::ConstructorKind::None; -const JSC::ImplementationVisibility s_jsBufferPrototypeReadFloatLECodeImplementationVisibility = JSC::ImplementationVisibility::Public; -const int s_jsBufferPrototypeReadFloatLECodeLength = 151; -static const JSC::Intrinsic s_jsBufferPrototypeReadFloatLECodeIntrinsic = JSC::NoIntrinsic; -const char* const s_jsBufferPrototypeReadFloatLECode = "(function (offset) {\"use strict\";\n return (this.@dataView ||= new DataView(this.buffer, this.byteOffset, this.byteLength)).getFloat32(offset, !0);\n})\n"; +// setUpWritableStreamDefaultController +const JSC::ConstructAbility s_writableStreamInternalsSetUpWritableStreamDefaultControllerCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; +const JSC::ConstructorKind s_writableStreamInternalsSetUpWritableStreamDefaultControllerCodeConstructorKind = JSC::ConstructorKind::None; +const JSC::ImplementationVisibility s_writableStreamInternalsSetUpWritableStreamDefaultControllerCodeImplementationVisibility = JSC::ImplementationVisibility::Public; +const int s_writableStreamInternalsSetUpWritableStreamDefaultControllerCodeLength = 972; +static const JSC::Intrinsic s_writableStreamInternalsSetUpWritableStreamDefaultControllerCodeIntrinsic = JSC::NoIntrinsic; +const char* const s_writableStreamInternalsSetUpWritableStreamDefaultControllerCode = "(function (stream, controller, startAlgorithm, writeAlgorithm, closeAlgorithm, abortAlgorithm, highWaterMark, sizeAlgorithm) {\"use strict\";\n @putByIdDirectPrivate(controller, \"stream\", stream), @putByIdDirectPrivate(stream, \"controller\", controller), @resetQueue(@getByIdDirectPrivate(controller, \"queue\")), @putByIdDirectPrivate(controller, \"started\", -1), @putByIdDirectPrivate(controller, \"startAlgorithm\", startAlgorithm), @putByIdDirectPrivate(controller, \"strategySizeAlgorithm\", sizeAlgorithm), @putByIdDirectPrivate(controller, \"strategyHWM\", highWaterMark), @putByIdDirectPrivate(controller, \"writeAlgorithm\", writeAlgorithm), @putByIdDirectPrivate(controller, \"closeAlgorithm\", closeAlgorithm), @putByIdDirectPrivate(controller, \"abortAlgorithm\", abortAlgorithm);\n const backpressure = @writableStreamDefaultControllerGetBackpressure(controller);\n @writableStreamUpdateBackpressure(stream, backpressure), @writableStreamDefaultControllerStart(controller);\n})\n"; -// readFloatBE -const JSC::ConstructAbility s_jsBufferPrototypeReadFloatBECodeConstructAbility = JSC::ConstructAbility::CannotConstruct; -const JSC::ConstructorKind s_jsBufferPrototypeReadFloatBECodeConstructorKind = JSC::ConstructorKind::None; -const JSC::ImplementationVisibility s_jsBufferPrototypeReadFloatBECodeImplementationVisibility = JSC::ImplementationVisibility::Public; -const int s_jsBufferPrototypeReadFloatBECodeLength = 151; -static const JSC::Intrinsic s_jsBufferPrototypeReadFloatBECodeIntrinsic = JSC::NoIntrinsic; -const char* const s_jsBufferPrototypeReadFloatBECode = "(function (offset) {\"use strict\";\n return (this.@dataView ||= new DataView(this.buffer, this.byteOffset, this.byteLength)).getFloat32(offset, !1);\n})\n"; +// writableStreamDefaultControllerStart +const JSC::ConstructAbility s_writableStreamInternalsWritableStreamDefaultControllerStartCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; +const JSC::ConstructorKind s_writableStreamInternalsWritableStreamDefaultControllerStartCodeConstructorKind = JSC::ConstructorKind::None; +const JSC::ImplementationVisibility s_writableStreamInternalsWritableStreamDefaultControllerStartCodeImplementationVisibility = JSC::ImplementationVisibility::Public; +const int s_writableStreamInternalsWritableStreamDefaultControllerStartCodeLength = 796; +static const JSC::Intrinsic s_writableStreamInternalsWritableStreamDefaultControllerStartCodeIntrinsic = JSC::NoIntrinsic; +const char* const s_writableStreamInternalsWritableStreamDefaultControllerStartCode = "(function (controller) {\"use strict\";\n if (@getByIdDirectPrivate(controller, \"started\") !== -1)\n return;\n @putByIdDirectPrivate(controller, \"started\", 0);\n const startAlgorithm = @getByIdDirectPrivate(controller, \"startAlgorithm\");\n @putByIdDirectPrivate(controller, \"startAlgorithm\", @undefined);\n const stream = @getByIdDirectPrivate(controller, \"stream\");\n return @Promise.@resolve(startAlgorithm.@call()).@then(() => {\n const state = @getByIdDirectPrivate(stream, \"state\");\n @putByIdDirectPrivate(controller, \"started\", 1), @writableStreamDefaultControllerAdvanceQueueIfNeeded(controller);\n }, (error) => {\n const state = @getByIdDirectPrivate(stream, \"state\");\n @putByIdDirectPrivate(controller, \"started\", 1), @writableStreamDealWithRejection(stream, error);\n });\n})\n"; -// readDoubleLE -const JSC::ConstructAbility s_jsBufferPrototypeReadDoubleLECodeConstructAbility = JSC::ConstructAbility::CannotConstruct; -const JSC::ConstructorKind s_jsBufferPrototypeReadDoubleLECodeConstructorKind = JSC::ConstructorKind::None; -const JSC::ImplementationVisibility s_jsBufferPrototypeReadDoubleLECodeImplementationVisibility = JSC::ImplementationVisibility::Public; -const int s_jsBufferPrototypeReadDoubleLECodeLength = 151; -static const JSC::Intrinsic s_jsBufferPrototypeReadDoubleLECodeIntrinsic = JSC::NoIntrinsic; -const char* const s_jsBufferPrototypeReadDoubleLECode = "(function (offset) {\"use strict\";\n return (this.@dataView ||= new DataView(this.buffer, this.byteOffset, this.byteLength)).getFloat64(offset, !0);\n})\n"; +// setUpWritableStreamDefaultControllerFromUnderlyingSink +const JSC::ConstructAbility s_writableStreamInternalsSetUpWritableStreamDefaultControllerFromUnderlyingSinkCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; +const JSC::ConstructorKind s_writableStreamInternalsSetUpWritableStreamDefaultControllerFromUnderlyingSinkCodeConstructorKind = JSC::ConstructorKind::None; +const JSC::ImplementationVisibility s_writableStreamInternalsSetUpWritableStreamDefaultControllerFromUnderlyingSinkCodeImplementationVisibility = JSC::ImplementationVisibility::Public; +const int s_writableStreamInternalsSetUpWritableStreamDefaultControllerFromUnderlyingSinkCodeLength = 1314; +static const JSC::Intrinsic s_writableStreamInternalsSetUpWritableStreamDefaultControllerFromUnderlyingSinkCodeIntrinsic = JSC::NoIntrinsic; +const char* const s_writableStreamInternalsSetUpWritableStreamDefaultControllerFromUnderlyingSinkCode = "(function (stream, underlyingSink, underlyingSinkDict, highWaterMark, sizeAlgorithm) {\"use strict\";\n const controller = new @WritableStreamDefaultController;\n let startAlgorithm = () => {\n }, writeAlgorithm = () => {\n return @Promise.@resolve();\n }, closeAlgorithm = () => {\n return @Promise.@resolve();\n }, abortAlgorithm = () => {\n return @Promise.@resolve();\n };\n if (\"start\" in underlyingSinkDict) {\n const startMethod = underlyingSinkDict.start;\n startAlgorithm = () => @promiseInvokeOrNoopMethodNoCatch(underlyingSink, startMethod, [controller]);\n }\n if (\"write\" in underlyingSinkDict) {\n const writeMethod = underlyingSinkDict.write;\n writeAlgorithm = (chunk) => @promiseInvokeOrNoopMethod(underlyingSink, writeMethod, [chunk, controller]);\n }\n if (\"close\" in underlyingSinkDict) {\n const closeMethod = underlyingSinkDict.close;\n closeAlgorithm = () => @promiseInvokeOrNoopMethod(underlyingSink, closeMethod, []);\n }\n if (\"abort\" in underlyingSinkDict) {\n const abortMethod = underlyingSinkDict.abort;\n abortAlgorithm = (reason) => @promiseInvokeOrNoopMethod(underlyingSink, abortMethod, [reason]);\n }\n @setUpWritableStreamDefaultController(stream, controller, startAlgorithm, writeAlgorithm, closeAlgorithm, abortAlgorithm, highWaterMark, sizeAlgorithm);\n})\n"; -// readDoubleBE -const JSC::ConstructAbility s_jsBufferPrototypeReadDoubleBECodeConstructAbility = JSC::ConstructAbility::CannotConstruct; -const JSC::ConstructorKind s_jsBufferPrototypeReadDoubleBECodeConstructorKind = JSC::ConstructorKind::None; -const JSC::ImplementationVisibility s_jsBufferPrototypeReadDoubleBECodeImplementationVisibility = JSC::ImplementationVisibility::Public; -const int s_jsBufferPrototypeReadDoubleBECodeLength = 151; -static const JSC::Intrinsic s_jsBufferPrototypeReadDoubleBECodeIntrinsic = JSC::NoIntrinsic; -const char* const s_jsBufferPrototypeReadDoubleBECode = "(function (offset) {\"use strict\";\n return (this.@dataView ||= new DataView(this.buffer, this.byteOffset, this.byteLength)).getFloat64(offset, !1);\n})\n"; +// writableStreamDefaultControllerAdvanceQueueIfNeeded +const JSC::ConstructAbility s_writableStreamInternalsWritableStreamDefaultControllerAdvanceQueueIfNeededCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; +const JSC::ConstructorKind s_writableStreamInternalsWritableStreamDefaultControllerAdvanceQueueIfNeededCodeConstructorKind = JSC::ConstructorKind::None; +const JSC::ImplementationVisibility s_writableStreamInternalsWritableStreamDefaultControllerAdvanceQueueIfNeededCodeImplementationVisibility = JSC::ImplementationVisibility::Public; +const int s_writableStreamInternalsWritableStreamDefaultControllerAdvanceQueueIfNeededCodeLength = 705; +static const JSC::Intrinsic s_writableStreamInternalsWritableStreamDefaultControllerAdvanceQueueIfNeededCodeIntrinsic = JSC::NoIntrinsic; +const char* const s_writableStreamInternalsWritableStreamDefaultControllerAdvanceQueueIfNeededCode = "(function (controller) {\"use strict\";\n const stream = @getByIdDirectPrivate(controller, \"stream\");\n if (@getByIdDirectPrivate(controller, \"started\") !== 1)\n return;\n if (@getByIdDirectPrivate(stream, \"inFlightWriteRequest\") !== @undefined)\n return;\n if (@getByIdDirectPrivate(stream, \"state\") === \"erroring\") {\n @writableStreamFinishErroring(stream);\n return;\n }\n const queue = @getByIdDirectPrivate(controller, \"queue\");\n if (queue.content\?.isEmpty() \?\? !1)\n return;\n const value = @peekQueueValue(queue);\n if (value === @isCloseSentinel)\n @writableStreamDefaultControllerProcessClose(controller);\n else\n @writableStreamDefaultControllerProcessWrite(controller, value);\n})\n"; -// readBigInt64LE -const JSC::ConstructAbility s_jsBufferPrototypeReadBigInt64LECodeConstructAbility = JSC::ConstructAbility::CannotConstruct; -const JSC::ConstructorKind s_jsBufferPrototypeReadBigInt64LECodeConstructorKind = JSC::ConstructorKind::None; -const JSC::ImplementationVisibility s_jsBufferPrototypeReadBigInt64LECodeImplementationVisibility = JSC::ImplementationVisibility::Public; -const int s_jsBufferPrototypeReadBigInt64LECodeLength = 152; -static const JSC::Intrinsic s_jsBufferPrototypeReadBigInt64LECodeIntrinsic = JSC::NoIntrinsic; -const char* const s_jsBufferPrototypeReadBigInt64LECode = "(function (offset) {\"use strict\";\n return (this.@dataView ||= new DataView(this.buffer, this.byteOffset, this.byteLength)).getBigInt64(offset, !0);\n})\n"; +// isCloseSentinel +const JSC::ConstructAbility s_writableStreamInternalsIsCloseSentinelCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; +const JSC::ConstructorKind s_writableStreamInternalsIsCloseSentinelCodeConstructorKind = JSC::ConstructorKind::None; +const JSC::ImplementationVisibility s_writableStreamInternalsIsCloseSentinelCodeImplementationVisibility = JSC::ImplementationVisibility::Public; +const int s_writableStreamInternalsIsCloseSentinelCodeLength = 31; +static const JSC::Intrinsic s_writableStreamInternalsIsCloseSentinelCodeIntrinsic = JSC::NoIntrinsic; +const char* const s_writableStreamInternalsIsCloseSentinelCode = "(function () {\"use strict\";\n})\n"; -// readBigInt64BE -const JSC::ConstructAbility s_jsBufferPrototypeReadBigInt64BECodeConstructAbility = JSC::ConstructAbility::CannotConstruct; -const JSC::ConstructorKind s_jsBufferPrototypeReadBigInt64BECodeConstructorKind = JSC::ConstructorKind::None; -const JSC::ImplementationVisibility s_jsBufferPrototypeReadBigInt64BECodeImplementationVisibility = JSC::ImplementationVisibility::Public; -const int s_jsBufferPrototypeReadBigInt64BECodeLength = 152; -static const JSC::Intrinsic s_jsBufferPrototypeReadBigInt64BECodeIntrinsic = JSC::NoIntrinsic; -const char* const s_jsBufferPrototypeReadBigInt64BECode = "(function (offset) {\"use strict\";\n return (this.@dataView ||= new DataView(this.buffer, this.byteOffset, this.byteLength)).getBigInt64(offset, !1);\n})\n"; +// writableStreamDefaultControllerClearAlgorithms +const JSC::ConstructAbility s_writableStreamInternalsWritableStreamDefaultControllerClearAlgorithmsCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; +const JSC::ConstructorKind s_writableStreamInternalsWritableStreamDefaultControllerClearAlgorithmsCodeConstructorKind = JSC::ConstructorKind::None; +const JSC::ImplementationVisibility s_writableStreamInternalsWritableStreamDefaultControllerClearAlgorithmsCodeImplementationVisibility = JSC::ImplementationVisibility::Public; +const int s_writableStreamInternalsWritableStreamDefaultControllerClearAlgorithmsCodeLength = 310; +static const JSC::Intrinsic s_writableStreamInternalsWritableStreamDefaultControllerClearAlgorithmsCodeIntrinsic = JSC::NoIntrinsic; +const char* const s_writableStreamInternalsWritableStreamDefaultControllerClearAlgorithmsCode = "(function (controller) {\"use strict\";\n @putByIdDirectPrivate(controller, \"writeAlgorithm\", @undefined), @putByIdDirectPrivate(controller, \"closeAlgorithm\", @undefined), @putByIdDirectPrivate(controller, \"abortAlgorithm\", @undefined), @putByIdDirectPrivate(controller, \"strategySizeAlgorithm\", @undefined);\n})\n"; -// readBigUInt64LE -const JSC::ConstructAbility s_jsBufferPrototypeReadBigUInt64LECodeConstructAbility = JSC::ConstructAbility::CannotConstruct; -const JSC::ConstructorKind s_jsBufferPrototypeReadBigUInt64LECodeConstructorKind = JSC::ConstructorKind::None; -const JSC::ImplementationVisibility s_jsBufferPrototypeReadBigUInt64LECodeImplementationVisibility = JSC::ImplementationVisibility::Public; -const int s_jsBufferPrototypeReadBigUInt64LECodeLength = 153; -static const JSC::Intrinsic s_jsBufferPrototypeReadBigUInt64LECodeIntrinsic = JSC::NoIntrinsic; -const char* const s_jsBufferPrototypeReadBigUInt64LECode = "(function (offset) {\"use strict\";\n return (this.@dataView ||= new DataView(this.buffer, this.byteOffset, this.byteLength)).getBigUint64(offset, !0);\n})\n"; +// writableStreamDefaultControllerClose +const JSC::ConstructAbility s_writableStreamInternalsWritableStreamDefaultControllerCloseCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; +const JSC::ConstructorKind s_writableStreamInternalsWritableStreamDefaultControllerCloseCodeConstructorKind = JSC::ConstructorKind::None; +const JSC::ImplementationVisibility s_writableStreamInternalsWritableStreamDefaultControllerCloseCodeImplementationVisibility = JSC::ImplementationVisibility::Public; +const int s_writableStreamInternalsWritableStreamDefaultControllerCloseCodeLength = 197; +static const JSC::Intrinsic s_writableStreamInternalsWritableStreamDefaultControllerCloseCodeIntrinsic = JSC::NoIntrinsic; +const char* const s_writableStreamInternalsWritableStreamDefaultControllerCloseCode = "(function (controller) {\"use strict\";\n @enqueueValueWithSize(@getByIdDirectPrivate(controller, \"queue\"), @isCloseSentinel, 0), @writableStreamDefaultControllerAdvanceQueueIfNeeded(controller);\n})\n"; -// readBigUInt64BE -const JSC::ConstructAbility s_jsBufferPrototypeReadBigUInt64BECodeConstructAbility = JSC::ConstructAbility::CannotConstruct; -const JSC::ConstructorKind s_jsBufferPrototypeReadBigUInt64BECodeConstructorKind = JSC::ConstructorKind::None; -const JSC::ImplementationVisibility s_jsBufferPrototypeReadBigUInt64BECodeImplementationVisibility = JSC::ImplementationVisibility::Public; -const int s_jsBufferPrototypeReadBigUInt64BECodeLength = 153; -static const JSC::Intrinsic s_jsBufferPrototypeReadBigUInt64BECodeIntrinsic = JSC::NoIntrinsic; -const char* const s_jsBufferPrototypeReadBigUInt64BECode = "(function (offset) {\"use strict\";\n return (this.@dataView ||= new DataView(this.buffer, this.byteOffset, this.byteLength)).getBigUint64(offset, !1);\n})\n"; +// writableStreamDefaultControllerError +const JSC::ConstructAbility s_writableStreamInternalsWritableStreamDefaultControllerErrorCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; +const JSC::ConstructorKind s_writableStreamInternalsWritableStreamDefaultControllerErrorCodeConstructorKind = JSC::ConstructorKind::None; +const JSC::ImplementationVisibility s_writableStreamInternalsWritableStreamDefaultControllerErrorCodeImplementationVisibility = JSC::ImplementationVisibility::Public; +const int s_writableStreamInternalsWritableStreamDefaultControllerErrorCodeLength = 218; +static const JSC::Intrinsic s_writableStreamInternalsWritableStreamDefaultControllerErrorCodeIntrinsic = JSC::NoIntrinsic; +const char* const s_writableStreamInternalsWritableStreamDefaultControllerErrorCode = "(function (controller, error) {\"use strict\";\n const stream = @getByIdDirectPrivate(controller, \"stream\");\n @writableStreamDefaultControllerClearAlgorithms(controller), @writableStreamStartErroring(stream, error);\n})\n"; -// writeInt8 -const JSC::ConstructAbility s_jsBufferPrototypeWriteInt8CodeConstructAbility = JSC::ConstructAbility::CannotConstruct; -const JSC::ConstructorKind s_jsBufferPrototypeWriteInt8CodeConstructorKind = JSC::ConstructorKind::None; -const JSC::ImplementationVisibility s_jsBufferPrototypeWriteInt8CodeImplementationVisibility = JSC::ImplementationVisibility::Public; -const int s_jsBufferPrototypeWriteInt8CodeLength = 170; -static const JSC::Intrinsic s_jsBufferPrototypeWriteInt8CodeIntrinsic = JSC::NoIntrinsic; -const char* const s_jsBufferPrototypeWriteInt8Code = "(function (value, offset) {\"use strict\";\n return (this.@dataView ||= new DataView(this.buffer, this.byteOffset, this.byteLength)).setInt8(offset, value), offset + 1;\n})\n"; +// writableStreamDefaultControllerErrorIfNeeded +const JSC::ConstructAbility s_writableStreamInternalsWritableStreamDefaultControllerErrorIfNeededCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; +const JSC::ConstructorKind s_writableStreamInternalsWritableStreamDefaultControllerErrorIfNeededCodeConstructorKind = JSC::ConstructorKind::None; +const JSC::ImplementationVisibility s_writableStreamInternalsWritableStreamDefaultControllerErrorIfNeededCodeImplementationVisibility = JSC::ImplementationVisibility::Public; +const int s_writableStreamInternalsWritableStreamDefaultControllerErrorIfNeededCodeLength = 233; +static const JSC::Intrinsic s_writableStreamInternalsWritableStreamDefaultControllerErrorIfNeededCodeIntrinsic = JSC::NoIntrinsic; +const char* const s_writableStreamInternalsWritableStreamDefaultControllerErrorIfNeededCode = "(function (controller, error) {\"use strict\";\n const stream = @getByIdDirectPrivate(controller, \"stream\");\n if (@getByIdDirectPrivate(stream, \"state\") === \"writable\")\n @writableStreamDefaultControllerError(controller, error);\n})\n"; -// writeUInt8 -const JSC::ConstructAbility s_jsBufferPrototypeWriteUInt8CodeConstructAbility = JSC::ConstructAbility::CannotConstruct; -const JSC::ConstructorKind s_jsBufferPrototypeWriteUInt8CodeConstructorKind = JSC::ConstructorKind::None; -const JSC::ImplementationVisibility s_jsBufferPrototypeWriteUInt8CodeImplementationVisibility = JSC::ImplementationVisibility::Public; -const int s_jsBufferPrototypeWriteUInt8CodeLength = 171; -static const JSC::Intrinsic s_jsBufferPrototypeWriteUInt8CodeIntrinsic = JSC::NoIntrinsic; -const char* const s_jsBufferPrototypeWriteUInt8Code = "(function (value, offset) {\"use strict\";\n return (this.@dataView ||= new DataView(this.buffer, this.byteOffset, this.byteLength)).setUint8(offset, value), offset + 1;\n})\n"; +// writableStreamDefaultControllerGetBackpressure +const JSC::ConstructAbility s_writableStreamInternalsWritableStreamDefaultControllerGetBackpressureCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; +const JSC::ConstructorKind s_writableStreamInternalsWritableStreamDefaultControllerGetBackpressureCodeConstructorKind = JSC::ConstructorKind::None; +const JSC::ImplementationVisibility s_writableStreamInternalsWritableStreamDefaultControllerGetBackpressureCodeImplementationVisibility = JSC::ImplementationVisibility::Public; +const int s_writableStreamInternalsWritableStreamDefaultControllerGetBackpressureCodeLength = 115; +static const JSC::Intrinsic s_writableStreamInternalsWritableStreamDefaultControllerGetBackpressureCodeIntrinsic = JSC::NoIntrinsic; +const char* const s_writableStreamInternalsWritableStreamDefaultControllerGetBackpressureCode = "(function (controller) {\"use strict\";\n return @writableStreamDefaultControllerGetDesiredSize(controller) <= 0;\n})\n"; -// writeInt16LE -const JSC::ConstructAbility s_jsBufferPrototypeWriteInt16LECodeConstructAbility = JSC::ConstructAbility::CannotConstruct; -const JSC::ConstructorKind s_jsBufferPrototypeWriteInt16LECodeConstructorKind = JSC::ConstructorKind::None; -const JSC::ImplementationVisibility s_jsBufferPrototypeWriteInt16LECodeImplementationVisibility = JSC::ImplementationVisibility::Public; -const int s_jsBufferPrototypeWriteInt16LECodeLength = 175; -static const JSC::Intrinsic s_jsBufferPrototypeWriteInt16LECodeIntrinsic = JSC::NoIntrinsic; -const char* const s_jsBufferPrototypeWriteInt16LECode = "(function (value, offset) {\"use strict\";\n return (this.@dataView ||= new DataView(this.buffer, this.byteOffset, this.byteLength)).setInt16(offset, value, !0), offset + 2;\n})\n"; +// writableStreamDefaultControllerGetChunkSize +const JSC::ConstructAbility s_writableStreamInternalsWritableStreamDefaultControllerGetChunkSizeCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; +const JSC::ConstructorKind s_writableStreamInternalsWritableStreamDefaultControllerGetChunkSizeCodeConstructorKind = JSC::ConstructorKind::None; +const JSC::ImplementationVisibility s_writableStreamInternalsWritableStreamDefaultControllerGetChunkSizeCodeImplementationVisibility = JSC::ImplementationVisibility::Public; +const int s_writableStreamInternalsWritableStreamDefaultControllerGetChunkSizeCodeLength = 248; +static const JSC::Intrinsic s_writableStreamInternalsWritableStreamDefaultControllerGetChunkSizeCodeIntrinsic = JSC::NoIntrinsic; +const char* const s_writableStreamInternalsWritableStreamDefaultControllerGetChunkSizeCode = "(function (controller, chunk) {\"use strict\";\n try {\n return @getByIdDirectPrivate(controller, \"strategySizeAlgorithm\").@call(@undefined, chunk);\n } catch (e) {\n return @writableStreamDefaultControllerErrorIfNeeded(controller, e), 1;\n }\n})\n"; -// writeInt16BE -const JSC::ConstructAbility s_jsBufferPrototypeWriteInt16BECodeConstructAbility = JSC::ConstructAbility::CannotConstruct; -const JSC::ConstructorKind s_jsBufferPrototypeWriteInt16BECodeConstructorKind = JSC::ConstructorKind::None; -const JSC::ImplementationVisibility s_jsBufferPrototypeWriteInt16BECodeImplementationVisibility = JSC::ImplementationVisibility::Public; -const int s_jsBufferPrototypeWriteInt16BECodeLength = 175; -static const JSC::Intrinsic s_jsBufferPrototypeWriteInt16BECodeIntrinsic = JSC::NoIntrinsic; -const char* const s_jsBufferPrototypeWriteInt16BECode = "(function (value, offset) {\"use strict\";\n return (this.@dataView ||= new DataView(this.buffer, this.byteOffset, this.byteLength)).setInt16(offset, value, !1), offset + 2;\n})\n"; +// writableStreamDefaultControllerGetDesiredSize +const JSC::ConstructAbility s_writableStreamInternalsWritableStreamDefaultControllerGetDesiredSizeCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; +const JSC::ConstructorKind s_writableStreamInternalsWritableStreamDefaultControllerGetDesiredSizeCodeConstructorKind = JSC::ConstructorKind::None; +const JSC::ImplementationVisibility s_writableStreamInternalsWritableStreamDefaultControllerGetDesiredSizeCodeImplementationVisibility = JSC::ImplementationVisibility::Public; +const int s_writableStreamInternalsWritableStreamDefaultControllerGetDesiredSizeCodeLength = 150; +static const JSC::Intrinsic s_writableStreamInternalsWritableStreamDefaultControllerGetDesiredSizeCodeIntrinsic = JSC::NoIntrinsic; +const char* const s_writableStreamInternalsWritableStreamDefaultControllerGetDesiredSizeCode = "(function (controller) {\"use strict\";\n return @getByIdDirectPrivate(controller, \"strategyHWM\") - @getByIdDirectPrivate(controller, \"queue\").size;\n})\n"; -// writeUInt16LE -const JSC::ConstructAbility s_jsBufferPrototypeWriteUInt16LECodeConstructAbility = JSC::ConstructAbility::CannotConstruct; -const JSC::ConstructorKind s_jsBufferPrototypeWriteUInt16LECodeConstructorKind = JSC::ConstructorKind::None; -const JSC::ImplementationVisibility s_jsBufferPrototypeWriteUInt16LECodeImplementationVisibility = JSC::ImplementationVisibility::Public; -const int s_jsBufferPrototypeWriteUInt16LECodeLength = 176; -static const JSC::Intrinsic s_jsBufferPrototypeWriteUInt16LECodeIntrinsic = JSC::NoIntrinsic; -const char* const s_jsBufferPrototypeWriteUInt16LECode = "(function (value, offset) {\"use strict\";\n return (this.@dataView ||= new DataView(this.buffer, this.byteOffset, this.byteLength)).setUint16(offset, value, !0), offset + 2;\n})\n"; +// writableStreamDefaultControllerProcessClose +const JSC::ConstructAbility s_writableStreamInternalsWritableStreamDefaultControllerProcessCloseCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; +const JSC::ConstructorKind s_writableStreamInternalsWritableStreamDefaultControllerProcessCloseCodeConstructorKind = JSC::ConstructorKind::None; +const JSC::ImplementationVisibility s_writableStreamInternalsWritableStreamDefaultControllerProcessCloseCodeImplementationVisibility = JSC::ImplementationVisibility::Public; +const int s_writableStreamInternalsWritableStreamDefaultControllerProcessCloseCodeLength = 533; +static const JSC::Intrinsic s_writableStreamInternalsWritableStreamDefaultControllerProcessCloseCodeIntrinsic = JSC::NoIntrinsic; +const char* const s_writableStreamInternalsWritableStreamDefaultControllerProcessCloseCode = "(function (controller) {\"use strict\";\n const stream = @getByIdDirectPrivate(controller, \"stream\");\n @writableStreamMarkCloseRequestInFlight(stream), @dequeueValue(@getByIdDirectPrivate(controller, \"queue\"));\n const sinkClosePromise = @getByIdDirectPrivate(controller, \"closeAlgorithm\").@call();\n @writableStreamDefaultControllerClearAlgorithms(controller), sinkClosePromise.@then(() => {\n @writableStreamFinishInFlightClose(stream);\n }, (reason) => {\n @writableStreamFinishInFlightCloseWithError(stream, reason);\n });\n})\n"; -// writeUInt16BE -const JSC::ConstructAbility s_jsBufferPrototypeWriteUInt16BECodeConstructAbility = JSC::ConstructAbility::CannotConstruct; -const JSC::ConstructorKind s_jsBufferPrototypeWriteUInt16BECodeConstructorKind = JSC::ConstructorKind::None; -const JSC::ImplementationVisibility s_jsBufferPrototypeWriteUInt16BECodeImplementationVisibility = JSC::ImplementationVisibility::Public; -const int s_jsBufferPrototypeWriteUInt16BECodeLength = 176; -static const JSC::Intrinsic s_jsBufferPrototypeWriteUInt16BECodeIntrinsic = JSC::NoIntrinsic; -const char* const s_jsBufferPrototypeWriteUInt16BECode = "(function (value, offset) {\"use strict\";\n return (this.@dataView ||= new DataView(this.buffer, this.byteOffset, this.byteLength)).setUint16(offset, value, !1), offset + 2;\n})\n"; +// writableStreamDefaultControllerProcessWrite +const JSC::ConstructAbility s_writableStreamInternalsWritableStreamDefaultControllerProcessWriteCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; +const JSC::ConstructorKind s_writableStreamInternalsWritableStreamDefaultControllerProcessWriteCodeConstructorKind = JSC::ConstructorKind::None; +const JSC::ImplementationVisibility s_writableStreamInternalsWritableStreamDefaultControllerProcessWriteCodeImplementationVisibility = JSC::ImplementationVisibility::Public; +const int s_writableStreamInternalsWritableStreamDefaultControllerProcessWriteCodeLength = 950; +static const JSC::Intrinsic s_writableStreamInternalsWritableStreamDefaultControllerProcessWriteCodeIntrinsic = JSC::NoIntrinsic; +const char* const s_writableStreamInternalsWritableStreamDefaultControllerProcessWriteCode = "(function (controller, chunk) {\"use strict\";\n const stream = @getByIdDirectPrivate(controller, \"stream\");\n @writableStreamMarkFirstWriteRequestInFlight(stream), @getByIdDirectPrivate(controller, \"writeAlgorithm\").@call(@undefined, chunk).@then(() => {\n @writableStreamFinishInFlightWrite(stream);\n const state = @getByIdDirectPrivate(stream, \"state\");\n if (@dequeueValue(@getByIdDirectPrivate(controller, \"queue\")), !@writableStreamCloseQueuedOrInFlight(stream) && state === \"writable\") {\n const backpressure = @writableStreamDefaultControllerGetBackpressure(controller);\n @writableStreamUpdateBackpressure(stream, backpressure);\n }\n @writableStreamDefaultControllerAdvanceQueueIfNeeded(controller);\n }, (reason) => {\n if (@getByIdDirectPrivate(stream, \"state\") === \"writable\")\n @writableStreamDefaultControllerClearAlgorithms(controller);\n @writableStreamFinishInFlightWriteWithError(stream, reason);\n });\n})\n"; -// writeInt32LE -const JSC::ConstructAbility s_jsBufferPrototypeWriteInt32LECodeConstructAbility = JSC::ConstructAbility::CannotConstruct; -const JSC::ConstructorKind s_jsBufferPrototypeWriteInt32LECodeConstructorKind = JSC::ConstructorKind::None; -const JSC::ImplementationVisibility s_jsBufferPrototypeWriteInt32LECodeImplementationVisibility = JSC::ImplementationVisibility::Public; -const int s_jsBufferPrototypeWriteInt32LECodeLength = 175; -static const JSC::Intrinsic s_jsBufferPrototypeWriteInt32LECodeIntrinsic = JSC::NoIntrinsic; -const char* const s_jsBufferPrototypeWriteInt32LECode = "(function (value, offset) {\"use strict\";\n return (this.@dataView ||= new DataView(this.buffer, this.byteOffset, this.byteLength)).setInt32(offset, value, !0), offset + 4;\n})\n"; +// writableStreamDefaultControllerWrite +const JSC::ConstructAbility s_writableStreamInternalsWritableStreamDefaultControllerWriteCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; +const JSC::ConstructorKind s_writableStreamInternalsWritableStreamDefaultControllerWriteCodeConstructorKind = JSC::ConstructorKind::None; +const JSC::ImplementationVisibility s_writableStreamInternalsWritableStreamDefaultControllerWriteCodeImplementationVisibility = JSC::ImplementationVisibility::Public; +const int s_writableStreamInternalsWritableStreamDefaultControllerWriteCodeLength = 662; +static const JSC::Intrinsic s_writableStreamInternalsWritableStreamDefaultControllerWriteCodeIntrinsic = JSC::NoIntrinsic; +const char* const s_writableStreamInternalsWritableStreamDefaultControllerWriteCode = "(function (controller, chunk, chunkSize) {\"use strict\";\n try {\n @enqueueValueWithSize(@getByIdDirectPrivate(controller, \"queue\"), chunk, chunkSize);\n const stream = @getByIdDirectPrivate(controller, \"stream\"), state = @getByIdDirectPrivate(stream, \"state\");\n if (!@writableStreamCloseQueuedOrInFlight(stream) && state === \"writable\") {\n const backpressure = @writableStreamDefaultControllerGetBackpressure(controller);\n @writableStreamUpdateBackpressure(stream, backpressure);\n }\n @writableStreamDefaultControllerAdvanceQueueIfNeeded(controller);\n } catch (e) {\n @writableStreamDefaultControllerErrorIfNeeded(controller, e);\n }\n})\n"; -// writeInt32BE -const JSC::ConstructAbility s_jsBufferPrototypeWriteInt32BECodeConstructAbility = JSC::ConstructAbility::CannotConstruct; -const JSC::ConstructorKind s_jsBufferPrototypeWriteInt32BECodeConstructorKind = JSC::ConstructorKind::None; -const JSC::ImplementationVisibility s_jsBufferPrototypeWriteInt32BECodeImplementationVisibility = JSC::ImplementationVisibility::Public; -const int s_jsBufferPrototypeWriteInt32BECodeLength = 175; -static const JSC::Intrinsic s_jsBufferPrototypeWriteInt32BECodeIntrinsic = JSC::NoIntrinsic; -const char* const s_jsBufferPrototypeWriteInt32BECode = "(function (value, offset) {\"use strict\";\n return (this.@dataView ||= new DataView(this.buffer, this.byteOffset, this.byteLength)).setInt32(offset, value, !1), offset + 4;\n})\n"; +#define DEFINE_BUILTIN_GENERATOR(codeName, functionName, overriddenName, argumentCount) \ +JSC::FunctionExecutable* codeName##Generator(JSC::VM& vm) \ +{\ + JSVMClientData* clientData = static_cast(vm.clientData); \ + return clientData->builtinFunctions().writableStreamInternalsBuiltins().codeName##Executable()->link(vm, nullptr, clientData->builtinFunctions().writableStreamInternalsBuiltins().codeName##Source(), std::nullopt, s_##codeName##Intrinsic); \ +} +WEBCORE_FOREACH_WRITABLESTREAMINTERNALS_BUILTIN_CODE(DEFINE_BUILTIN_GENERATOR) +#undef DEFINE_BUILTIN_GENERATOR -// writeUInt32LE -const JSC::ConstructAbility s_jsBufferPrototypeWriteUInt32LECodeConstructAbility = JSC::ConstructAbility::CannotConstruct; -const JSC::ConstructorKind s_jsBufferPrototypeWriteUInt32LECodeConstructorKind = JSC::ConstructorKind::None; -const JSC::ImplementationVisibility s_jsBufferPrototypeWriteUInt32LECodeImplementationVisibility = JSC::ImplementationVisibility::Public; -const int s_jsBufferPrototypeWriteUInt32LECodeLength = 176; -static const JSC::Intrinsic s_jsBufferPrototypeWriteUInt32LECodeIntrinsic = JSC::NoIntrinsic; -const char* const s_jsBufferPrototypeWriteUInt32LECode = "(function (value, offset) {\"use strict\";\n return (this.@dataView ||= new DataView(this.buffer, this.byteOffset, this.byteLength)).setUint32(offset, value, !0), offset + 4;\n})\n"; +/* ReadableStream.ts */ +// initializeReadableStream +const JSC::ConstructAbility s_readableStreamInitializeReadableStreamCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; +const JSC::ConstructorKind s_readableStreamInitializeReadableStreamCodeConstructorKind = JSC::ConstructorKind::None; +const JSC::ImplementationVisibility s_readableStreamInitializeReadableStreamCodeImplementationVisibility = JSC::ImplementationVisibility::Public; +const int s_readableStreamInitializeReadableStreamCodeLength = 2962; +static const JSC::Intrinsic s_readableStreamInitializeReadableStreamCodeIntrinsic = JSC::NoIntrinsic; +const char* const s_readableStreamInitializeReadableStreamCode = "(function (underlyingSource, strategy) {\"use strict\";\n if (underlyingSource === @undefined)\n underlyingSource = { @bunNativeType: 0, @bunNativePtr: 0, @lazy: !1 };\n if (strategy === @undefined)\n strategy = {};\n if (!@isObject(underlyingSource))\n @throwTypeError(\"ReadableStream constructor takes an object as first argument\");\n if (strategy !== @undefined && !@isObject(strategy))\n @throwTypeError(\"ReadableStream constructor takes an object as second argument, if any\");\n @putByIdDirectPrivate(this, \"state\", 4), @putByIdDirectPrivate(this, \"reader\", @undefined), @putByIdDirectPrivate(this, \"storedError\", @undefined), @putByIdDirectPrivate(this, \"disturbed\", !1), @putByIdDirectPrivate(this, \"readableStreamController\", null), @putByIdDirectPrivate(this, \"bunNativeType\", @getByIdDirectPrivate(underlyingSource, \"bunNativeType\") \?\? 0), @putByIdDirectPrivate(this, \"bunNativePtr\", @getByIdDirectPrivate(underlyingSource, \"bunNativePtr\") \?\? 0), @putByIdDirectPrivate(this, \"asyncContext\", @getInternalField(@asyncContext, 0));\n const isDirect = underlyingSource.type === \"direct\", isUnderlyingSourceLazy = !!underlyingSource.@lazy, isLazy = isDirect || isUnderlyingSourceLazy;\n if (@getByIdDirectPrivate(underlyingSource, \"pull\") !== @undefined && !isLazy) {\n const size = @getByIdDirectPrivate(strategy, \"size\"), highWaterMark = @getByIdDirectPrivate(strategy, \"highWaterMark\");\n return @putByIdDirectPrivate(this, \"highWaterMark\", highWaterMark), @putByIdDirectPrivate(this, \"underlyingSource\", @undefined), @setupReadableStreamDefaultController(this, underlyingSource, size, highWaterMark !== @undefined \? highWaterMark : 1, @getByIdDirectPrivate(underlyingSource, \"start\"), @getByIdDirectPrivate(underlyingSource, \"pull\"), @getByIdDirectPrivate(underlyingSource, \"cancel\")), this;\n }\n if (isDirect)\n @putByIdDirectPrivate(this, \"underlyingSource\", underlyingSource), @putByIdDirectPrivate(this, \"highWaterMark\", @getByIdDirectPrivate(strategy, \"highWaterMark\")), @putByIdDirectPrivate(this, \"start\", () => @createReadableStreamController(this, underlyingSource, strategy));\n else if (isLazy) {\n const autoAllocateChunkSize = underlyingSource.autoAllocateChunkSize;\n @putByIdDirectPrivate(this, \"highWaterMark\", @undefined), @putByIdDirectPrivate(this, \"underlyingSource\", @undefined), @putByIdDirectPrivate(this, \"highWaterMark\", autoAllocateChunkSize || @getByIdDirectPrivate(strategy, \"highWaterMark\")), @putByIdDirectPrivate(this, \"start\", () => {\n const instance = @lazyLoadStream(this, autoAllocateChunkSize);\n if (instance)\n @createReadableStreamController(this, instance, strategy);\n });\n } else\n @putByIdDirectPrivate(this, \"underlyingSource\", @undefined), @putByIdDirectPrivate(this, \"highWaterMark\", @getByIdDirectPrivate(strategy, \"highWaterMark\")), @putByIdDirectPrivate(this, \"start\", @undefined), @createReadableStreamController(this, underlyingSource, strategy);\n return this;\n})\n"; -// writeUInt32BE -const JSC::ConstructAbility s_jsBufferPrototypeWriteUInt32BECodeConstructAbility = JSC::ConstructAbility::CannotConstruct; -const JSC::ConstructorKind s_jsBufferPrototypeWriteUInt32BECodeConstructorKind = JSC::ConstructorKind::None; -const JSC::ImplementationVisibility s_jsBufferPrototypeWriteUInt32BECodeImplementationVisibility = JSC::ImplementationVisibility::Public; -const int s_jsBufferPrototypeWriteUInt32BECodeLength = 176; -static const JSC::Intrinsic s_jsBufferPrototypeWriteUInt32BECodeIntrinsic = JSC::NoIntrinsic; -const char* const s_jsBufferPrototypeWriteUInt32BECode = "(function (value, offset) {\"use strict\";\n return (this.@dataView ||= new DataView(this.buffer, this.byteOffset, this.byteLength)).setUint32(offset, value, !1), offset + 4;\n})\n"; +// readableStreamToArray +const JSC::ConstructAbility s_readableStreamReadableStreamToArrayCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; +const JSC::ConstructorKind s_readableStreamReadableStreamToArrayCodeConstructorKind = JSC::ConstructorKind::None; +const JSC::ImplementationVisibility s_readableStreamReadableStreamToArrayCodeImplementationVisibility = JSC::ImplementationVisibility::Private; +const int s_readableStreamReadableStreamToArrayCodeLength = 262; +static const JSC::Intrinsic s_readableStreamReadableStreamToArrayCodeIntrinsic = JSC::NoIntrinsic; +const char* const s_readableStreamReadableStreamToArrayCode = "(function (stream) {\"use strict\";\n var underlyingSource = @getByIdDirectPrivate(stream, \"underlyingSource\");\n if (underlyingSource !== @undefined)\n return @readableStreamToArrayDirect(stream, underlyingSource);\n return @readableStreamIntoArray(stream);\n})\n"; -// writeIntLE -const JSC::ConstructAbility s_jsBufferPrototypeWriteIntLECodeConstructAbility = JSC::ConstructAbility::CannotConstruct; -const JSC::ConstructorKind s_jsBufferPrototypeWriteIntLECodeConstructorKind = JSC::ConstructorKind::None; -const JSC::ImplementationVisibility s_jsBufferPrototypeWriteIntLECodeImplementationVisibility = JSC::ImplementationVisibility::Public; -const int s_jsBufferPrototypeWriteIntLECodeLength = 957; -static const JSC::Intrinsic s_jsBufferPrototypeWriteIntLECodeIntrinsic = JSC::NoIntrinsic; -const char* const s_jsBufferPrototypeWriteIntLECode = "(function (value, offset, byteLength) {\"use strict\";\n const view = this.@dataView ||= new DataView(this.buffer, this.byteOffset, this.byteLength);\n switch (byteLength) {\n case 1: {\n view.setInt8(offset, value);\n break;\n }\n case 2: {\n view.setInt16(offset, value, !0);\n break;\n }\n case 3: {\n view.setUint16(offset, value & 65535, !0), view.setInt8(offset + 2, Math.floor(value * 0.0000152587890625));\n break;\n }\n case 4: {\n view.setInt32(offset, value, !0);\n break;\n }\n case 5: {\n view.setUint32(offset, value | 0, !0), view.setInt8(offset + 4, Math.floor(value * 0.00000000023283064365386964));\n break;\n }\n case 6: {\n view.setUint32(offset, value | 0, !0), view.setInt16(offset + 4, Math.floor(value * 0.00000000023283064365386964), !0);\n break;\n }\n default:\n @throwRangeError(\"byteLength must be >= 1 and <= 6\");\n }\n return offset + byteLength;\n})\n"; +// readableStreamToText +const JSC::ConstructAbility s_readableStreamReadableStreamToTextCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; +const JSC::ConstructorKind s_readableStreamReadableStreamToTextCodeConstructorKind = JSC::ConstructorKind::None; +const JSC::ImplementationVisibility s_readableStreamReadableStreamToTextCodeImplementationVisibility = JSC::ImplementationVisibility::Private; +const int s_readableStreamReadableStreamToTextCodeLength = 260; +static const JSC::Intrinsic s_readableStreamReadableStreamToTextCodeIntrinsic = JSC::NoIntrinsic; +const char* const s_readableStreamReadableStreamToTextCode = "(function (stream) {\"use strict\";\n var underlyingSource = @getByIdDirectPrivate(stream, \"underlyingSource\");\n if (underlyingSource !== @undefined)\n return @readableStreamToTextDirect(stream, underlyingSource);\n return @readableStreamIntoText(stream);\n})\n"; -// writeIntBE -const JSC::ConstructAbility s_jsBufferPrototypeWriteIntBECodeConstructAbility = JSC::ConstructAbility::CannotConstruct; -const JSC::ConstructorKind s_jsBufferPrototypeWriteIntBECodeConstructorKind = JSC::ConstructorKind::None; -const JSC::ImplementationVisibility s_jsBufferPrototypeWriteIntBECodeImplementationVisibility = JSC::ImplementationVisibility::Public; -const int s_jsBufferPrototypeWriteIntBECodeLength = 957; -static const JSC::Intrinsic s_jsBufferPrototypeWriteIntBECodeIntrinsic = JSC::NoIntrinsic; -const char* const s_jsBufferPrototypeWriteIntBECode = "(function (value, offset, byteLength) {\"use strict\";\n const view = this.@dataView ||= new DataView(this.buffer, this.byteOffset, this.byteLength);\n switch (byteLength) {\n case 1: {\n view.setInt8(offset, value);\n break;\n }\n case 2: {\n view.setInt16(offset, value, !1);\n break;\n }\n case 3: {\n view.setUint16(offset + 1, value & 65535, !1), view.setInt8(offset, Math.floor(value * 0.0000152587890625));\n break;\n }\n case 4: {\n view.setInt32(offset, value, !1);\n break;\n }\n case 5: {\n view.setUint32(offset + 1, value | 0, !1), view.setInt8(offset, Math.floor(value * 0.00000000023283064365386964));\n break;\n }\n case 6: {\n view.setUint32(offset + 2, value | 0, !1), view.setInt16(offset, Math.floor(value * 0.00000000023283064365386964), !1);\n break;\n }\n default:\n @throwRangeError(\"byteLength must be >= 1 and <= 6\");\n }\n return offset + byteLength;\n})\n"; +// readableStreamToArrayBuffer +const JSC::ConstructAbility s_readableStreamReadableStreamToArrayBufferCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; +const JSC::ConstructorKind s_readableStreamReadableStreamToArrayBufferCodeConstructorKind = JSC::ConstructorKind::None; +const JSC::ImplementationVisibility s_readableStreamReadableStreamToArrayBufferCodeImplementationVisibility = JSC::ImplementationVisibility::Private; +const int s_readableStreamReadableStreamToArrayBufferCodeLength = 390; +static const JSC::Intrinsic s_readableStreamReadableStreamToArrayBufferCodeIntrinsic = JSC::NoIntrinsic; +const char* const s_readableStreamReadableStreamToArrayBufferCode = "(function (stream) {\"use strict\";\n var underlyingSource = @getByIdDirectPrivate(stream, \"underlyingSource\");\n if (underlyingSource !== @undefined)\n return @readableStreamToArrayBufferDirect(stream, underlyingSource);\n var result = Bun.readableStreamToArray(stream);\n if (@isPromise(result))\n return result.then(Bun.concatArrayBuffers);\n return Bun.concatArrayBuffers(result);\n})\n"; -// writeUIntLE -const JSC::ConstructAbility s_jsBufferPrototypeWriteUIntLECodeConstructAbility = JSC::ConstructAbility::CannotConstruct; -const JSC::ConstructorKind s_jsBufferPrototypeWriteUIntLECodeConstructorKind = JSC::ConstructorKind::None; -const JSC::ImplementationVisibility s_jsBufferPrototypeWriteUIntLECodeImplementationVisibility = JSC::ImplementationVisibility::Public; -const int s_jsBufferPrototypeWriteUIntLECodeLength = 963; -static const JSC::Intrinsic s_jsBufferPrototypeWriteUIntLECodeIntrinsic = JSC::NoIntrinsic; -const char* const s_jsBufferPrototypeWriteUIntLECode = "(function (value, offset, byteLength) {\"use strict\";\n const view = this.@dataView ||= new DataView(this.buffer, this.byteOffset, this.byteLength);\n switch (byteLength) {\n case 1: {\n view.setUint8(offset, value);\n break;\n }\n case 2: {\n view.setUint16(offset, value, !0);\n break;\n }\n case 3: {\n view.setUint16(offset, value & 65535, !0), view.setUint8(offset + 2, Math.floor(value * 0.0000152587890625));\n break;\n }\n case 4: {\n view.setUint32(offset, value, !0);\n break;\n }\n case 5: {\n view.setUint32(offset, value | 0, !0), view.setUint8(offset + 4, Math.floor(value * 0.00000000023283064365386964));\n break;\n }\n case 6: {\n view.setUint32(offset, value | 0, !0), view.setUint16(offset + 4, Math.floor(value * 0.00000000023283064365386964), !0);\n break;\n }\n default:\n @throwRangeError(\"byteLength must be >= 1 and <= 6\");\n }\n return offset + byteLength;\n})\n"; +// readableStreamToFormData +const JSC::ConstructAbility s_readableStreamReadableStreamToFormDataCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; +const JSC::ConstructorKind s_readableStreamReadableStreamToFormDataCodeConstructorKind = JSC::ConstructorKind::None; +const JSC::ImplementationVisibility s_readableStreamReadableStreamToFormDataCodeImplementationVisibility = JSC::ImplementationVisibility::Private; +const int s_readableStreamReadableStreamToFormDataCodeLength = 160; +static const JSC::Intrinsic s_readableStreamReadableStreamToFormDataCodeIntrinsic = JSC::NoIntrinsic; +const char* const s_readableStreamReadableStreamToFormDataCode = "(function (stream, contentType) {\"use strict\";\n return Bun.readableStreamToBlob(stream).then((blob) => {\n return FormData.from(blob, contentType);\n });\n})\n"; -// writeUIntBE -const JSC::ConstructAbility s_jsBufferPrototypeWriteUIntBECodeConstructAbility = JSC::ConstructAbility::CannotConstruct; -const JSC::ConstructorKind s_jsBufferPrototypeWriteUIntBECodeConstructorKind = JSC::ConstructorKind::None; -const JSC::ImplementationVisibility s_jsBufferPrototypeWriteUIntBECodeImplementationVisibility = JSC::ImplementationVisibility::Public; -const int s_jsBufferPrototypeWriteUIntBECodeLength = 963; -static const JSC::Intrinsic s_jsBufferPrototypeWriteUIntBECodeIntrinsic = JSC::NoIntrinsic; -const char* const s_jsBufferPrototypeWriteUIntBECode = "(function (value, offset, byteLength) {\"use strict\";\n const view = this.@dataView ||= new DataView(this.buffer, this.byteOffset, this.byteLength);\n switch (byteLength) {\n case 1: {\n view.setUint8(offset, value);\n break;\n }\n case 2: {\n view.setUint16(offset, value, !1);\n break;\n }\n case 3: {\n view.setUint16(offset + 1, value & 65535, !1), view.setUint8(offset, Math.floor(value * 0.0000152587890625));\n break;\n }\n case 4: {\n view.setUint32(offset, value, !1);\n break;\n }\n case 5: {\n view.setUint32(offset + 1, value | 0, !1), view.setUint8(offset, Math.floor(value * 0.00000000023283064365386964));\n break;\n }\n case 6: {\n view.setUint32(offset + 2, value | 0, !1), view.setUint16(offset, Math.floor(value * 0.00000000023283064365386964), !1);\n break;\n }\n default:\n @throwRangeError(\"byteLength must be >= 1 and <= 6\");\n }\n return offset + byteLength;\n})\n"; +// readableStreamToJSON +const JSC::ConstructAbility s_readableStreamReadableStreamToJSONCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; +const JSC::ConstructorKind s_readableStreamReadableStreamToJSONCodeConstructorKind = JSC::ConstructorKind::None; +const JSC::ImplementationVisibility s_readableStreamReadableStreamToJSONCodeImplementationVisibility = JSC::ImplementationVisibility::Private; +const int s_readableStreamReadableStreamToJSONCodeLength = 109; +static const JSC::Intrinsic s_readableStreamReadableStreamToJSONCodeIntrinsic = JSC::NoIntrinsic; +const char* const s_readableStreamReadableStreamToJSONCode = "(function (stream) {\"use strict\";\n return Bun.readableStreamToText(stream).@then(globalThis.JSON.parse);\n})\n"; -// writeFloatLE -const JSC::ConstructAbility s_jsBufferPrototypeWriteFloatLECodeConstructAbility = JSC::ConstructAbility::CannotConstruct; -const JSC::ConstructorKind s_jsBufferPrototypeWriteFloatLECodeConstructorKind = JSC::ConstructorKind::None; -const JSC::ImplementationVisibility s_jsBufferPrototypeWriteFloatLECodeImplementationVisibility = JSC::ImplementationVisibility::Public; -const int s_jsBufferPrototypeWriteFloatLECodeLength = 177; -static const JSC::Intrinsic s_jsBufferPrototypeWriteFloatLECodeIntrinsic = JSC::NoIntrinsic; -const char* const s_jsBufferPrototypeWriteFloatLECode = "(function (value, offset) {\"use strict\";\n return (this.@dataView ||= new DataView(this.buffer, this.byteOffset, this.byteLength)).setFloat32(offset, value, !0), offset + 4;\n})\n"; +// readableStreamToBlob +const JSC::ConstructAbility s_readableStreamReadableStreamToBlobCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; +const JSC::ConstructorKind s_readableStreamReadableStreamToBlobCodeConstructorKind = JSC::ConstructorKind::None; +const JSC::ImplementationVisibility s_readableStreamReadableStreamToBlobCodeImplementationVisibility = JSC::ImplementationVisibility::Private; +const int s_readableStreamReadableStreamToBlobCodeLength = 133; +static const JSC::Intrinsic s_readableStreamReadableStreamToBlobCodeIntrinsic = JSC::NoIntrinsic; +const char* const s_readableStreamReadableStreamToBlobCode = "(function (stream) {\"use strict\";\n return @Promise.resolve(Bun.readableStreamToArray(stream)).@then((array) => new Blob(array));\n})\n"; -// writeFloatBE -const JSC::ConstructAbility s_jsBufferPrototypeWriteFloatBECodeConstructAbility = JSC::ConstructAbility::CannotConstruct; -const JSC::ConstructorKind s_jsBufferPrototypeWriteFloatBECodeConstructorKind = JSC::ConstructorKind::None; -const JSC::ImplementationVisibility s_jsBufferPrototypeWriteFloatBECodeImplementationVisibility = JSC::ImplementationVisibility::Public; -const int s_jsBufferPrototypeWriteFloatBECodeLength = 177; -static const JSC::Intrinsic s_jsBufferPrototypeWriteFloatBECodeIntrinsic = JSC::NoIntrinsic; -const char* const s_jsBufferPrototypeWriteFloatBECode = "(function (value, offset) {\"use strict\";\n return (this.@dataView ||= new DataView(this.buffer, this.byteOffset, this.byteLength)).setFloat32(offset, value, !1), offset + 4;\n})\n"; +// consumeReadableStream +const JSC::ConstructAbility s_readableStreamConsumeReadableStreamCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; +const JSC::ConstructorKind s_readableStreamConsumeReadableStreamCodeConstructorKind = JSC::ConstructorKind::None; +const JSC::ImplementationVisibility s_readableStreamConsumeReadableStreamCodeImplementationVisibility = JSC::ImplementationVisibility::Private; +const int s_readableStreamConsumeReadableStreamCodeLength = 2830; +static const JSC::Intrinsic s_readableStreamConsumeReadableStreamCodeIntrinsic = JSC::NoIntrinsic; +const char* const s_readableStreamConsumeReadableStreamCode = "(function (nativePtr, nativeType, inputStream) {\"use strict\";\n const symbol = globalThis.Symbol.for(\"Bun.consumeReadableStreamPrototype\");\n var cached = globalThis[symbol];\n if (!cached)\n cached = globalThis[symbol] = [];\n var Prototype = cached[nativeType];\n if (Prototype === @undefined) {\n var [doRead, doError, doReadMany, doClose, onClose, deinit] = @lazy(nativeType);\n Prototype = class NativeReadableStreamSink {\n handleError;\n handleClosed;\n processResult;\n constructor(reader, ptr) {\n this.#ptr = ptr, this.#reader = reader, this.#didClose = !1, this.handleError = this._handleError.bind(this), this.handleClosed = this._handleClosed.bind(this), this.processResult = this._processResult.bind(this), reader.closed.then(this.handleClosed, this.handleError);\n }\n _handleClosed() {\n if (this.#didClose)\n return;\n this.#didClose = !0;\n var ptr = this.#ptr;\n this.#ptr = 0, doClose(ptr), deinit(ptr);\n }\n _handleError(error) {\n if (this.#didClose)\n return;\n this.#didClose = !0;\n var ptr = this.#ptr;\n this.#ptr = 0, doError(ptr, error), deinit(ptr);\n }\n #ptr;\n #didClose = !1;\n #reader;\n _handleReadMany({ value, done, size }) {\n if (done) {\n this.handleClosed();\n return;\n }\n if (this.#didClose)\n return;\n doReadMany(this.#ptr, value, done, size);\n }\n read() {\n if (!this.#ptr)\n return @throwTypeError(\"ReadableStreamSink is already closed\");\n return this.processResult(this.#reader.read());\n }\n _processResult(result) {\n if (result && @isPromise(result)) {\n if (@getPromiseInternalField(result, @promiseFieldFlags) & @promiseStateFulfilled) {\n const fulfilledValue = @getPromiseInternalField(result, @promiseFieldReactionsOrResult);\n if (fulfilledValue)\n result = fulfilledValue;\n }\n }\n if (result && @isPromise(result))\n return result.then(this.processResult, this.handleError), null;\n if (result.done)\n return this.handleClosed(), 0;\n else if (result.value)\n return result.value;\n else\n return -1;\n }\n readMany() {\n if (!this.#ptr)\n return @throwTypeError(\"ReadableStreamSink is already closed\");\n return this.processResult(this.#reader.readMany());\n }\n };\n const minlength = nativeType + 1;\n if (cached.length < minlength)\n cached.length = minlength;\n @putByValDirect(cached, nativeType, Prototype);\n }\n if (@isReadableStreamLocked(inputStream))\n @throwTypeError(\"Cannot start reading from a locked stream\");\n return new Prototype(inputStream.getReader(), nativePtr);\n})\n"; -// writeDoubleLE -const JSC::ConstructAbility s_jsBufferPrototypeWriteDoubleLECodeConstructAbility = JSC::ConstructAbility::CannotConstruct; -const JSC::ConstructorKind s_jsBufferPrototypeWriteDoubleLECodeConstructorKind = JSC::ConstructorKind::None; -const JSC::ImplementationVisibility s_jsBufferPrototypeWriteDoubleLECodeImplementationVisibility = JSC::ImplementationVisibility::Public; -const int s_jsBufferPrototypeWriteDoubleLECodeLength = 177; -static const JSC::Intrinsic s_jsBufferPrototypeWriteDoubleLECodeIntrinsic = JSC::NoIntrinsic; -const char* const s_jsBufferPrototypeWriteDoubleLECode = "(function (value, offset) {\"use strict\";\n return (this.@dataView ||= new DataView(this.buffer, this.byteOffset, this.byteLength)).setFloat64(offset, value, !0), offset + 8;\n})\n"; +// createEmptyReadableStream +const JSC::ConstructAbility s_readableStreamCreateEmptyReadableStreamCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; +const JSC::ConstructorKind s_readableStreamCreateEmptyReadableStreamCodeConstructorKind = JSC::ConstructorKind::None; +const JSC::ImplementationVisibility s_readableStreamCreateEmptyReadableStreamCodeImplementationVisibility = JSC::ImplementationVisibility::Private; +const int s_readableStreamCreateEmptyReadableStreamCodeLength = 140; +static const JSC::Intrinsic s_readableStreamCreateEmptyReadableStreamCodeIntrinsic = JSC::NoIntrinsic; +const char* const s_readableStreamCreateEmptyReadableStreamCode = "(function () {\"use strict\";\n var stream = new @ReadableStream({\n pull() {\n }\n });\n return @readableStreamClose(stream), stream;\n})\n"; -// writeDoubleBE -const JSC::ConstructAbility s_jsBufferPrototypeWriteDoubleBECodeConstructAbility = JSC::ConstructAbility::CannotConstruct; -const JSC::ConstructorKind s_jsBufferPrototypeWriteDoubleBECodeConstructorKind = JSC::ConstructorKind::None; -const JSC::ImplementationVisibility s_jsBufferPrototypeWriteDoubleBECodeImplementationVisibility = JSC::ImplementationVisibility::Public; -const int s_jsBufferPrototypeWriteDoubleBECodeLength = 177; -static const JSC::Intrinsic s_jsBufferPrototypeWriteDoubleBECodeIntrinsic = JSC::NoIntrinsic; -const char* const s_jsBufferPrototypeWriteDoubleBECode = "(function (value, offset) {\"use strict\";\n return (this.@dataView ||= new DataView(this.buffer, this.byteOffset, this.byteLength)).setFloat64(offset, value, !1), offset + 8;\n})\n"; +// createNativeReadableStream +const JSC::ConstructAbility s_readableStreamCreateNativeReadableStreamCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; +const JSC::ConstructorKind s_readableStreamCreateNativeReadableStreamCodeConstructorKind = JSC::ConstructorKind::None; +const JSC::ImplementationVisibility s_readableStreamCreateNativeReadableStreamCodeImplementationVisibility = JSC::ImplementationVisibility::Private; +const int s_readableStreamCreateNativeReadableStreamCodeLength = 215; +static const JSC::Intrinsic s_readableStreamCreateNativeReadableStreamCodeIntrinsic = JSC::NoIntrinsic; +const char* const s_readableStreamCreateNativeReadableStreamCode = "(function (nativePtr, nativeType, autoAllocateChunkSize) {\"use strict\";\n return new @ReadableStream({\n @lazy: !0,\n @bunNativeType: nativeType,\n @bunNativePtr: nativePtr,\n autoAllocateChunkSize\n });\n})\n"; -// writeBigInt64LE -const JSC::ConstructAbility s_jsBufferPrototypeWriteBigInt64LECodeConstructAbility = JSC::ConstructAbility::CannotConstruct; -const JSC::ConstructorKind s_jsBufferPrototypeWriteBigInt64LECodeConstructorKind = JSC::ConstructorKind::None; -const JSC::ImplementationVisibility s_jsBufferPrototypeWriteBigInt64LECodeImplementationVisibility = JSC::ImplementationVisibility::Public; -const int s_jsBufferPrototypeWriteBigInt64LECodeLength = 178; -static const JSC::Intrinsic s_jsBufferPrototypeWriteBigInt64LECodeIntrinsic = JSC::NoIntrinsic; -const char* const s_jsBufferPrototypeWriteBigInt64LECode = "(function (value, offset) {\"use strict\";\n return (this.@dataView ||= new DataView(this.buffer, this.byteOffset, this.byteLength)).setBigInt64(offset, value, !0), offset + 8;\n})\n"; +// cancel +const JSC::ConstructAbility s_readableStreamCancelCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; +const JSC::ConstructorKind s_readableStreamCancelCodeConstructorKind = JSC::ConstructorKind::None; +const JSC::ImplementationVisibility s_readableStreamCancelCodeImplementationVisibility = JSC::ImplementationVisibility::Public; +const int s_readableStreamCancelCodeLength = 302; +static const JSC::Intrinsic s_readableStreamCancelCodeIntrinsic = JSC::NoIntrinsic; +const char* const s_readableStreamCancelCode = "(function (reason) {\"use strict\";\n if (!@isReadableStream(this))\n return @Promise.@reject(@makeThisTypeError(\"ReadableStream\", \"cancel\"));\n if (@isReadableStreamLocked(this))\n return @Promise.@reject(@makeTypeError(\"ReadableStream is locked\"));\n return @readableStreamCancel(this, reason);\n})\n"; -// writeBigInt64BE -const JSC::ConstructAbility s_jsBufferPrototypeWriteBigInt64BECodeConstructAbility = JSC::ConstructAbility::CannotConstruct; -const JSC::ConstructorKind s_jsBufferPrototypeWriteBigInt64BECodeConstructorKind = JSC::ConstructorKind::None; -const JSC::ImplementationVisibility s_jsBufferPrototypeWriteBigInt64BECodeImplementationVisibility = JSC::ImplementationVisibility::Public; -const int s_jsBufferPrototypeWriteBigInt64BECodeLength = 178; -static const JSC::Intrinsic s_jsBufferPrototypeWriteBigInt64BECodeIntrinsic = JSC::NoIntrinsic; -const char* const s_jsBufferPrototypeWriteBigInt64BECode = "(function (value, offset) {\"use strict\";\n return (this.@dataView ||= new DataView(this.buffer, this.byteOffset, this.byteLength)).setBigInt64(offset, value, !1), offset + 8;\n})\n"; +// getReader +const JSC::ConstructAbility s_readableStreamGetReaderCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; +const JSC::ConstructorKind s_readableStreamGetReaderCodeConstructorKind = JSC::ConstructorKind::None; +const JSC::ImplementationVisibility s_readableStreamGetReaderCodeImplementationVisibility = JSC::ImplementationVisibility::Public; +const int s_readableStreamGetReaderCodeLength = 580; +static const JSC::Intrinsic s_readableStreamGetReaderCodeIntrinsic = JSC::NoIntrinsic; +const char* const s_readableStreamGetReaderCode = "(function (options) {\"use strict\";\n if (!@isReadableStream(this))\n throw @makeThisTypeError(\"ReadableStream\", \"getReader\");\n const mode = @toDictionary(options, {}, \"ReadableStream.getReader takes an object as first argument\").mode;\n if (mode === @undefined) {\n var start_ = @getByIdDirectPrivate(this, \"start\");\n if (start_)\n @putByIdDirectPrivate(this, \"start\", @undefined), start_();\n return new @ReadableStreamDefaultReader(this);\n }\n if (mode == \"byob\")\n return new @ReadableStreamBYOBReader(this);\n @throwTypeError(\"Invalid mode is specified\");\n})\n"; -// writeBigUInt64LE -const JSC::ConstructAbility s_jsBufferPrototypeWriteBigUInt64LECodeConstructAbility = JSC::ConstructAbility::CannotConstruct; -const JSC::ConstructorKind s_jsBufferPrototypeWriteBigUInt64LECodeConstructorKind = JSC::ConstructorKind::None; -const JSC::ImplementationVisibility s_jsBufferPrototypeWriteBigUInt64LECodeImplementationVisibility = JSC::ImplementationVisibility::Public; -const int s_jsBufferPrototypeWriteBigUInt64LECodeLength = 179; -static const JSC::Intrinsic s_jsBufferPrototypeWriteBigUInt64LECodeIntrinsic = JSC::NoIntrinsic; -const char* const s_jsBufferPrototypeWriteBigUInt64LECode = "(function (value, offset) {\"use strict\";\n return (this.@dataView ||= new DataView(this.buffer, this.byteOffset, this.byteLength)).setBigUint64(offset, value, !0), offset + 8;\n})\n"; +// pipeThrough +const JSC::ConstructAbility s_readableStreamPipeThroughCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; +const JSC::ConstructorKind s_readableStreamPipeThroughCodeConstructorKind = JSC::ConstructorKind::None; +const JSC::ImplementationVisibility s_readableStreamPipeThroughCodeImplementationVisibility = JSC::ImplementationVisibility::Public; +const int s_readableStreamPipeThroughCodeLength = 1300; +static const JSC::Intrinsic s_readableStreamPipeThroughCodeIntrinsic = JSC::NoIntrinsic; +const char* const s_readableStreamPipeThroughCode = "(function (streams, options) {\"use strict\";\n const transforms = streams, readable = transforms.readable;\n if (!@isReadableStream(readable))\n throw @makeTypeError(\"readable should be ReadableStream\");\n const writable = transforms.writable, internalWritable = @getInternalWritableStream(writable);\n if (!@isWritableStream(internalWritable))\n throw @makeTypeError(\"writable should be WritableStream\");\n let preventClose = !1, preventAbort = !1, preventCancel = !1, signal;\n if (!@isUndefinedOrNull(options)) {\n if (!@isObject(options))\n throw @makeTypeError(\"options must be an object\");\n if (preventAbort = !!options.preventAbort, preventCancel = !!options.preventCancel, preventClose = !!options.preventClose, signal = options.signal, signal !== @undefined && !@isAbortSignal(signal))\n throw @makeTypeError(\"options.signal must be AbortSignal\");\n }\n if (!@isReadableStream(this))\n throw @makeThisTypeError(\"ReadableStream\", \"pipeThrough\");\n if (@isReadableStreamLocked(this))\n throw @makeTypeError(\"ReadableStream is locked\");\n if (@isWritableStreamLocked(internalWritable))\n throw @makeTypeError(\"WritableStream is locked\");\n return @readableStreamPipeToWritableStream(this, internalWritable, preventClose, preventAbort, preventCancel, signal), readable;\n})\n"; -// writeBigUInt64BE -const JSC::ConstructAbility s_jsBufferPrototypeWriteBigUInt64BECodeConstructAbility = JSC::ConstructAbility::CannotConstruct; -const JSC::ConstructorKind s_jsBufferPrototypeWriteBigUInt64BECodeConstructorKind = JSC::ConstructorKind::None; -const JSC::ImplementationVisibility s_jsBufferPrototypeWriteBigUInt64BECodeImplementationVisibility = JSC::ImplementationVisibility::Public; -const int s_jsBufferPrototypeWriteBigUInt64BECodeLength = 179; -static const JSC::Intrinsic s_jsBufferPrototypeWriteBigUInt64BECodeIntrinsic = JSC::NoIntrinsic; -const char* const s_jsBufferPrototypeWriteBigUInt64BECode = "(function (value, offset) {\"use strict\";\n return (this.@dataView ||= new DataView(this.buffer, this.byteOffset, this.byteLength)).setBigUint64(offset, value, !1), offset + 8;\n})\n"; +// pipeTo +const JSC::ConstructAbility s_readableStreamPipeToCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; +const JSC::ConstructorKind s_readableStreamPipeToCodeConstructorKind = JSC::ConstructorKind::None; +const JSC::ImplementationVisibility s_readableStreamPipeToCodeImplementationVisibility = JSC::ImplementationVisibility::Public; +const int s_readableStreamPipeToCodeLength = 1328; +static const JSC::Intrinsic s_readableStreamPipeToCodeIntrinsic = JSC::NoIntrinsic; +const char* const s_readableStreamPipeToCode = "(function (destination) {\"use strict\";\n if (!@isReadableStream(this))\n return @Promise.@reject(@makeThisTypeError(\"ReadableStream\", \"pipeTo\"));\n if (@isReadableStreamLocked(this))\n return @Promise.@reject(@makeTypeError(\"ReadableStream is locked\"));\n let options = @argument(1), preventClose = !1, preventAbort = !1, preventCancel = !1, signal;\n if (!@isUndefinedOrNull(options)) {\n if (!@isObject(options))\n return @Promise.@reject(@makeTypeError(\"options must be an object\"));\n try {\n preventAbort = !!options.preventAbort, preventCancel = !!options.preventCancel, preventClose = !!options.preventClose, signal = options.signal;\n } catch (e) {\n return @Promise.@reject(e);\n }\n if (signal !== @undefined && !@isAbortSignal(signal))\n return @Promise.@reject(@makeTypeError(\"options.signal must be AbortSignal\"));\n }\n const internalDestination = @getInternalWritableStream(destination);\n if (!@isWritableStream(internalDestination))\n return @Promise.@reject(@makeTypeError(\"ReadableStream pipeTo requires a WritableStream\"));\n if (@isWritableStreamLocked(internalDestination))\n return @Promise.@reject(@makeTypeError(\"WritableStream is locked\"));\n return @readableStreamPipeToWritableStream(this, internalDestination, preventClose, preventAbort, preventCancel, signal);\n})\n"; -// utf8Write -const JSC::ConstructAbility s_jsBufferPrototypeUtf8WriteCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; -const JSC::ConstructorKind s_jsBufferPrototypeUtf8WriteCodeConstructorKind = JSC::ConstructorKind::None; -const JSC::ImplementationVisibility s_jsBufferPrototypeUtf8WriteCodeImplementationVisibility = JSC::ImplementationVisibility::Public; -const int s_jsBufferPrototypeUtf8WriteCodeLength = 102; -static const JSC::Intrinsic s_jsBufferPrototypeUtf8WriteCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_jsBufferPrototypeUtf8WriteCode = "(function (text, offset, length) {\"use strict\";\n return this.write(text, offset, length, \"utf8\");\n})\n"; +// tee +const JSC::ConstructAbility s_readableStreamTeeCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; +const JSC::ConstructorKind s_readableStreamTeeCodeConstructorKind = JSC::ConstructorKind::None; +const JSC::ImplementationVisibility s_readableStreamTeeCodeImplementationVisibility = JSC::ImplementationVisibility::Public; +const int s_readableStreamTeeCodeLength = 157; +static const JSC::Intrinsic s_readableStreamTeeCodeIntrinsic = JSC::NoIntrinsic; +const char* const s_readableStreamTeeCode = "(function () {\"use strict\";\n if (!@isReadableStream(this))\n throw @makeThisTypeError(\"ReadableStream\", \"tee\");\n return @readableStreamTee(this, !1);\n})\n"; -// ucs2Write -const JSC::ConstructAbility s_jsBufferPrototypeUcs2WriteCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; -const JSC::ConstructorKind s_jsBufferPrototypeUcs2WriteCodeConstructorKind = JSC::ConstructorKind::None; -const JSC::ImplementationVisibility s_jsBufferPrototypeUcs2WriteCodeImplementationVisibility = JSC::ImplementationVisibility::Public; -const int s_jsBufferPrototypeUcs2WriteCodeLength = 102; -static const JSC::Intrinsic s_jsBufferPrototypeUcs2WriteCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_jsBufferPrototypeUcs2WriteCode = "(function (text, offset, length) {\"use strict\";\n return this.write(text, offset, length, \"ucs2\");\n})\n"; +// locked +const JSC::ConstructAbility s_readableStreamLockedCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; +const JSC::ConstructorKind s_readableStreamLockedCodeConstructorKind = JSC::ConstructorKind::None; +const JSC::ImplementationVisibility s_readableStreamLockedCodeImplementationVisibility = JSC::ImplementationVisibility::Public; +const int s_readableStreamLockedCodeLength = 163; +static const JSC::Intrinsic s_readableStreamLockedCodeIntrinsic = JSC::NoIntrinsic; +const char* const s_readableStreamLockedCode = "(function () {\"use strict\";\n if (!@isReadableStream(this))\n throw @makeGetterTypeError(\"ReadableStream\", \"locked\");\n return @isReadableStreamLocked(this);\n})\n"; -// utf16leWrite -const JSC::ConstructAbility s_jsBufferPrototypeUtf16leWriteCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; -const JSC::ConstructorKind s_jsBufferPrototypeUtf16leWriteCodeConstructorKind = JSC::ConstructorKind::None; -const JSC::ImplementationVisibility s_jsBufferPrototypeUtf16leWriteCodeImplementationVisibility = JSC::ImplementationVisibility::Public; -const int s_jsBufferPrototypeUtf16leWriteCodeLength = 105; -static const JSC::Intrinsic s_jsBufferPrototypeUtf16leWriteCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_jsBufferPrototypeUtf16leWriteCode = "(function (text, offset, length) {\"use strict\";\n return this.write(text, offset, length, \"utf16le\");\n})\n"; +// values +const JSC::ConstructAbility s_readableStreamValuesCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; +const JSC::ConstructorKind s_readableStreamValuesCodeConstructorKind = JSC::ConstructorKind::None; +const JSC::ImplementationVisibility s_readableStreamValuesCodeImplementationVisibility = JSC::ImplementationVisibility::Public; +const int s_readableStreamValuesCodeLength = 178; +static const JSC::Intrinsic s_readableStreamValuesCodeIntrinsic = JSC::NoIntrinsic; +const char* const s_readableStreamValuesCode = "(function (options) {\"use strict\";\n var prototype = @ReadableStream.prototype;\n return @readableStreamDefineLazyIterators(prototype), prototype.values.@call(this, options);\n})\n"; + +// lazyAsyncIterator +const JSC::ConstructAbility s_readableStreamLazyAsyncIteratorCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; +const JSC::ConstructorKind s_readableStreamLazyAsyncIteratorCodeConstructorKind = JSC::ConstructorKind::None; +const JSC::ImplementationVisibility s_readableStreamLazyAsyncIteratorCodeImplementationVisibility = JSC::ImplementationVisibility::Private; +const int s_readableStreamLazyAsyncIteratorCodeLength = 188; +static const JSC::Intrinsic s_readableStreamLazyAsyncIteratorCodeIntrinsic = JSC::NoIntrinsic; +const char* const s_readableStreamLazyAsyncIteratorCode = "(function () {\"use strict\";\n var prototype = @ReadableStream.prototype;\n return @readableStreamDefineLazyIterators(prototype), prototype[globalThis.Symbol.asyncIterator].@call(this);\n})\n"; -// latin1Write -const JSC::ConstructAbility s_jsBufferPrototypeLatin1WriteCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; -const JSC::ConstructorKind s_jsBufferPrototypeLatin1WriteCodeConstructorKind = JSC::ConstructorKind::None; -const JSC::ImplementationVisibility s_jsBufferPrototypeLatin1WriteCodeImplementationVisibility = JSC::ImplementationVisibility::Public; -const int s_jsBufferPrototypeLatin1WriteCodeLength = 104; -static const JSC::Intrinsic s_jsBufferPrototypeLatin1WriteCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_jsBufferPrototypeLatin1WriteCode = "(function (text, offset, length) {\"use strict\";\n return this.write(text, offset, length, \"latin1\");\n})\n"; +#define DEFINE_BUILTIN_GENERATOR(codeName, functionName, overriddenName, argumentCount) \ +JSC::FunctionExecutable* codeName##Generator(JSC::VM& vm) \ +{\ + JSVMClientData* clientData = static_cast(vm.clientData); \ + return clientData->builtinFunctions().readableStreamBuiltins().codeName##Executable()->link(vm, nullptr, clientData->builtinFunctions().readableStreamBuiltins().codeName##Source(), std::nullopt, s_##codeName##Intrinsic); \ +} +WEBCORE_FOREACH_READABLESTREAM_BUILTIN_CODE(DEFINE_BUILTIN_GENERATOR) +#undef DEFINE_BUILTIN_GENERATOR -// asciiWrite -const JSC::ConstructAbility s_jsBufferPrototypeAsciiWriteCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; -const JSC::ConstructorKind s_jsBufferPrototypeAsciiWriteCodeConstructorKind = JSC::ConstructorKind::None; -const JSC::ImplementationVisibility s_jsBufferPrototypeAsciiWriteCodeImplementationVisibility = JSC::ImplementationVisibility::Public; -const int s_jsBufferPrototypeAsciiWriteCodeLength = 103; -static const JSC::Intrinsic s_jsBufferPrototypeAsciiWriteCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_jsBufferPrototypeAsciiWriteCode = "(function (text, offset, length) {\"use strict\";\n return this.write(text, offset, length, \"ascii\");\n})\n"; +/* TransformStreamDefaultController.ts */ +// initializeTransformStreamDefaultController +const JSC::ConstructAbility s_transformStreamDefaultControllerInitializeTransformStreamDefaultControllerCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; +const JSC::ConstructorKind s_transformStreamDefaultControllerInitializeTransformStreamDefaultControllerCodeConstructorKind = JSC::ConstructorKind::None; +const JSC::ImplementationVisibility s_transformStreamDefaultControllerInitializeTransformStreamDefaultControllerCodeImplementationVisibility = JSC::ImplementationVisibility::Public; +const int s_transformStreamDefaultControllerInitializeTransformStreamDefaultControllerCodeLength = 46; +static const JSC::Intrinsic s_transformStreamDefaultControllerInitializeTransformStreamDefaultControllerCodeIntrinsic = JSC::NoIntrinsic; +const char* const s_transformStreamDefaultControllerInitializeTransformStreamDefaultControllerCode = "(function () {\"use strict\";\n return this;\n})\n"; -// base64Write -const JSC::ConstructAbility s_jsBufferPrototypeBase64WriteCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; -const JSC::ConstructorKind s_jsBufferPrototypeBase64WriteCodeConstructorKind = JSC::ConstructorKind::None; -const JSC::ImplementationVisibility s_jsBufferPrototypeBase64WriteCodeImplementationVisibility = JSC::ImplementationVisibility::Public; -const int s_jsBufferPrototypeBase64WriteCodeLength = 104; -static const JSC::Intrinsic s_jsBufferPrototypeBase64WriteCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_jsBufferPrototypeBase64WriteCode = "(function (text, offset, length) {\"use strict\";\n return this.write(text, offset, length, \"base64\");\n})\n"; +// desiredSize +const JSC::ConstructAbility s_transformStreamDefaultControllerDesiredSizeCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; +const JSC::ConstructorKind s_transformStreamDefaultControllerDesiredSizeCodeConstructorKind = JSC::ConstructorKind::None; +const JSC::ImplementationVisibility s_transformStreamDefaultControllerDesiredSizeCodeImplementationVisibility = JSC::ImplementationVisibility::Public; +const int s_transformStreamDefaultControllerDesiredSizeCodeLength = 427; +static const JSC::Intrinsic s_transformStreamDefaultControllerDesiredSizeCodeIntrinsic = JSC::NoIntrinsic; +const char* const s_transformStreamDefaultControllerDesiredSizeCode = "(function () {\"use strict\";\n if (!@isTransformStreamDefaultController(this))\n throw @makeThisTypeError(\"TransformStreamDefaultController\", \"enqueue\");\n const stream = @getByIdDirectPrivate(this, \"stream\"), readable = @getByIdDirectPrivate(stream, \"readable\"), readableController = @getByIdDirectPrivate(readable, \"readableStreamController\");\n return @readableStreamDefaultControllerGetDesiredSize(readableController);\n})\n"; -// base64urlWrite -const JSC::ConstructAbility s_jsBufferPrototypeBase64urlWriteCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; -const JSC::ConstructorKind s_jsBufferPrototypeBase64urlWriteCodeConstructorKind = JSC::ConstructorKind::None; -const JSC::ImplementationVisibility s_jsBufferPrototypeBase64urlWriteCodeImplementationVisibility = JSC::ImplementationVisibility::Public; -const int s_jsBufferPrototypeBase64urlWriteCodeLength = 107; -static const JSC::Intrinsic s_jsBufferPrototypeBase64urlWriteCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_jsBufferPrototypeBase64urlWriteCode = "(function (text, offset, length) {\"use strict\";\n return this.write(text, offset, length, \"base64url\");\n})\n"; +// enqueue +const JSC::ConstructAbility s_transformStreamDefaultControllerEnqueueCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; +const JSC::ConstructorKind s_transformStreamDefaultControllerEnqueueCodeConstructorKind = JSC::ConstructorKind::None; +const JSC::ImplementationVisibility s_transformStreamDefaultControllerEnqueueCodeImplementationVisibility = JSC::ImplementationVisibility::Public; +const int s_transformStreamDefaultControllerEnqueueCodeLength = 220; +static const JSC::Intrinsic s_transformStreamDefaultControllerEnqueueCodeIntrinsic = JSC::NoIntrinsic; +const char* const s_transformStreamDefaultControllerEnqueueCode = "(function (chunk) {\"use strict\";\n if (!@isTransformStreamDefaultController(this))\n throw @makeThisTypeError(\"TransformStreamDefaultController\", \"enqueue\");\n @transformStreamDefaultControllerEnqueue(this, chunk);\n})\n"; -// hexWrite -const JSC::ConstructAbility s_jsBufferPrototypeHexWriteCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; -const JSC::ConstructorKind s_jsBufferPrototypeHexWriteCodeConstructorKind = JSC::ConstructorKind::None; -const JSC::ImplementationVisibility s_jsBufferPrototypeHexWriteCodeImplementationVisibility = JSC::ImplementationVisibility::Public; -const int s_jsBufferPrototypeHexWriteCodeLength = 101; -static const JSC::Intrinsic s_jsBufferPrototypeHexWriteCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_jsBufferPrototypeHexWriteCode = "(function (text, offset, length) {\"use strict\";\n return this.write(text, offset, length, \"hex\");\n})\n"; +// error +const JSC::ConstructAbility s_transformStreamDefaultControllerErrorCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; +const JSC::ConstructorKind s_transformStreamDefaultControllerErrorCodeConstructorKind = JSC::ConstructorKind::None; +const JSC::ImplementationVisibility s_transformStreamDefaultControllerErrorCodeImplementationVisibility = JSC::ImplementationVisibility::Public; +const int s_transformStreamDefaultControllerErrorCodeLength = 208; +static const JSC::Intrinsic s_transformStreamDefaultControllerErrorCodeIntrinsic = JSC::NoIntrinsic; +const char* const s_transformStreamDefaultControllerErrorCode = "(function (e) {\"use strict\";\n if (!@isTransformStreamDefaultController(this))\n throw @makeThisTypeError(\"TransformStreamDefaultController\", \"error\");\n @transformStreamDefaultControllerError(this, e);\n})\n"; -// utf8Slice -const JSC::ConstructAbility s_jsBufferPrototypeUtf8SliceCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; -const JSC::ConstructorKind s_jsBufferPrototypeUtf8SliceCodeConstructorKind = JSC::ConstructorKind::None; -const JSC::ImplementationVisibility s_jsBufferPrototypeUtf8SliceCodeImplementationVisibility = JSC::ImplementationVisibility::Public; -const int s_jsBufferPrototypeUtf8SliceCodeLength = 85; -static const JSC::Intrinsic s_jsBufferPrototypeUtf8SliceCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_jsBufferPrototypeUtf8SliceCode = "(function (start, end) {\"use strict\";\n return this.toString(\"utf8\", start, end);\n})\n"; +// terminate +const JSC::ConstructAbility s_transformStreamDefaultControllerTerminateCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; +const JSC::ConstructorKind s_transformStreamDefaultControllerTerminateCodeConstructorKind = JSC::ConstructorKind::None; +const JSC::ImplementationVisibility s_transformStreamDefaultControllerTerminateCodeImplementationVisibility = JSC::ImplementationVisibility::Public; +const int s_transformStreamDefaultControllerTerminateCodeLength = 212; +static const JSC::Intrinsic s_transformStreamDefaultControllerTerminateCodeIntrinsic = JSC::NoIntrinsic; +const char* const s_transformStreamDefaultControllerTerminateCode = "(function () {\"use strict\";\n if (!@isTransformStreamDefaultController(this))\n throw @makeThisTypeError(\"TransformStreamDefaultController\", \"terminate\");\n @transformStreamDefaultControllerTerminate(this);\n})\n"; -// ucs2Slice -const JSC::ConstructAbility s_jsBufferPrototypeUcs2SliceCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; -const JSC::ConstructorKind s_jsBufferPrototypeUcs2SliceCodeConstructorKind = JSC::ConstructorKind::None; -const JSC::ImplementationVisibility s_jsBufferPrototypeUcs2SliceCodeImplementationVisibility = JSC::ImplementationVisibility::Public; -const int s_jsBufferPrototypeUcs2SliceCodeLength = 85; -static const JSC::Intrinsic s_jsBufferPrototypeUcs2SliceCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_jsBufferPrototypeUcs2SliceCode = "(function (start, end) {\"use strict\";\n return this.toString(\"ucs2\", start, end);\n})\n"; +#define DEFINE_BUILTIN_GENERATOR(codeName, functionName, overriddenName, argumentCount) \ +JSC::FunctionExecutable* codeName##Generator(JSC::VM& vm) \ +{\ + JSVMClientData* clientData = static_cast(vm.clientData); \ + return clientData->builtinFunctions().transformStreamDefaultControllerBuiltins().codeName##Executable()->link(vm, nullptr, clientData->builtinFunctions().transformStreamDefaultControllerBuiltins().codeName##Source(), std::nullopt, s_##codeName##Intrinsic); \ +} +WEBCORE_FOREACH_TRANSFORMSTREAMDEFAULTCONTROLLER_BUILTIN_CODE(DEFINE_BUILTIN_GENERATOR) +#undef DEFINE_BUILTIN_GENERATOR -// utf16leSlice -const JSC::ConstructAbility s_jsBufferPrototypeUtf16leSliceCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; -const JSC::ConstructorKind s_jsBufferPrototypeUtf16leSliceCodeConstructorKind = JSC::ConstructorKind::None; -const JSC::ImplementationVisibility s_jsBufferPrototypeUtf16leSliceCodeImplementationVisibility = JSC::ImplementationVisibility::Public; -const int s_jsBufferPrototypeUtf16leSliceCodeLength = 88; -static const JSC::Intrinsic s_jsBufferPrototypeUtf16leSliceCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_jsBufferPrototypeUtf16leSliceCode = "(function (start, end) {\"use strict\";\n return this.toString(\"utf16le\", start, end);\n})\n"; +/* TransformStreamInternals.ts */ +// isTransformStream +const JSC::ConstructAbility s_transformStreamInternalsIsTransformStreamCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; +const JSC::ConstructorKind s_transformStreamInternalsIsTransformStreamCodeConstructorKind = JSC::ConstructorKind::None; +const JSC::ImplementationVisibility s_transformStreamInternalsIsTransformStreamCodeImplementationVisibility = JSC::ImplementationVisibility::Public; +const int s_transformStreamInternalsIsTransformStreamCodeLength = 112; +static const JSC::Intrinsic s_transformStreamInternalsIsTransformStreamCodeIntrinsic = JSC::NoIntrinsic; +const char* const s_transformStreamInternalsIsTransformStreamCode = "(function (stream) {\"use strict\";\n return @isObject(stream) && !!@getByIdDirectPrivate(stream, \"readable\");\n})\n"; -// latin1Slice -const JSC::ConstructAbility s_jsBufferPrototypeLatin1SliceCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; -const JSC::ConstructorKind s_jsBufferPrototypeLatin1SliceCodeConstructorKind = JSC::ConstructorKind::None; -const JSC::ImplementationVisibility s_jsBufferPrototypeLatin1SliceCodeImplementationVisibility = JSC::ImplementationVisibility::Public; -const int s_jsBufferPrototypeLatin1SliceCodeLength = 87; -static const JSC::Intrinsic s_jsBufferPrototypeLatin1SliceCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_jsBufferPrototypeLatin1SliceCode = "(function (start, end) {\"use strict\";\n return this.toString(\"latin1\", start, end);\n})\n"; +// isTransformStreamDefaultController +const JSC::ConstructAbility s_transformStreamInternalsIsTransformStreamDefaultControllerCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; +const JSC::ConstructorKind s_transformStreamInternalsIsTransformStreamDefaultControllerCodeConstructorKind = JSC::ConstructorKind::None; +const JSC::ImplementationVisibility s_transformStreamInternalsIsTransformStreamDefaultControllerCodeImplementationVisibility = JSC::ImplementationVisibility::Public; +const int s_transformStreamInternalsIsTransformStreamDefaultControllerCodeLength = 134; +static const JSC::Intrinsic s_transformStreamInternalsIsTransformStreamDefaultControllerCodeIntrinsic = JSC::NoIntrinsic; +const char* const s_transformStreamInternalsIsTransformStreamDefaultControllerCode = "(function (controller) {\"use strict\";\n return @isObject(controller) && !!@getByIdDirectPrivate(controller, \"transformAlgorithm\");\n})\n"; -// asciiSlice -const JSC::ConstructAbility s_jsBufferPrototypeAsciiSliceCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; -const JSC::ConstructorKind s_jsBufferPrototypeAsciiSliceCodeConstructorKind = JSC::ConstructorKind::None; -const JSC::ImplementationVisibility s_jsBufferPrototypeAsciiSliceCodeImplementationVisibility = JSC::ImplementationVisibility::Public; -const int s_jsBufferPrototypeAsciiSliceCodeLength = 86; -static const JSC::Intrinsic s_jsBufferPrototypeAsciiSliceCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_jsBufferPrototypeAsciiSliceCode = "(function (start, end) {\"use strict\";\n return this.toString(\"ascii\", start, end);\n})\n"; +// createTransformStream +const JSC::ConstructAbility s_transformStreamInternalsCreateTransformStreamCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; +const JSC::ConstructorKind s_transformStreamInternalsCreateTransformStreamCodeConstructorKind = JSC::ConstructorKind::None; +const JSC::ImplementationVisibility s_transformStreamInternalsCreateTransformStreamCodeImplementationVisibility = JSC::ImplementationVisibility::Public; +const int s_transformStreamInternalsCreateTransformStreamCodeLength = 1170; +static const JSC::Intrinsic s_transformStreamInternalsCreateTransformStreamCodeIntrinsic = JSC::NoIntrinsic; +const char* const s_transformStreamInternalsCreateTransformStreamCode = "(function (startAlgorithm, transformAlgorithm, flushAlgorithm, writableHighWaterMark, writableSizeAlgorithm, readableHighWaterMark, readableSizeAlgorithm) {\"use strict\";\n if (writableHighWaterMark === @undefined)\n writableHighWaterMark = 1;\n if (writableSizeAlgorithm === @undefined)\n writableSizeAlgorithm = () => 1;\n if (readableHighWaterMark === @undefined)\n readableHighWaterMark = 0;\n if (readableSizeAlgorithm === @undefined)\n readableSizeAlgorithm = () => 1;\n const transform = {};\n @putByIdDirectPrivate(transform, \"TransformStream\", !0);\n const stream = new @TransformStream(transform), startPromiseCapability = @newPromiseCapability(@Promise);\n @initializeTransformStream(stream, startPromiseCapability.promise, writableHighWaterMark, writableSizeAlgorithm, readableHighWaterMark, readableSizeAlgorithm);\n const controller = new @TransformStreamDefaultController;\n return @setUpTransformStreamDefaultController(stream, controller, transformAlgorithm, flushAlgorithm), startAlgorithm().@then(() => {\n startPromiseCapability.resolve.@call();\n }, (error) => {\n startPromiseCapability.reject.@call(@undefined, error);\n }), stream;\n})\n"; -// base64Slice -const JSC::ConstructAbility s_jsBufferPrototypeBase64SliceCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; -const JSC::ConstructorKind s_jsBufferPrototypeBase64SliceCodeConstructorKind = JSC::ConstructorKind::None; -const JSC::ImplementationVisibility s_jsBufferPrototypeBase64SliceCodeImplementationVisibility = JSC::ImplementationVisibility::Public; -const int s_jsBufferPrototypeBase64SliceCodeLength = 87; -static const JSC::Intrinsic s_jsBufferPrototypeBase64SliceCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_jsBufferPrototypeBase64SliceCode = "(function (start, end) {\"use strict\";\n return this.toString(\"base64\", start, end);\n})\n"; +// initializeTransformStream +const JSC::ConstructAbility s_transformStreamInternalsInitializeTransformStreamCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; +const JSC::ConstructorKind s_transformStreamInternalsInitializeTransformStreamCodeConstructorKind = JSC::ConstructorKind::None; +const JSC::ImplementationVisibility s_transformStreamInternalsInitializeTransformStreamCodeImplementationVisibility = JSC::ImplementationVisibility::Public; +const int s_transformStreamInternalsInitializeTransformStreamCodeLength = 1754; +static const JSC::Intrinsic s_transformStreamInternalsInitializeTransformStreamCodeIntrinsic = JSC::NoIntrinsic; +const char* const s_transformStreamInternalsInitializeTransformStreamCode = "(function (stream, startPromise, writableHighWaterMark, writableSizeAlgorithm, readableHighWaterMark, readableSizeAlgorithm) {\"use strict\";\n const startAlgorithm = () => {\n return startPromise;\n }, writeAlgorithm = (chunk) => {\n return @transformStreamDefaultSinkWriteAlgorithm(stream, chunk);\n }, abortAlgorithm = (reason) => {\n return @transformStreamDefaultSinkAbortAlgorithm(stream, reason);\n }, closeAlgorithm = () => {\n return @transformStreamDefaultSinkCloseAlgorithm(stream);\n }, writable = @createWritableStream(startAlgorithm, writeAlgorithm, closeAlgorithm, abortAlgorithm, writableHighWaterMark, writableSizeAlgorithm), pullAlgorithm = () => {\n return @transformStreamDefaultSourcePullAlgorithm(stream);\n }, cancelAlgorithm = (reason) => {\n return @transformStreamErrorWritableAndUnblockWrite(stream, reason), @Promise.@resolve();\n }, underlyingSource = {};\n @putByIdDirectPrivate(underlyingSource, \"start\", startAlgorithm), @putByIdDirectPrivate(underlyingSource, \"pull\", pullAlgorithm), @putByIdDirectPrivate(underlyingSource, \"cancel\", cancelAlgorithm);\n const options = {};\n @putByIdDirectPrivate(options, \"size\", readableSizeAlgorithm), @putByIdDirectPrivate(options, \"highWaterMark\", readableHighWaterMark);\n const readable = new @ReadableStream(underlyingSource, options);\n @putByIdDirectPrivate(stream, \"writable\", writable), @putByIdDirectPrivate(stream, \"internalWritable\", @getInternalWritableStream(writable)), @putByIdDirectPrivate(stream, \"readable\", readable), @putByIdDirectPrivate(stream, \"backpressure\", @undefined), @putByIdDirectPrivate(stream, \"backpressureChangePromise\", @undefined), @transformStreamSetBackpressure(stream, !0), @putByIdDirectPrivate(stream, \"controller\", @undefined);\n})\n"; -// base64urlSlice -const JSC::ConstructAbility s_jsBufferPrototypeBase64urlSliceCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; -const JSC::ConstructorKind s_jsBufferPrototypeBase64urlSliceCodeConstructorKind = JSC::ConstructorKind::None; -const JSC::ImplementationVisibility s_jsBufferPrototypeBase64urlSliceCodeImplementationVisibility = JSC::ImplementationVisibility::Public; -const int s_jsBufferPrototypeBase64urlSliceCodeLength = 90; -static const JSC::Intrinsic s_jsBufferPrototypeBase64urlSliceCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_jsBufferPrototypeBase64urlSliceCode = "(function (start, end) {\"use strict\";\n return this.toString(\"base64url\", start, end);\n})\n"; +// transformStreamError +const JSC::ConstructAbility s_transformStreamInternalsTransformStreamErrorCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; +const JSC::ConstructorKind s_transformStreamInternalsTransformStreamErrorCodeConstructorKind = JSC::ConstructorKind::None; +const JSC::ImplementationVisibility s_transformStreamInternalsTransformStreamErrorCodeImplementationVisibility = JSC::ImplementationVisibility::Public; +const int s_transformStreamInternalsTransformStreamErrorCodeLength = 305; +static const JSC::Intrinsic s_transformStreamInternalsTransformStreamErrorCodeIntrinsic = JSC::NoIntrinsic; +const char* const s_transformStreamInternalsTransformStreamErrorCode = "(function (stream, e) {\"use strict\";\n const readable = @getByIdDirectPrivate(stream, \"readable\"), readableController = @getByIdDirectPrivate(readable, \"readableStreamController\");\n @readableStreamDefaultControllerError(readableController, e), @transformStreamErrorWritableAndUnblockWrite(stream, e);\n})\n"; -// hexSlice -const JSC::ConstructAbility s_jsBufferPrototypeHexSliceCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; -const JSC::ConstructorKind s_jsBufferPrototypeHexSliceCodeConstructorKind = JSC::ConstructorKind::None; -const JSC::ImplementationVisibility s_jsBufferPrototypeHexSliceCodeImplementationVisibility = JSC::ImplementationVisibility::Public; -const int s_jsBufferPrototypeHexSliceCodeLength = 84; -static const JSC::Intrinsic s_jsBufferPrototypeHexSliceCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_jsBufferPrototypeHexSliceCode = "(function (start, end) {\"use strict\";\n return this.toString(\"hex\", start, end);\n})\n"; +// transformStreamErrorWritableAndUnblockWrite +const JSC::ConstructAbility s_transformStreamInternalsTransformStreamErrorWritableAndUnblockWriteCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; +const JSC::ConstructorKind s_transformStreamInternalsTransformStreamErrorWritableAndUnblockWriteCodeConstructorKind = JSC::ConstructorKind::None; +const JSC::ImplementationVisibility s_transformStreamInternalsTransformStreamErrorWritableAndUnblockWriteCodeImplementationVisibility = JSC::ImplementationVisibility::Public; +const int s_transformStreamInternalsTransformStreamErrorWritableAndUnblockWriteCodeLength = 406; +static const JSC::Intrinsic s_transformStreamInternalsTransformStreamErrorWritableAndUnblockWriteCodeIntrinsic = JSC::NoIntrinsic; +const char* const s_transformStreamInternalsTransformStreamErrorWritableAndUnblockWriteCode = "(function (stream, e) {\"use strict\";\n @transformStreamDefaultControllerClearAlgorithms(@getByIdDirectPrivate(stream, \"controller\"));\n const writable = @getByIdDirectPrivate(stream, \"internalWritable\");\n if (@writableStreamDefaultControllerErrorIfNeeded(@getByIdDirectPrivate(writable, \"controller\"), e), @getByIdDirectPrivate(stream, \"backpressure\"))\n @transformStreamSetBackpressure(stream, !1);\n})\n"; -// toJSON -const JSC::ConstructAbility s_jsBufferPrototypeToJSONCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; -const JSC::ConstructorKind s_jsBufferPrototypeToJSONCodeConstructorKind = JSC::ConstructorKind::None; -const JSC::ImplementationVisibility s_jsBufferPrototypeToJSONCodeImplementationVisibility = JSC::ImplementationVisibility::Public; -const int s_jsBufferPrototypeToJSONCodeLength = 85; -static const JSC::Intrinsic s_jsBufferPrototypeToJSONCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_jsBufferPrototypeToJSONCode = "(function () {\"use strict\";\n return { type: \"Buffer\", data: @Array.from(this) };\n})\n"; +// transformStreamSetBackpressure +const JSC::ConstructAbility s_transformStreamInternalsTransformStreamSetBackpressureCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; +const JSC::ConstructorKind s_transformStreamInternalsTransformStreamSetBackpressureCodeConstructorKind = JSC::ConstructorKind::None; +const JSC::ImplementationVisibility s_transformStreamInternalsTransformStreamSetBackpressureCodeImplementationVisibility = JSC::ImplementationVisibility::Public; +const int s_transformStreamInternalsTransformStreamSetBackpressureCodeLength = 398; +static const JSC::Intrinsic s_transformStreamInternalsTransformStreamSetBackpressureCodeIntrinsic = JSC::NoIntrinsic; +const char* const s_transformStreamInternalsTransformStreamSetBackpressureCode = "(function (stream, backpressure) {\"use strict\";\n const backpressureChangePromise = @getByIdDirectPrivate(stream, \"backpressureChangePromise\");\n if (backpressureChangePromise !== @undefined)\n backpressureChangePromise.resolve.@call();\n @putByIdDirectPrivate(stream, \"backpressureChangePromise\", @newPromiseCapability(@Promise)), @putByIdDirectPrivate(stream, \"backpressure\", backpressure);\n})\n"; -// slice -const JSC::ConstructAbility s_jsBufferPrototypeSliceCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; -const JSC::ConstructorKind s_jsBufferPrototypeSliceCodeConstructorKind = JSC::ConstructorKind::None; -const JSC::ImplementationVisibility s_jsBufferPrototypeSliceCodeImplementationVisibility = JSC::ImplementationVisibility::Public; -const int s_jsBufferPrototypeSliceCodeLength = 564; -static const JSC::Intrinsic s_jsBufferPrototypeSliceCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_jsBufferPrototypeSliceCode = "(function (start, end) {\"use strict\";\n var { buffer, byteOffset, byteLength } = this;\n function adjustOffset(offset, length) {\n if (offset = @trunc(offset), offset === 0 || offset !== offset)\n return 0;\n else if (offset < 0)\n return offset += length, offset > 0 \? offset : 0;\n else\n return offset < length \? offset : length;\n }\n var start_ = adjustOffset(start, byteLength), end_ = end !== @undefined \? adjustOffset(end, byteLength) : byteLength;\n return new @Buffer(buffer, byteOffset + start_, end_ > start_ \? end_ - start_ : 0);\n})\n"; +// setUpTransformStreamDefaultController +const JSC::ConstructAbility s_transformStreamInternalsSetUpTransformStreamDefaultControllerCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; +const JSC::ConstructorKind s_transformStreamInternalsSetUpTransformStreamDefaultControllerCodeConstructorKind = JSC::ConstructorKind::None; +const JSC::ImplementationVisibility s_transformStreamInternalsSetUpTransformStreamDefaultControllerCodeImplementationVisibility = JSC::ImplementationVisibility::Public; +const int s_transformStreamInternalsSetUpTransformStreamDefaultControllerCodeLength = 343; +static const JSC::Intrinsic s_transformStreamInternalsSetUpTransformStreamDefaultControllerCodeIntrinsic = JSC::NoIntrinsic; +const char* const s_transformStreamInternalsSetUpTransformStreamDefaultControllerCode = "(function (stream, controller, transformAlgorithm, flushAlgorithm) {\"use strict\";\n @putByIdDirectPrivate(controller, \"stream\", stream), @putByIdDirectPrivate(stream, \"controller\", controller), @putByIdDirectPrivate(controller, \"transformAlgorithm\", transformAlgorithm), @putByIdDirectPrivate(controller, \"flushAlgorithm\", flushAlgorithm);\n})\n"; -// parent -const JSC::ConstructAbility s_jsBufferPrototypeParentCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; -const JSC::ConstructorKind s_jsBufferPrototypeParentCodeConstructorKind = JSC::ConstructorKind::None; -const JSC::ImplementationVisibility s_jsBufferPrototypeParentCodeImplementationVisibility = JSC::ImplementationVisibility::Public; -const int s_jsBufferPrototypeParentCodeLength = 111; -static const JSC::Intrinsic s_jsBufferPrototypeParentCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_jsBufferPrototypeParentCode = "(function () {\"use strict\";\n return @isObject(this) && this instanceof @Buffer \? this.buffer : @undefined;\n})\n"; +// setUpTransformStreamDefaultControllerFromTransformer +const JSC::ConstructAbility s_transformStreamInternalsSetUpTransformStreamDefaultControllerFromTransformerCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; +const JSC::ConstructorKind s_transformStreamInternalsSetUpTransformStreamDefaultControllerFromTransformerCodeConstructorKind = JSC::ConstructorKind::None; +const JSC::ImplementationVisibility s_transformStreamInternalsSetUpTransformStreamDefaultControllerFromTransformerCodeImplementationVisibility = JSC::ImplementationVisibility::Public; +const int s_transformStreamInternalsSetUpTransformStreamDefaultControllerFromTransformerCodeLength = 845; +static const JSC::Intrinsic s_transformStreamInternalsSetUpTransformStreamDefaultControllerFromTransformerCodeIntrinsic = JSC::NoIntrinsic; +const char* const s_transformStreamInternalsSetUpTransformStreamDefaultControllerFromTransformerCode = "(function (stream, transformer, transformerDict) {\"use strict\";\n const controller = new @TransformStreamDefaultController;\n let transformAlgorithm = (chunk) => {\n try {\n @transformStreamDefaultControllerEnqueue(controller, chunk);\n } catch (e) {\n return @Promise.@reject(e);\n }\n return @Promise.@resolve();\n }, flushAlgorithm = () => {\n return @Promise.@resolve();\n };\n if (\"transform\" in transformerDict)\n transformAlgorithm = (chunk) => {\n return @promiseInvokeOrNoopMethod(transformer, transformerDict.transform, [chunk, controller]);\n };\n if (\"flush\" in transformerDict)\n flushAlgorithm = () => {\n return @promiseInvokeOrNoopMethod(transformer, transformerDict.flush, [controller]);\n };\n @setUpTransformStreamDefaultController(stream, controller, transformAlgorithm, flushAlgorithm);\n})\n"; -// offset -const JSC::ConstructAbility s_jsBufferPrototypeOffsetCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; -const JSC::ConstructorKind s_jsBufferPrototypeOffsetCodeConstructorKind = JSC::ConstructorKind::None; -const JSC::ImplementationVisibility s_jsBufferPrototypeOffsetCodeImplementationVisibility = JSC::ImplementationVisibility::Public; -const int s_jsBufferPrototypeOffsetCodeLength = 115; -static const JSC::Intrinsic s_jsBufferPrototypeOffsetCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_jsBufferPrototypeOffsetCode = "(function () {\"use strict\";\n return @isObject(this) && this instanceof @Buffer \? this.byteOffset : @undefined;\n})\n"; +// transformStreamDefaultControllerClearAlgorithms +const JSC::ConstructAbility s_transformStreamInternalsTransformStreamDefaultControllerClearAlgorithmsCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; +const JSC::ConstructorKind s_transformStreamInternalsTransformStreamDefaultControllerClearAlgorithmsCodeConstructorKind = JSC::ConstructorKind::None; +const JSC::ImplementationVisibility s_transformStreamInternalsTransformStreamDefaultControllerClearAlgorithmsCodeImplementationVisibility = JSC::ImplementationVisibility::Public; +const int s_transformStreamInternalsTransformStreamDefaultControllerClearAlgorithmsCodeLength = 169; +static const JSC::Intrinsic s_transformStreamInternalsTransformStreamDefaultControllerClearAlgorithmsCodeIntrinsic = JSC::NoIntrinsic; +const char* const s_transformStreamInternalsTransformStreamDefaultControllerClearAlgorithmsCode = "(function (controller) {\"use strict\";\n @putByIdDirectPrivate(controller, \"transformAlgorithm\", !0), @putByIdDirectPrivate(controller, \"flushAlgorithm\", @undefined);\n})\n"; -// inspect -const JSC::ConstructAbility s_jsBufferPrototypeInspectCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; -const JSC::ConstructorKind s_jsBufferPrototypeInspectCodeConstructorKind = JSC::ConstructorKind::None; -const JSC::ImplementationVisibility s_jsBufferPrototypeInspectCodeImplementationVisibility = JSC::ImplementationVisibility::Public; -const int s_jsBufferPrototypeInspectCodeLength = 76; -static const JSC::Intrinsic s_jsBufferPrototypeInspectCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_jsBufferPrototypeInspectCode = "(function (recurseTimes, ctx) {\"use strict\";\n return Bun.inspect(this);\n})\n"; +// transformStreamDefaultControllerEnqueue +const JSC::ConstructAbility s_transformStreamInternalsTransformStreamDefaultControllerEnqueueCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; +const JSC::ConstructorKind s_transformStreamInternalsTransformStreamDefaultControllerEnqueueCodeConstructorKind = JSC::ConstructorKind::None; +const JSC::ImplementationVisibility s_transformStreamInternalsTransformStreamDefaultControllerEnqueueCodeImplementationVisibility = JSC::ImplementationVisibility::Public; +const int s_transformStreamInternalsTransformStreamDefaultControllerEnqueueCodeLength = 786; +static const JSC::Intrinsic s_transformStreamInternalsTransformStreamDefaultControllerEnqueueCodeIntrinsic = JSC::NoIntrinsic; +const char* const s_transformStreamInternalsTransformStreamDefaultControllerEnqueueCode = "(function (controller, chunk) {\"use strict\";\n const stream = @getByIdDirectPrivate(controller, \"stream\"), readable = @getByIdDirectPrivate(stream, \"readable\"), readableController = @getByIdDirectPrivate(readable, \"readableStreamController\");\n if (!@readableStreamDefaultControllerCanCloseOrEnqueue(readableController))\n @throwTypeError(\"TransformStream.readable cannot close or enqueue\");\n try {\n @readableStreamDefaultControllerEnqueue(readableController, chunk);\n } catch (e) {\n throw @transformStreamErrorWritableAndUnblockWrite(stream, e), @getByIdDirectPrivate(readable, \"storedError\");\n }\n if (!@readableStreamDefaultControllerShouldCallPull(readableController) !== @getByIdDirectPrivate(stream, \"backpressure\"))\n @transformStreamSetBackpressure(stream, !0);\n})\n"; -#define DEFINE_BUILTIN_GENERATOR(codeName, functionName, overriddenName, argumentCount) \ -JSC::FunctionExecutable* codeName##Generator(JSC::VM& vm) \ -{\ - JSVMClientData* clientData = static_cast(vm.clientData); \ - return clientData->builtinFunctions().jsBufferPrototypeBuiltins().codeName##Executable()->link(vm, nullptr, clientData->builtinFunctions().jsBufferPrototypeBuiltins().codeName##Source(), std::nullopt, s_##codeName##Intrinsic); \ -} -WEBCORE_FOREACH_JSBUFFERPROTOTYPE_BUILTIN_CODE(DEFINE_BUILTIN_GENERATOR) -#undef DEFINE_BUILTIN_GENERATOR +// transformStreamDefaultControllerError +const JSC::ConstructAbility s_transformStreamInternalsTransformStreamDefaultControllerErrorCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; +const JSC::ConstructorKind s_transformStreamInternalsTransformStreamDefaultControllerErrorCodeConstructorKind = JSC::ConstructorKind::None; +const JSC::ImplementationVisibility s_transformStreamInternalsTransformStreamDefaultControllerErrorCodeImplementationVisibility = JSC::ImplementationVisibility::Public; +const int s_transformStreamInternalsTransformStreamDefaultControllerErrorCodeLength = 117; +static const JSC::Intrinsic s_transformStreamInternalsTransformStreamDefaultControllerErrorCodeIntrinsic = JSC::NoIntrinsic; +const char* const s_transformStreamInternalsTransformStreamDefaultControllerErrorCode = "(function (controller, e) {\"use strict\";\n @transformStreamError(@getByIdDirectPrivate(controller, \"stream\"), e);\n})\n"; -/* ReadableByteStreamController.ts */ -// initializeReadableByteStreamController -const JSC::ConstructAbility s_readableByteStreamControllerInitializeReadableByteStreamControllerCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; -const JSC::ConstructorKind s_readableByteStreamControllerInitializeReadableByteStreamControllerCodeConstructorKind = JSC::ConstructorKind::None; -const JSC::ImplementationVisibility s_readableByteStreamControllerInitializeReadableByteStreamControllerCodeImplementationVisibility = JSC::ImplementationVisibility::Public; -const int s_readableByteStreamControllerInitializeReadableByteStreamControllerCodeLength = 351; -static const JSC::Intrinsic s_readableByteStreamControllerInitializeReadableByteStreamControllerCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_readableByteStreamControllerInitializeReadableByteStreamControllerCode = "(function (stream, underlyingByteSource, highWaterMark) {\"use strict\";\n if (arguments.length !== 4 && arguments[3] !== @isReadableStream)\n @throwTypeError(\"ReadableByteStreamController constructor should not be called directly\");\n return @privateInitializeReadableByteStreamController.@call(this, stream, underlyingByteSource, highWaterMark);\n})\n"; +// transformStreamDefaultControllerPerformTransform +const JSC::ConstructAbility s_transformStreamInternalsTransformStreamDefaultControllerPerformTransformCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; +const JSC::ConstructorKind s_transformStreamInternalsTransformStreamDefaultControllerPerformTransformCodeConstructorKind = JSC::ConstructorKind::None; +const JSC::ImplementationVisibility s_transformStreamInternalsTransformStreamDefaultControllerPerformTransformCodeImplementationVisibility = JSC::ImplementationVisibility::Public; +const int s_transformStreamInternalsTransformStreamDefaultControllerPerformTransformCodeLength = 415; +static const JSC::Intrinsic s_transformStreamInternalsTransformStreamDefaultControllerPerformTransformCodeIntrinsic = JSC::NoIntrinsic; +const char* const s_transformStreamInternalsTransformStreamDefaultControllerPerformTransformCode = "(function (controller, chunk) {\"use strict\";\n const promiseCapability = @newPromiseCapability(@Promise);\n return @getByIdDirectPrivate(controller, \"transformAlgorithm\").@call(@undefined, chunk).@then(() => {\n promiseCapability.resolve();\n }, (r) => {\n @transformStreamError(@getByIdDirectPrivate(controller, \"stream\"), r), promiseCapability.reject.@call(@undefined, r);\n }), promiseCapability.promise;\n})\n"; -// enqueue -const JSC::ConstructAbility s_readableByteStreamControllerEnqueueCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; -const JSC::ConstructorKind s_readableByteStreamControllerEnqueueCodeConstructorKind = JSC::ConstructorKind::None; -const JSC::ImplementationVisibility s_readableByteStreamControllerEnqueueCodeImplementationVisibility = JSC::ImplementationVisibility::Public; -const int s_readableByteStreamControllerEnqueueCodeLength = 615; -static const JSC::Intrinsic s_readableByteStreamControllerEnqueueCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_readableByteStreamControllerEnqueueCode = "(function (chunk) {\"use strict\";\n if (!@isReadableByteStreamController(this))\n throw @makeThisTypeError(\"ReadableByteStreamController\", \"enqueue\");\n if (@getByIdDirectPrivate(this, \"closeRequested\"))\n @throwTypeError(\"ReadableByteStreamController is requested to close\");\n if (@getByIdDirectPrivate(@getByIdDirectPrivate(this, \"controlledReadableStream\"), \"state\") !== 4)\n @throwTypeError(\"ReadableStream is not readable\");\n if (!@isObject(chunk) || !@ArrayBuffer.@isView(chunk))\n @throwTypeError(\"Provided chunk is not a TypedArray\");\n return @readableByteStreamControllerEnqueue(this, chunk);\n})\n"; +// transformStreamDefaultControllerTerminate +const JSC::ConstructAbility s_transformStreamInternalsTransformStreamDefaultControllerTerminateCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; +const JSC::ConstructorKind s_transformStreamInternalsTransformStreamDefaultControllerTerminateCodeConstructorKind = JSC::ConstructorKind::None; +const JSC::ImplementationVisibility s_transformStreamInternalsTransformStreamDefaultControllerTerminateCodeImplementationVisibility = JSC::ImplementationVisibility::Public; +const int s_transformStreamInternalsTransformStreamDefaultControllerTerminateCodeLength = 508; +static const JSC::Intrinsic s_transformStreamInternalsTransformStreamDefaultControllerTerminateCodeIntrinsic = JSC::NoIntrinsic; +const char* const s_transformStreamInternalsTransformStreamDefaultControllerTerminateCode = "(function (controller) {\"use strict\";\n const stream = @getByIdDirectPrivate(controller, \"stream\"), readable = @getByIdDirectPrivate(stream, \"readable\"), readableController = @getByIdDirectPrivate(readable, \"readableStreamController\");\n if (@readableStreamDefaultControllerCanCloseOrEnqueue(readableController))\n @readableStreamDefaultControllerClose(readableController);\n const error = @makeTypeError(\"the stream has been terminated\");\n @transformStreamErrorWritableAndUnblockWrite(stream, error);\n})\n"; -// error -const JSC::ConstructAbility s_readableByteStreamControllerErrorCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; -const JSC::ConstructorKind s_readableByteStreamControllerErrorCodeConstructorKind = JSC::ConstructorKind::None; -const JSC::ImplementationVisibility s_readableByteStreamControllerErrorCodeImplementationVisibility = JSC::ImplementationVisibility::Public; -const int s_readableByteStreamControllerErrorCodeLength = 360; -static const JSC::Intrinsic s_readableByteStreamControllerErrorCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_readableByteStreamControllerErrorCode = "(function (error) {\"use strict\";\n if (!@isReadableByteStreamController(this))\n throw @makeThisTypeError(\"ReadableByteStreamController\", \"error\");\n if (@getByIdDirectPrivate(@getByIdDirectPrivate(this, \"controlledReadableStream\"), \"state\") !== 4)\n @throwTypeError(\"ReadableStream is not readable\");\n @readableByteStreamControllerError(this, error);\n})\n"; +// transformStreamDefaultSinkWriteAlgorithm +const JSC::ConstructAbility s_transformStreamInternalsTransformStreamDefaultSinkWriteAlgorithmCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; +const JSC::ConstructorKind s_transformStreamInternalsTransformStreamDefaultSinkWriteAlgorithmCodeConstructorKind = JSC::ConstructorKind::None; +const JSC::ImplementationVisibility s_transformStreamInternalsTransformStreamDefaultSinkWriteAlgorithmCodeImplementationVisibility = JSC::ImplementationVisibility::Public; +const int s_transformStreamInternalsTransformStreamDefaultSinkWriteAlgorithmCodeLength = 971; +static const JSC::Intrinsic s_transformStreamInternalsTransformStreamDefaultSinkWriteAlgorithmCodeIntrinsic = JSC::NoIntrinsic; +const char* const s_transformStreamInternalsTransformStreamDefaultSinkWriteAlgorithmCode = "(function (stream, chunk) {\"use strict\";\n const writable = @getByIdDirectPrivate(stream, \"internalWritable\"), controller = @getByIdDirectPrivate(stream, \"controller\");\n if (@getByIdDirectPrivate(stream, \"backpressure\")) {\n const promiseCapability = @newPromiseCapability(@Promise);\n return @getByIdDirectPrivate(stream, \"backpressureChangePromise\").promise.@then(() => {\n if (@getByIdDirectPrivate(writable, \"state\") === \"erroring\") {\n promiseCapability.reject.@call(@undefined, @getByIdDirectPrivate(writable, \"storedError\"));\n return;\n }\n @transformStreamDefaultControllerPerformTransform(controller, chunk).@then(() => {\n promiseCapability.resolve();\n }, (e) => {\n promiseCapability.reject.@call(@undefined, e);\n });\n }, (e) => {\n promiseCapability.reject.@call(@undefined, e);\n }), promiseCapability.promise;\n }\n return @transformStreamDefaultControllerPerformTransform(controller, chunk);\n})\n"; -// close -const JSC::ConstructAbility s_readableByteStreamControllerCloseCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; -const JSC::ConstructorKind s_readableByteStreamControllerCloseCodeConstructorKind = JSC::ConstructorKind::None; -const JSC::ImplementationVisibility s_readableByteStreamControllerCloseCodeImplementationVisibility = JSC::ImplementationVisibility::Public; -const int s_readableByteStreamControllerCloseCodeLength = 458; -static const JSC::Intrinsic s_readableByteStreamControllerCloseCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_readableByteStreamControllerCloseCode = "(function () {\"use strict\";\n if (!@isReadableByteStreamController(this))\n throw @makeThisTypeError(\"ReadableByteStreamController\", \"close\");\n if (@getByIdDirectPrivate(this, \"closeRequested\"))\n @throwTypeError(\"Close has already been requested\");\n if (@getByIdDirectPrivate(@getByIdDirectPrivate(this, \"controlledReadableStream\"), \"state\") !== 4)\n @throwTypeError(\"ReadableStream is not readable\");\n @readableByteStreamControllerClose(this);\n})\n"; +// transformStreamDefaultSinkAbortAlgorithm +const JSC::ConstructAbility s_transformStreamInternalsTransformStreamDefaultSinkAbortAlgorithmCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; +const JSC::ConstructorKind s_transformStreamInternalsTransformStreamDefaultSinkAbortAlgorithmCodeConstructorKind = JSC::ConstructorKind::None; +const JSC::ImplementationVisibility s_transformStreamInternalsTransformStreamDefaultSinkAbortAlgorithmCodeImplementationVisibility = JSC::ImplementationVisibility::Public; +const int s_transformStreamInternalsTransformStreamDefaultSinkAbortAlgorithmCodeLength = 114; +static const JSC::Intrinsic s_transformStreamInternalsTransformStreamDefaultSinkAbortAlgorithmCodeIntrinsic = JSC::NoIntrinsic; +const char* const s_transformStreamInternalsTransformStreamDefaultSinkAbortAlgorithmCode = "(function (stream, reason) {\"use strict\";\n return @transformStreamError(stream, reason), @Promise.@resolve();\n})\n"; -// byobRequest -const JSC::ConstructAbility s_readableByteStreamControllerByobRequestCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; -const JSC::ConstructorKind s_readableByteStreamControllerByobRequestCodeConstructorKind = JSC::ConstructorKind::None; -const JSC::ImplementationVisibility s_readableByteStreamControllerByobRequestCodeImplementationVisibility = JSC::ImplementationVisibility::Public; -const int s_readableByteStreamControllerByobRequestCodeLength = 738; -static const JSC::Intrinsic s_readableByteStreamControllerByobRequestCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_readableByteStreamControllerByobRequestCode = "(function () {\"use strict\";\n if (!@isReadableByteStreamController(this))\n throw @makeGetterTypeError(\"ReadableByteStreamController\", \"byobRequest\");\n var request = @getByIdDirectPrivate(this, \"byobRequest\");\n if (request === @undefined) {\n var pending = @getByIdDirectPrivate(this, \"pendingPullIntos\");\n const firstDescriptor = pending.peek();\n if (firstDescriptor) {\n const view = new @Uint8Array(firstDescriptor.buffer, firstDescriptor.byteOffset + firstDescriptor.bytesFilled, firstDescriptor.byteLength - firstDescriptor.bytesFilled);\n @putByIdDirectPrivate(this, \"byobRequest\", new @ReadableStreamBYOBRequest(this, view, @isReadableStream));\n }\n }\n return @getByIdDirectPrivate(this, \"byobRequest\");\n})\n"; +// transformStreamDefaultSinkCloseAlgorithm +const JSC::ConstructAbility s_transformStreamInternalsTransformStreamDefaultSinkCloseAlgorithmCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; +const JSC::ConstructorKind s_transformStreamInternalsTransformStreamDefaultSinkCloseAlgorithmCodeConstructorKind = JSC::ConstructorKind::None; +const JSC::ImplementationVisibility s_transformStreamInternalsTransformStreamDefaultSinkCloseAlgorithmCodeImplementationVisibility = JSC::ImplementationVisibility::Public; +const int s_transformStreamInternalsTransformStreamDefaultSinkCloseAlgorithmCodeLength = 1113; +static const JSC::Intrinsic s_transformStreamInternalsTransformStreamDefaultSinkCloseAlgorithmCodeIntrinsic = JSC::NoIntrinsic; +const char* const s_transformStreamInternalsTransformStreamDefaultSinkCloseAlgorithmCode = "(function (stream) {\"use strict\";\n const readable = @getByIdDirectPrivate(stream, \"readable\"), controller = @getByIdDirectPrivate(stream, \"controller\"), readableController = @getByIdDirectPrivate(readable, \"readableStreamController\"), flushAlgorithm = @getByIdDirectPrivate(controller, \"flushAlgorithm\"), flushPromise = @getByIdDirectPrivate(controller, \"flushAlgorithm\").@call();\n @transformStreamDefaultControllerClearAlgorithms(controller);\n const promiseCapability = @newPromiseCapability(@Promise);\n return flushPromise.@then(() => {\n if (@getByIdDirectPrivate(readable, \"state\") === 3) {\n promiseCapability.reject.@call(@undefined, @getByIdDirectPrivate(readable, \"storedError\"));\n return;\n }\n if (@readableStreamDefaultControllerCanCloseOrEnqueue(readableController))\n @readableStreamDefaultControllerClose(readableController);\n promiseCapability.resolve();\n }, (r) => {\n @transformStreamError(@getByIdDirectPrivate(controller, \"stream\"), r), promiseCapability.reject.@call(@undefined, @getByIdDirectPrivate(readable, \"storedError\"));\n }), promiseCapability.promise;\n})\n"; -// desiredSize -const JSC::ConstructAbility s_readableByteStreamControllerDesiredSizeCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; -const JSC::ConstructorKind s_readableByteStreamControllerDesiredSizeCodeConstructorKind = JSC::ConstructorKind::None; -const JSC::ImplementationVisibility s_readableByteStreamControllerDesiredSizeCodeImplementationVisibility = JSC::ImplementationVisibility::Public; -const int s_readableByteStreamControllerDesiredSizeCodeLength = 216; -static const JSC::Intrinsic s_readableByteStreamControllerDesiredSizeCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_readableByteStreamControllerDesiredSizeCode = "(function () {\"use strict\";\n if (!@isReadableByteStreamController(this))\n throw @makeGetterTypeError(\"ReadableByteStreamController\", \"desiredSize\");\n return @readableByteStreamControllerGetDesiredSize(this);\n})\n"; +// transformStreamDefaultSourcePullAlgorithm +const JSC::ConstructAbility s_transformStreamInternalsTransformStreamDefaultSourcePullAlgorithmCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; +const JSC::ConstructorKind s_transformStreamInternalsTransformStreamDefaultSourcePullAlgorithmCodeConstructorKind = JSC::ConstructorKind::None; +const JSC::ImplementationVisibility s_transformStreamInternalsTransformStreamDefaultSourcePullAlgorithmCodeImplementationVisibility = JSC::ImplementationVisibility::Public; +const int s_transformStreamInternalsTransformStreamDefaultSourcePullAlgorithmCodeLength = 159; +static const JSC::Intrinsic s_transformStreamInternalsTransformStreamDefaultSourcePullAlgorithmCodeIntrinsic = JSC::NoIntrinsic; +const char* const s_transformStreamInternalsTransformStreamDefaultSourcePullAlgorithmCode = "(function (stream) {\"use strict\";\n return @transformStreamSetBackpressure(stream, !1), @getByIdDirectPrivate(stream, \"backpressureChangePromise\").promise;\n})\n"; #define DEFINE_BUILTIN_GENERATOR(codeName, functionName, overriddenName, argumentCount) \ JSC::FunctionExecutable* codeName##Generator(JSC::VM& vm) \ {\ JSVMClientData* clientData = static_cast(vm.clientData); \ - return clientData->builtinFunctions().readableByteStreamControllerBuiltins().codeName##Executable()->link(vm, nullptr, clientData->builtinFunctions().readableByteStreamControllerBuiltins().codeName##Source(), std::nullopt, s_##codeName##Intrinsic); \ + return clientData->builtinFunctions().transformStreamInternalsBuiltins().codeName##Executable()->link(vm, nullptr, clientData->builtinFunctions().transformStreamInternalsBuiltins().codeName##Source(), std::nullopt, s_##codeName##Intrinsic); \ } -WEBCORE_FOREACH_READABLEBYTESTREAMCONTROLLER_BUILTIN_CODE(DEFINE_BUILTIN_GENERATOR) +WEBCORE_FOREACH_TRANSFORMSTREAMINTERNALS_BUILTIN_CODE(DEFINE_BUILTIN_GENERATOR) #undef DEFINE_BUILTIN_GENERATOR -/* UtilInspect.ts */ -// getStylizeWithColor -const JSC::ConstructAbility s_utilInspectGetStylizeWithColorCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; -const JSC::ConstructorKind s_utilInspectGetStylizeWithColorCodeConstructorKind = JSC::ConstructorKind::None; -const JSC::ImplementationVisibility s_utilInspectGetStylizeWithColorCodeImplementationVisibility = JSC::ImplementationVisibility::Public; -const int s_utilInspectGetStylizeWithColorCodeLength = 329; -static const JSC::Intrinsic s_utilInspectGetStylizeWithColorCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_utilInspectGetStylizeWithColorCode = "(function (inspect) {\"use strict\";\n return function stylizeWithColor(str, styleType) {\n const style = inspect.styles[styleType];\n if (style !== @undefined) {\n const color = inspect.colors[style];\n if (color !== @undefined)\n return `\\x1B[${color[0]}m${str}\\x1B[${color[1]}m`;\n }\n return str;\n };\n})\n"; - -// stylizeWithNoColor -const JSC::ConstructAbility s_utilInspectStylizeWithNoColorCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; -const JSC::ConstructorKind s_utilInspectStylizeWithNoColorCodeConstructorKind = JSC::ConstructorKind::None; -const JSC::ImplementationVisibility s_utilInspectStylizeWithNoColorCodeImplementationVisibility = JSC::ImplementationVisibility::Public; -const int s_utilInspectStylizeWithNoColorCodeLength = 48; -static const JSC::Intrinsic s_utilInspectStylizeWithNoColorCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_utilInspectStylizeWithNoColorCode = "(function (str) {\"use strict\";\n return str;\n})\n"; +/* EventSource.ts */ +// getEventSource +const JSC::ConstructAbility s_eventSourceGetEventSourceCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; +const JSC::ConstructorKind s_eventSourceGetEventSourceCodeConstructorKind = JSC::ConstructorKind::None; +const JSC::ImplementationVisibility s_eventSourceGetEventSourceCodeImplementationVisibility = JSC::ImplementationVisibility::Public; +const int s_eventSourceGetEventSourceCodeLength = 12373; +static const JSC::Intrinsic s_eventSourceGetEventSourceCodeIntrinsic = JSC::NoIntrinsic; +const char* const s_eventSourceGetEventSourceCode = "(function () {\"use strict\";\n\n class EventSource extends EventTarget {\n #url;\n #state;\n #onerror;\n #onmessage;\n #onopen;\n #is_tls = !1;\n #socket = null;\n #data_buffer = \"\";\n #send_buffer = \"\";\n #lastEventID = \"\";\n #reconnect = !0;\n #content_length = 0;\n #received_length = 0;\n #reconnection_time = 0;\n #reconnection_timer = null;\n static #ConnectNextTick(self) {\n self.#connect();\n }\n static #SendRequest(socket, url) {\n const self = socket.data, last_event_header = self.#lastEventID \? `Last-Event-ID: ${self.#lastEventID}\\r\\n` : \"\", request = `GET ${url.pathname}${url.search} HTTP/1.1\\r\\nHost: bun\\r\\nContent-type: text/event-stream\\r\\nContent-length: 0\\r\\n${last_event_header}\\r\\n`, sended = socket.write(request);\n if (sended !== request.length)\n self.#send_buffer = request.substring(sended);\n }\n static #ProcessChunk(self, chunks, offset) {\n for (;; ) {\n if (offset >= chunks.length)\n return;\n let chunk_end_idx = -1, start_idx = chunks.indexOf(\"\\r\\n\", offset);\n const chunk_start_idx = start_idx + 2;\n if (start_idx > 0)\n if (self.#content_length === 0) {\n const chunk_size = parseInt(chunks.substring(offset, start_idx), 16);\n if (chunk_size === 0) {\n self.#state = 2, self.#socket\?.end();\n return;\n }\n chunk_end_idx = chunk_start_idx + chunk_size;\n } else\n chunk_end_idx = chunks.length;\n else {\n if (self.#data_buffer.length === 0) {\n self.#data_buffer += chunks.substring(offset);\n return;\n }\n chunk_end_idx = chunks.length;\n }\n let chunk = chunks.substring(chunk_start_idx, chunk_end_idx);\n offset = chunk_end_idx + 2;\n let chunk_offset = 0, event_idx = chunk.indexOf(\"\\n\\n\");\n if (event_idx == -1) {\n self.#data_buffer += chunks.substring(chunk_start_idx);\n return;\n }\n if (self.#data_buffer.length)\n self.#data_buffer += chunk, chunk = self.#data_buffer, self.#data_buffer = \"\";\n let more_events = !0;\n while (more_events) {\n const event_data = chunk.substring(chunk_offset, event_idx);\n let type, data = \"\", id, event_line_idx = 0, retry = -1;\n for (;; ) {\n let idx = event_data.indexOf(\"\\n\", event_line_idx);\n if (idx === -1) {\n if (event_line_idx >= event_data.length)\n break;\n idx = event_data.length;\n }\n const line = event_data.substring(event_line_idx, idx);\n if (line.startsWith(\"data:\"))\n if (data.length)\n data += `\\n${line.substring(5).trim()}`;\n else\n data = line.substring(5).trim();\n else if (line.startsWith(\"event:\"))\n type = line.substring(6).trim();\n else if (line.startsWith(\"id:\"))\n id = line.substring(3).trim();\n else if (line.startsWith(\"retry:\")) {\n if (retry = parseInt(line.substring(6).trim(), 10), retry !== retry)\n retry = -1;\n }\n event_line_idx = idx + 1;\n }\n if (self.#lastEventID = id || \"\", retry >= 0)\n self.#reconnection_time = retry;\n if (data || id || type)\n self.dispatchEvent(new MessageEvent(type || \"message\", {\n data: data || \"\",\n origin: self.#url.origin,\n source: self,\n lastEventId: id\n }));\n if (chunk.length === event_idx + 2) {\n more_events = !1;\n break;\n }\n const next_event_idx = chunk.indexOf(\"\\n\\n\", event_idx + 1);\n if (next_event_idx === -1)\n break;\n chunk_offset = event_idx, event_idx = next_event_idx;\n }\n }\n }\n static #Handlers = {\n open(socket) {\n const self = socket.data;\n if (self.#socket = socket, !self.#is_tls)\n EventSource.#SendRequest(socket, self.#url);\n },\n handshake(socket, success, verifyError) {\n const self = socket.data;\n if (success)\n EventSource.#SendRequest(socket, self.#url);\n else\n self.#state = 2, self.dispatchEvent(new ErrorEvent(\"error\", { error: verifyError })), socket.end();\n },\n data(socket, buffer) {\n const self = socket.data;\n switch (self.#state) {\n case 0: {\n let text = buffer.toString();\n const headers_idx = text.indexOf(\"\\r\\n\\r\\n\");\n if (headers_idx === -1) {\n self.#data_buffer += text;\n return;\n }\n if (self.#data_buffer.length)\n self.#data_buffer += text, text = self.#data_buffer, self.#data_buffer = \"\";\n const headers = text.substring(0, headers_idx), status_idx = headers.indexOf(\"\\r\\n\");\n if (status_idx === -1) {\n self.#state = 2, self.dispatchEvent(new ErrorEvent(\"error\", { error: new Error(\"Invalid HTTP request\") })), socket.end();\n return;\n }\n const status = headers.substring(0, status_idx);\n if (status !== \"HTTP/1.1 200 OK\") {\n self.#state = 2, self.dispatchEvent(new ErrorEvent(\"error\", { error: new Error(status) })), socket.end();\n return;\n }\n let start_idx = status_idx + 1, mime_type_ok = !1, content_length = -1;\n for (;; ) {\n let header_idx = headers.indexOf(\"\\r\\n\", start_idx);\n if (header_idx === -1) {\n if (start_idx >= headers.length) {\n if (!mime_type_ok)\n self.#state = 2, self.dispatchEvent(new ErrorEvent(\"error\", {\n error: new Error(`EventSource's response has no MIME type and \"text/event-stream\" is required. Aborting the connection.`)\n })), socket.end();\n return;\n }\n header_idx = headers.length;\n }\n const header = headers.substring(start_idx + 1, header_idx), header_name_idx = header.indexOf(\":\"), header_name = header.substring(0, header_name_idx), is_content_type = header_name.localeCompare(\"content-type\", @undefined, { sensitivity: \"accent\" }) === 0;\n if (start_idx = header_idx + 1, is_content_type)\n if (header.endsWith(\" text/event-stream\"))\n mime_type_ok = !0;\n else {\n self.#state = 2, self.dispatchEvent(new ErrorEvent(\"error\", {\n error: new Error(`EventSource's response has a MIME type that is not \"text/event-stream\". Aborting the connection.`)\n })), socket.end();\n return;\n }\n else if (header_name.localeCompare(\"content-length\", @undefined, { sensitivity: \"accent\" }) === 0) {\n if (content_length = parseInt(header.substring(header_name_idx + 1).trim(), 10), content_length !== content_length || content_length <= 0) {\n self.dispatchEvent(new ErrorEvent(\"error\", {\n error: new Error(\"EventSource's Content-Length is invalid. Aborting the connection.\")\n })), socket.end();\n return;\n }\n if (mime_type_ok)\n break;\n } else if (header_name.localeCompare(\"transfer-encoding\", @undefined, { sensitivity: \"accent\" }) === 0) {\n if (header.substring(header_name_idx + 1).trim() !== \"chunked\") {\n self.dispatchEvent(new ErrorEvent(\"error\", {\n error: new Error(\"EventSource's Transfer-Encoding is invalid. Aborting the connection.\")\n })), socket.end();\n return;\n }\n if (content_length = 0, mime_type_ok)\n break;\n }\n }\n self.#content_length = content_length, self.#state = 1, self.dispatchEvent(new Event(\"open\"));\n const chunks = text.substring(headers_idx + 4);\n if (EventSource.#ProcessChunk(self, chunks, 0), self.#content_length > 0) {\n if (self.#received_length += chunks.length, self.#received_length >= self.#content_length)\n self.#state = 2, socket.end();\n }\n return;\n }\n case 1:\n if (EventSource.#ProcessChunk(self, buffer.toString(), 2), self.#content_length > 0) {\n if (self.#received_length += buffer.byteLength, self.#received_length >= self.#content_length)\n self.#state = 2, socket.end();\n }\n return;\n default:\n break;\n }\n },\n drain(socket) {\n const self = socket.data;\n if (self.#state === 0) {\n const request = self.#data_buffer;\n if (request.length) {\n const sended = socket.write(request);\n if (sended !== request.length)\n socket.data.#send_buffer = request.substring(sended);\n else\n socket.data.#send_buffer = \"\";\n }\n }\n },\n close: EventSource.#Close,\n end(socket) {\n EventSource.#Close(socket).dispatchEvent(new ErrorEvent(\"error\", { error: new Error(\"Connection closed by server\") }));\n },\n timeout(socket) {\n EventSource.#Close(socket).dispatchEvent(new ErrorEvent(\"error\", { error: new Error(\"Timeout\") }));\n },\n binaryType: \"buffer\"\n };\n static #Close(socket) {\n const self = socket.data;\n if (self.#socket = null, self.#received_length = 0, self.#state = 2, self.#reconnect) {\n if (self.#reconnection_timer)\n clearTimeout(self.#reconnection_timer);\n self.#reconnection_timer = setTimeout(EventSource.#ConnectNextTick, self.#reconnection_time, self);\n }\n return self;\n }\n constructor(url, options = @undefined) {\n super();\n const uri = new URL(url);\n this.#is_tls = uri.protocol === \"https:\", this.#url = uri, this.#state = 2, process.nextTick(EventSource.#ConnectNextTick, this);\n }\n ref() {\n this.#reconnection_timer\?.ref(), this.#socket\?.ref();\n }\n unref() {\n this.#reconnection_timer\?.unref(), this.#socket\?.unref();\n }\n #connect() {\n if (this.#state !== 2)\n return;\n const uri = this.#url, is_tls = this.#is_tls;\n this.#state = 0, Bun.connect({\n data: this,\n socket: EventSource.#Handlers,\n hostname: uri.hostname,\n port: parseInt(uri.port || (is_tls \? \"443\" : \"80\"), 10),\n tls: is_tls \? {\n requestCert: !0,\n rejectUnauthorized: !1\n } : !1\n }).catch((err) => {\n if (super.dispatchEvent(new ErrorEvent(\"error\", { error: err })), this.#reconnect) {\n if (this.#reconnection_timer)\n this.#reconnection_timer.unref\?.();\n this.#reconnection_timer = setTimeout(EventSource.#ConnectNextTick, 1000, this);\n }\n });\n }\n get url() {\n return this.#url.href;\n }\n get readyState() {\n return this.#state;\n }\n close() {\n this.#reconnect = !1, this.#state = 2, this.#socket\?.unref(), this.#socket\?.end();\n }\n get onopen() {\n return this.#onopen;\n }\n get onerror() {\n return this.#onerror;\n }\n get onmessage() {\n return this.#onmessage;\n }\n set onopen(cb) {\n if (this.#onopen)\n super.removeEventListener(\"close\", this.#onopen);\n super.addEventListener(\"open\", cb), this.#onopen = cb;\n }\n set onerror(cb) {\n if (this.#onerror)\n super.removeEventListener(\"error\", this.#onerror);\n super.addEventListener(\"error\", cb), this.#onerror = cb;\n }\n set onmessage(cb) {\n if (this.#onmessage)\n super.removeEventListener(\"message\", this.#onmessage);\n super.addEventListener(\"message\", cb), this.#onmessage = cb;\n }\n }\n return Object.defineProperty(EventSource.prototype, \"CONNECTING\", {\n enumerable: !0,\n value: 0\n }), Object.defineProperty(EventSource.prototype, \"OPEN\", {\n enumerable: !0,\n value: 1\n }), Object.defineProperty(EventSource.prototype, \"CLOSED\", {\n enumerable: !0,\n value: 2\n }), EventSource;\n})\n"; #define DEFINE_BUILTIN_GENERATOR(codeName, functionName, overriddenName, argumentCount) \ JSC::FunctionExecutable* codeName##Generator(JSC::VM& vm) \ {\ JSVMClientData* clientData = static_cast(vm.clientData); \ - return clientData->builtinFunctions().utilInspectBuiltins().codeName##Executable()->link(vm, nullptr, clientData->builtinFunctions().utilInspectBuiltins().codeName##Source(), std::nullopt, s_##codeName##Intrinsic); \ + return clientData->builtinFunctions().eventSourceBuiltins().codeName##Executable()->link(vm, nullptr, clientData->builtinFunctions().eventSourceBuiltins().codeName##Source(), std::nullopt, s_##codeName##Intrinsic); \ } -WEBCORE_FOREACH_UTILINSPECT_BUILTIN_CODE(DEFINE_BUILTIN_GENERATOR) +WEBCORE_FOREACH_EVENTSOURCE_BUILTIN_CODE(DEFINE_BUILTIN_GENERATOR) #undef DEFINE_BUILTIN_GENERATOR /* ConsoleObject.ts */ @@ -1399,710 +1445,668 @@ JSC::FunctionExecutable* codeName##Generator(JSC::VM& vm) \ WEBCORE_FOREACH_CONSOLEOBJECT_BUILTIN_CODE(DEFINE_BUILTIN_GENERATOR) #undef DEFINE_BUILTIN_GENERATOR -/* ReadableStreamInternals.ts */ -// readableStreamReaderGenericInitialize -const JSC::ConstructAbility s_readableStreamInternalsReadableStreamReaderGenericInitializeCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; -const JSC::ConstructorKind s_readableStreamInternalsReadableStreamReaderGenericInitializeCodeConstructorKind = JSC::ConstructorKind::None; -const JSC::ImplementationVisibility s_readableStreamInternalsReadableStreamReaderGenericInitializeCodeImplementationVisibility = JSC::ImplementationVisibility::Public; -const int s_readableStreamInternalsReadableStreamReaderGenericInitializeCodeLength = 632; -static const JSC::Intrinsic s_readableStreamInternalsReadableStreamReaderGenericInitializeCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_readableStreamInternalsReadableStreamReaderGenericInitializeCode = "(function (reader, stream) {\"use strict\";\n if (@putByIdDirectPrivate(reader, \"ownerReadableStream\", stream), @putByIdDirectPrivate(stream, \"reader\", reader), @getByIdDirectPrivate(stream, \"state\") === 4)\n @putByIdDirectPrivate(reader, \"closedPromiseCapability\", @newPromiseCapability(@Promise));\n else if (@getByIdDirectPrivate(stream, \"state\") === 1)\n @putByIdDirectPrivate(reader, \"closedPromiseCapability\", {\n promise: @Promise.@resolve()\n });\n else\n @putByIdDirectPrivate(reader, \"closedPromiseCapability\", {\n promise: @newHandledRejectedPromise(@getByIdDirectPrivate(stream, \"storedError\"))\n });\n})\n"; - -// privateInitializeReadableStreamDefaultController -const JSC::ConstructAbility s_readableStreamInternalsPrivateInitializeReadableStreamDefaultControllerCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; -const JSC::ConstructorKind s_readableStreamInternalsPrivateInitializeReadableStreamDefaultControllerCodeConstructorKind = JSC::ConstructorKind::None; -const JSC::ImplementationVisibility s_readableStreamInternalsPrivateInitializeReadableStreamDefaultControllerCodeImplementationVisibility = JSC::ImplementationVisibility::Public; -const int s_readableStreamInternalsPrivateInitializeReadableStreamDefaultControllerCodeLength = 810; -static const JSC::Intrinsic s_readableStreamInternalsPrivateInitializeReadableStreamDefaultControllerCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_readableStreamInternalsPrivateInitializeReadableStreamDefaultControllerCode = "(function (stream, underlyingSource, size, highWaterMark) {\"use strict\";\n if (!@isReadableStream(stream))\n @throwTypeError(\"ReadableStreamDefaultController needs a ReadableStream\");\n if (@getByIdDirectPrivate(stream, \"readableStreamController\") !== null)\n @throwTypeError(\"ReadableStream already has a controller\");\n return @putByIdDirectPrivate(this, \"controlledReadableStream\", stream), @putByIdDirectPrivate(this, \"underlyingSource\", 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(size, highWaterMark)), this;\n})\n"; - -// readableStreamDefaultControllerError -const JSC::ConstructAbility s_readableStreamInternalsReadableStreamDefaultControllerErrorCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; -const JSC::ConstructorKind s_readableStreamInternalsReadableStreamDefaultControllerErrorCodeConstructorKind = JSC::ConstructorKind::None; -const JSC::ImplementationVisibility s_readableStreamInternalsReadableStreamDefaultControllerErrorCodeImplementationVisibility = JSC::ImplementationVisibility::Public; -const int s_readableStreamInternalsReadableStreamDefaultControllerErrorCodeLength = 288; -static const JSC::Intrinsic s_readableStreamInternalsReadableStreamDefaultControllerErrorCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_readableStreamInternalsReadableStreamDefaultControllerErrorCode = "(function (controller, error) {\"use strict\";\n const stream = @getByIdDirectPrivate(controller, \"controlledReadableStream\");\n if (@getByIdDirectPrivate(stream, \"state\") !== 4)\n return;\n @putByIdDirectPrivate(controller, \"queue\", @newQueue()), @readableStreamError(stream, error);\n})\n"; - -// readableStreamPipeTo -const JSC::ConstructAbility s_readableStreamInternalsReadableStreamPipeToCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; -const JSC::ConstructorKind s_readableStreamInternalsReadableStreamPipeToCodeConstructorKind = JSC::ConstructorKind::None; -const JSC::ImplementationVisibility s_readableStreamInternalsReadableStreamPipeToCodeImplementationVisibility = JSC::ImplementationVisibility::Public; -const int s_readableStreamInternalsReadableStreamPipeToCodeLength = 633; -static const JSC::Intrinsic s_readableStreamInternalsReadableStreamPipeToCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_readableStreamInternalsReadableStreamPipeToCode = "(function (stream, sink) {\"use strict\";\n const reader = new @ReadableStreamDefaultReader(stream);\n @getByIdDirectPrivate(reader, \"closedPromiseCapability\").promise.@then(() => {\n }, (e) => {\n sink.error(e);\n });\n function doPipe() {\n @readableStreamDefaultReaderRead(reader).@then(function(result) {\n if (result.done) {\n sink.close();\n return;\n }\n try {\n sink.enqueue(result.value);\n } catch (e) {\n sink.error(\"ReadableStream chunk enqueueing in the sink failed\");\n return;\n }\n doPipe();\n }, function(e) {\n sink.error(e);\n });\n }\n doPipe();\n})\n"; - -// acquireReadableStreamDefaultReader -const JSC::ConstructAbility s_readableStreamInternalsAcquireReadableStreamDefaultReaderCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; -const JSC::ConstructorKind s_readableStreamInternalsAcquireReadableStreamDefaultReaderCodeConstructorKind = JSC::ConstructorKind::None; -const JSC::ImplementationVisibility s_readableStreamInternalsAcquireReadableStreamDefaultReaderCodeImplementationVisibility = JSC::ImplementationVisibility::Public; -const int s_readableStreamInternalsAcquireReadableStreamDefaultReaderCodeLength = 180; -static const JSC::Intrinsic s_readableStreamInternalsAcquireReadableStreamDefaultReaderCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_readableStreamInternalsAcquireReadableStreamDefaultReaderCode = "(function (stream) {\"use strict\";\n var start = @getByIdDirectPrivate(stream, \"start\");\n if (start)\n start.@call(stream);\n return new @ReadableStreamDefaultReader(stream);\n})\n"; - -// setupReadableStreamDefaultController -const JSC::ConstructAbility s_readableStreamInternalsSetupReadableStreamDefaultControllerCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; -const JSC::ConstructorKind s_readableStreamInternalsSetupReadableStreamDefaultControllerCodeConstructorKind = JSC::ConstructorKind::None; -const JSC::ImplementationVisibility s_readableStreamInternalsSetupReadableStreamDefaultControllerCodeImplementationVisibility = JSC::ImplementationVisibility::Public; -const int s_readableStreamInternalsSetupReadableStreamDefaultControllerCodeLength = 1204; -static const JSC::Intrinsic s_readableStreamInternalsSetupReadableStreamDefaultControllerCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_readableStreamInternalsSetupReadableStreamDefaultControllerCode = "(function (stream, underlyingSource, size, highWaterMark, startMethod, pullMethod, cancelMethod) {\"use strict\";\n const controller = new @ReadableStreamDefaultController(stream, underlyingSource, size, highWaterMark, @isReadableStream);\n var asyncContext = stream.@asyncContext;\n const pullAlgorithm = () => @promiseInvokeOrNoopMethod(underlyingSource, pullMethod, [controller]), cancelAlgorithm = asyncContext \? (reason) => {\n var prev = @getInternalField(@asyncContext, 0);\n @putInternalField(@asyncContext, 0, asyncContext);\n var result = @promiseInvokeOrNoopMethod(underlyingSource, cancelMethod, [reason]);\n return @putInternalField(@asyncContext, 0, prev), result;\n } : (reason) => @promiseInvokeOrNoopMethod(underlyingSource, cancelMethod, [reason]);\n @putByIdDirectPrivate(controller, \"pullAlgorithm\", pullAlgorithm), @putByIdDirectPrivate(controller, \"cancelAlgorithm\", cancelAlgorithm), @putByIdDirectPrivate(controller, \"pull\", @readableStreamDefaultControllerPull), @putByIdDirectPrivate(controller, \"cancel\", @readableStreamDefaultControllerCancel), @putByIdDirectPrivate(stream, \"readableStreamController\", controller), @readableStreamDefaultControllerStart(controller);\n})\n"; - -// createReadableStreamController -const JSC::ConstructAbility s_readableStreamInternalsCreateReadableStreamControllerCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; -const JSC::ConstructorKind s_readableStreamInternalsCreateReadableStreamControllerCodeConstructorKind = JSC::ConstructorKind::None; -const JSC::ImplementationVisibility s_readableStreamInternalsCreateReadableStreamControllerCodeImplementationVisibility = JSC::ImplementationVisibility::Public; -const int s_readableStreamInternalsCreateReadableStreamControllerCodeLength = 1077; -static const JSC::Intrinsic s_readableStreamInternalsCreateReadableStreamControllerCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_readableStreamInternalsCreateReadableStreamControllerCode = "(function (stream, underlyingSource, strategy) {\"use strict\";\n const type = underlyingSource.type, typeString = @toString(type);\n if (typeString === \"bytes\") {\n if (strategy.highWaterMark === @undefined)\n strategy.highWaterMark = 0;\n if (strategy.size !== @undefined)\n @throwRangeError(\"Strategy for a ReadableByteStreamController cannot have a size\");\n @putByIdDirectPrivate(stream, \"readableStreamController\", new @ReadableByteStreamController(stream, underlyingSource, strategy.highWaterMark, @isReadableStream));\n } else if (typeString === \"direct\") {\n var highWaterMark = strategy\?.highWaterMark;\n @initializeArrayBufferStream.@call(stream, underlyingSource, highWaterMark);\n } else if (type === @undefined) {\n if (strategy.highWaterMark === @undefined)\n strategy.highWaterMark = 1;\n @setupReadableStreamDefaultController(stream, underlyingSource, strategy.size, strategy.highWaterMark, underlyingSource.start, underlyingSource.pull, underlyingSource.cancel);\n } else\n @throwRangeError(\"Invalid type for underlying source\");\n})\n"; +/* Module.ts */ +// main +const JSC::ConstructAbility s_moduleMainCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; +const JSC::ConstructorKind s_moduleMainCodeConstructorKind = JSC::ConstructorKind::None; +const JSC::ImplementationVisibility s_moduleMainCodeImplementationVisibility = JSC::ImplementationVisibility::Public; +const int s_moduleMainCodeLength = 68; +static const JSC::Intrinsic s_moduleMainCodeIntrinsic = JSC::NoIntrinsic; +const char* const s_moduleMainCode = "(function () {\"use strict\";\n return @requireMap.@get(Bun.main);\n})\n"; -// readableStreamDefaultControllerStart -const JSC::ConstructAbility s_readableStreamInternalsReadableStreamDefaultControllerStartCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; -const JSC::ConstructorKind s_readableStreamInternalsReadableStreamDefaultControllerStartCodeConstructorKind = JSC::ConstructorKind::None; -const JSC::ImplementationVisibility s_readableStreamInternalsReadableStreamDefaultControllerStartCodeImplementationVisibility = JSC::ImplementationVisibility::Public; -const int s_readableStreamInternalsReadableStreamDefaultControllerStartCodeLength = 577; -static const JSC::Intrinsic s_readableStreamInternalsReadableStreamDefaultControllerStartCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_readableStreamInternalsReadableStreamDefaultControllerStartCode = "(function (controller) {\"use strict\";\n if (@getByIdDirectPrivate(controller, \"started\") !== -1)\n return;\n const underlyingSource = @getByIdDirectPrivate(controller, \"underlyingSource\"), startMethod = underlyingSource.start;\n @putByIdDirectPrivate(controller, \"started\", 0), @promiseInvokeOrNoopMethodNoCatch(underlyingSource, startMethod, [controller]).@then(() => {\n @putByIdDirectPrivate(controller, \"started\", 1), @readableStreamDefaultControllerCallPullIfNeeded(controller);\n }, (error) => {\n @readableStreamDefaultControllerError(controller, error);\n });\n})\n"; +// require +const JSC::ConstructAbility s_moduleRequireCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; +const JSC::ConstructorKind s_moduleRequireCodeConstructorKind = JSC::ConstructorKind::None; +const JSC::ImplementationVisibility s_moduleRequireCodeImplementationVisibility = JSC::ImplementationVisibility::Public; +const int s_moduleRequireCodeLength = 882; +static const JSC::Intrinsic s_moduleRequireCodeIntrinsic = JSC::NoIntrinsic; +const char* const s_moduleRequireCode = "(function (id) {\"use strict\";\n const existing = @requireMap.@get(id) || @requireMap.@get(id = @resolveSync(id, this.path, !1));\n if (existing)\n return @evaluateCommonJSModule(existing), existing.exports;\n if (id.endsWith(\".node\"))\n return @internalRequire(id);\n const mod = @createCommonJSModule(id, {}, !1);\n @requireMap.@set(id, mod);\n var out = this.@require(id, mod);\n if (out === -1) {\n try {\n out = @requireESM(id);\n } catch (exception) {\n throw @requireMap.@delete(id), exception;\n }\n const esm = @Loader.registry.@get(id);\n if (esm\?.evaluated && (esm.state \?\? 0) >= @ModuleReady) {\n const namespace = @Loader.getModuleNamespaceObject(esm.module);\n return mod.exports = namespace.__esModule \? namespace : Object.create(namespace, { __esModule: { value: !0 } });\n }\n }\n return @evaluateCommonJSModule(mod), mod.exports;\n})\n"; -// readableStreamPipeToWritableStream -const JSC::ConstructAbility s_readableStreamInternalsReadableStreamPipeToWritableStreamCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; -const JSC::ConstructorKind s_readableStreamInternalsReadableStreamPipeToWritableStreamCodeConstructorKind = JSC::ConstructorKind::None; -const JSC::ImplementationVisibility s_readableStreamInternalsReadableStreamPipeToWritableStreamCodeImplementationVisibility = JSC::ImplementationVisibility::Public; -const int s_readableStreamInternalsReadableStreamPipeToWritableStreamCodeLength = 2342; -static const JSC::Intrinsic s_readableStreamInternalsReadableStreamPipeToWritableStreamCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_readableStreamInternalsReadableStreamPipeToWritableStreamCode = "(function (source, destination, preventClose, preventAbort, preventCancel, signal) {\"use strict\";\n if (@getByIdDirectPrivate(source, \"underlyingByteSource\") !== @undefined)\n return @Promise.@reject(\"Piping to a readable bytestream is not supported\");\n let pipeState = {\n source,\n destination,\n preventAbort,\n preventCancel,\n preventClose,\n signal\n };\n if (pipeState.reader = @acquireReadableStreamDefaultReader(source), pipeState.writer = @acquireWritableStreamDefaultWriter(destination), @putByIdDirectPrivate(source, \"disturbed\", !0), pipeState.finalized = !1, pipeState.shuttingDown = !1, pipeState.promiseCapability = @newPromiseCapability(@Promise), pipeState.pendingReadPromiseCapability = @newPromiseCapability(@Promise), pipeState.pendingReadPromiseCapability.resolve.@call(), pipeState.pendingWritePromise = @Promise.@resolve(), signal !== @undefined) {\n const algorithm = (reason) => {\n if (pipeState.finalized)\n return;\n @pipeToShutdownWithAction(pipeState, () => {\n const promiseDestination = !pipeState.preventAbort && @getByIdDirectPrivate(pipeState.destination, \"state\") === \"writable\" \? @writableStreamAbort(pipeState.destination, reason) : @Promise.@resolve(), promiseSource = !pipeState.preventCancel && @getByIdDirectPrivate(pipeState.source, \"state\") === 4 \? @readableStreamCancel(pipeState.source, reason) : @Promise.@resolve();\n let promiseCapability = @newPromiseCapability(@Promise), shouldWait = !0, handleResolvedPromise = () => {\n if (shouldWait) {\n shouldWait = !1;\n return;\n }\n promiseCapability.resolve.@call();\n }, handleRejectedPromise = (e) => {\n promiseCapability.reject.@call(@undefined, e);\n };\n return promiseDestination.@then(handleResolvedPromise, handleRejectedPromise), promiseSource.@then(handleResolvedPromise, handleRejectedPromise), promiseCapability.promise;\n }, reason);\n };\n if (@whenSignalAborted(signal, algorithm))\n return pipeState.promiseCapability.promise;\n }\n return @pipeToErrorsMustBePropagatedForward(pipeState), @pipeToErrorsMustBePropagatedBackward(pipeState), @pipeToClosingMustBePropagatedForward(pipeState), @pipeToClosingMustBePropagatedBackward(pipeState), @pipeToLoop(pipeState), pipeState.promiseCapability.promise;\n})\n"; +// requireResolve +const JSC::ConstructAbility s_moduleRequireResolveCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; +const JSC::ConstructorKind s_moduleRequireResolveCodeConstructorKind = JSC::ConstructorKind::None; +const JSC::ImplementationVisibility s_moduleRequireResolveCodeImplementationVisibility = JSC::ImplementationVisibility::Public; +const int s_moduleRequireResolveCodeLength = 110; +static const JSC::Intrinsic s_moduleRequireResolveCodeIntrinsic = JSC::NoIntrinsic; +const char* const s_moduleRequireResolveCode = "(function (id) {\"use strict\";\n return @resolveSync(id, typeof this === \"string\" \? this : this\?.path, !1);\n})\n"; -// pipeToLoop -const JSC::ConstructAbility s_readableStreamInternalsPipeToLoopCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; -const JSC::ConstructorKind s_readableStreamInternalsPipeToLoopCodeConstructorKind = JSC::ConstructorKind::None; -const JSC::ImplementationVisibility s_readableStreamInternalsPipeToLoopCodeImplementationVisibility = JSC::ImplementationVisibility::Public; -const int s_readableStreamInternalsPipeToLoopCodeLength = 186; -static const JSC::Intrinsic s_readableStreamInternalsPipeToLoopCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_readableStreamInternalsPipeToLoopCode = "(function (pipeState) {\"use strict\";\n if (pipeState.shuttingDown)\n return;\n @pipeToDoReadWrite(pipeState).@then((result) => {\n if (result)\n @pipeToLoop(pipeState);\n });\n})\n"; +// requireNativeModule +const JSC::ConstructAbility s_moduleRequireNativeModuleCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; +const JSC::ConstructorKind s_moduleRequireNativeModuleCodeConstructorKind = JSC::ConstructorKind::None; +const JSC::ImplementationVisibility s_moduleRequireNativeModuleCodeImplementationVisibility = JSC::ImplementationVisibility::Public; +const int s_moduleRequireNativeModuleCodeLength = 229; +static const JSC::Intrinsic s_moduleRequireNativeModuleCodeIntrinsic = JSC::NoIntrinsic; +const char* const s_moduleRequireNativeModuleCode = "(function (id) {\"use strict\";\n let esm = @Loader.registry.@get(id);\n if (esm\?.evaluated && (esm.state \?\? 0) >= @ModuleReady)\n return @Loader.getModuleNamespaceObject(esm.module).default;\n return @requireESM(id).default;\n})\n"; -// pipeToDoReadWrite -const JSC::ConstructAbility s_readableStreamInternalsPipeToDoReadWriteCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; -const JSC::ConstructorKind s_readableStreamInternalsPipeToDoReadWriteCodeConstructorKind = JSC::ConstructorKind::None; -const JSC::ImplementationVisibility s_readableStreamInternalsPipeToDoReadWriteCodeImplementationVisibility = JSC::ImplementationVisibility::Public; -const int s_readableStreamInternalsPipeToDoReadWriteCodeLength = 971; -static const JSC::Intrinsic s_readableStreamInternalsPipeToDoReadWriteCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_readableStreamInternalsPipeToDoReadWriteCode = "(function (pipeState) {\"use strict\";\n return pipeState.pendingReadPromiseCapability = @newPromiseCapability(@Promise), @getByIdDirectPrivate(pipeState.writer, \"readyPromise\").promise.@then(() => {\n if (pipeState.shuttingDown) {\n pipeState.pendingReadPromiseCapability.resolve.@call(@undefined, !1);\n return;\n }\n @readableStreamDefaultReaderRead(pipeState.reader).@then((result) => {\n const canWrite = !result.done && @getByIdDirectPrivate(pipeState.writer, \"stream\") !== @undefined;\n if (pipeState.pendingReadPromiseCapability.resolve.@call(@undefined, canWrite), !canWrite)\n return;\n pipeState.pendingWritePromise = @writableStreamDefaultWriterWrite(pipeState.writer, result.value);\n }, (e) => {\n pipeState.pendingReadPromiseCapability.resolve.@call(@undefined, !1);\n });\n }, (e) => {\n pipeState.pendingReadPromiseCapability.resolve.@call(@undefined, !1);\n }), pipeState.pendingReadPromiseCapability.promise;\n})\n"; +#define DEFINE_BUILTIN_GENERATOR(codeName, functionName, overriddenName, argumentCount) \ +JSC::FunctionExecutable* codeName##Generator(JSC::VM& vm) \ +{\ + JSVMClientData* clientData = static_cast(vm.clientData); \ + return clientData->builtinFunctions().moduleBuiltins().codeName##Executable()->link(vm, nullptr, clientData->builtinFunctions().moduleBuiltins().codeName##Source(), std::nullopt, s_##codeName##Intrinsic); \ +} +WEBCORE_FOREACH_MODULE_BUILTIN_CODE(DEFINE_BUILTIN_GENERATOR) +#undef DEFINE_BUILTIN_GENERATOR -// pipeToErrorsMustBePropagatedForward -const JSC::ConstructAbility s_readableStreamInternalsPipeToErrorsMustBePropagatedForwardCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; -const JSC::ConstructorKind s_readableStreamInternalsPipeToErrorsMustBePropagatedForwardCodeConstructorKind = JSC::ConstructorKind::None; -const JSC::ImplementationVisibility s_readableStreamInternalsPipeToErrorsMustBePropagatedForwardCodeImplementationVisibility = JSC::ImplementationVisibility::Public; -const int s_readableStreamInternalsPipeToErrorsMustBePropagatedForwardCodeLength = 619; -static const JSC::Intrinsic s_readableStreamInternalsPipeToErrorsMustBePropagatedForwardCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_readableStreamInternalsPipeToErrorsMustBePropagatedForwardCode = "(function (pipeState) {\"use strict\";\n const action = () => {\n pipeState.pendingReadPromiseCapability.resolve.@call(@undefined, !1);\n const error = @getByIdDirectPrivate(pipeState.source, \"storedError\");\n if (!pipeState.preventAbort) {\n @pipeToShutdownWithAction(pipeState, () => @writableStreamAbort(pipeState.destination, error), error);\n return;\n }\n @pipeToShutdown(pipeState, error);\n };\n if (@getByIdDirectPrivate(pipeState.source, \"state\") === 3) {\n action();\n return;\n }\n @getByIdDirectPrivate(pipeState.reader, \"closedPromiseCapability\").promise.@then(@undefined, action);\n})\n"; +/* JSBufferConstructor.ts */ +// from +const JSC::ConstructAbility s_jsBufferConstructorFromCodeConstructAbility = JSC::ConstructAbility::CanConstruct; +const JSC::ConstructorKind s_jsBufferConstructorFromCodeConstructorKind = JSC::ConstructorKind::None; +const JSC::ImplementationVisibility s_jsBufferConstructorFromCodeImplementationVisibility = JSC::ImplementationVisibility::Public; +const int s_jsBufferConstructorFromCodeLength = 1538; +static const JSC::Intrinsic s_jsBufferConstructorFromCodeIntrinsic = JSC::NoIntrinsic; +const char* const s_jsBufferConstructorFromCode = "(function (items) {\"use strict\";\n if (@isUndefinedOrNull(items))\n @throwTypeError(\"The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object.\");\n if (typeof items === \"string\" || typeof items === \"object\" && (@isTypedArrayView(items) || items instanceof @ArrayBuffer || items instanceof SharedArrayBuffer || items instanceof @String))\n switch (@argumentCount()) {\n case 1:\n return new @Buffer(items);\n case 2:\n return new @Buffer(items, @argument(1));\n default:\n return new @Buffer(items, @argument(1), @argument(2));\n }\n var arrayLike = @toObject(items, \"The first argument must be of type string or an instance of Buffer, ArrayBuffer, or Array or an Array-like Object.\");\n if (!@isJSArray(arrayLike)) {\n const toPrimitive = @tryGetByIdWithWellKnownSymbol(items, \"toPrimitive\");\n if (toPrimitive) {\n const primitive = toPrimitive.@call(items, \"string\");\n if (typeof primitive === \"string\")\n switch (@argumentCount()) {\n case 1:\n return new @Buffer(primitive);\n case 2:\n return new @Buffer(primitive, @argument(1));\n default:\n return new @Buffer(primitive, @argument(1), @argument(2));\n }\n }\n if (!(\"length\" in arrayLike) || @isCallable(arrayLike))\n @throwTypeError(\"The first argument must be of type string or an instance of Buffer, ArrayBuffer, or Array or an Array-like Object.\");\n }\n return new @Buffer(@Uint8Array.from(arrayLike).buffer);\n})\n"; -// pipeToErrorsMustBePropagatedBackward -const JSC::ConstructAbility s_readableStreamInternalsPipeToErrorsMustBePropagatedBackwardCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; -const JSC::ConstructorKind s_readableStreamInternalsPipeToErrorsMustBePropagatedBackwardCodeConstructorKind = JSC::ConstructorKind::None; -const JSC::ImplementationVisibility s_readableStreamInternalsPipeToErrorsMustBePropagatedBackwardCodeImplementationVisibility = JSC::ImplementationVisibility::Public; -const int s_readableStreamInternalsPipeToErrorsMustBePropagatedBackwardCodeLength = 550; -static const JSC::Intrinsic s_readableStreamInternalsPipeToErrorsMustBePropagatedBackwardCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_readableStreamInternalsPipeToErrorsMustBePropagatedBackwardCode = "(function (pipeState) {\"use strict\";\n const action = () => {\n const error = @getByIdDirectPrivate(pipeState.destination, \"storedError\");\n if (!pipeState.preventCancel) {\n @pipeToShutdownWithAction(pipeState, () => @readableStreamCancel(pipeState.source, error), error);\n return;\n }\n @pipeToShutdown(pipeState, error);\n };\n if (@getByIdDirectPrivate(pipeState.destination, \"state\") === \"errored\") {\n action();\n return;\n }\n @getByIdDirectPrivate(pipeState.writer, \"closedPromise\").promise.@then(@undefined, action);\n})\n"; +// isBuffer +const JSC::ConstructAbility s_jsBufferConstructorIsBufferCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; +const JSC::ConstructorKind s_jsBufferConstructorIsBufferCodeConstructorKind = JSC::ConstructorKind::None; +const JSC::ImplementationVisibility s_jsBufferConstructorIsBufferCodeImplementationVisibility = JSC::ImplementationVisibility::Public; +const int s_jsBufferConstructorIsBufferCodeLength = 81; +static const JSC::Intrinsic s_jsBufferConstructorIsBufferCodeIntrinsic = JSC::NoIntrinsic; +const char* const s_jsBufferConstructorIsBufferCode = "(function (bufferlike) {\"use strict\";\n return bufferlike instanceof @Buffer;\n})\n"; -// pipeToClosingMustBePropagatedForward -const JSC::ConstructAbility s_readableStreamInternalsPipeToClosingMustBePropagatedForwardCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; -const JSC::ConstructorKind s_readableStreamInternalsPipeToClosingMustBePropagatedForwardCodeConstructorKind = JSC::ConstructorKind::None; -const JSC::ImplementationVisibility s_readableStreamInternalsPipeToClosingMustBePropagatedForwardCodeImplementationVisibility = JSC::ImplementationVisibility::Public; -const int s_readableStreamInternalsPipeToClosingMustBePropagatedForwardCodeLength = 548; -static const JSC::Intrinsic s_readableStreamInternalsPipeToClosingMustBePropagatedForwardCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_readableStreamInternalsPipeToClosingMustBePropagatedForwardCode = "(function (pipeState) {\"use strict\";\n const action = () => {\n if (pipeState.pendingReadPromiseCapability.resolve.@call(@undefined, !1), !pipeState.preventClose) {\n @pipeToShutdownWithAction(pipeState, () => @writableStreamDefaultWriterCloseWithErrorPropagation(pipeState.writer));\n return;\n }\n @pipeToShutdown(pipeState);\n };\n if (@getByIdDirectPrivate(pipeState.source, \"state\") === 1) {\n action();\n return;\n }\n @getByIdDirectPrivate(pipeState.reader, \"closedPromiseCapability\").promise.@then(action, @undefined);\n})\n"; +#define DEFINE_BUILTIN_GENERATOR(codeName, functionName, overriddenName, argumentCount) \ +JSC::FunctionExecutable* codeName##Generator(JSC::VM& vm) \ +{\ + JSVMClientData* clientData = static_cast(vm.clientData); \ + return clientData->builtinFunctions().jsBufferConstructorBuiltins().codeName##Executable()->link(vm, nullptr, clientData->builtinFunctions().jsBufferConstructorBuiltins().codeName##Source(), std::nullopt, s_##codeName##Intrinsic); \ +} +WEBCORE_FOREACH_JSBUFFERCONSTRUCTOR_BUILTIN_CODE(DEFINE_BUILTIN_GENERATOR) +#undef DEFINE_BUILTIN_GENERATOR -// pipeToClosingMustBePropagatedBackward -const JSC::ConstructAbility s_readableStreamInternalsPipeToClosingMustBePropagatedBackwardCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; -const JSC::ConstructorKind s_readableStreamInternalsPipeToClosingMustBePropagatedBackwardCodeConstructorKind = JSC::ConstructorKind::None; -const JSC::ImplementationVisibility s_readableStreamInternalsPipeToClosingMustBePropagatedBackwardCodeImplementationVisibility = JSC::ImplementationVisibility::Public; -const int s_readableStreamInternalsPipeToClosingMustBePropagatedBackwardCodeLength = 446; -static const JSC::Intrinsic s_readableStreamInternalsPipeToClosingMustBePropagatedBackwardCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_readableStreamInternalsPipeToClosingMustBePropagatedBackwardCode = "(function (pipeState) {\"use strict\";\n if (!@writableStreamCloseQueuedOrInFlight(pipeState.destination) && @getByIdDirectPrivate(pipeState.destination, \"state\") !== \"closed\")\n return;\n const error = @makeTypeError(\"closing is propagated backward\");\n if (!pipeState.preventCancel) {\n @pipeToShutdownWithAction(pipeState, () => @readableStreamCancel(pipeState.source, error), error);\n return;\n }\n @pipeToShutdown(pipeState, error);\n})\n"; +/* JSBufferPrototype.ts */ +// setBigUint64 +const JSC::ConstructAbility s_jsBufferPrototypeSetBigUint64CodeConstructAbility = JSC::ConstructAbility::CannotConstruct; +const JSC::ConstructorKind s_jsBufferPrototypeSetBigUint64CodeConstructorKind = JSC::ConstructorKind::None; +const JSC::ImplementationVisibility s_jsBufferPrototypeSetBigUint64CodeImplementationVisibility = JSC::ImplementationVisibility::Public; +const int s_jsBufferPrototypeSetBigUint64CodeLength = 171; +static const JSC::Intrinsic s_jsBufferPrototypeSetBigUint64CodeIntrinsic = JSC::NoIntrinsic; +const char* const s_jsBufferPrototypeSetBigUint64Code = "(function (offset, value, le) {\"use strict\";\n return (this.@dataView ||= new DataView(this.buffer, this.byteOffset, this.byteLength)).setBigUint64(offset, value, le);\n})\n"; -// pipeToShutdownWithAction -const JSC::ConstructAbility s_readableStreamInternalsPipeToShutdownWithActionCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; -const JSC::ConstructorKind s_readableStreamInternalsPipeToShutdownWithActionCodeConstructorKind = JSC::ConstructorKind::None; -const JSC::ImplementationVisibility s_readableStreamInternalsPipeToShutdownWithActionCodeImplementationVisibility = JSC::ImplementationVisibility::Public; -const int s_readableStreamInternalsPipeToShutdownWithActionCodeLength = 752; -static const JSC::Intrinsic s_readableStreamInternalsPipeToShutdownWithActionCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_readableStreamInternalsPipeToShutdownWithActionCode = "(function (pipeState, action) {\"use strict\";\n if (pipeState.shuttingDown)\n return;\n pipeState.shuttingDown = !0;\n const hasError = arguments.length > 2, error = arguments[2], finalize = () => {\n action().@then(() => {\n if (hasError)\n @pipeToFinalize(pipeState, error);\n else\n @pipeToFinalize(pipeState);\n }, (e) => {\n @pipeToFinalize(pipeState, e);\n });\n };\n if (@getByIdDirectPrivate(pipeState.destination, \"state\") === \"writable\" && !@writableStreamCloseQueuedOrInFlight(pipeState.destination)) {\n pipeState.pendingReadPromiseCapability.promise.@then(() => {\n pipeState.pendingWritePromise.@then(finalize, finalize);\n }, (e) => @pipeToFinalize(pipeState, e));\n return;\n }\n finalize();\n})\n"; +// readInt8 +const JSC::ConstructAbility s_jsBufferPrototypeReadInt8CodeConstructAbility = JSC::ConstructAbility::CannotConstruct; +const JSC::ConstructorKind s_jsBufferPrototypeReadInt8CodeConstructorKind = JSC::ConstructorKind::None; +const JSC::ImplementationVisibility s_jsBufferPrototypeReadInt8CodeImplementationVisibility = JSC::ImplementationVisibility::Public; +const int s_jsBufferPrototypeReadInt8CodeLength = 144; +static const JSC::Intrinsic s_jsBufferPrototypeReadInt8CodeIntrinsic = JSC::NoIntrinsic; +const char* const s_jsBufferPrototypeReadInt8Code = "(function (offset) {\"use strict\";\n return (this.@dataView ||= new DataView(this.buffer, this.byteOffset, this.byteLength)).getInt8(offset);\n})\n"; -// pipeToShutdown -const JSC::ConstructAbility s_readableStreamInternalsPipeToShutdownCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; -const JSC::ConstructorKind s_readableStreamInternalsPipeToShutdownCodeConstructorKind = JSC::ConstructorKind::None; -const JSC::ImplementationVisibility s_readableStreamInternalsPipeToShutdownCodeImplementationVisibility = JSC::ImplementationVisibility::Public; -const int s_readableStreamInternalsPipeToShutdownCodeLength = 648; -static const JSC::Intrinsic s_readableStreamInternalsPipeToShutdownCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_readableStreamInternalsPipeToShutdownCode = "(function (pipeState) {\"use strict\";\n if (pipeState.shuttingDown)\n return;\n pipeState.shuttingDown = !0;\n const hasError = arguments.length > 1, error = arguments[1], finalize = () => {\n if (hasError)\n @pipeToFinalize(pipeState, error);\n else\n @pipeToFinalize(pipeState);\n };\n if (@getByIdDirectPrivate(pipeState.destination, \"state\") === \"writable\" && !@writableStreamCloseQueuedOrInFlight(pipeState.destination)) {\n pipeState.pendingReadPromiseCapability.promise.@then(() => {\n pipeState.pendingWritePromise.@then(finalize, finalize);\n }, (e) => @pipeToFinalize(pipeState, e));\n return;\n }\n finalize();\n})\n"; +// readUInt8 +const JSC::ConstructAbility s_jsBufferPrototypeReadUInt8CodeConstructAbility = JSC::ConstructAbility::CannotConstruct; +const JSC::ConstructorKind s_jsBufferPrototypeReadUInt8CodeConstructorKind = JSC::ConstructorKind::None; +const JSC::ImplementationVisibility s_jsBufferPrototypeReadUInt8CodeImplementationVisibility = JSC::ImplementationVisibility::Public; +const int s_jsBufferPrototypeReadUInt8CodeLength = 145; +static const JSC::Intrinsic s_jsBufferPrototypeReadUInt8CodeIntrinsic = JSC::NoIntrinsic; +const char* const s_jsBufferPrototypeReadUInt8Code = "(function (offset) {\"use strict\";\n return (this.@dataView ||= new DataView(this.buffer, this.byteOffset, this.byteLength)).getUint8(offset);\n})\n"; -// pipeToFinalize -const JSC::ConstructAbility s_readableStreamInternalsPipeToFinalizeCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; -const JSC::ConstructorKind s_readableStreamInternalsPipeToFinalizeCodeConstructorKind = JSC::ConstructorKind::None; -const JSC::ImplementationVisibility s_readableStreamInternalsPipeToFinalizeCodeImplementationVisibility = JSC::ImplementationVisibility::Public; -const int s_readableStreamInternalsPipeToFinalizeCodeLength = 332; -static const JSC::Intrinsic s_readableStreamInternalsPipeToFinalizeCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_readableStreamInternalsPipeToFinalizeCode = "(function (pipeState) {\"use strict\";\n if (@writableStreamDefaultWriterRelease(pipeState.writer), @readableStreamReaderGenericRelease(pipeState.reader), pipeState.finalized = !0, arguments.length > 1)\n pipeState.promiseCapability.reject.@call(@undefined, arguments[1]);\n else\n pipeState.promiseCapability.resolve.@call();\n})\n"; +// readInt16LE +const JSC::ConstructAbility s_jsBufferPrototypeReadInt16LECodeConstructAbility = JSC::ConstructAbility::CannotConstruct; +const JSC::ConstructorKind s_jsBufferPrototypeReadInt16LECodeConstructorKind = JSC::ConstructorKind::None; +const JSC::ImplementationVisibility s_jsBufferPrototypeReadInt16LECodeImplementationVisibility = JSC::ImplementationVisibility::Public; +const int s_jsBufferPrototypeReadInt16LECodeLength = 149; +static const JSC::Intrinsic s_jsBufferPrototypeReadInt16LECodeIntrinsic = JSC::NoIntrinsic; +const char* const s_jsBufferPrototypeReadInt16LECode = "(function (offset) {\"use strict\";\n return (this.@dataView ||= new DataView(this.buffer, this.byteOffset, this.byteLength)).getInt16(offset, !0);\n})\n"; -// readableStreamTee -const JSC::ConstructAbility s_readableStreamInternalsReadableStreamTeeCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; -const JSC::ConstructorKind s_readableStreamInternalsReadableStreamTeeCodeConstructorKind = JSC::ConstructorKind::None; -const JSC::ImplementationVisibility s_readableStreamInternalsReadableStreamTeeCodeImplementationVisibility = JSC::ImplementationVisibility::Public; -const int s_readableStreamInternalsReadableStreamTeeCodeLength = 1545; -static const JSC::Intrinsic s_readableStreamInternalsReadableStreamTeeCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_readableStreamInternalsReadableStreamTeeCode = "(function (stream, shouldClone) {\"use strict\";\n var start_ = @getByIdDirectPrivate(stream, \"start\");\n if (start_)\n @putByIdDirectPrivate(stream, \"start\", @undefined), start_();\n const reader = new @ReadableStreamDefaultReader(stream), teeState = {\n closedOrErrored: !1,\n canceled1: !1,\n canceled2: !1,\n reason1: @undefined,\n reason2: @undefined\n };\n teeState.cancelPromiseCapability = @newPromiseCapability(@Promise);\n const pullFunction = @readableStreamTeePullFunction(teeState, reader, shouldClone), branch1Source = {};\n @putByIdDirectPrivate(branch1Source, \"pull\", pullFunction), @putByIdDirectPrivate(branch1Source, \"cancel\", @readableStreamTeeBranch1CancelFunction(teeState, stream));\n const branch2Source = {};\n @putByIdDirectPrivate(branch2Source, \"pull\", pullFunction), @putByIdDirectPrivate(branch2Source, \"cancel\", @readableStreamTeeBranch2CancelFunction(teeState, stream));\n const branch1 = new @ReadableStream(branch1Source), branch2 = new @ReadableStream(branch2Source);\n return @getByIdDirectPrivate(reader, \"closedPromiseCapability\").promise.@then(@undefined, function(e) {\n if (teeState.closedOrErrored)\n return;\n if (@readableStreamDefaultControllerError(branch1.@readableStreamController, e), @readableStreamDefaultControllerError(branch2.@readableStreamController, e), teeState.closedOrErrored = !0, !teeState.canceled1 || !teeState.canceled2)\n teeState.cancelPromiseCapability.resolve.@call();\n }), teeState.branch1 = branch1, teeState.branch2 = branch2, [branch1, branch2];\n})\n"; +// readInt16BE +const JSC::ConstructAbility s_jsBufferPrototypeReadInt16BECodeConstructAbility = JSC::ConstructAbility::CannotConstruct; +const JSC::ConstructorKind s_jsBufferPrototypeReadInt16BECodeConstructorKind = JSC::ConstructorKind::None; +const JSC::ImplementationVisibility s_jsBufferPrototypeReadInt16BECodeImplementationVisibility = JSC::ImplementationVisibility::Public; +const int s_jsBufferPrototypeReadInt16BECodeLength = 149; +static const JSC::Intrinsic s_jsBufferPrototypeReadInt16BECodeIntrinsic = JSC::NoIntrinsic; +const char* const s_jsBufferPrototypeReadInt16BECode = "(function (offset) {\"use strict\";\n return (this.@dataView ||= new DataView(this.buffer, this.byteOffset, this.byteLength)).getInt16(offset, !1);\n})\n"; -// readableStreamTeePullFunction -const JSC::ConstructAbility s_readableStreamInternalsReadableStreamTeePullFunctionCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; -const JSC::ConstructorKind s_readableStreamInternalsReadableStreamTeePullFunctionCodeConstructorKind = JSC::ConstructorKind::None; -const JSC::ImplementationVisibility s_readableStreamInternalsReadableStreamTeePullFunctionCodeImplementationVisibility = JSC::ImplementationVisibility::Public; -const int s_readableStreamInternalsReadableStreamTeePullFunctionCodeLength = 1036; -static const JSC::Intrinsic s_readableStreamInternalsReadableStreamTeePullFunctionCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_readableStreamInternalsReadableStreamTeePullFunctionCode = "(function (teeState, reader, shouldClone) {\"use strict\";\n return function() {\n @Promise.prototype.@then.@call(@readableStreamDefaultReaderRead(reader), function(result) {\n if (result.done && !teeState.closedOrErrored) {\n if (!teeState.canceled1)\n @readableStreamDefaultControllerClose(teeState.branch1.@readableStreamController);\n if (!teeState.canceled2)\n @readableStreamDefaultControllerClose(teeState.branch2.@readableStreamController);\n if (teeState.closedOrErrored = !0, !teeState.canceled1 || !teeState.canceled2)\n teeState.cancelPromiseCapability.resolve.@call();\n }\n if (teeState.closedOrErrored)\n return;\n if (!teeState.canceled1)\n @readableStreamDefaultControllerEnqueue(teeState.branch1.@readableStreamController, result.value);\n if (!teeState.canceled2)\n @readableStreamDefaultControllerEnqueue(teeState.branch2.@readableStreamController, shouldClone \? @structuredCloneForStream(result.value) : result.value);\n });\n };\n})\n"; +// readUInt16LE +const JSC::ConstructAbility s_jsBufferPrototypeReadUInt16LECodeConstructAbility = JSC::ConstructAbility::CannotConstruct; +const JSC::ConstructorKind s_jsBufferPrototypeReadUInt16LECodeConstructorKind = JSC::ConstructorKind::None; +const JSC::ImplementationVisibility s_jsBufferPrototypeReadUInt16LECodeImplementationVisibility = JSC::ImplementationVisibility::Public; +const int s_jsBufferPrototypeReadUInt16LECodeLength = 150; +static const JSC::Intrinsic s_jsBufferPrototypeReadUInt16LECodeIntrinsic = JSC::NoIntrinsic; +const char* const s_jsBufferPrototypeReadUInt16LECode = "(function (offset) {\"use strict\";\n return (this.@dataView ||= new DataView(this.buffer, this.byteOffset, this.byteLength)).getUint16(offset, !0);\n})\n"; -// readableStreamTeeBranch1CancelFunction -const JSC::ConstructAbility s_readableStreamInternalsReadableStreamTeeBranch1CancelFunctionCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; -const JSC::ConstructorKind s_readableStreamInternalsReadableStreamTeeBranch1CancelFunctionCodeConstructorKind = JSC::ConstructorKind::None; -const JSC::ImplementationVisibility s_readableStreamInternalsReadableStreamTeeBranch1CancelFunctionCodeImplementationVisibility = JSC::ImplementationVisibility::Public; -const int s_readableStreamInternalsReadableStreamTeeBranch1CancelFunctionCodeLength = 369; -static const JSC::Intrinsic s_readableStreamInternalsReadableStreamTeeBranch1CancelFunctionCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_readableStreamInternalsReadableStreamTeeBranch1CancelFunctionCode = "(function (teeState, stream) {\"use strict\";\n return function(r) {\n if (teeState.canceled1 = !0, teeState.reason1 = r, teeState.canceled2)\n @readableStreamCancel(stream, [teeState.reason1, teeState.reason2]).@then(teeState.cancelPromiseCapability.@resolve, teeState.cancelPromiseCapability.@reject);\n return teeState.cancelPromiseCapability.promise;\n };\n})\n"; +// readUInt16BE +const JSC::ConstructAbility s_jsBufferPrototypeReadUInt16BECodeConstructAbility = JSC::ConstructAbility::CannotConstruct; +const JSC::ConstructorKind s_jsBufferPrototypeReadUInt16BECodeConstructorKind = JSC::ConstructorKind::None; +const JSC::ImplementationVisibility s_jsBufferPrototypeReadUInt16BECodeImplementationVisibility = JSC::ImplementationVisibility::Public; +const int s_jsBufferPrototypeReadUInt16BECodeLength = 150; +static const JSC::Intrinsic s_jsBufferPrototypeReadUInt16BECodeIntrinsic = JSC::NoIntrinsic; +const char* const s_jsBufferPrototypeReadUInt16BECode = "(function (offset) {\"use strict\";\n return (this.@dataView ||= new DataView(this.buffer, this.byteOffset, this.byteLength)).getUint16(offset, !1);\n})\n"; -// readableStreamTeeBranch2CancelFunction -const JSC::ConstructAbility s_readableStreamInternalsReadableStreamTeeBranch2CancelFunctionCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; -const JSC::ConstructorKind s_readableStreamInternalsReadableStreamTeeBranch2CancelFunctionCodeConstructorKind = JSC::ConstructorKind::None; -const JSC::ImplementationVisibility s_readableStreamInternalsReadableStreamTeeBranch2CancelFunctionCodeImplementationVisibility = JSC::ImplementationVisibility::Public; -const int s_readableStreamInternalsReadableStreamTeeBranch2CancelFunctionCodeLength = 369; -static const JSC::Intrinsic s_readableStreamInternalsReadableStreamTeeBranch2CancelFunctionCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_readableStreamInternalsReadableStreamTeeBranch2CancelFunctionCode = "(function (teeState, stream) {\"use strict\";\n return function(r) {\n if (teeState.canceled2 = !0, teeState.reason2 = r, teeState.canceled1)\n @readableStreamCancel(stream, [teeState.reason1, teeState.reason2]).@then(teeState.cancelPromiseCapability.@resolve, teeState.cancelPromiseCapability.@reject);\n return teeState.cancelPromiseCapability.promise;\n };\n})\n"; +// readInt32LE +const JSC::ConstructAbility s_jsBufferPrototypeReadInt32LECodeConstructAbility = JSC::ConstructAbility::CannotConstruct; +const JSC::ConstructorKind s_jsBufferPrototypeReadInt32LECodeConstructorKind = JSC::ConstructorKind::None; +const JSC::ImplementationVisibility s_jsBufferPrototypeReadInt32LECodeImplementationVisibility = JSC::ImplementationVisibility::Public; +const int s_jsBufferPrototypeReadInt32LECodeLength = 149; +static const JSC::Intrinsic s_jsBufferPrototypeReadInt32LECodeIntrinsic = JSC::NoIntrinsic; +const char* const s_jsBufferPrototypeReadInt32LECode = "(function (offset) {\"use strict\";\n return (this.@dataView ||= new DataView(this.buffer, this.byteOffset, this.byteLength)).getInt32(offset, !0);\n})\n"; -// isReadableStream -const JSC::ConstructAbility s_readableStreamInternalsIsReadableStreamCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; -const JSC::ConstructorKind s_readableStreamInternalsIsReadableStreamCodeConstructorKind = JSC::ConstructorKind::None; -const JSC::ImplementationVisibility s_readableStreamInternalsIsReadableStreamCodeImplementationVisibility = JSC::ImplementationVisibility::Public; -const int s_readableStreamInternalsIsReadableStreamCodeLength = 141; -static const JSC::Intrinsic s_readableStreamInternalsIsReadableStreamCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_readableStreamInternalsIsReadableStreamCode = "(function (stream) {\"use strict\";\n return @isObject(stream) && @getByIdDirectPrivate(stream, \"readableStreamController\") !== @undefined;\n})\n"; +// readInt32BE +const JSC::ConstructAbility s_jsBufferPrototypeReadInt32BECodeConstructAbility = JSC::ConstructAbility::CannotConstruct; +const JSC::ConstructorKind s_jsBufferPrototypeReadInt32BECodeConstructorKind = JSC::ConstructorKind::None; +const JSC::ImplementationVisibility s_jsBufferPrototypeReadInt32BECodeImplementationVisibility = JSC::ImplementationVisibility::Public; +const int s_jsBufferPrototypeReadInt32BECodeLength = 149; +static const JSC::Intrinsic s_jsBufferPrototypeReadInt32BECodeIntrinsic = JSC::NoIntrinsic; +const char* const s_jsBufferPrototypeReadInt32BECode = "(function (offset) {\"use strict\";\n return (this.@dataView ||= new DataView(this.buffer, this.byteOffset, this.byteLength)).getInt32(offset, !1);\n})\n"; -// isReadableStreamDefaultReader -const JSC::ConstructAbility s_readableStreamInternalsIsReadableStreamDefaultReaderCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; -const JSC::ConstructorKind s_readableStreamInternalsIsReadableStreamDefaultReaderCodeConstructorKind = JSC::ConstructorKind::None; -const JSC::ImplementationVisibility s_readableStreamInternalsIsReadableStreamDefaultReaderCodeImplementationVisibility = JSC::ImplementationVisibility::Public; -const int s_readableStreamInternalsIsReadableStreamDefaultReaderCodeLength = 116; -static const JSC::Intrinsic s_readableStreamInternalsIsReadableStreamDefaultReaderCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_readableStreamInternalsIsReadableStreamDefaultReaderCode = "(function (reader) {\"use strict\";\n return @isObject(reader) && !!@getByIdDirectPrivate(reader, \"readRequests\");\n})\n"; +// readUInt32LE +const JSC::ConstructAbility s_jsBufferPrototypeReadUInt32LECodeConstructAbility = JSC::ConstructAbility::CannotConstruct; +const JSC::ConstructorKind s_jsBufferPrototypeReadUInt32LECodeConstructorKind = JSC::ConstructorKind::None; +const JSC::ImplementationVisibility s_jsBufferPrototypeReadUInt32LECodeImplementationVisibility = JSC::ImplementationVisibility::Public; +const int s_jsBufferPrototypeReadUInt32LECodeLength = 150; +static const JSC::Intrinsic s_jsBufferPrototypeReadUInt32LECodeIntrinsic = JSC::NoIntrinsic; +const char* const s_jsBufferPrototypeReadUInt32LECode = "(function (offset) {\"use strict\";\n return (this.@dataView ||= new DataView(this.buffer, this.byteOffset, this.byteLength)).getUint32(offset, !0);\n})\n"; -// isReadableStreamDefaultController -const JSC::ConstructAbility s_readableStreamInternalsIsReadableStreamDefaultControllerCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; -const JSC::ConstructorKind s_readableStreamInternalsIsReadableStreamDefaultControllerCodeConstructorKind = JSC::ConstructorKind::None; -const JSC::ImplementationVisibility s_readableStreamInternalsIsReadableStreamDefaultControllerCodeImplementationVisibility = JSC::ImplementationVisibility::Public; -const int s_readableStreamInternalsIsReadableStreamDefaultControllerCodeLength = 132; -static const JSC::Intrinsic s_readableStreamInternalsIsReadableStreamDefaultControllerCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_readableStreamInternalsIsReadableStreamDefaultControllerCode = "(function (controller) {\"use strict\";\n return @isObject(controller) && !!@getByIdDirectPrivate(controller, \"underlyingSource\");\n})\n"; +// readUInt32BE +const JSC::ConstructAbility s_jsBufferPrototypeReadUInt32BECodeConstructAbility = JSC::ConstructAbility::CannotConstruct; +const JSC::ConstructorKind s_jsBufferPrototypeReadUInt32BECodeConstructorKind = JSC::ConstructorKind::None; +const JSC::ImplementationVisibility s_jsBufferPrototypeReadUInt32BECodeImplementationVisibility = JSC::ImplementationVisibility::Public; +const int s_jsBufferPrototypeReadUInt32BECodeLength = 150; +static const JSC::Intrinsic s_jsBufferPrototypeReadUInt32BECodeIntrinsic = JSC::NoIntrinsic; +const char* const s_jsBufferPrototypeReadUInt32BECode = "(function (offset) {\"use strict\";\n return (this.@dataView ||= new DataView(this.buffer, this.byteOffset, this.byteLength)).getUint32(offset, !1);\n})\n"; -// readDirectStream -const JSC::ConstructAbility s_readableStreamInternalsReadDirectStreamCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; -const JSC::ConstructorKind s_readableStreamInternalsReadDirectStreamCodeConstructorKind = JSC::ConstructorKind::None; -const JSC::ImplementationVisibility s_readableStreamInternalsReadDirectStreamCodeImplementationVisibility = JSC::ImplementationVisibility::Public; -const int s_readableStreamInternalsReadDirectStreamCodeLength = 1518; -static const JSC::Intrinsic s_readableStreamInternalsReadDirectStreamCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_readableStreamInternalsReadDirectStreamCode = "(function (stream, sink, underlyingSource) {\"use strict\";\n @putByIdDirectPrivate(stream, \"underlyingSource\", @undefined), @putByIdDirectPrivate(stream, \"start\", @undefined);\n function close(stream2, reason) {\n if (reason && underlyingSource\?.cancel) {\n try {\n var prom = underlyingSource.cancel(reason);\n @markPromiseAsHandled(prom);\n } catch (e) {\n }\n underlyingSource = @undefined;\n }\n if (stream2) {\n if (@putByIdDirectPrivate(stream2, \"readableStreamController\", @undefined), @putByIdDirectPrivate(stream2, \"reader\", @undefined), reason)\n @putByIdDirectPrivate(stream2, \"state\", 3), @putByIdDirectPrivate(stream2, \"storedError\", reason);\n else\n @putByIdDirectPrivate(stream2, \"state\", 1);\n stream2 = @undefined;\n }\n }\n if (!underlyingSource.pull) {\n close();\n return;\n }\n if (!@isCallable(underlyingSource.pull)) {\n close(), @throwTypeError(\"pull is not a function\");\n return;\n }\n @putByIdDirectPrivate(stream, \"readableStreamController\", sink);\n const highWaterMark = @getByIdDirectPrivate(stream, \"highWaterMark\");\n sink.start({\n highWaterMark: !highWaterMark || highWaterMark < 64 \? 64 : highWaterMark\n }), @startDirectStream.@call(sink, stream, underlyingSource.pull, close, stream.@asyncContext), @putByIdDirectPrivate(stream, \"reader\", {});\n var maybePromise = underlyingSource.pull(sink);\n if (sink = @undefined, maybePromise && @isPromise(maybePromise))\n return maybePromise.@then(() => {\n });\n})\n"; +// readIntLE +const JSC::ConstructAbility s_jsBufferPrototypeReadIntLECodeConstructAbility = JSC::ConstructAbility::CannotConstruct; +const JSC::ConstructorKind s_jsBufferPrototypeReadIntLECodeConstructorKind = JSC::ConstructorKind::None; +const JSC::ImplementationVisibility s_jsBufferPrototypeReadIntLECodeImplementationVisibility = JSC::ImplementationVisibility::Public; +const int s_jsBufferPrototypeReadIntLECodeLength = 838; +static const JSC::Intrinsic s_jsBufferPrototypeReadIntLECodeIntrinsic = JSC::NoIntrinsic; +const char* const s_jsBufferPrototypeReadIntLECode = "(function (offset, byteLength) {\"use strict\";\n const view = this.@dataView ||= new DataView(this.buffer, this.byteOffset, this.byteLength);\n switch (byteLength) {\n case 1:\n return view.getInt8(offset);\n case 2:\n return view.getInt16(offset, !0);\n case 3: {\n const val = view.getUint16(offset, !0) + view.getUint8(offset + 2) * 65536;\n return val | (val & 8388608) * 510;\n }\n case 4:\n return view.getInt32(offset, !0);\n case 5: {\n const last = view.getUint8(offset + 4);\n return (last | (last & 128) * 33554430) * 4294967296 + view.getUint32(offset, !0);\n }\n case 6: {\n const last = view.getUint16(offset + 4, !0);\n return (last | (last & 32768) * 131070) * 4294967296 + view.getUint32(offset, !0);\n }\n }\n @throwRangeError(\"byteLength must be >= 1 and <= 6\");\n})\n"; -// assignToStream -const JSC::ConstructAbility s_readableStreamInternalsAssignToStreamCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; -const JSC::ConstructorKind s_readableStreamInternalsAssignToStreamCodeConstructorKind = JSC::ConstructorKind::None; -const JSC::ImplementationVisibility s_readableStreamInternalsAssignToStreamCodeImplementationVisibility = JSC::ImplementationVisibility::Private; -const int s_readableStreamInternalsAssignToStreamCodeLength = 397; -static const JSC::Intrinsic s_readableStreamInternalsAssignToStreamCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_readableStreamInternalsAssignToStreamCode = "(function (stream, sink) {\"use strict\";\n var underlyingSource = @getByIdDirectPrivate(stream, \"underlyingSource\");\n if (underlyingSource)\n try {\n return @readDirectStream(stream, sink, underlyingSource);\n } catch (e) {\n throw e;\n } finally {\n underlyingSource = @undefined, stream = @undefined, sink = @undefined;\n }\n return @readStreamIntoSink(stream, sink, !0);\n})\n"; +// readIntBE +const JSC::ConstructAbility s_jsBufferPrototypeReadIntBECodeConstructAbility = JSC::ConstructAbility::CannotConstruct; +const JSC::ConstructorKind s_jsBufferPrototypeReadIntBECodeConstructorKind = JSC::ConstructorKind::None; +const JSC::ImplementationVisibility s_jsBufferPrototypeReadIntBECodeImplementationVisibility = JSC::ImplementationVisibility::Public; +const int s_jsBufferPrototypeReadIntBECodeLength = 838; +static const JSC::Intrinsic s_jsBufferPrototypeReadIntBECodeIntrinsic = JSC::NoIntrinsic; +const char* const s_jsBufferPrototypeReadIntBECode = "(function (offset, byteLength) {\"use strict\";\n const view = this.@dataView ||= new DataView(this.buffer, this.byteOffset, this.byteLength);\n switch (byteLength) {\n case 1:\n return view.getInt8(offset);\n case 2:\n return view.getInt16(offset, !1);\n case 3: {\n const val = view.getUint16(offset + 1, !1) + view.getUint8(offset) * 65536;\n return val | (val & 8388608) * 510;\n }\n case 4:\n return view.getInt32(offset, !1);\n case 5: {\n const last = view.getUint8(offset);\n return (last | (last & 128) * 33554430) * 4294967296 + view.getUint32(offset + 1, !1);\n }\n case 6: {\n const last = view.getUint16(offset, !1);\n return (last | (last & 32768) * 131070) * 4294967296 + view.getUint32(offset + 2, !1);\n }\n }\n @throwRangeError(\"byteLength must be >= 1 and <= 6\");\n})\n"; -// readStreamIntoSink -const JSC::ConstructAbility s_readableStreamInternalsReadStreamIntoSinkCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; -const JSC::ConstructorKind s_readableStreamInternalsReadStreamIntoSinkCodeConstructorKind = JSC::ConstructorKind::None; -const JSC::ImplementationVisibility s_readableStreamInternalsReadStreamIntoSinkCodeImplementationVisibility = JSC::ImplementationVisibility::Public; -const int s_readableStreamInternalsReadStreamIntoSinkCodeLength = 2487; -static const JSC::Intrinsic s_readableStreamInternalsReadStreamIntoSinkCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_readableStreamInternalsReadStreamIntoSinkCode = "(async function (stream, sink, isNative) {\"use strict\";\n var didClose = !1, didThrow = !1;\n try {\n var reader = stream.getReader(), many = reader.readMany();\n if (many && @isPromise(many))\n many = await many;\n if (many.done)\n return didClose = !0, sink.end();\n var wroteCount = many.value.length;\n const highWaterMark = @getByIdDirectPrivate(stream, \"highWaterMark\");\n if (isNative)\n @startDirectStream.@call(sink, stream, @undefined, () => !didThrow && @markPromiseAsHandled(stream.cancel()), stream.@asyncContext);\n sink.start({ highWaterMark: highWaterMark || 0 });\n for (var i = 0, values = many.value, length = many.value.length;i < length; i++)\n sink.write(values[i]);\n var streamState = @getByIdDirectPrivate(stream, \"state\");\n if (streamState === 1)\n return didClose = !0, sink.end();\n while (!0) {\n var { value, done } = await reader.read();\n if (done)\n return didClose = !0, sink.end();\n sink.write(value);\n }\n } catch (e) {\n didThrow = !0;\n try {\n reader = @undefined;\n const prom = stream.cancel(e);\n @markPromiseAsHandled(prom);\n } catch (j) {\n }\n if (sink && !didClose) {\n didClose = !0;\n try {\n sink.close(e);\n } catch (j) {\n throw new globalThis.AggregateError([e, j]);\n }\n }\n throw e;\n } finally {\n if (reader) {\n try {\n reader.releaseLock();\n } catch (e) {\n }\n reader = @undefined;\n }\n sink = @undefined;\n var streamState = @getByIdDirectPrivate(stream, \"state\");\n if (stream) {\n var readableStreamController = @getByIdDirectPrivate(stream, \"readableStreamController\");\n if (readableStreamController) {\n if (@getByIdDirectPrivate(readableStreamController, \"underlyingSource\"))\n @putByIdDirectPrivate(readableStreamController, \"underlyingSource\", @undefined);\n if (@getByIdDirectPrivate(readableStreamController, \"controlledReadableStream\"))\n @putByIdDirectPrivate(readableStreamController, \"controlledReadableStream\", @undefined);\n if (@putByIdDirectPrivate(stream, \"readableStreamController\", null), @getByIdDirectPrivate(stream, \"underlyingSource\"))\n @putByIdDirectPrivate(stream, \"underlyingSource\", @undefined);\n readableStreamController = @undefined;\n }\n if (!didThrow && streamState !== 1 && streamState !== 3)\n @readableStreamClose(stream);\n stream = @undefined;\n }\n }\n})\n"; +// readUIntLE +const JSC::ConstructAbility s_jsBufferPrototypeReadUIntLECodeConstructAbility = JSC::ConstructAbility::CannotConstruct; +const JSC::ConstructorKind s_jsBufferPrototypeReadUIntLECodeConstructorKind = JSC::ConstructorKind::None; +const JSC::ImplementationVisibility s_jsBufferPrototypeReadUIntLECodeImplementationVisibility = JSC::ImplementationVisibility::Public; +const int s_jsBufferPrototypeReadUIntLECodeLength = 664; +static const JSC::Intrinsic s_jsBufferPrototypeReadUIntLECodeIntrinsic = JSC::NoIntrinsic; +const char* const s_jsBufferPrototypeReadUIntLECode = "(function (offset, byteLength) {\"use strict\";\n const view = this.@dataView ||= new DataView(this.buffer, this.byteOffset, this.byteLength);\n switch (byteLength) {\n case 1:\n return view.getUint8(offset);\n case 2:\n return view.getUint16(offset, !0);\n case 3:\n return view.getUint16(offset, !0) + view.getUint8(offset + 2) * 65536;\n case 4:\n return view.getUint32(offset, !0);\n case 5:\n return view.getUint8(offset + 4) * 4294967296 + view.getUint32(offset, !0);\n case 6:\n return view.getUint16(offset + 4, !0) * 4294967296 + view.getUint32(offset, !0);\n }\n @throwRangeError(\"byteLength must be >= 1 and <= 6\");\n})\n"; -// handleDirectStreamError -const JSC::ConstructAbility s_readableStreamInternalsHandleDirectStreamErrorCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; -const JSC::ConstructorKind s_readableStreamInternalsHandleDirectStreamErrorCodeConstructorKind = JSC::ConstructorKind::None; -const JSC::ImplementationVisibility s_readableStreamInternalsHandleDirectStreamErrorCodeImplementationVisibility = JSC::ImplementationVisibility::Public; -const int s_readableStreamInternalsHandleDirectStreamErrorCodeLength = 735; -static const JSC::Intrinsic s_readableStreamInternalsHandleDirectStreamErrorCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_readableStreamInternalsHandleDirectStreamErrorCode = "(function (e) {\"use strict\";\n var controller = this, sink = controller.@sink;\n if (sink) {\n @putByIdDirectPrivate(controller, \"sink\", @undefined);\n try {\n sink.close(e);\n } catch (f) {\n }\n }\n if (this.error = this.flush = this.write = this.close = this.end = @onReadableStreamDirectControllerClosed, typeof this.@underlyingSource.close === \"function\")\n try {\n this.@underlyingSource.close.@call(this.@underlyingSource, e);\n } catch (e2) {\n }\n try {\n var pend = controller._pendingRead;\n if (pend)\n controller._pendingRead = @undefined, @rejectPromise(pend, e);\n } catch (f) {\n }\n var stream = controller.@controlledReadableStream;\n if (stream)\n @readableStreamError(stream, e);\n})\n"; +// readUIntBE +const JSC::ConstructAbility s_jsBufferPrototypeReadUIntBECodeConstructAbility = JSC::ConstructAbility::CannotConstruct; +const JSC::ConstructorKind s_jsBufferPrototypeReadUIntBECodeConstructorKind = JSC::ConstructorKind::None; +const JSC::ImplementationVisibility s_jsBufferPrototypeReadUIntBECodeImplementationVisibility = JSC::ImplementationVisibility::Public; +const int s_jsBufferPrototypeReadUIntBECodeLength = 786; +static const JSC::Intrinsic s_jsBufferPrototypeReadUIntBECodeIntrinsic = JSC::NoIntrinsic; +const char* const s_jsBufferPrototypeReadUIntBECode = "(function (offset, byteLength) {\"use strict\";\n const view = this.@dataView ||= new DataView(this.buffer, this.byteOffset, this.byteLength);\n switch (byteLength) {\n case 1:\n return view.getUint8(offset);\n case 2:\n return view.getUint16(offset, !1);\n case 3:\n return view.getUint16(offset + 1, !1) + view.getUint8(offset) * 65536;\n case 4:\n return view.getUint32(offset, !1);\n case 5: {\n const last = view.getUint8(offset);\n return (last | (last & 128) * 33554430) * 4294967296 + view.getUint32(offset + 1, !1);\n }\n case 6: {\n const last = view.getUint16(offset, !1);\n return (last | (last & 32768) * 131070) * 4294967296 + view.getUint32(offset + 2, !1);\n }\n }\n @throwRangeError(\"byteLength must be >= 1 and <= 6\");\n})\n"; -// handleDirectStreamErrorReject -const JSC::ConstructAbility s_readableStreamInternalsHandleDirectStreamErrorRejectCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; -const JSC::ConstructorKind s_readableStreamInternalsHandleDirectStreamErrorRejectCodeConstructorKind = JSC::ConstructorKind::None; -const JSC::ImplementationVisibility s_readableStreamInternalsHandleDirectStreamErrorRejectCodeImplementationVisibility = JSC::ImplementationVisibility::Public; -const int s_readableStreamInternalsHandleDirectStreamErrorRejectCodeLength = 103; -static const JSC::Intrinsic s_readableStreamInternalsHandleDirectStreamErrorRejectCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_readableStreamInternalsHandleDirectStreamErrorRejectCode = "(function (e) {\"use strict\";\n return @handleDirectStreamError.@call(this, e), @Promise.@reject(e);\n})\n"; +// readFloatLE +const JSC::ConstructAbility s_jsBufferPrototypeReadFloatLECodeConstructAbility = JSC::ConstructAbility::CannotConstruct; +const JSC::ConstructorKind s_jsBufferPrototypeReadFloatLECodeConstructorKind = JSC::ConstructorKind::None; +const JSC::ImplementationVisibility s_jsBufferPrototypeReadFloatLECodeImplementationVisibility = JSC::ImplementationVisibility::Public; +const int s_jsBufferPrototypeReadFloatLECodeLength = 151; +static const JSC::Intrinsic s_jsBufferPrototypeReadFloatLECodeIntrinsic = JSC::NoIntrinsic; +const char* const s_jsBufferPrototypeReadFloatLECode = "(function (offset) {\"use strict\";\n return (this.@dataView ||= new DataView(this.buffer, this.byteOffset, this.byteLength)).getFloat32(offset, !0);\n})\n"; -// onPullDirectStream -const JSC::ConstructAbility s_readableStreamInternalsOnPullDirectStreamCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; -const JSC::ConstructorKind s_readableStreamInternalsOnPullDirectStreamCodeConstructorKind = JSC::ConstructorKind::None; -const JSC::ImplementationVisibility s_readableStreamInternalsOnPullDirectStreamCodeImplementationVisibility = JSC::ImplementationVisibility::Public; -const int s_readableStreamInternalsOnPullDirectStreamCodeLength = 1586; -static const JSC::Intrinsic s_readableStreamInternalsOnPullDirectStreamCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_readableStreamInternalsOnPullDirectStreamCode = "(function (controller) {\"use strict\";\n var stream = controller.@controlledReadableStream;\n if (!stream || @getByIdDirectPrivate(stream, \"state\") !== 4)\n return;\n if (controller._deferClose === -1)\n return;\n controller._deferClose = -1, controller._deferFlush = -1;\n var deferClose, deferFlush, asyncContext = stream.@asyncContext;\n if (asyncContext) {\n var prev = @getInternalField(@asyncContext, 0);\n @putInternalField(@asyncContext, 0, asyncContext);\n }\n try {\n var result = controller.@underlyingSource.pull(controller);\n if (result && @isPromise(result)) {\n if (controller._handleError === @undefined)\n controller._handleError = @handleDirectStreamErrorReject.bind(controller);\n @Promise.prototype.catch.@call(result, controller._handleError);\n }\n } catch (e) {\n return @handleDirectStreamErrorReject.@call(controller, e);\n } finally {\n if (deferClose = controller._deferClose, deferFlush = controller._deferFlush, controller._deferFlush = controller._deferClose = 0, asyncContext)\n @putInternalField(@asyncContext, 0, prev);\n }\n var promiseToReturn;\n if (controller._pendingRead === @undefined)\n controller._pendingRead = promiseToReturn = @newPromise();\n else\n promiseToReturn = @readableStreamAddReadRequest(stream);\n if (deferClose === 1) {\n var reason = controller._deferCloseReason;\n return controller._deferCloseReason = @undefined, @onCloseDirectStream.@call(controller, reason), promiseToReturn;\n }\n if (deferFlush === 1)\n @onFlushDirectStream.@call(controller);\n return promiseToReturn;\n})\n"; +// readFloatBE +const JSC::ConstructAbility s_jsBufferPrototypeReadFloatBECodeConstructAbility = JSC::ConstructAbility::CannotConstruct; +const JSC::ConstructorKind s_jsBufferPrototypeReadFloatBECodeConstructorKind = JSC::ConstructorKind::None; +const JSC::ImplementationVisibility s_jsBufferPrototypeReadFloatBECodeImplementationVisibility = JSC::ImplementationVisibility::Public; +const int s_jsBufferPrototypeReadFloatBECodeLength = 151; +static const JSC::Intrinsic s_jsBufferPrototypeReadFloatBECodeIntrinsic = JSC::NoIntrinsic; +const char* const s_jsBufferPrototypeReadFloatBECode = "(function (offset) {\"use strict\";\n return (this.@dataView ||= new DataView(this.buffer, this.byteOffset, this.byteLength)).getFloat32(offset, !1);\n})\n"; -// noopDoneFunction -const JSC::ConstructAbility s_readableStreamInternalsNoopDoneFunctionCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; -const JSC::ConstructorKind s_readableStreamInternalsNoopDoneFunctionCodeConstructorKind = JSC::ConstructorKind::None; -const JSC::ImplementationVisibility s_readableStreamInternalsNoopDoneFunctionCodeImplementationVisibility = JSC::ImplementationVisibility::Public; -const int s_readableStreamInternalsNoopDoneFunctionCodeLength = 92; -static const JSC::Intrinsic s_readableStreamInternalsNoopDoneFunctionCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_readableStreamInternalsNoopDoneFunctionCode = "(function () {\"use strict\";\n return @Promise.@resolve({ value: @undefined, done: !0 });\n})\n"; +// readDoubleLE +const JSC::ConstructAbility s_jsBufferPrototypeReadDoubleLECodeConstructAbility = JSC::ConstructAbility::CannotConstruct; +const JSC::ConstructorKind s_jsBufferPrototypeReadDoubleLECodeConstructorKind = JSC::ConstructorKind::None; +const JSC::ImplementationVisibility s_jsBufferPrototypeReadDoubleLECodeImplementationVisibility = JSC::ImplementationVisibility::Public; +const int s_jsBufferPrototypeReadDoubleLECodeLength = 151; +static const JSC::Intrinsic s_jsBufferPrototypeReadDoubleLECodeIntrinsic = JSC::NoIntrinsic; +const char* const s_jsBufferPrototypeReadDoubleLECode = "(function (offset) {\"use strict\";\n return (this.@dataView ||= new DataView(this.buffer, this.byteOffset, this.byteLength)).getFloat64(offset, !0);\n})\n"; -// onReadableStreamDirectControllerClosed -const JSC::ConstructAbility s_readableStreamInternalsOnReadableStreamDirectControllerClosedCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; -const JSC::ConstructorKind s_readableStreamInternalsOnReadableStreamDirectControllerClosedCodeConstructorKind = JSC::ConstructorKind::None; -const JSC::ImplementationVisibility s_readableStreamInternalsOnReadableStreamDirectControllerClosedCodeImplementationVisibility = JSC::ImplementationVisibility::Public; -const int s_readableStreamInternalsOnReadableStreamDirectControllerClosedCodeLength = 104; -static const JSC::Intrinsic s_readableStreamInternalsOnReadableStreamDirectControllerClosedCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_readableStreamInternalsOnReadableStreamDirectControllerClosedCode = "(function (reason) {\"use strict\";\n @throwTypeError(\"ReadableStreamDirectController is now closed\");\n})\n"; +// readDoubleBE +const JSC::ConstructAbility s_jsBufferPrototypeReadDoubleBECodeConstructAbility = JSC::ConstructAbility::CannotConstruct; +const JSC::ConstructorKind s_jsBufferPrototypeReadDoubleBECodeConstructorKind = JSC::ConstructorKind::None; +const JSC::ImplementationVisibility s_jsBufferPrototypeReadDoubleBECodeImplementationVisibility = JSC::ImplementationVisibility::Public; +const int s_jsBufferPrototypeReadDoubleBECodeLength = 151; +static const JSC::Intrinsic s_jsBufferPrototypeReadDoubleBECodeIntrinsic = JSC::NoIntrinsic; +const char* const s_jsBufferPrototypeReadDoubleBECode = "(function (offset) {\"use strict\";\n return (this.@dataView ||= new DataView(this.buffer, this.byteOffset, this.byteLength)).getFloat64(offset, !1);\n})\n"; -// onCloseDirectStream -const JSC::ConstructAbility s_readableStreamInternalsOnCloseDirectStreamCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; -const JSC::ConstructorKind s_readableStreamInternalsOnCloseDirectStreamCodeConstructorKind = JSC::ConstructorKind::None; -const JSC::ImplementationVisibility s_readableStreamInternalsOnCloseDirectStreamCodeImplementationVisibility = JSC::ImplementationVisibility::Public; -const int s_readableStreamInternalsOnCloseDirectStreamCodeLength = 2038; -static const JSC::Intrinsic s_readableStreamInternalsOnCloseDirectStreamCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_readableStreamInternalsOnCloseDirectStreamCode = "(function (reason) {\"use strict\";\n var stream = this.@controlledReadableStream;\n if (!stream || @getByIdDirectPrivate(stream, \"state\") !== 4)\n return;\n if (this._deferClose !== 0) {\n this._deferClose = 1, this._deferCloseReason = reason;\n return;\n }\n if (@putByIdDirectPrivate(stream, \"state\", 2), typeof this.@underlyingSource.close === \"function\")\n try {\n this.@underlyingSource.close.@call(this.@underlyingSource, reason);\n } catch (e) {\n }\n var flushed;\n try {\n flushed = this.@sink.end(), @putByIdDirectPrivate(this, \"sink\", @undefined);\n } catch (e) {\n if (this._pendingRead) {\n var read = this._pendingRead;\n this._pendingRead = @undefined, @rejectPromise(read, e);\n }\n @readableStreamError(stream, e);\n return;\n }\n this.error = this.flush = this.write = this.close = this.end = @onReadableStreamDirectControllerClosed;\n var reader = @getByIdDirectPrivate(stream, \"reader\");\n if (reader && @isReadableStreamDefaultReader(reader)) {\n var _pendingRead = this._pendingRead;\n if (_pendingRead && @isPromise(_pendingRead) && flushed\?.byteLength) {\n this._pendingRead = @undefined, @fulfillPromise(_pendingRead, { value: flushed, done: !1 }), @readableStreamClose(stream);\n return;\n }\n }\n if (flushed\?.byteLength) {\n var requests = @getByIdDirectPrivate(reader, \"readRequests\");\n if (requests\?.isNotEmpty()) {\n @readableStreamFulfillReadRequest(stream, flushed, !1), @readableStreamClose(stream);\n return;\n }\n @putByIdDirectPrivate(stream, \"state\", 4), this.@pull = () => {\n var thisResult = @createFulfilledPromise({\n value: flushed,\n done: !1\n });\n return flushed = @undefined, @readableStreamClose(stream), stream = @undefined, thisResult;\n };\n } else if (this._pendingRead) {\n var read = this._pendingRead;\n this._pendingRead = @undefined, @putByIdDirectPrivate(this, \"pull\", @noopDoneFunction), @fulfillPromise(read, { value: @undefined, done: !0 });\n }\n @readableStreamClose(stream);\n})\n"; +// readBigInt64LE +const JSC::ConstructAbility s_jsBufferPrototypeReadBigInt64LECodeConstructAbility = JSC::ConstructAbility::CannotConstruct; +const JSC::ConstructorKind s_jsBufferPrototypeReadBigInt64LECodeConstructorKind = JSC::ConstructorKind::None; +const JSC::ImplementationVisibility s_jsBufferPrototypeReadBigInt64LECodeImplementationVisibility = JSC::ImplementationVisibility::Public; +const int s_jsBufferPrototypeReadBigInt64LECodeLength = 152; +static const JSC::Intrinsic s_jsBufferPrototypeReadBigInt64LECodeIntrinsic = JSC::NoIntrinsic; +const char* const s_jsBufferPrototypeReadBigInt64LECode = "(function (offset) {\"use strict\";\n return (this.@dataView ||= new DataView(this.buffer, this.byteOffset, this.byteLength)).getBigInt64(offset, !0);\n})\n"; -// onFlushDirectStream -const JSC::ConstructAbility s_readableStreamInternalsOnFlushDirectStreamCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; -const JSC::ConstructorKind s_readableStreamInternalsOnFlushDirectStreamCodeConstructorKind = JSC::ConstructorKind::None; -const JSC::ImplementationVisibility s_readableStreamInternalsOnFlushDirectStreamCodeImplementationVisibility = JSC::ImplementationVisibility::Public; -const int s_readableStreamInternalsOnFlushDirectStreamCodeLength = 848; -static const JSC::Intrinsic s_readableStreamInternalsOnFlushDirectStreamCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_readableStreamInternalsOnFlushDirectStreamCode = "(function () {\"use strict\";\n var stream = this.@controlledReadableStream, reader = @getByIdDirectPrivate(stream, \"reader\");\n if (!reader || !@isReadableStreamDefaultReader(reader))\n return;\n var _pendingRead = this._pendingRead;\n if (this._pendingRead = @undefined, _pendingRead && @isPromise(_pendingRead)) {\n var flushed = this.@sink.flush();\n if (flushed\?.byteLength)\n this._pendingRead = @getByIdDirectPrivate(stream, \"readRequests\")\?.shift(), @fulfillPromise(_pendingRead, { value: flushed, done: !1 });\n else\n this._pendingRead = _pendingRead;\n } else if (@getByIdDirectPrivate(stream, \"readRequests\")\?.isNotEmpty()) {\n var flushed = this.@sink.flush();\n if (flushed\?.byteLength)\n @readableStreamFulfillReadRequest(stream, flushed, !1);\n } else if (this._deferFlush === -1)\n this._deferFlush = 1;\n})\n"; +// readBigInt64BE +const JSC::ConstructAbility s_jsBufferPrototypeReadBigInt64BECodeConstructAbility = JSC::ConstructAbility::CannotConstruct; +const JSC::ConstructorKind s_jsBufferPrototypeReadBigInt64BECodeConstructorKind = JSC::ConstructorKind::None; +const JSC::ImplementationVisibility s_jsBufferPrototypeReadBigInt64BECodeImplementationVisibility = JSC::ImplementationVisibility::Public; +const int s_jsBufferPrototypeReadBigInt64BECodeLength = 152; +static const JSC::Intrinsic s_jsBufferPrototypeReadBigInt64BECodeIntrinsic = JSC::NoIntrinsic; +const char* const s_jsBufferPrototypeReadBigInt64BECode = "(function (offset) {\"use strict\";\n return (this.@dataView ||= new DataView(this.buffer, this.byteOffset, this.byteLength)).getBigInt64(offset, !1);\n})\n"; -// createTextStream -const JSC::ConstructAbility s_readableStreamInternalsCreateTextStreamCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; -const JSC::ConstructorKind s_readableStreamInternalsCreateTextStreamCodeConstructorKind = JSC::ConstructorKind::None; -const JSC::ImplementationVisibility s_readableStreamInternalsCreateTextStreamCodeImplementationVisibility = JSC::ImplementationVisibility::Public; -const int s_readableStreamInternalsCreateTextStreamCodeLength = 2026; -static const JSC::Intrinsic s_readableStreamInternalsCreateTextStreamCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_readableStreamInternalsCreateTextStreamCode = "(function (highWaterMark) {\"use strict\";\n var sink, array = [], hasString = !1, hasBuffer = !1, rope = \"\", estimatedLength = @toLength(0), capability = @newPromiseCapability(@Promise), calledDone = !1;\n return sink = {\n start() {\n },\n write(chunk) {\n if (typeof chunk === \"string\") {\n var chunkLength = @toLength(chunk.length);\n if (chunkLength > 0)\n rope += chunk, hasString = !0, estimatedLength += chunkLength;\n return chunkLength;\n }\n if (!chunk || !(@ArrayBuffer.@isView(chunk) || chunk instanceof @ArrayBuffer))\n @throwTypeError(\"Expected text, ArrayBuffer or ArrayBufferView\");\n const byteLength = @toLength(chunk.byteLength);\n if (byteLength > 0)\n if (hasBuffer = !0, rope.length > 0)\n @arrayPush(array, rope, chunk), rope = \"\";\n else\n @arrayPush(array, chunk);\n return estimatedLength += byteLength, byteLength;\n },\n flush() {\n return 0;\n },\n end() {\n if (calledDone)\n return \"\";\n return sink.fulfill();\n },\n fulfill() {\n calledDone = !0;\n const result = sink.finishInternal();\n return @fulfillPromise(capability.promise, result), result;\n },\n finishInternal() {\n if (!hasString && !hasBuffer)\n return \"\";\n if (hasString && !hasBuffer)\n return rope;\n if (hasBuffer && !hasString)\n return new globalThis.TextDecoder().decode(Bun.concatArrayBuffers(array));\n var arrayBufferSink = new Bun.ArrayBufferSink;\n arrayBufferSink.start({\n highWaterMark: estimatedLength,\n asUint8Array: !0\n });\n for (let item of array)\n arrayBufferSink.write(item);\n if (array.length = 0, rope.length > 0)\n arrayBufferSink.write(rope), rope = \"\";\n return new globalThis.TextDecoder().decode(arrayBufferSink.end());\n },\n close() {\n try {\n if (!calledDone)\n calledDone = !0, sink.fulfill();\n } catch (e) {\n }\n }\n }, [sink, capability];\n})\n"; +// readBigUInt64LE +const JSC::ConstructAbility s_jsBufferPrototypeReadBigUInt64LECodeConstructAbility = JSC::ConstructAbility::CannotConstruct; +const JSC::ConstructorKind s_jsBufferPrototypeReadBigUInt64LECodeConstructorKind = JSC::ConstructorKind::None; +const JSC::ImplementationVisibility s_jsBufferPrototypeReadBigUInt64LECodeImplementationVisibility = JSC::ImplementationVisibility::Public; +const int s_jsBufferPrototypeReadBigUInt64LECodeLength = 153; +static const JSC::Intrinsic s_jsBufferPrototypeReadBigUInt64LECodeIntrinsic = JSC::NoIntrinsic; +const char* const s_jsBufferPrototypeReadBigUInt64LECode = "(function (offset) {\"use strict\";\n return (this.@dataView ||= new DataView(this.buffer, this.byteOffset, this.byteLength)).getBigUint64(offset, !0);\n})\n"; -// initializeTextStream -const JSC::ConstructAbility s_readableStreamInternalsInitializeTextStreamCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; -const JSC::ConstructorKind s_readableStreamInternalsInitializeTextStreamCodeConstructorKind = JSC::ConstructorKind::None; -const JSC::ImplementationVisibility s_readableStreamInternalsInitializeTextStreamCodeImplementationVisibility = JSC::ImplementationVisibility::Public; -const int s_readableStreamInternalsInitializeTextStreamCodeLength = 804; -static const JSC::Intrinsic s_readableStreamInternalsInitializeTextStreamCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_readableStreamInternalsInitializeTextStreamCode = "(function (underlyingSource, highWaterMark) {\"use strict\";\n var [sink, closingPromise] = @createTextStream(highWaterMark), controller = {\n @underlyingSource: underlyingSource,\n @pull: @onPullDirectStream,\n @controlledReadableStream: this,\n @sink: sink,\n close: @onCloseDirectStream,\n write: sink.write,\n error: @handleDirectStreamError,\n end: @onCloseDirectStream,\n @close: @onCloseDirectStream,\n flush: @onFlushDirectStream,\n _pendingRead: @undefined,\n _deferClose: 0,\n _deferFlush: 0,\n _deferCloseReason: @undefined,\n _handleError: @undefined\n };\n return @putByIdDirectPrivate(this, \"readableStreamController\", controller), @putByIdDirectPrivate(this, \"underlyingSource\", @undefined), @putByIdDirectPrivate(this, \"start\", @undefined), closingPromise;\n})\n"; +// readBigUInt64BE +const JSC::ConstructAbility s_jsBufferPrototypeReadBigUInt64BECodeConstructAbility = JSC::ConstructAbility::CannotConstruct; +const JSC::ConstructorKind s_jsBufferPrototypeReadBigUInt64BECodeConstructorKind = JSC::ConstructorKind::None; +const JSC::ImplementationVisibility s_jsBufferPrototypeReadBigUInt64BECodeImplementationVisibility = JSC::ImplementationVisibility::Public; +const int s_jsBufferPrototypeReadBigUInt64BECodeLength = 153; +static const JSC::Intrinsic s_jsBufferPrototypeReadBigUInt64BECodeIntrinsic = JSC::NoIntrinsic; +const char* const s_jsBufferPrototypeReadBigUInt64BECode = "(function (offset) {\"use strict\";\n return (this.@dataView ||= new DataView(this.buffer, this.byteOffset, this.byteLength)).getBigUint64(offset, !1);\n})\n"; -// initializeArrayStream -const JSC::ConstructAbility s_readableStreamInternalsInitializeArrayStreamCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; -const JSC::ConstructorKind s_readableStreamInternalsInitializeArrayStreamCodeConstructorKind = JSC::ConstructorKind::None; -const JSC::ImplementationVisibility s_readableStreamInternalsInitializeArrayStreamCodeImplementationVisibility = JSC::ImplementationVisibility::Public; -const int s_readableStreamInternalsInitializeArrayStreamCodeLength = 1258; -static const JSC::Intrinsic s_readableStreamInternalsInitializeArrayStreamCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_readableStreamInternalsInitializeArrayStreamCode = "(function (underlyingSource, highWaterMark) {\"use strict\";\n var array = [], closingPromise = @newPromiseCapability(@Promise), calledDone = !1;\n function fulfill() {\n return calledDone = !0, closingPromise.resolve.@call(@undefined, array), array;\n }\n var sink = {\n start() {\n },\n write(chunk) {\n return @arrayPush(array, chunk), chunk.byteLength || chunk.length;\n },\n flush() {\n return 0;\n },\n end() {\n if (calledDone)\n return [];\n return fulfill();\n },\n close() {\n if (!calledDone)\n fulfill();\n }\n }, controller = {\n @underlyingSource: underlyingSource,\n @pull: @onPullDirectStream,\n @controlledReadableStream: this,\n @sink: sink,\n close: @onCloseDirectStream,\n write: sink.write,\n error: @handleDirectStreamError,\n end: @onCloseDirectStream,\n @close: @onCloseDirectStream,\n flush: @onFlushDirectStream,\n _pendingRead: @undefined,\n _deferClose: 0,\n _deferFlush: 0,\n _deferCloseReason: @undefined,\n _handleError: @undefined\n };\n return @putByIdDirectPrivate(this, \"readableStreamController\", controller), @putByIdDirectPrivate(this, \"underlyingSource\", @undefined), @putByIdDirectPrivate(this, \"start\", @undefined), closingPromise;\n})\n"; +// writeInt8 +const JSC::ConstructAbility s_jsBufferPrototypeWriteInt8CodeConstructAbility = JSC::ConstructAbility::CannotConstruct; +const JSC::ConstructorKind s_jsBufferPrototypeWriteInt8CodeConstructorKind = JSC::ConstructorKind::None; +const JSC::ImplementationVisibility s_jsBufferPrototypeWriteInt8CodeImplementationVisibility = JSC::ImplementationVisibility::Public; +const int s_jsBufferPrototypeWriteInt8CodeLength = 170; +static const JSC::Intrinsic s_jsBufferPrototypeWriteInt8CodeIntrinsic = JSC::NoIntrinsic; +const char* const s_jsBufferPrototypeWriteInt8Code = "(function (value, offset) {\"use strict\";\n return (this.@dataView ||= new DataView(this.buffer, this.byteOffset, this.byteLength)).setInt8(offset, value), offset + 1;\n})\n"; -// initializeArrayBufferStream -const JSC::ConstructAbility s_readableStreamInternalsInitializeArrayBufferStreamCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; -const JSC::ConstructorKind s_readableStreamInternalsInitializeArrayBufferStreamCodeConstructorKind = JSC::ConstructorKind::None; -const JSC::ImplementationVisibility s_readableStreamInternalsInitializeArrayBufferStreamCodeImplementationVisibility = JSC::ImplementationVisibility::Public; -const int s_readableStreamInternalsInitializeArrayBufferStreamCodeLength = 935; -static const JSC::Intrinsic s_readableStreamInternalsInitializeArrayBufferStreamCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_readableStreamInternalsInitializeArrayBufferStreamCode = "(function (underlyingSource, highWaterMark) {\"use strict\";\n var opts = highWaterMark && typeof highWaterMark === \"number\" \? { highWaterMark, stream: !0, asUint8Array: !0 } : { stream: !0, asUint8Array: !0 }, sink = new Bun.ArrayBufferSink;\n sink.start(opts);\n var controller = {\n @underlyingSource: underlyingSource,\n @pull: @onPullDirectStream,\n @controlledReadableStream: this,\n @sink: sink,\n close: @onCloseDirectStream,\n write: sink.write.bind(sink),\n error: @handleDirectStreamError,\n end: @onCloseDirectStream,\n @close: @onCloseDirectStream,\n flush: @onFlushDirectStream,\n _pendingRead: @undefined,\n _deferClose: 0,\n _deferFlush: 0,\n _deferCloseReason: @undefined,\n _handleError: @undefined\n };\n @putByIdDirectPrivate(this, \"readableStreamController\", controller), @putByIdDirectPrivate(this, \"underlyingSource\", @undefined), @putByIdDirectPrivate(this, \"start\", @undefined);\n})\n"; +// writeUInt8 +const JSC::ConstructAbility s_jsBufferPrototypeWriteUInt8CodeConstructAbility = JSC::ConstructAbility::CannotConstruct; +const JSC::ConstructorKind s_jsBufferPrototypeWriteUInt8CodeConstructorKind = JSC::ConstructorKind::None; +const JSC::ImplementationVisibility s_jsBufferPrototypeWriteUInt8CodeImplementationVisibility = JSC::ImplementationVisibility::Public; +const int s_jsBufferPrototypeWriteUInt8CodeLength = 171; +static const JSC::Intrinsic s_jsBufferPrototypeWriteUInt8CodeIntrinsic = JSC::NoIntrinsic; +const char* const s_jsBufferPrototypeWriteUInt8Code = "(function (value, offset) {\"use strict\";\n return (this.@dataView ||= new DataView(this.buffer, this.byteOffset, this.byteLength)).setUint8(offset, value), offset + 1;\n})\n"; -// readableStreamError -const JSC::ConstructAbility s_readableStreamInternalsReadableStreamErrorCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; -const JSC::ConstructorKind s_readableStreamInternalsReadableStreamErrorCodeConstructorKind = JSC::ConstructorKind::None; -const JSC::ImplementationVisibility s_readableStreamInternalsReadableStreamErrorCodeImplementationVisibility = JSC::ImplementationVisibility::Public; -const int s_readableStreamInternalsReadableStreamErrorCodeLength = 1006; -static const JSC::Intrinsic s_readableStreamInternalsReadableStreamErrorCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_readableStreamInternalsReadableStreamErrorCode = "(function (stream, error) {\"use strict\";\n @putByIdDirectPrivate(stream, \"state\", 3), @putByIdDirectPrivate(stream, \"storedError\", error);\n const reader = @getByIdDirectPrivate(stream, \"reader\");\n if (!reader)\n return;\n if (@isReadableStreamDefaultReader(reader)) {\n const requests = @getByIdDirectPrivate(reader, \"readRequests\");\n @putByIdDirectPrivate(reader, \"readRequests\", @createFIFO());\n for (var request = requests.shift();request; request = requests.shift())\n @rejectPromise(request, error);\n } else {\n const requests = @getByIdDirectPrivate(reader, \"readIntoRequests\");\n @putByIdDirectPrivate(reader, \"readIntoRequests\", @createFIFO());\n for (var request = requests.shift();request; request = requests.shift())\n @rejectPromise(request, error);\n }\n @getByIdDirectPrivate(reader, \"closedPromiseCapability\").reject.@call(@undefined, error);\n const promise = @getByIdDirectPrivate(reader, \"closedPromiseCapability\").promise;\n @markPromiseAsHandled(promise);\n})\n"; +// writeInt16LE +const JSC::ConstructAbility s_jsBufferPrototypeWriteInt16LECodeConstructAbility = JSC::ConstructAbility::CannotConstruct; +const JSC::ConstructorKind s_jsBufferPrototypeWriteInt16LECodeConstructorKind = JSC::ConstructorKind::None; +const JSC::ImplementationVisibility s_jsBufferPrototypeWriteInt16LECodeImplementationVisibility = JSC::ImplementationVisibility::Public; +const int s_jsBufferPrototypeWriteInt16LECodeLength = 175; +static const JSC::Intrinsic s_jsBufferPrototypeWriteInt16LECodeIntrinsic = JSC::NoIntrinsic; +const char* const s_jsBufferPrototypeWriteInt16LECode = "(function (value, offset) {\"use strict\";\n return (this.@dataView ||= new DataView(this.buffer, this.byteOffset, this.byteLength)).setInt16(offset, value, !0), offset + 2;\n})\n"; -// readableStreamDefaultControllerShouldCallPull -const JSC::ConstructAbility s_readableStreamInternalsReadableStreamDefaultControllerShouldCallPullCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; -const JSC::ConstructorKind s_readableStreamInternalsReadableStreamDefaultControllerShouldCallPullCodeConstructorKind = JSC::ConstructorKind::None; -const JSC::ImplementationVisibility s_readableStreamInternalsReadableStreamDefaultControllerShouldCallPullCodeImplementationVisibility = JSC::ImplementationVisibility::Public; -const int s_readableStreamInternalsReadableStreamDefaultControllerShouldCallPullCodeLength = 573; -static const JSC::Intrinsic s_readableStreamInternalsReadableStreamDefaultControllerShouldCallPullCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_readableStreamInternalsReadableStreamDefaultControllerShouldCallPullCode = "(function (controller) {\"use strict\";\n const stream = @getByIdDirectPrivate(controller, \"controlledReadableStream\");\n if (!@readableStreamDefaultControllerCanCloseOrEnqueue(controller))\n return !1;\n if (@getByIdDirectPrivate(controller, \"started\") !== 1)\n return !1;\n if ((!@isReadableStreamLocked(stream) || !@getByIdDirectPrivate(@getByIdDirectPrivate(stream, \"reader\"), \"readRequests\")\?.isNotEmpty()) && @readableStreamDefaultControllerGetDesiredSize(controller) <= 0)\n return !1;\n return @readableStreamDefaultControllerGetDesiredSize(controller) > 0;\n})\n"; +// writeInt16BE +const JSC::ConstructAbility s_jsBufferPrototypeWriteInt16BECodeConstructAbility = JSC::ConstructAbility::CannotConstruct; +const JSC::ConstructorKind s_jsBufferPrototypeWriteInt16BECodeConstructorKind = JSC::ConstructorKind::None; +const JSC::ImplementationVisibility s_jsBufferPrototypeWriteInt16BECodeImplementationVisibility = JSC::ImplementationVisibility::Public; +const int s_jsBufferPrototypeWriteInt16BECodeLength = 175; +static const JSC::Intrinsic s_jsBufferPrototypeWriteInt16BECodeIntrinsic = JSC::NoIntrinsic; +const char* const s_jsBufferPrototypeWriteInt16BECode = "(function (value, offset) {\"use strict\";\n return (this.@dataView ||= new DataView(this.buffer, this.byteOffset, this.byteLength)).setInt16(offset, value, !1), offset + 2;\n})\n"; -// readableStreamDefaultControllerCallPullIfNeeded -const JSC::ConstructAbility s_readableStreamInternalsReadableStreamDefaultControllerCallPullIfNeededCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; -const JSC::ConstructorKind s_readableStreamInternalsReadableStreamDefaultControllerCallPullIfNeededCodeConstructorKind = JSC::ConstructorKind::None; -const JSC::ImplementationVisibility s_readableStreamInternalsReadableStreamDefaultControllerCallPullIfNeededCodeImplementationVisibility = JSC::ImplementationVisibility::Public; -const int s_readableStreamInternalsReadableStreamDefaultControllerCallPullIfNeededCodeLength = 1074; -static const JSC::Intrinsic s_readableStreamInternalsReadableStreamDefaultControllerCallPullIfNeededCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_readableStreamInternalsReadableStreamDefaultControllerCallPullIfNeededCode = "(function (controller) {\"use strict\";\n const stream = @getByIdDirectPrivate(controller, \"controlledReadableStream\");\n if (!@readableStreamDefaultControllerCanCloseOrEnqueue(controller))\n return;\n if (@getByIdDirectPrivate(controller, \"started\") !== 1)\n return;\n if ((!@isReadableStreamLocked(stream) || !@getByIdDirectPrivate(@getByIdDirectPrivate(stream, \"reader\"), \"readRequests\")\?.isNotEmpty()) && @readableStreamDefaultControllerGetDesiredSize(controller) <= 0)\n return;\n if (@getByIdDirectPrivate(controller, \"pulling\")) {\n @putByIdDirectPrivate(controller, \"pullAgain\", !0);\n return;\n }\n @putByIdDirectPrivate(controller, \"pulling\", !0), @getByIdDirectPrivate(controller, \"pullAlgorithm\").@call(@undefined).@then(function() {\n if (@putByIdDirectPrivate(controller, \"pulling\", !1), @getByIdDirectPrivate(controller, \"pullAgain\"))\n @putByIdDirectPrivate(controller, \"pullAgain\", !1), @readableStreamDefaultControllerCallPullIfNeeded(controller);\n }, function(error) {\n @readableStreamDefaultControllerError(controller, error);\n });\n})\n"; +// writeUInt16LE +const JSC::ConstructAbility s_jsBufferPrototypeWriteUInt16LECodeConstructAbility = JSC::ConstructAbility::CannotConstruct; +const JSC::ConstructorKind s_jsBufferPrototypeWriteUInt16LECodeConstructorKind = JSC::ConstructorKind::None; +const JSC::ImplementationVisibility s_jsBufferPrototypeWriteUInt16LECodeImplementationVisibility = JSC::ImplementationVisibility::Public; +const int s_jsBufferPrototypeWriteUInt16LECodeLength = 176; +static const JSC::Intrinsic s_jsBufferPrototypeWriteUInt16LECodeIntrinsic = JSC::NoIntrinsic; +const char* const s_jsBufferPrototypeWriteUInt16LECode = "(function (value, offset) {\"use strict\";\n return (this.@dataView ||= new DataView(this.buffer, this.byteOffset, this.byteLength)).setUint16(offset, value, !0), offset + 2;\n})\n"; -// isReadableStreamLocked -const JSC::ConstructAbility s_readableStreamInternalsIsReadableStreamLockedCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; -const JSC::ConstructorKind s_readableStreamInternalsIsReadableStreamLockedCodeConstructorKind = JSC::ConstructorKind::None; -const JSC::ImplementationVisibility s_readableStreamInternalsIsReadableStreamLockedCodeImplementationVisibility = JSC::ImplementationVisibility::Public; -const int s_readableStreamInternalsIsReadableStreamLockedCodeLength = 89; -static const JSC::Intrinsic s_readableStreamInternalsIsReadableStreamLockedCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_readableStreamInternalsIsReadableStreamLockedCode = "(function (stream) {\"use strict\";\n return !!@getByIdDirectPrivate(stream, \"reader\");\n})\n"; +// writeUInt16BE +const JSC::ConstructAbility s_jsBufferPrototypeWriteUInt16BECodeConstructAbility = JSC::ConstructAbility::CannotConstruct; +const JSC::ConstructorKind s_jsBufferPrototypeWriteUInt16BECodeConstructorKind = JSC::ConstructorKind::None; +const JSC::ImplementationVisibility s_jsBufferPrototypeWriteUInt16BECodeImplementationVisibility = JSC::ImplementationVisibility::Public; +const int s_jsBufferPrototypeWriteUInt16BECodeLength = 176; +static const JSC::Intrinsic s_jsBufferPrototypeWriteUInt16BECodeIntrinsic = JSC::NoIntrinsic; +const char* const s_jsBufferPrototypeWriteUInt16BECode = "(function (value, offset) {\"use strict\";\n return (this.@dataView ||= new DataView(this.buffer, this.byteOffset, this.byteLength)).setUint16(offset, value, !1), offset + 2;\n})\n"; -// readableStreamDefaultControllerGetDesiredSize -const JSC::ConstructAbility s_readableStreamInternalsReadableStreamDefaultControllerGetDesiredSizeCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; -const JSC::ConstructorKind s_readableStreamInternalsReadableStreamDefaultControllerGetDesiredSizeCodeConstructorKind = JSC::ConstructorKind::None; -const JSC::ImplementationVisibility s_readableStreamInternalsReadableStreamDefaultControllerGetDesiredSizeCodeImplementationVisibility = JSC::ImplementationVisibility::Public; -const int s_readableStreamInternalsReadableStreamDefaultControllerGetDesiredSizeCodeLength = 358; -static const JSC::Intrinsic s_readableStreamInternalsReadableStreamDefaultControllerGetDesiredSizeCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_readableStreamInternalsReadableStreamDefaultControllerGetDesiredSizeCode = "(function (controller) {\"use strict\";\n const stream = @getByIdDirectPrivate(controller, \"controlledReadableStream\"), state = @getByIdDirectPrivate(stream, \"state\");\n if (state === 3)\n return null;\n if (state === 1)\n return 0;\n return @getByIdDirectPrivate(controller, \"strategy\").highWaterMark - @getByIdDirectPrivate(controller, \"queue\").size;\n})\n"; +// writeInt32LE +const JSC::ConstructAbility s_jsBufferPrototypeWriteInt32LECodeConstructAbility = JSC::ConstructAbility::CannotConstruct; +const JSC::ConstructorKind s_jsBufferPrototypeWriteInt32LECodeConstructorKind = JSC::ConstructorKind::None; +const JSC::ImplementationVisibility s_jsBufferPrototypeWriteInt32LECodeImplementationVisibility = JSC::ImplementationVisibility::Public; +const int s_jsBufferPrototypeWriteInt32LECodeLength = 175; +static const JSC::Intrinsic s_jsBufferPrototypeWriteInt32LECodeIntrinsic = JSC::NoIntrinsic; +const char* const s_jsBufferPrototypeWriteInt32LECode = "(function (value, offset) {\"use strict\";\n return (this.@dataView ||= new DataView(this.buffer, this.byteOffset, this.byteLength)).setInt32(offset, value, !0), offset + 4;\n})\n"; -// readableStreamReaderGenericCancel -const JSC::ConstructAbility s_readableStreamInternalsReadableStreamReaderGenericCancelCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; -const JSC::ConstructorKind s_readableStreamInternalsReadableStreamReaderGenericCancelCodeConstructorKind = JSC::ConstructorKind::None; -const JSC::ImplementationVisibility s_readableStreamInternalsReadableStreamReaderGenericCancelCodeImplementationVisibility = JSC::ImplementationVisibility::Public; -const int s_readableStreamInternalsReadableStreamReaderGenericCancelCodeLength = 164; -static const JSC::Intrinsic s_readableStreamInternalsReadableStreamReaderGenericCancelCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_readableStreamInternalsReadableStreamReaderGenericCancelCode = "(function (reader, reason) {\"use strict\";\n const stream = @getByIdDirectPrivate(reader, \"ownerReadableStream\");\n return @readableStreamCancel(stream, reason);\n})\n"; +// writeInt32BE +const JSC::ConstructAbility s_jsBufferPrototypeWriteInt32BECodeConstructAbility = JSC::ConstructAbility::CannotConstruct; +const JSC::ConstructorKind s_jsBufferPrototypeWriteInt32BECodeConstructorKind = JSC::ConstructorKind::None; +const JSC::ImplementationVisibility s_jsBufferPrototypeWriteInt32BECodeImplementationVisibility = JSC::ImplementationVisibility::Public; +const int s_jsBufferPrototypeWriteInt32BECodeLength = 175; +static const JSC::Intrinsic s_jsBufferPrototypeWriteInt32BECodeIntrinsic = JSC::NoIntrinsic; +const char* const s_jsBufferPrototypeWriteInt32BECode = "(function (value, offset) {\"use strict\";\n return (this.@dataView ||= new DataView(this.buffer, this.byteOffset, this.byteLength)).setInt32(offset, value, !1), offset + 4;\n})\n"; -// readableStreamCancel -const JSC::ConstructAbility s_readableStreamInternalsReadableStreamCancelCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; -const JSC::ConstructorKind s_readableStreamInternalsReadableStreamCancelCodeConstructorKind = JSC::ConstructorKind::None; -const JSC::ImplementationVisibility s_readableStreamInternalsReadableStreamCancelCodeImplementationVisibility = JSC::ImplementationVisibility::Public; -const int s_readableStreamInternalsReadableStreamCancelCodeLength = 692; -static const JSC::Intrinsic s_readableStreamInternalsReadableStreamCancelCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_readableStreamInternalsReadableStreamCancelCode = "(function (stream, reason) {\"use strict\";\n @putByIdDirectPrivate(stream, \"disturbed\", !0);\n const state = @getByIdDirectPrivate(stream, \"state\");\n if (state === 1)\n return @Promise.@resolve();\n if (state === 3)\n return @Promise.@reject(@getByIdDirectPrivate(stream, \"storedError\"));\n @readableStreamClose(stream);\n var controller = @getByIdDirectPrivate(stream, \"readableStreamController\"), cancel = controller.@cancel;\n if (cancel)\n return cancel(controller, reason).@then(function() {\n });\n var close = controller.close;\n if (close)\n return @Promise.@resolve(controller.close(reason));\n @throwTypeError(\"ReadableStreamController has no cancel or close method\");\n})\n"; +// writeUInt32LE +const JSC::ConstructAbility s_jsBufferPrototypeWriteUInt32LECodeConstructAbility = JSC::ConstructAbility::CannotConstruct; +const JSC::ConstructorKind s_jsBufferPrototypeWriteUInt32LECodeConstructorKind = JSC::ConstructorKind::None; +const JSC::ImplementationVisibility s_jsBufferPrototypeWriteUInt32LECodeImplementationVisibility = JSC::ImplementationVisibility::Public; +const int s_jsBufferPrototypeWriteUInt32LECodeLength = 176; +static const JSC::Intrinsic s_jsBufferPrototypeWriteUInt32LECodeIntrinsic = JSC::NoIntrinsic; +const char* const s_jsBufferPrototypeWriteUInt32LECode = "(function (value, offset) {\"use strict\";\n return (this.@dataView ||= new DataView(this.buffer, this.byteOffset, this.byteLength)).setUint32(offset, value, !0), offset + 4;\n})\n"; -// readableStreamDefaultControllerCancel -const JSC::ConstructAbility s_readableStreamInternalsReadableStreamDefaultControllerCancelCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; -const JSC::ConstructorKind s_readableStreamInternalsReadableStreamDefaultControllerCancelCodeConstructorKind = JSC::ConstructorKind::None; -const JSC::ImplementationVisibility s_readableStreamInternalsReadableStreamDefaultControllerCancelCodeImplementationVisibility = JSC::ImplementationVisibility::Public; -const int s_readableStreamInternalsReadableStreamDefaultControllerCancelCodeLength = 195; -static const JSC::Intrinsic s_readableStreamInternalsReadableStreamDefaultControllerCancelCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_readableStreamInternalsReadableStreamDefaultControllerCancelCode = "(function (controller, reason) {\"use strict\";\n return @putByIdDirectPrivate(controller, \"queue\", @newQueue()), @getByIdDirectPrivate(controller, \"cancelAlgorithm\").@call(@undefined, reason);\n})\n"; +// writeUInt32BE +const JSC::ConstructAbility s_jsBufferPrototypeWriteUInt32BECodeConstructAbility = JSC::ConstructAbility::CannotConstruct; +const JSC::ConstructorKind s_jsBufferPrototypeWriteUInt32BECodeConstructorKind = JSC::ConstructorKind::None; +const JSC::ImplementationVisibility s_jsBufferPrototypeWriteUInt32BECodeImplementationVisibility = JSC::ImplementationVisibility::Public; +const int s_jsBufferPrototypeWriteUInt32BECodeLength = 176; +static const JSC::Intrinsic s_jsBufferPrototypeWriteUInt32BECodeIntrinsic = JSC::NoIntrinsic; +const char* const s_jsBufferPrototypeWriteUInt32BECode = "(function (value, offset) {\"use strict\";\n return (this.@dataView ||= new DataView(this.buffer, this.byteOffset, this.byteLength)).setUint32(offset, value, !1), offset + 4;\n})\n"; + +// writeIntLE +const JSC::ConstructAbility s_jsBufferPrototypeWriteIntLECodeConstructAbility = JSC::ConstructAbility::CannotConstruct; +const JSC::ConstructorKind s_jsBufferPrototypeWriteIntLECodeConstructorKind = JSC::ConstructorKind::None; +const JSC::ImplementationVisibility s_jsBufferPrototypeWriteIntLECodeImplementationVisibility = JSC::ImplementationVisibility::Public; +const int s_jsBufferPrototypeWriteIntLECodeLength = 957; +static const JSC::Intrinsic s_jsBufferPrototypeWriteIntLECodeIntrinsic = JSC::NoIntrinsic; +const char* const s_jsBufferPrototypeWriteIntLECode = "(function (value, offset, byteLength) {\"use strict\";\n const view = this.@dataView ||= new DataView(this.buffer, this.byteOffset, this.byteLength);\n switch (byteLength) {\n case 1: {\n view.setInt8(offset, value);\n break;\n }\n case 2: {\n view.setInt16(offset, value, !0);\n break;\n }\n case 3: {\n view.setUint16(offset, value & 65535, !0), view.setInt8(offset + 2, Math.floor(value * 0.0000152587890625));\n break;\n }\n case 4: {\n view.setInt32(offset, value, !0);\n break;\n }\n case 5: {\n view.setUint32(offset, value | 0, !0), view.setInt8(offset + 4, Math.floor(value * 0.00000000023283064365386964));\n break;\n }\n case 6: {\n view.setUint32(offset, value | 0, !0), view.setInt16(offset + 4, Math.floor(value * 0.00000000023283064365386964), !0);\n break;\n }\n default:\n @throwRangeError(\"byteLength must be >= 1 and <= 6\");\n }\n return offset + byteLength;\n})\n"; -// readableStreamDefaultControllerPull -const JSC::ConstructAbility s_readableStreamInternalsReadableStreamDefaultControllerPullCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; -const JSC::ConstructorKind s_readableStreamInternalsReadableStreamDefaultControllerPullCodeConstructorKind = JSC::ConstructorKind::None; -const JSC::ImplementationVisibility s_readableStreamInternalsReadableStreamDefaultControllerPullCodeImplementationVisibility = JSC::ImplementationVisibility::Public; -const int s_readableStreamInternalsReadableStreamDefaultControllerPullCodeLength = 705; -static const JSC::Intrinsic s_readableStreamInternalsReadableStreamDefaultControllerPullCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_readableStreamInternalsReadableStreamDefaultControllerPullCode = "(function (controller) {\"use strict\";\n var queue = @getByIdDirectPrivate(controller, \"queue\");\n if (queue.content.isNotEmpty()) {\n const chunk = @dequeueValue(queue);\n if (@getByIdDirectPrivate(controller, \"closeRequested\") && queue.content.isEmpty())\n @readableStreamClose(@getByIdDirectPrivate(controller, \"controlledReadableStream\"));\n else\n @readableStreamDefaultControllerCallPullIfNeeded(controller);\n return @createFulfilledPromise({ value: chunk, done: !1 });\n }\n const pendingPromise = @readableStreamAddReadRequest(@getByIdDirectPrivate(controller, \"controlledReadableStream\"));\n return @readableStreamDefaultControllerCallPullIfNeeded(controller), pendingPromise;\n})\n"; +// writeIntBE +const JSC::ConstructAbility s_jsBufferPrototypeWriteIntBECodeConstructAbility = JSC::ConstructAbility::CannotConstruct; +const JSC::ConstructorKind s_jsBufferPrototypeWriteIntBECodeConstructorKind = JSC::ConstructorKind::None; +const JSC::ImplementationVisibility s_jsBufferPrototypeWriteIntBECodeImplementationVisibility = JSC::ImplementationVisibility::Public; +const int s_jsBufferPrototypeWriteIntBECodeLength = 957; +static const JSC::Intrinsic s_jsBufferPrototypeWriteIntBECodeIntrinsic = JSC::NoIntrinsic; +const char* const s_jsBufferPrototypeWriteIntBECode = "(function (value, offset, byteLength) {\"use strict\";\n const view = this.@dataView ||= new DataView(this.buffer, this.byteOffset, this.byteLength);\n switch (byteLength) {\n case 1: {\n view.setInt8(offset, value);\n break;\n }\n case 2: {\n view.setInt16(offset, value, !1);\n break;\n }\n case 3: {\n view.setUint16(offset + 1, value & 65535, !1), view.setInt8(offset, Math.floor(value * 0.0000152587890625));\n break;\n }\n case 4: {\n view.setInt32(offset, value, !1);\n break;\n }\n case 5: {\n view.setUint32(offset + 1, value | 0, !1), view.setInt8(offset, Math.floor(value * 0.00000000023283064365386964));\n break;\n }\n case 6: {\n view.setUint32(offset + 2, value | 0, !1), view.setInt16(offset, Math.floor(value * 0.00000000023283064365386964), !1);\n break;\n }\n default:\n @throwRangeError(\"byteLength must be >= 1 and <= 6\");\n }\n return offset + byteLength;\n})\n"; -// readableStreamDefaultControllerClose -const JSC::ConstructAbility s_readableStreamInternalsReadableStreamDefaultControllerCloseCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; -const JSC::ConstructorKind s_readableStreamInternalsReadableStreamDefaultControllerCloseCodeConstructorKind = JSC::ConstructorKind::None; -const JSC::ImplementationVisibility s_readableStreamInternalsReadableStreamDefaultControllerCloseCodeImplementationVisibility = JSC::ImplementationVisibility::Public; -const int s_readableStreamInternalsReadableStreamDefaultControllerCloseCodeLength = 257; -static const JSC::Intrinsic s_readableStreamInternalsReadableStreamDefaultControllerCloseCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_readableStreamInternalsReadableStreamDefaultControllerCloseCode = "(function (controller) {\"use strict\";\n if (@putByIdDirectPrivate(controller, \"closeRequested\", !0), @getByIdDirectPrivate(controller, \"queue\")\?.content\?.isEmpty())\n @readableStreamClose(@getByIdDirectPrivate(controller, \"controlledReadableStream\"));\n})\n"; +// writeUIntLE +const JSC::ConstructAbility s_jsBufferPrototypeWriteUIntLECodeConstructAbility = JSC::ConstructAbility::CannotConstruct; +const JSC::ConstructorKind s_jsBufferPrototypeWriteUIntLECodeConstructorKind = JSC::ConstructorKind::None; +const JSC::ImplementationVisibility s_jsBufferPrototypeWriteUIntLECodeImplementationVisibility = JSC::ImplementationVisibility::Public; +const int s_jsBufferPrototypeWriteUIntLECodeLength = 963; +static const JSC::Intrinsic s_jsBufferPrototypeWriteUIntLECodeIntrinsic = JSC::NoIntrinsic; +const char* const s_jsBufferPrototypeWriteUIntLECode = "(function (value, offset, byteLength) {\"use strict\";\n const view = this.@dataView ||= new DataView(this.buffer, this.byteOffset, this.byteLength);\n switch (byteLength) {\n case 1: {\n view.setUint8(offset, value);\n break;\n }\n case 2: {\n view.setUint16(offset, value, !0);\n break;\n }\n case 3: {\n view.setUint16(offset, value & 65535, !0), view.setUint8(offset + 2, Math.floor(value * 0.0000152587890625));\n break;\n }\n case 4: {\n view.setUint32(offset, value, !0);\n break;\n }\n case 5: {\n view.setUint32(offset, value | 0, !0), view.setUint8(offset + 4, Math.floor(value * 0.00000000023283064365386964));\n break;\n }\n case 6: {\n view.setUint32(offset, value | 0, !0), view.setUint16(offset + 4, Math.floor(value * 0.00000000023283064365386964), !0);\n break;\n }\n default:\n @throwRangeError(\"byteLength must be >= 1 and <= 6\");\n }\n return offset + byteLength;\n})\n"; -// readableStreamClose -const JSC::ConstructAbility s_readableStreamInternalsReadableStreamCloseCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; -const JSC::ConstructorKind s_readableStreamInternalsReadableStreamCloseCodeConstructorKind = JSC::ConstructorKind::None; -const JSC::ImplementationVisibility s_readableStreamInternalsReadableStreamCloseCodeImplementationVisibility = JSC::ImplementationVisibility::Public; -const int s_readableStreamInternalsReadableStreamCloseCodeLength = 721; -static const JSC::Intrinsic s_readableStreamInternalsReadableStreamCloseCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_readableStreamInternalsReadableStreamCloseCode = "(function (stream) {\"use strict\";\n if (@putByIdDirectPrivate(stream, \"state\", 1), !@getByIdDirectPrivate(stream, \"reader\"))\n return;\n if (@isReadableStreamDefaultReader(@getByIdDirectPrivate(stream, \"reader\"))) {\n const requests = @getByIdDirectPrivate(@getByIdDirectPrivate(stream, \"reader\"), \"readRequests\");\n if (requests.isNotEmpty()) {\n @putByIdDirectPrivate(@getByIdDirectPrivate(stream, \"reader\"), \"readRequests\", @createFIFO());\n for (var request = requests.shift();request; request = requests.shift())\n @fulfillPromise(request, { value: @undefined, done: !0 });\n }\n }\n @getByIdDirectPrivate(@getByIdDirectPrivate(stream, \"reader\"), \"closedPromiseCapability\").resolve.@call();\n})\n"; +// writeUIntBE +const JSC::ConstructAbility s_jsBufferPrototypeWriteUIntBECodeConstructAbility = JSC::ConstructAbility::CannotConstruct; +const JSC::ConstructorKind s_jsBufferPrototypeWriteUIntBECodeConstructorKind = JSC::ConstructorKind::None; +const JSC::ImplementationVisibility s_jsBufferPrototypeWriteUIntBECodeImplementationVisibility = JSC::ImplementationVisibility::Public; +const int s_jsBufferPrototypeWriteUIntBECodeLength = 963; +static const JSC::Intrinsic s_jsBufferPrototypeWriteUIntBECodeIntrinsic = JSC::NoIntrinsic; +const char* const s_jsBufferPrototypeWriteUIntBECode = "(function (value, offset, byteLength) {\"use strict\";\n const view = this.@dataView ||= new DataView(this.buffer, this.byteOffset, this.byteLength);\n switch (byteLength) {\n case 1: {\n view.setUint8(offset, value);\n break;\n }\n case 2: {\n view.setUint16(offset, value, !1);\n break;\n }\n case 3: {\n view.setUint16(offset + 1, value & 65535, !1), view.setUint8(offset, Math.floor(value * 0.0000152587890625));\n break;\n }\n case 4: {\n view.setUint32(offset, value, !1);\n break;\n }\n case 5: {\n view.setUint32(offset + 1, value | 0, !1), view.setUint8(offset, Math.floor(value * 0.00000000023283064365386964));\n break;\n }\n case 6: {\n view.setUint32(offset + 2, value | 0, !1), view.setUint16(offset, Math.floor(value * 0.00000000023283064365386964), !1);\n break;\n }\n default:\n @throwRangeError(\"byteLength must be >= 1 and <= 6\");\n }\n return offset + byteLength;\n})\n"; -// readableStreamFulfillReadRequest -const JSC::ConstructAbility s_readableStreamInternalsReadableStreamFulfillReadRequestCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; -const JSC::ConstructorKind s_readableStreamInternalsReadableStreamFulfillReadRequestCodeConstructorKind = JSC::ConstructorKind::None; -const JSC::ImplementationVisibility s_readableStreamInternalsReadableStreamFulfillReadRequestCodeImplementationVisibility = JSC::ImplementationVisibility::Public; -const int s_readableStreamInternalsReadableStreamFulfillReadRequestCodeLength = 216; -static const JSC::Intrinsic s_readableStreamInternalsReadableStreamFulfillReadRequestCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_readableStreamInternalsReadableStreamFulfillReadRequestCode = "(function (stream, chunk, done) {\"use strict\";\n const readRequest = @getByIdDirectPrivate(@getByIdDirectPrivate(stream, \"reader\"), \"readRequests\").shift();\n @fulfillPromise(readRequest, { value: chunk, done });\n})\n"; +// writeFloatLE +const JSC::ConstructAbility s_jsBufferPrototypeWriteFloatLECodeConstructAbility = JSC::ConstructAbility::CannotConstruct; +const JSC::ConstructorKind s_jsBufferPrototypeWriteFloatLECodeConstructorKind = JSC::ConstructorKind::None; +const JSC::ImplementationVisibility s_jsBufferPrototypeWriteFloatLECodeImplementationVisibility = JSC::ImplementationVisibility::Public; +const int s_jsBufferPrototypeWriteFloatLECodeLength = 177; +static const JSC::Intrinsic s_jsBufferPrototypeWriteFloatLECodeIntrinsic = JSC::NoIntrinsic; +const char* const s_jsBufferPrototypeWriteFloatLECode = "(function (value, offset) {\"use strict\";\n return (this.@dataView ||= new DataView(this.buffer, this.byteOffset, this.byteLength)).setFloat32(offset, value, !0), offset + 4;\n})\n"; -// readableStreamDefaultControllerEnqueue -const JSC::ConstructAbility s_readableStreamInternalsReadableStreamDefaultControllerEnqueueCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; -const JSC::ConstructorKind s_readableStreamInternalsReadableStreamDefaultControllerEnqueueCodeConstructorKind = JSC::ConstructorKind::None; -const JSC::ImplementationVisibility s_readableStreamInternalsReadableStreamDefaultControllerEnqueueCodeImplementationVisibility = JSC::ImplementationVisibility::Public; -const int s_readableStreamInternalsReadableStreamDefaultControllerEnqueueCodeLength = 836; -static const JSC::Intrinsic s_readableStreamInternalsReadableStreamDefaultControllerEnqueueCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_readableStreamInternalsReadableStreamDefaultControllerEnqueueCode = "(function (controller, chunk) {\"use strict\";\n const stream = @getByIdDirectPrivate(controller, \"controlledReadableStream\");\n if (@isReadableStreamLocked(stream) && @getByIdDirectPrivate(@getByIdDirectPrivate(stream, \"reader\"), \"readRequests\")\?.isNotEmpty()) {\n @readableStreamFulfillReadRequest(stream, chunk, !1), @readableStreamDefaultControllerCallPullIfNeeded(controller);\n return;\n }\n try {\n let chunkSize = 1;\n if (@getByIdDirectPrivate(controller, \"strategy\").size !== @undefined)\n chunkSize = @getByIdDirectPrivate(controller, \"strategy\").size(chunk);\n @enqueueValueWithSize(@getByIdDirectPrivate(controller, \"queue\"), chunk, chunkSize);\n } catch (error) {\n throw @readableStreamDefaultControllerError(controller, error), error;\n }\n @readableStreamDefaultControllerCallPullIfNeeded(controller);\n})\n"; +// writeFloatBE +const JSC::ConstructAbility s_jsBufferPrototypeWriteFloatBECodeConstructAbility = JSC::ConstructAbility::CannotConstruct; +const JSC::ConstructorKind s_jsBufferPrototypeWriteFloatBECodeConstructorKind = JSC::ConstructorKind::None; +const JSC::ImplementationVisibility s_jsBufferPrototypeWriteFloatBECodeImplementationVisibility = JSC::ImplementationVisibility::Public; +const int s_jsBufferPrototypeWriteFloatBECodeLength = 177; +static const JSC::Intrinsic s_jsBufferPrototypeWriteFloatBECodeIntrinsic = JSC::NoIntrinsic; +const char* const s_jsBufferPrototypeWriteFloatBECode = "(function (value, offset) {\"use strict\";\n return (this.@dataView ||= new DataView(this.buffer, this.byteOffset, this.byteLength)).setFloat32(offset, value, !1), offset + 4;\n})\n"; -// readableStreamDefaultReaderRead -const JSC::ConstructAbility s_readableStreamInternalsReadableStreamDefaultReaderReadCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; -const JSC::ConstructorKind s_readableStreamInternalsReadableStreamDefaultReaderReadCodeConstructorKind = JSC::ConstructorKind::None; -const JSC::ImplementationVisibility s_readableStreamInternalsReadableStreamDefaultReaderReadCodeImplementationVisibility = JSC::ImplementationVisibility::Public; -const int s_readableStreamInternalsReadableStreamDefaultReaderReadCodeLength = 519; -static const JSC::Intrinsic s_readableStreamInternalsReadableStreamDefaultReaderReadCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_readableStreamInternalsReadableStreamDefaultReaderReadCode = "(function (reader) {\"use strict\";\n const stream = @getByIdDirectPrivate(reader, \"ownerReadableStream\"), state = @getByIdDirectPrivate(stream, \"state\");\n if (@putByIdDirectPrivate(stream, \"disturbed\", !0), state === 1)\n return @createFulfilledPromise({ value: @undefined, done: !0 });\n if (state === 3)\n return @Promise.@reject(@getByIdDirectPrivate(stream, \"storedError\"));\n return @getByIdDirectPrivate(stream, \"readableStreamController\").@pull(@getByIdDirectPrivate(stream, \"readableStreamController\"));\n})\n"; +// writeDoubleLE +const JSC::ConstructAbility s_jsBufferPrototypeWriteDoubleLECodeConstructAbility = JSC::ConstructAbility::CannotConstruct; +const JSC::ConstructorKind s_jsBufferPrototypeWriteDoubleLECodeConstructorKind = JSC::ConstructorKind::None; +const JSC::ImplementationVisibility s_jsBufferPrototypeWriteDoubleLECodeImplementationVisibility = JSC::ImplementationVisibility::Public; +const int s_jsBufferPrototypeWriteDoubleLECodeLength = 177; +static const JSC::Intrinsic s_jsBufferPrototypeWriteDoubleLECodeIntrinsic = JSC::NoIntrinsic; +const char* const s_jsBufferPrototypeWriteDoubleLECode = "(function (value, offset) {\"use strict\";\n return (this.@dataView ||= new DataView(this.buffer, this.byteOffset, this.byteLength)).setFloat64(offset, value, !0), offset + 8;\n})\n"; -// readableStreamAddReadRequest -const JSC::ConstructAbility s_readableStreamInternalsReadableStreamAddReadRequestCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; -const JSC::ConstructorKind s_readableStreamInternalsReadableStreamAddReadRequestCodeConstructorKind = JSC::ConstructorKind::None; -const JSC::ImplementationVisibility s_readableStreamInternalsReadableStreamAddReadRequestCodeImplementationVisibility = JSC::ImplementationVisibility::Public; -const int s_readableStreamInternalsReadableStreamAddReadRequestCodeLength = 194; -static const JSC::Intrinsic s_readableStreamInternalsReadableStreamAddReadRequestCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_readableStreamInternalsReadableStreamAddReadRequestCode = "(function (stream) {\"use strict\";\n const readRequest = @newPromise();\n return @getByIdDirectPrivate(@getByIdDirectPrivate(stream, \"reader\"), \"readRequests\").push(readRequest), readRequest;\n})\n"; +// writeDoubleBE +const JSC::ConstructAbility s_jsBufferPrototypeWriteDoubleBECodeConstructAbility = JSC::ConstructAbility::CannotConstruct; +const JSC::ConstructorKind s_jsBufferPrototypeWriteDoubleBECodeConstructorKind = JSC::ConstructorKind::None; +const JSC::ImplementationVisibility s_jsBufferPrototypeWriteDoubleBECodeImplementationVisibility = JSC::ImplementationVisibility::Public; +const int s_jsBufferPrototypeWriteDoubleBECodeLength = 177; +static const JSC::Intrinsic s_jsBufferPrototypeWriteDoubleBECodeIntrinsic = JSC::NoIntrinsic; +const char* const s_jsBufferPrototypeWriteDoubleBECode = "(function (value, offset) {\"use strict\";\n return (this.@dataView ||= new DataView(this.buffer, this.byteOffset, this.byteLength)).setFloat64(offset, value, !1), offset + 8;\n})\n"; -// isReadableStreamDisturbed -const JSC::ConstructAbility s_readableStreamInternalsIsReadableStreamDisturbedCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; -const JSC::ConstructorKind s_readableStreamInternalsIsReadableStreamDisturbedCodeConstructorKind = JSC::ConstructorKind::None; -const JSC::ImplementationVisibility s_readableStreamInternalsIsReadableStreamDisturbedCodeImplementationVisibility = JSC::ImplementationVisibility::Public; -const int s_readableStreamInternalsIsReadableStreamDisturbedCodeLength = 90; -static const JSC::Intrinsic s_readableStreamInternalsIsReadableStreamDisturbedCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_readableStreamInternalsIsReadableStreamDisturbedCode = "(function (stream) {\"use strict\";\n return @getByIdDirectPrivate(stream, \"disturbed\");\n})\n"; +// writeBigInt64LE +const JSC::ConstructAbility s_jsBufferPrototypeWriteBigInt64LECodeConstructAbility = JSC::ConstructAbility::CannotConstruct; +const JSC::ConstructorKind s_jsBufferPrototypeWriteBigInt64LECodeConstructorKind = JSC::ConstructorKind::None; +const JSC::ImplementationVisibility s_jsBufferPrototypeWriteBigInt64LECodeImplementationVisibility = JSC::ImplementationVisibility::Public; +const int s_jsBufferPrototypeWriteBigInt64LECodeLength = 178; +static const JSC::Intrinsic s_jsBufferPrototypeWriteBigInt64LECodeIntrinsic = JSC::NoIntrinsic; +const char* const s_jsBufferPrototypeWriteBigInt64LECode = "(function (value, offset) {\"use strict\";\n return (this.@dataView ||= new DataView(this.buffer, this.byteOffset, this.byteLength)).setBigInt64(offset, value, !0), offset + 8;\n})\n"; -// readableStreamReaderGenericRelease -const JSC::ConstructAbility s_readableStreamInternalsReadableStreamReaderGenericReleaseCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; -const JSC::ConstructorKind s_readableStreamInternalsReadableStreamReaderGenericReleaseCodeConstructorKind = JSC::ConstructorKind::None; -const JSC::ImplementationVisibility s_readableStreamInternalsReadableStreamReaderGenericReleaseCodeImplementationVisibility = JSC::ImplementationVisibility::Public; -const int s_readableStreamInternalsReadableStreamReaderGenericReleaseCodeLength = 749; -static const JSC::Intrinsic s_readableStreamInternalsReadableStreamReaderGenericReleaseCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_readableStreamInternalsReadableStreamReaderGenericReleaseCode = "(function (reader) {\"use strict\";\n if (@getByIdDirectPrivate(@getByIdDirectPrivate(reader, \"ownerReadableStream\"), \"state\") === 4)\n @getByIdDirectPrivate(reader, \"closedPromiseCapability\").reject.@call(@undefined, @makeTypeError(\"releasing lock of reader whose stream is still in readable state\"));\n else\n @putByIdDirectPrivate(reader, \"closedPromiseCapability\", {\n promise: @newHandledRejectedPromise(@makeTypeError(\"reader released lock\"))\n });\n const promise = @getByIdDirectPrivate(reader, \"closedPromiseCapability\").promise;\n @markPromiseAsHandled(promise), @putByIdDirectPrivate(@getByIdDirectPrivate(reader, \"ownerReadableStream\"), \"reader\", @undefined), @putByIdDirectPrivate(reader, \"ownerReadableStream\", @undefined);\n})\n"; +// writeBigInt64BE +const JSC::ConstructAbility s_jsBufferPrototypeWriteBigInt64BECodeConstructAbility = JSC::ConstructAbility::CannotConstruct; +const JSC::ConstructorKind s_jsBufferPrototypeWriteBigInt64BECodeConstructorKind = JSC::ConstructorKind::None; +const JSC::ImplementationVisibility s_jsBufferPrototypeWriteBigInt64BECodeImplementationVisibility = JSC::ImplementationVisibility::Public; +const int s_jsBufferPrototypeWriteBigInt64BECodeLength = 178; +static const JSC::Intrinsic s_jsBufferPrototypeWriteBigInt64BECodeIntrinsic = JSC::NoIntrinsic; +const char* const s_jsBufferPrototypeWriteBigInt64BECode = "(function (value, offset) {\"use strict\";\n return (this.@dataView ||= new DataView(this.buffer, this.byteOffset, this.byteLength)).setBigInt64(offset, value, !1), offset + 8;\n})\n"; -// readableStreamDefaultControllerCanCloseOrEnqueue -const JSC::ConstructAbility s_readableStreamInternalsReadableStreamDefaultControllerCanCloseOrEnqueueCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; -const JSC::ConstructorKind s_readableStreamInternalsReadableStreamDefaultControllerCanCloseOrEnqueueCodeConstructorKind = JSC::ConstructorKind::None; -const JSC::ImplementationVisibility s_readableStreamInternalsReadableStreamDefaultControllerCanCloseOrEnqueueCodeImplementationVisibility = JSC::ImplementationVisibility::Public; -const int s_readableStreamInternalsReadableStreamDefaultControllerCanCloseOrEnqueueCodeLength = 207; -static const JSC::Intrinsic s_readableStreamInternalsReadableStreamDefaultControllerCanCloseOrEnqueueCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_readableStreamInternalsReadableStreamDefaultControllerCanCloseOrEnqueueCode = "(function (controller) {\"use strict\";\n return !@getByIdDirectPrivate(controller, \"closeRequested\") && @getByIdDirectPrivate(@getByIdDirectPrivate(controller, \"controlledReadableStream\"), \"state\") === 4;\n})\n"; +// writeBigUInt64LE +const JSC::ConstructAbility s_jsBufferPrototypeWriteBigUInt64LECodeConstructAbility = JSC::ConstructAbility::CannotConstruct; +const JSC::ConstructorKind s_jsBufferPrototypeWriteBigUInt64LECodeConstructorKind = JSC::ConstructorKind::None; +const JSC::ImplementationVisibility s_jsBufferPrototypeWriteBigUInt64LECodeImplementationVisibility = JSC::ImplementationVisibility::Public; +const int s_jsBufferPrototypeWriteBigUInt64LECodeLength = 179; +static const JSC::Intrinsic s_jsBufferPrototypeWriteBigUInt64LECodeIntrinsic = JSC::NoIntrinsic; +const char* const s_jsBufferPrototypeWriteBigUInt64LECode = "(function (value, offset) {\"use strict\";\n return (this.@dataView ||= new DataView(this.buffer, this.byteOffset, this.byteLength)).setBigUint64(offset, value, !0), offset + 8;\n})\n"; -// lazyLoadStream -const JSC::ConstructAbility s_readableStreamInternalsLazyLoadStreamCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; -const JSC::ConstructorKind s_readableStreamInternalsLazyLoadStreamCodeConstructorKind = JSC::ConstructorKind::None; -const JSC::ImplementationVisibility s_readableStreamInternalsLazyLoadStreamCodeImplementationVisibility = JSC::ImplementationVisibility::Public; -const int s_readableStreamInternalsLazyLoadStreamCodeLength = 3907; -static const JSC::Intrinsic s_readableStreamInternalsLazyLoadStreamCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_readableStreamInternalsLazyLoadStreamCode = "(function (stream, autoAllocateChunkSize) {\"use strict\";\n var nativeType = @getByIdDirectPrivate(stream, \"bunNativeType\"), nativePtr = @getByIdDirectPrivate(stream, \"bunNativePtr\"), Prototype = @lazyStreamPrototypeMap.@get(nativeType);\n if (Prototype === @undefined) {\n let handleNativeReadableStreamPromiseResult2 = function(val) {\n var { c, v } = this;\n this.c = @undefined, this.v = @undefined, handleResult(val, c, v);\n }, callClose2 = function(controller) {\n try {\n if (@getByIdDirectPrivate(@getByIdDirectPrivate(controller, \"controlledReadableStream\"), \"state\") === 4)\n controller.close();\n } catch (e) {\n globalThis.reportError(e);\n }\n }, createResult2 = function(tag, controller, view, closer2) {\n closer2[0] = !1;\n var result;\n try {\n result = pull(tag, view, closer2);\n } catch (err) {\n return controller.error(err);\n }\n return handleResult(result, controller, view);\n };\n var handleNativeReadableStreamPromiseResult = handleNativeReadableStreamPromiseResult2, callClose = callClose2, createResult = createResult2, [pull, start, cancel, setClose, deinit, setRefOrUnref, drain] = @lazy(nativeType), closer = [!1], handleResult;\n handleResult = function handleResult(result, controller, view) {\n if (result && @isPromise(result))\n return result.then(handleNativeReadableStreamPromiseResult2.bind({\n c: controller,\n v: view\n }), (err) => controller.error(err));\n else if (typeof result === \"number\")\n if (view && view.byteLength === result && view.buffer === controller.byobRequest\?.view\?.buffer)\n controller.byobRequest.respondWithNewView(view);\n else\n controller.byobRequest.respond(result);\n else if (result.constructor === @Uint8Array)\n controller.enqueue(result);\n if (closer[0] || result === !1)\n @enqueueJob(callClose2, controller), closer[0] = !1;\n };\n const registry = deinit \? new FinalizationRegistry(deinit) : null;\n Prototype = class NativeReadableStreamSource {\n constructor(tag, autoAllocateChunkSize2, drainValue2) {\n if (this.#tag = tag, this.#cancellationToken = {}, this.pull = this.#pull.bind(this), this.cancel = this.#cancel.bind(this), this.autoAllocateChunkSize = autoAllocateChunkSize2, drainValue2 !== @undefined)\n this.start = (controller) => {\n controller.enqueue(drainValue2);\n };\n if (registry)\n registry.register(this, tag, this.#cancellationToken);\n }\n #cancellationToken;\n pull;\n cancel;\n start;\n #tag;\n type = \"bytes\";\n autoAllocateChunkSize = 0;\n static startSync = start;\n #pull(controller) {\n var tag = this.#tag;\n if (!tag) {\n controller.close();\n return;\n }\n createResult2(tag, controller, controller.byobRequest.view, closer);\n }\n #cancel(reason) {\n var tag = this.#tag;\n registry && registry.unregister(this.#cancellationToken), setRefOrUnref && setRefOrUnref(tag, !1), cancel(tag, reason);\n }\n static deinit = deinit;\n static drain = drain;\n }, @lazyStreamPrototypeMap.@set(nativeType, Prototype);\n }\n const chunkSize = Prototype.startSync(nativePtr, autoAllocateChunkSize);\n var drainValue;\n const { drain: drainFn, deinit: deinitFn } = Prototype;\n if (drainFn)\n drainValue = drainFn(nativePtr);\n if (chunkSize === 0) {\n if (deinit && nativePtr && @enqueueJob(deinit, nativePtr), (drainValue\?.byteLength \?\? 0) > 0)\n return {\n start(controller) {\n controller.enqueue(drainValue), controller.close();\n },\n type: \"bytes\"\n };\n return {\n start(controller) {\n controller.close();\n },\n type: \"bytes\"\n };\n }\n return new Prototype(nativePtr, chunkSize, drainValue);\n})\n"; +// writeBigUInt64BE +const JSC::ConstructAbility s_jsBufferPrototypeWriteBigUInt64BECodeConstructAbility = JSC::ConstructAbility::CannotConstruct; +const JSC::ConstructorKind s_jsBufferPrototypeWriteBigUInt64BECodeConstructorKind = JSC::ConstructorKind::None; +const JSC::ImplementationVisibility s_jsBufferPrototypeWriteBigUInt64BECodeImplementationVisibility = JSC::ImplementationVisibility::Public; +const int s_jsBufferPrototypeWriteBigUInt64BECodeLength = 179; +static const JSC::Intrinsic s_jsBufferPrototypeWriteBigUInt64BECodeIntrinsic = JSC::NoIntrinsic; +const char* const s_jsBufferPrototypeWriteBigUInt64BECode = "(function (value, offset) {\"use strict\";\n return (this.@dataView ||= new DataView(this.buffer, this.byteOffset, this.byteLength)).setBigUint64(offset, value, !1), offset + 8;\n})\n"; -// readableStreamIntoArray -const JSC::ConstructAbility s_readableStreamInternalsReadableStreamIntoArrayCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; -const JSC::ConstructorKind s_readableStreamInternalsReadableStreamIntoArrayCodeConstructorKind = JSC::ConstructorKind::None; -const JSC::ImplementationVisibility s_readableStreamInternalsReadableStreamIntoArrayCodeImplementationVisibility = JSC::ImplementationVisibility::Public; -const int s_readableStreamInternalsReadableStreamIntoArrayCodeLength = 536; -static const JSC::Intrinsic s_readableStreamInternalsReadableStreamIntoArrayCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_readableStreamInternalsReadableStreamIntoArrayCode = "(function (stream) {\"use strict\";\n var reader = stream.getReader(), manyResult = reader.readMany();\n async function processManyResult(result) {\n if (result.done)\n return [];\n var chunks = result.value || [];\n while (!0) {\n var thisResult = await reader.read();\n if (thisResult.done)\n break;\n chunks = chunks.concat(thisResult.value);\n }\n return chunks;\n }\n if (manyResult && @isPromise(manyResult))\n return manyResult.@then(processManyResult);\n return processManyResult(manyResult);\n})\n"; +// utf8Write +const JSC::ConstructAbility s_jsBufferPrototypeUtf8WriteCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; +const JSC::ConstructorKind s_jsBufferPrototypeUtf8WriteCodeConstructorKind = JSC::ConstructorKind::None; +const JSC::ImplementationVisibility s_jsBufferPrototypeUtf8WriteCodeImplementationVisibility = JSC::ImplementationVisibility::Public; +const int s_jsBufferPrototypeUtf8WriteCodeLength = 102; +static const JSC::Intrinsic s_jsBufferPrototypeUtf8WriteCodeIntrinsic = JSC::NoIntrinsic; +const char* const s_jsBufferPrototypeUtf8WriteCode = "(function (text, offset, length) {\"use strict\";\n return this.write(text, offset, length, \"utf8\");\n})\n"; -// readableStreamIntoText -const JSC::ConstructAbility s_readableStreamInternalsReadableStreamIntoTextCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; -const JSC::ConstructorKind s_readableStreamInternalsReadableStreamIntoTextCodeConstructorKind = JSC::ConstructorKind::None; -const JSC::ImplementationVisibility s_readableStreamInternalsReadableStreamIntoTextCodeImplementationVisibility = JSC::ImplementationVisibility::Public; -const int s_readableStreamInternalsReadableStreamIntoTextCodeLength = 302; -static const JSC::Intrinsic s_readableStreamInternalsReadableStreamIntoTextCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_readableStreamInternalsReadableStreamIntoTextCode = "(function (stream) {\"use strict\";\n const [textStream, closer] = @createTextStream(@getByIdDirectPrivate(stream, \"highWaterMark\")), prom = @readStreamIntoSink(stream, textStream, !1);\n if (prom && @isPromise(prom))\n return @Promise.@resolve(prom).@then(closer.promise);\n return closer.promise;\n})\n"; +// ucs2Write +const JSC::ConstructAbility s_jsBufferPrototypeUcs2WriteCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; +const JSC::ConstructorKind s_jsBufferPrototypeUcs2WriteCodeConstructorKind = JSC::ConstructorKind::None; +const JSC::ImplementationVisibility s_jsBufferPrototypeUcs2WriteCodeImplementationVisibility = JSC::ImplementationVisibility::Public; +const int s_jsBufferPrototypeUcs2WriteCodeLength = 102; +static const JSC::Intrinsic s_jsBufferPrototypeUcs2WriteCodeIntrinsic = JSC::NoIntrinsic; +const char* const s_jsBufferPrototypeUcs2WriteCode = "(function (text, offset, length) {\"use strict\";\n return this.write(text, offset, length, \"ucs2\");\n})\n"; -// readableStreamToArrayBufferDirect -const JSC::ConstructAbility s_readableStreamInternalsReadableStreamToArrayBufferDirectCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; -const JSC::ConstructorKind s_readableStreamInternalsReadableStreamToArrayBufferDirectCodeConstructorKind = JSC::ConstructorKind::None; -const JSC::ImplementationVisibility s_readableStreamInternalsReadableStreamToArrayBufferDirectCodeImplementationVisibility = JSC::ImplementationVisibility::Public; -const int s_readableStreamInternalsReadableStreamToArrayBufferDirectCodeLength = 1422; -static const JSC::Intrinsic s_readableStreamInternalsReadableStreamToArrayBufferDirectCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_readableStreamInternalsReadableStreamToArrayBufferDirectCode = "(function (stream, underlyingSource) {\"use strict\";\n var sink = new Bun.ArrayBufferSink;\n @putByIdDirectPrivate(stream, \"underlyingSource\", @undefined);\n var highWaterMark = @getByIdDirectPrivate(stream, \"highWaterMark\");\n sink.start(highWaterMark \? { highWaterMark } : {});\n var capability = @newPromiseCapability(@Promise), ended = !1, pull = underlyingSource.pull, close = underlyingSource.close, controller = {\n start() {\n },\n close(reason) {\n if (!ended) {\n if (ended = !0, close)\n close();\n @fulfillPromise(capability.promise, sink.end());\n }\n },\n end() {\n if (!ended) {\n if (ended = !0, close)\n close();\n @fulfillPromise(capability.promise, sink.end());\n }\n },\n flush() {\n return 0;\n },\n write: sink.write.bind(sink)\n }, didError = !1;\n try {\n const firstPull = pull(controller);\n if (firstPull && @isObject(firstPull) && @isPromise(firstPull))\n return async function(controller2, promise2, pull2) {\n while (!ended)\n await pull2(controller2);\n return await promise2;\n }(controller, promise, pull);\n return capability.promise;\n } catch (e) {\n return didError = !0, @readableStreamError(stream, e), @Promise.@reject(e);\n } finally {\n if (!didError && stream)\n @readableStreamClose(stream);\n controller = close = sink = pull = stream = @undefined;\n }\n})\n"; +// utf16leWrite +const JSC::ConstructAbility s_jsBufferPrototypeUtf16leWriteCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; +const JSC::ConstructorKind s_jsBufferPrototypeUtf16leWriteCodeConstructorKind = JSC::ConstructorKind::None; +const JSC::ImplementationVisibility s_jsBufferPrototypeUtf16leWriteCodeImplementationVisibility = JSC::ImplementationVisibility::Public; +const int s_jsBufferPrototypeUtf16leWriteCodeLength = 105; +static const JSC::Intrinsic s_jsBufferPrototypeUtf16leWriteCodeIntrinsic = JSC::NoIntrinsic; +const char* const s_jsBufferPrototypeUtf16leWriteCode = "(function (text, offset, length) {\"use strict\";\n return this.write(text, offset, length, \"utf16le\");\n})\n"; -// readableStreamToTextDirect -const JSC::ConstructAbility s_readableStreamInternalsReadableStreamToTextDirectCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; -const JSC::ConstructorKind s_readableStreamInternalsReadableStreamToTextDirectCodeConstructorKind = JSC::ConstructorKind::None; -const JSC::ImplementationVisibility s_readableStreamInternalsReadableStreamToTextDirectCodeImplementationVisibility = JSC::ImplementationVisibility::Public; -const int s_readableStreamInternalsReadableStreamToTextDirectCodeLength = 450; -static const JSC::Intrinsic s_readableStreamInternalsReadableStreamToTextDirectCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_readableStreamInternalsReadableStreamToTextDirectCode = "(async function (stream, underlyingSource) {\"use strict\";\n const capability = @initializeTextStream.@call(stream, underlyingSource, @undefined);\n var reader = stream.getReader();\n while (@getByIdDirectPrivate(stream, \"state\") === 4) {\n var thisResult = await reader.read();\n if (thisResult.done)\n break;\n }\n try {\n reader.releaseLock();\n } catch (e) {\n }\n return reader = @undefined, stream = @undefined, capability.promise;\n})\n"; +// latin1Write +const JSC::ConstructAbility s_jsBufferPrototypeLatin1WriteCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; +const JSC::ConstructorKind s_jsBufferPrototypeLatin1WriteCodeConstructorKind = JSC::ConstructorKind::None; +const JSC::ImplementationVisibility s_jsBufferPrototypeLatin1WriteCodeImplementationVisibility = JSC::ImplementationVisibility::Public; +const int s_jsBufferPrototypeLatin1WriteCodeLength = 104; +static const JSC::Intrinsic s_jsBufferPrototypeLatin1WriteCodeIntrinsic = JSC::NoIntrinsic; +const char* const s_jsBufferPrototypeLatin1WriteCode = "(function (text, offset, length) {\"use strict\";\n return this.write(text, offset, length, \"latin1\");\n})\n"; -// readableStreamToArrayDirect -const JSC::ConstructAbility s_readableStreamInternalsReadableStreamToArrayDirectCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; -const JSC::ConstructorKind s_readableStreamInternalsReadableStreamToArrayDirectCodeConstructorKind = JSC::ConstructorKind::None; -const JSC::ImplementationVisibility s_readableStreamInternalsReadableStreamToArrayDirectCodeImplementationVisibility = JSC::ImplementationVisibility::Public; -const int s_readableStreamInternalsReadableStreamToArrayDirectCodeLength = 603; -static const JSC::Intrinsic s_readableStreamInternalsReadableStreamToArrayDirectCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_readableStreamInternalsReadableStreamToArrayDirectCode = "(async function (stream, underlyingSource) {\"use strict\";\n const capability = @initializeArrayStream.@call(stream, underlyingSource, @undefined);\n underlyingSource = @undefined;\n var reader = stream.getReader();\n try {\n while (@getByIdDirectPrivate(stream, \"state\") === 4) {\n var thisResult = await reader.read();\n if (thisResult.done)\n break;\n }\n try {\n reader.releaseLock();\n } catch (e) {\n }\n return reader = @undefined, @Promise.@resolve(capability.promise);\n } catch (e) {\n throw e;\n } finally {\n stream = @undefined, reader = @undefined;\n }\n})\n"; +// asciiWrite +const JSC::ConstructAbility s_jsBufferPrototypeAsciiWriteCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; +const JSC::ConstructorKind s_jsBufferPrototypeAsciiWriteCodeConstructorKind = JSC::ConstructorKind::None; +const JSC::ImplementationVisibility s_jsBufferPrototypeAsciiWriteCodeImplementationVisibility = JSC::ImplementationVisibility::Public; +const int s_jsBufferPrototypeAsciiWriteCodeLength = 103; +static const JSC::Intrinsic s_jsBufferPrototypeAsciiWriteCodeIntrinsic = JSC::NoIntrinsic; +const char* const s_jsBufferPrototypeAsciiWriteCode = "(function (text, offset, length) {\"use strict\";\n return this.write(text, offset, length, \"ascii\");\n})\n"; -// readableStreamDefineLazyIterators -const JSC::ConstructAbility s_readableStreamInternalsReadableStreamDefineLazyIteratorsCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; -const JSC::ConstructorKind s_readableStreamInternalsReadableStreamDefineLazyIteratorsCodeConstructorKind = JSC::ConstructorKind::None; -const JSC::ImplementationVisibility s_readableStreamInternalsReadableStreamDefineLazyIteratorsCodeImplementationVisibility = JSC::ImplementationVisibility::Public; -const int s_readableStreamInternalsReadableStreamDefineLazyIteratorsCodeLength = 1190; -static const JSC::Intrinsic s_readableStreamInternalsReadableStreamDefineLazyIteratorsCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_readableStreamInternalsReadableStreamDefineLazyIteratorsCode = "(function (prototype) {\"use strict\";\n var asyncIterator = globalThis.Symbol.asyncIterator, ReadableStreamAsyncIterator = async function* ReadableStreamAsyncIterator(stream, preventCancel) {\n var reader = stream.getReader(), deferredError;\n try {\n while (!0) {\n var done, value;\n const firstResult = reader.readMany();\n if (@isPromise(firstResult))\n ({ done, value } = await firstResult);\n else\n ({ done, value } = firstResult);\n if (done)\n return;\n yield* value;\n }\n } catch (e) {\n deferredError = e;\n } finally {\n if (reader.releaseLock(), !preventCancel)\n stream.cancel(deferredError);\n if (deferredError)\n throw deferredError;\n }\n }, createAsyncIterator = function asyncIterator() {\n return ReadableStreamAsyncIterator(this, !1);\n }, createValues = function values({ preventCancel = !1 } = { preventCancel: !1 }) {\n return ReadableStreamAsyncIterator(this, preventCancel);\n };\n return @Object.@defineProperty(prototype, asyncIterator, { value: createAsyncIterator }), @Object.@defineProperty(prototype, \"values\", { value: createValues }), prototype;\n})\n"; +// base64Write +const JSC::ConstructAbility s_jsBufferPrototypeBase64WriteCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; +const JSC::ConstructorKind s_jsBufferPrototypeBase64WriteCodeConstructorKind = JSC::ConstructorKind::None; +const JSC::ImplementationVisibility s_jsBufferPrototypeBase64WriteCodeImplementationVisibility = JSC::ImplementationVisibility::Public; +const int s_jsBufferPrototypeBase64WriteCodeLength = 104; +static const JSC::Intrinsic s_jsBufferPrototypeBase64WriteCodeIntrinsic = JSC::NoIntrinsic; +const char* const s_jsBufferPrototypeBase64WriteCode = "(function (text, offset, length) {\"use strict\";\n return this.write(text, offset, length, \"base64\");\n})\n"; -#define DEFINE_BUILTIN_GENERATOR(codeName, functionName, overriddenName, argumentCount) \ -JSC::FunctionExecutable* codeName##Generator(JSC::VM& vm) \ -{\ - JSVMClientData* clientData = static_cast(vm.clientData); \ - return clientData->builtinFunctions().readableStreamInternalsBuiltins().codeName##Executable()->link(vm, nullptr, clientData->builtinFunctions().readableStreamInternalsBuiltins().codeName##Source(), std::nullopt, s_##codeName##Intrinsic); \ -} -WEBCORE_FOREACH_READABLESTREAMINTERNALS_BUILTIN_CODE(DEFINE_BUILTIN_GENERATOR) -#undef DEFINE_BUILTIN_GENERATOR +// base64urlWrite +const JSC::ConstructAbility s_jsBufferPrototypeBase64urlWriteCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; +const JSC::ConstructorKind s_jsBufferPrototypeBase64urlWriteCodeConstructorKind = JSC::ConstructorKind::None; +const JSC::ImplementationVisibility s_jsBufferPrototypeBase64urlWriteCodeImplementationVisibility = JSC::ImplementationVisibility::Public; +const int s_jsBufferPrototypeBase64urlWriteCodeLength = 107; +static const JSC::Intrinsic s_jsBufferPrototypeBase64urlWriteCodeIntrinsic = JSC::NoIntrinsic; +const char* const s_jsBufferPrototypeBase64urlWriteCode = "(function (text, offset, length) {\"use strict\";\n return this.write(text, offset, length, \"base64url\");\n})\n"; -/* TransformStreamDefaultController.ts */ -// initializeTransformStreamDefaultController -const JSC::ConstructAbility s_transformStreamDefaultControllerInitializeTransformStreamDefaultControllerCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; -const JSC::ConstructorKind s_transformStreamDefaultControllerInitializeTransformStreamDefaultControllerCodeConstructorKind = JSC::ConstructorKind::None; -const JSC::ImplementationVisibility s_transformStreamDefaultControllerInitializeTransformStreamDefaultControllerCodeImplementationVisibility = JSC::ImplementationVisibility::Public; -const int s_transformStreamDefaultControllerInitializeTransformStreamDefaultControllerCodeLength = 46; -static const JSC::Intrinsic s_transformStreamDefaultControllerInitializeTransformStreamDefaultControllerCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_transformStreamDefaultControllerInitializeTransformStreamDefaultControllerCode = "(function () {\"use strict\";\n return this;\n})\n"; +// hexWrite +const JSC::ConstructAbility s_jsBufferPrototypeHexWriteCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; +const JSC::ConstructorKind s_jsBufferPrototypeHexWriteCodeConstructorKind = JSC::ConstructorKind::None; +const JSC::ImplementationVisibility s_jsBufferPrototypeHexWriteCodeImplementationVisibility = JSC::ImplementationVisibility::Public; +const int s_jsBufferPrototypeHexWriteCodeLength = 101; +static const JSC::Intrinsic s_jsBufferPrototypeHexWriteCodeIntrinsic = JSC::NoIntrinsic; +const char* const s_jsBufferPrototypeHexWriteCode = "(function (text, offset, length) {\"use strict\";\n return this.write(text, offset, length, \"hex\");\n})\n"; -// desiredSize -const JSC::ConstructAbility s_transformStreamDefaultControllerDesiredSizeCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; -const JSC::ConstructorKind s_transformStreamDefaultControllerDesiredSizeCodeConstructorKind = JSC::ConstructorKind::None; -const JSC::ImplementationVisibility s_transformStreamDefaultControllerDesiredSizeCodeImplementationVisibility = JSC::ImplementationVisibility::Public; -const int s_transformStreamDefaultControllerDesiredSizeCodeLength = 427; -static const JSC::Intrinsic s_transformStreamDefaultControllerDesiredSizeCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_transformStreamDefaultControllerDesiredSizeCode = "(function () {\"use strict\";\n if (!@isTransformStreamDefaultController(this))\n throw @makeThisTypeError(\"TransformStreamDefaultController\", \"enqueue\");\n const stream = @getByIdDirectPrivate(this, \"stream\"), readable = @getByIdDirectPrivate(stream, \"readable\"), readableController = @getByIdDirectPrivate(readable, \"readableStreamController\");\n return @readableStreamDefaultControllerGetDesiredSize(readableController);\n})\n"; +// utf8Slice +const JSC::ConstructAbility s_jsBufferPrototypeUtf8SliceCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; +const JSC::ConstructorKind s_jsBufferPrototypeUtf8SliceCodeConstructorKind = JSC::ConstructorKind::None; +const JSC::ImplementationVisibility s_jsBufferPrototypeUtf8SliceCodeImplementationVisibility = JSC::ImplementationVisibility::Public; +const int s_jsBufferPrototypeUtf8SliceCodeLength = 85; +static const JSC::Intrinsic s_jsBufferPrototypeUtf8SliceCodeIntrinsic = JSC::NoIntrinsic; +const char* const s_jsBufferPrototypeUtf8SliceCode = "(function (start, end) {\"use strict\";\n return this.toString(\"utf8\", start, end);\n})\n"; -// enqueue -const JSC::ConstructAbility s_transformStreamDefaultControllerEnqueueCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; -const JSC::ConstructorKind s_transformStreamDefaultControllerEnqueueCodeConstructorKind = JSC::ConstructorKind::None; -const JSC::ImplementationVisibility s_transformStreamDefaultControllerEnqueueCodeImplementationVisibility = JSC::ImplementationVisibility::Public; -const int s_transformStreamDefaultControllerEnqueueCodeLength = 220; -static const JSC::Intrinsic s_transformStreamDefaultControllerEnqueueCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_transformStreamDefaultControllerEnqueueCode = "(function (chunk) {\"use strict\";\n if (!@isTransformStreamDefaultController(this))\n throw @makeThisTypeError(\"TransformStreamDefaultController\", \"enqueue\");\n @transformStreamDefaultControllerEnqueue(this, chunk);\n})\n"; +// ucs2Slice +const JSC::ConstructAbility s_jsBufferPrototypeUcs2SliceCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; +const JSC::ConstructorKind s_jsBufferPrototypeUcs2SliceCodeConstructorKind = JSC::ConstructorKind::None; +const JSC::ImplementationVisibility s_jsBufferPrototypeUcs2SliceCodeImplementationVisibility = JSC::ImplementationVisibility::Public; +const int s_jsBufferPrototypeUcs2SliceCodeLength = 85; +static const JSC::Intrinsic s_jsBufferPrototypeUcs2SliceCodeIntrinsic = JSC::NoIntrinsic; +const char* const s_jsBufferPrototypeUcs2SliceCode = "(function (start, end) {\"use strict\";\n return this.toString(\"ucs2\", start, end);\n})\n"; -// error -const JSC::ConstructAbility s_transformStreamDefaultControllerErrorCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; -const JSC::ConstructorKind s_transformStreamDefaultControllerErrorCodeConstructorKind = JSC::ConstructorKind::None; -const JSC::ImplementationVisibility s_transformStreamDefaultControllerErrorCodeImplementationVisibility = JSC::ImplementationVisibility::Public; -const int s_transformStreamDefaultControllerErrorCodeLength = 208; -static const JSC::Intrinsic s_transformStreamDefaultControllerErrorCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_transformStreamDefaultControllerErrorCode = "(function (e) {\"use strict\";\n if (!@isTransformStreamDefaultController(this))\n throw @makeThisTypeError(\"TransformStreamDefaultController\", \"error\");\n @transformStreamDefaultControllerError(this, e);\n})\n"; +// utf16leSlice +const JSC::ConstructAbility s_jsBufferPrototypeUtf16leSliceCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; +const JSC::ConstructorKind s_jsBufferPrototypeUtf16leSliceCodeConstructorKind = JSC::ConstructorKind::None; +const JSC::ImplementationVisibility s_jsBufferPrototypeUtf16leSliceCodeImplementationVisibility = JSC::ImplementationVisibility::Public; +const int s_jsBufferPrototypeUtf16leSliceCodeLength = 88; +static const JSC::Intrinsic s_jsBufferPrototypeUtf16leSliceCodeIntrinsic = JSC::NoIntrinsic; +const char* const s_jsBufferPrototypeUtf16leSliceCode = "(function (start, end) {\"use strict\";\n return this.toString(\"utf16le\", start, end);\n})\n"; -// terminate -const JSC::ConstructAbility s_transformStreamDefaultControllerTerminateCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; -const JSC::ConstructorKind s_transformStreamDefaultControllerTerminateCodeConstructorKind = JSC::ConstructorKind::None; -const JSC::ImplementationVisibility s_transformStreamDefaultControllerTerminateCodeImplementationVisibility = JSC::ImplementationVisibility::Public; -const int s_transformStreamDefaultControllerTerminateCodeLength = 212; -static const JSC::Intrinsic s_transformStreamDefaultControllerTerminateCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_transformStreamDefaultControllerTerminateCode = "(function () {\"use strict\";\n if (!@isTransformStreamDefaultController(this))\n throw @makeThisTypeError(\"TransformStreamDefaultController\", \"terminate\");\n @transformStreamDefaultControllerTerminate(this);\n})\n"; +// latin1Slice +const JSC::ConstructAbility s_jsBufferPrototypeLatin1SliceCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; +const JSC::ConstructorKind s_jsBufferPrototypeLatin1SliceCodeConstructorKind = JSC::ConstructorKind::None; +const JSC::ImplementationVisibility s_jsBufferPrototypeLatin1SliceCodeImplementationVisibility = JSC::ImplementationVisibility::Public; +const int s_jsBufferPrototypeLatin1SliceCodeLength = 87; +static const JSC::Intrinsic s_jsBufferPrototypeLatin1SliceCodeIntrinsic = JSC::NoIntrinsic; +const char* const s_jsBufferPrototypeLatin1SliceCode = "(function (start, end) {\"use strict\";\n return this.toString(\"latin1\", start, end);\n})\n"; -#define DEFINE_BUILTIN_GENERATOR(codeName, functionName, overriddenName, argumentCount) \ -JSC::FunctionExecutable* codeName##Generator(JSC::VM& vm) \ -{\ - JSVMClientData* clientData = static_cast(vm.clientData); \ - return clientData->builtinFunctions().transformStreamDefaultControllerBuiltins().codeName##Executable()->link(vm, nullptr, clientData->builtinFunctions().transformStreamDefaultControllerBuiltins().codeName##Source(), std::nullopt, s_##codeName##Intrinsic); \ -} -WEBCORE_FOREACH_TRANSFORMSTREAMDEFAULTCONTROLLER_BUILTIN_CODE(DEFINE_BUILTIN_GENERATOR) -#undef DEFINE_BUILTIN_GENERATOR +// asciiSlice +const JSC::ConstructAbility s_jsBufferPrototypeAsciiSliceCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; +const JSC::ConstructorKind s_jsBufferPrototypeAsciiSliceCodeConstructorKind = JSC::ConstructorKind::None; +const JSC::ImplementationVisibility s_jsBufferPrototypeAsciiSliceCodeImplementationVisibility = JSC::ImplementationVisibility::Public; +const int s_jsBufferPrototypeAsciiSliceCodeLength = 86; +static const JSC::Intrinsic s_jsBufferPrototypeAsciiSliceCodeIntrinsic = JSC::NoIntrinsic; +const char* const s_jsBufferPrototypeAsciiSliceCode = "(function (start, end) {\"use strict\";\n return this.toString(\"ascii\", start, end);\n})\n"; -/* ReadableStreamBYOBReader.ts */ -// initializeReadableStreamBYOBReader -const JSC::ConstructAbility s_readableStreamBYOBReaderInitializeReadableStreamBYOBReaderCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; -const JSC::ConstructorKind s_readableStreamBYOBReaderInitializeReadableStreamBYOBReaderCodeConstructorKind = JSC::ConstructorKind::None; -const JSC::ImplementationVisibility s_readableStreamBYOBReaderInitializeReadableStreamBYOBReaderCodeImplementationVisibility = JSC::ImplementationVisibility::Public; -const int s_readableStreamBYOBReaderInitializeReadableStreamBYOBReaderCodeLength = 549; -static const JSC::Intrinsic s_readableStreamBYOBReaderInitializeReadableStreamBYOBReaderCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_readableStreamBYOBReaderInitializeReadableStreamBYOBReaderCode = "(function (stream) {\"use strict\";\n if (!@isReadableStream(stream))\n @throwTypeError(\"ReadableStreamBYOBReader needs a ReadableStream\");\n if (!@isReadableByteStreamController(@getByIdDirectPrivate(stream, \"readableStreamController\")))\n @throwTypeError(\"ReadableStreamBYOBReader needs a ReadableByteStreamController\");\n if (@isReadableStreamLocked(stream))\n @throwTypeError(\"ReadableStream is locked\");\n return @readableStreamReaderGenericInitialize(this, stream), @putByIdDirectPrivate(this, \"readIntoRequests\", @createFIFO()), this;\n})\n"; +// base64Slice +const JSC::ConstructAbility s_jsBufferPrototypeBase64SliceCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; +const JSC::ConstructorKind s_jsBufferPrototypeBase64SliceCodeConstructorKind = JSC::ConstructorKind::None; +const JSC::ImplementationVisibility s_jsBufferPrototypeBase64SliceCodeImplementationVisibility = JSC::ImplementationVisibility::Public; +const int s_jsBufferPrototypeBase64SliceCodeLength = 87; +static const JSC::Intrinsic s_jsBufferPrototypeBase64SliceCodeIntrinsic = JSC::NoIntrinsic; +const char* const s_jsBufferPrototypeBase64SliceCode = "(function (start, end) {\"use strict\";\n return this.toString(\"base64\", start, end);\n})\n"; -// cancel -const JSC::ConstructAbility s_readableStreamBYOBReaderCancelCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; -const JSC::ConstructorKind s_readableStreamBYOBReaderCancelCodeConstructorKind = JSC::ConstructorKind::None; -const JSC::ImplementationVisibility s_readableStreamBYOBReaderCancelCodeImplementationVisibility = JSC::ImplementationVisibility::Public; -const int s_readableStreamBYOBReaderCancelCodeLength = 388; -static const JSC::Intrinsic s_readableStreamBYOBReaderCancelCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_readableStreamBYOBReaderCancelCode = "(function (reason) {\"use strict\";\n if (!@isReadableStreamBYOBReader(this))\n return @Promise.@reject(@makeThisTypeError(\"ReadableStreamBYOBReader\", \"cancel\"));\n if (!@getByIdDirectPrivate(this, \"ownerReadableStream\"))\n return @Promise.@reject(@makeTypeError(\"cancel() called on a reader owned by no readable stream\"));\n return @readableStreamReaderGenericCancel(this, reason);\n})\n"; +// base64urlSlice +const JSC::ConstructAbility s_jsBufferPrototypeBase64urlSliceCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; +const JSC::ConstructorKind s_jsBufferPrototypeBase64urlSliceCodeConstructorKind = JSC::ConstructorKind::None; +const JSC::ImplementationVisibility s_jsBufferPrototypeBase64urlSliceCodeImplementationVisibility = JSC::ImplementationVisibility::Public; +const int s_jsBufferPrototypeBase64urlSliceCodeLength = 90; +static const JSC::Intrinsic s_jsBufferPrototypeBase64urlSliceCodeIntrinsic = JSC::NoIntrinsic; +const char* const s_jsBufferPrototypeBase64urlSliceCode = "(function (start, end) {\"use strict\";\n return this.toString(\"base64url\", start, end);\n})\n"; -// read -const JSC::ConstructAbility s_readableStreamBYOBReaderReadCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; -const JSC::ConstructorKind s_readableStreamBYOBReaderReadCodeConstructorKind = JSC::ConstructorKind::None; -const JSC::ImplementationVisibility s_readableStreamBYOBReaderReadCodeImplementationVisibility = JSC::ImplementationVisibility::Public; -const int s_readableStreamBYOBReaderReadCodeLength = 719; -static const JSC::Intrinsic s_readableStreamBYOBReaderReadCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_readableStreamBYOBReaderReadCode = "(function (view) {\"use strict\";\n if (!@isReadableStreamBYOBReader(this))\n return @Promise.@reject(@makeThisTypeError(\"ReadableStreamBYOBReader\", \"read\"));\n if (!@getByIdDirectPrivate(this, \"ownerReadableStream\"))\n return @Promise.@reject(@makeTypeError(\"read() called on a reader owned by no readable stream\"));\n if (!@isObject(view))\n return @Promise.@reject(@makeTypeError(\"Provided view is not an object\"));\n if (!@ArrayBuffer.@isView(view))\n return @Promise.@reject(@makeTypeError(\"Provided view is not an ArrayBufferView\"));\n if (view.byteLength === 0)\n return @Promise.@reject(@makeTypeError(\"Provided view cannot have a 0 byteLength\"));\n return @readableStreamBYOBReaderRead(this, view);\n})\n"; +// hexSlice +const JSC::ConstructAbility s_jsBufferPrototypeHexSliceCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; +const JSC::ConstructorKind s_jsBufferPrototypeHexSliceCodeConstructorKind = JSC::ConstructorKind::None; +const JSC::ImplementationVisibility s_jsBufferPrototypeHexSliceCodeImplementationVisibility = JSC::ImplementationVisibility::Public; +const int s_jsBufferPrototypeHexSliceCodeLength = 84; +static const JSC::Intrinsic s_jsBufferPrototypeHexSliceCodeIntrinsic = JSC::NoIntrinsic; +const char* const s_jsBufferPrototypeHexSliceCode = "(function (start, end) {\"use strict\";\n return this.toString(\"hex\", start, end);\n})\n"; -// releaseLock -const JSC::ConstructAbility s_readableStreamBYOBReaderReleaseLockCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; -const JSC::ConstructorKind s_readableStreamBYOBReaderReleaseLockCodeConstructorKind = JSC::ConstructorKind::None; -const JSC::ImplementationVisibility s_readableStreamBYOBReaderReleaseLockCodeImplementationVisibility = JSC::ImplementationVisibility::Public; -const int s_readableStreamBYOBReaderReleaseLockCodeLength = 418; -static const JSC::Intrinsic s_readableStreamBYOBReaderReleaseLockCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_readableStreamBYOBReaderReleaseLockCode = "(function () {\"use strict\";\n if (!@isReadableStreamBYOBReader(this))\n throw @makeThisTypeError(\"ReadableStreamBYOBReader\", \"releaseLock\");\n if (!@getByIdDirectPrivate(this, \"ownerReadableStream\"))\n return;\n if (@getByIdDirectPrivate(this, \"readIntoRequests\")\?.isNotEmpty())\n @throwTypeError(\"There are still pending read requests, cannot release the lock\");\n @readableStreamReaderGenericRelease(this);\n})\n"; +// toJSON +const JSC::ConstructAbility s_jsBufferPrototypeToJSONCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; +const JSC::ConstructorKind s_jsBufferPrototypeToJSONCodeConstructorKind = JSC::ConstructorKind::None; +const JSC::ImplementationVisibility s_jsBufferPrototypeToJSONCodeImplementationVisibility = JSC::ImplementationVisibility::Public; +const int s_jsBufferPrototypeToJSONCodeLength = 85; +static const JSC::Intrinsic s_jsBufferPrototypeToJSONCodeIntrinsic = JSC::NoIntrinsic; +const char* const s_jsBufferPrototypeToJSONCode = "(function () {\"use strict\";\n return { type: \"Buffer\", data: @Array.from(this) };\n})\n"; -// closed -const JSC::ConstructAbility s_readableStreamBYOBReaderClosedCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; -const JSC::ConstructorKind s_readableStreamBYOBReaderClosedCodeConstructorKind = JSC::ConstructorKind::None; -const JSC::ImplementationVisibility s_readableStreamBYOBReaderClosedCodeImplementationVisibility = JSC::ImplementationVisibility::Public; -const int s_readableStreamBYOBReaderClosedCodeLength = 235; -static const JSC::Intrinsic s_readableStreamBYOBReaderClosedCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_readableStreamBYOBReaderClosedCode = "(function () {\"use strict\";\n if (!@isReadableStreamBYOBReader(this))\n return @Promise.@reject(@makeGetterTypeError(\"ReadableStreamBYOBReader\", \"closed\"));\n return @getByIdDirectPrivate(this, \"closedPromiseCapability\").promise;\n})\n"; +// slice +const JSC::ConstructAbility s_jsBufferPrototypeSliceCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; +const JSC::ConstructorKind s_jsBufferPrototypeSliceCodeConstructorKind = JSC::ConstructorKind::None; +const JSC::ImplementationVisibility s_jsBufferPrototypeSliceCodeImplementationVisibility = JSC::ImplementationVisibility::Public; +const int s_jsBufferPrototypeSliceCodeLength = 564; +static const JSC::Intrinsic s_jsBufferPrototypeSliceCodeIntrinsic = JSC::NoIntrinsic; +const char* const s_jsBufferPrototypeSliceCode = "(function (start, end) {\"use strict\";\n var { buffer, byteOffset, byteLength } = this;\n function adjustOffset(offset, length) {\n if (offset = @trunc(offset), offset === 0 || offset !== offset)\n return 0;\n else if (offset < 0)\n return offset += length, offset > 0 \? offset : 0;\n else\n return offset < length \? offset : length;\n }\n var start_ = adjustOffset(start, byteLength), end_ = end !== @undefined \? adjustOffset(end, byteLength) : byteLength;\n return new @Buffer(buffer, byteOffset + start_, end_ > start_ \? end_ - start_ : 0);\n})\n"; -#define DEFINE_BUILTIN_GENERATOR(codeName, functionName, overriddenName, argumentCount) \ -JSC::FunctionExecutable* codeName##Generator(JSC::VM& vm) \ -{\ - JSVMClientData* clientData = static_cast(vm.clientData); \ - return clientData->builtinFunctions().readableStreamBYOBReaderBuiltins().codeName##Executable()->link(vm, nullptr, clientData->builtinFunctions().readableStreamBYOBReaderBuiltins().codeName##Source(), std::nullopt, s_##codeName##Intrinsic); \ -} -WEBCORE_FOREACH_READABLESTREAMBYOBREADER_BUILTIN_CODE(DEFINE_BUILTIN_GENERATOR) -#undef DEFINE_BUILTIN_GENERATOR +// parent +const JSC::ConstructAbility s_jsBufferPrototypeParentCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; +const JSC::ConstructorKind s_jsBufferPrototypeParentCodeConstructorKind = JSC::ConstructorKind::None; +const JSC::ImplementationVisibility s_jsBufferPrototypeParentCodeImplementationVisibility = JSC::ImplementationVisibility::Public; +const int s_jsBufferPrototypeParentCodeLength = 111; +static const JSC::Intrinsic s_jsBufferPrototypeParentCodeIntrinsic = JSC::NoIntrinsic; +const char* const s_jsBufferPrototypeParentCode = "(function () {\"use strict\";\n return @isObject(this) && this instanceof @Buffer \? this.buffer : @undefined;\n})\n"; -/* JSBufferConstructor.ts */ -// from -const JSC::ConstructAbility s_jsBufferConstructorFromCodeConstructAbility = JSC::ConstructAbility::CanConstruct; -const JSC::ConstructorKind s_jsBufferConstructorFromCodeConstructorKind = JSC::ConstructorKind::None; -const JSC::ImplementationVisibility s_jsBufferConstructorFromCodeImplementationVisibility = JSC::ImplementationVisibility::Public; -const int s_jsBufferConstructorFromCodeLength = 1538; -static const JSC::Intrinsic s_jsBufferConstructorFromCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_jsBufferConstructorFromCode = "(function (items) {\"use strict\";\n if (@isUndefinedOrNull(items))\n @throwTypeError(\"The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object.\");\n if (typeof items === \"string\" || typeof items === \"object\" && (@isTypedArrayView(items) || items instanceof @ArrayBuffer || items instanceof SharedArrayBuffer || items instanceof @String))\n switch (@argumentCount()) {\n case 1:\n return new @Buffer(items);\n case 2:\n return new @Buffer(items, @argument(1));\n default:\n return new @Buffer(items, @argument(1), @argument(2));\n }\n var arrayLike = @toObject(items, \"The first argument must be of type string or an instance of Buffer, ArrayBuffer, or Array or an Array-like Object.\");\n if (!@isJSArray(arrayLike)) {\n const toPrimitive = @tryGetByIdWithWellKnownSymbol(items, \"toPrimitive\");\n if (toPrimitive) {\n const primitive = toPrimitive.@call(items, \"string\");\n if (typeof primitive === \"string\")\n switch (@argumentCount()) {\n case 1:\n return new @Buffer(primitive);\n case 2:\n return new @Buffer(primitive, @argument(1));\n default:\n return new @Buffer(primitive, @argument(1), @argument(2));\n }\n }\n if (!(\"length\" in arrayLike) || @isCallable(arrayLike))\n @throwTypeError(\"The first argument must be of type string or an instance of Buffer, ArrayBuffer, or Array or an Array-like Object.\");\n }\n return new @Buffer(@Uint8Array.from(arrayLike).buffer);\n})\n"; +// offset +const JSC::ConstructAbility s_jsBufferPrototypeOffsetCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; +const JSC::ConstructorKind s_jsBufferPrototypeOffsetCodeConstructorKind = JSC::ConstructorKind::None; +const JSC::ImplementationVisibility s_jsBufferPrototypeOffsetCodeImplementationVisibility = JSC::ImplementationVisibility::Public; +const int s_jsBufferPrototypeOffsetCodeLength = 115; +static const JSC::Intrinsic s_jsBufferPrototypeOffsetCodeIntrinsic = JSC::NoIntrinsic; +const char* const s_jsBufferPrototypeOffsetCode = "(function () {\"use strict\";\n return @isObject(this) && this instanceof @Buffer \? this.byteOffset : @undefined;\n})\n"; -// isBuffer -const JSC::ConstructAbility s_jsBufferConstructorIsBufferCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; -const JSC::ConstructorKind s_jsBufferConstructorIsBufferCodeConstructorKind = JSC::ConstructorKind::None; -const JSC::ImplementationVisibility s_jsBufferConstructorIsBufferCodeImplementationVisibility = JSC::ImplementationVisibility::Public; -const int s_jsBufferConstructorIsBufferCodeLength = 81; -static const JSC::Intrinsic s_jsBufferConstructorIsBufferCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_jsBufferConstructorIsBufferCode = "(function (bufferlike) {\"use strict\";\n return bufferlike instanceof @Buffer;\n})\n"; +// inspect +const JSC::ConstructAbility s_jsBufferPrototypeInspectCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; +const JSC::ConstructorKind s_jsBufferPrototypeInspectCodeConstructorKind = JSC::ConstructorKind::None; +const JSC::ImplementationVisibility s_jsBufferPrototypeInspectCodeImplementationVisibility = JSC::ImplementationVisibility::Public; +const int s_jsBufferPrototypeInspectCodeLength = 76; +static const JSC::Intrinsic s_jsBufferPrototypeInspectCodeIntrinsic = JSC::NoIntrinsic; +const char* const s_jsBufferPrototypeInspectCode = "(function (recurseTimes, ctx) {\"use strict\";\n return Bun.inspect(this);\n})\n"; #define DEFINE_BUILTIN_GENERATOR(codeName, functionName, overriddenName, argumentCount) \ JSC::FunctionExecutable* codeName##Generator(JSC::VM& vm) \ {\ JSVMClientData* clientData = static_cast(vm.clientData); \ - return clientData->builtinFunctions().jsBufferConstructorBuiltins().codeName##Executable()->link(vm, nullptr, clientData->builtinFunctions().jsBufferConstructorBuiltins().codeName##Source(), std::nullopt, s_##codeName##Intrinsic); \ + return clientData->builtinFunctions().jsBufferPrototypeBuiltins().codeName##Executable()->link(vm, nullptr, clientData->builtinFunctions().jsBufferPrototypeBuiltins().codeName##Source(), std::nullopt, s_##codeName##Intrinsic); \ } -WEBCORE_FOREACH_JSBUFFERCONSTRUCTOR_BUILTIN_CODE(DEFINE_BUILTIN_GENERATOR) +WEBCORE_FOREACH_JSBUFFERPROTOTYPE_BUILTIN_CODE(DEFINE_BUILTIN_GENERATOR) #undef DEFINE_BUILTIN_GENERATOR -/* ReadableStreamDefaultReader.ts */ -// initializeReadableStreamDefaultReader -const JSC::ConstructAbility s_readableStreamDefaultReaderInitializeReadableStreamDefaultReaderCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; -const JSC::ConstructorKind s_readableStreamDefaultReaderInitializeReadableStreamDefaultReaderCodeConstructorKind = JSC::ConstructorKind::None; -const JSC::ImplementationVisibility s_readableStreamDefaultReaderInitializeReadableStreamDefaultReaderCodeImplementationVisibility = JSC::ImplementationVisibility::Public; -const int s_readableStreamDefaultReaderInitializeReadableStreamDefaultReaderCodeLength = 363; -static const JSC::Intrinsic s_readableStreamDefaultReaderInitializeReadableStreamDefaultReaderCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_readableStreamDefaultReaderInitializeReadableStreamDefaultReaderCode = "(function (stream) {\"use strict\";\n if (!@isReadableStream(stream))\n @throwTypeError(\"ReadableStreamDefaultReader needs a ReadableStream\");\n if (@isReadableStreamLocked(stream))\n @throwTypeError(\"ReadableStream is locked\");\n return @readableStreamReaderGenericInitialize(this, stream), @putByIdDirectPrivate(this, \"readRequests\", @createFIFO()), this;\n})\n"; - -// cancel -const JSC::ConstructAbility s_readableStreamDefaultReaderCancelCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; -const JSC::ConstructorKind s_readableStreamDefaultReaderCancelCodeConstructorKind = JSC::ConstructorKind::None; -const JSC::ImplementationVisibility s_readableStreamDefaultReaderCancelCodeImplementationVisibility = JSC::ImplementationVisibility::Public; -const int s_readableStreamDefaultReaderCancelCodeLength = 394; -static const JSC::Intrinsic s_readableStreamDefaultReaderCancelCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_readableStreamDefaultReaderCancelCode = "(function (reason) {\"use strict\";\n if (!@isReadableStreamDefaultReader(this))\n return @Promise.@reject(@makeThisTypeError(\"ReadableStreamDefaultReader\", \"cancel\"));\n if (!@getByIdDirectPrivate(this, \"ownerReadableStream\"))\n return @Promise.@reject(@makeTypeError(\"cancel() called on a reader owned by no readable stream\"));\n return @readableStreamReaderGenericCancel(this, reason);\n})\n"; +/* ReadableByteStreamController.ts */ +// initializeReadableByteStreamController +const JSC::ConstructAbility s_readableByteStreamControllerInitializeReadableByteStreamControllerCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; +const JSC::ConstructorKind s_readableByteStreamControllerInitializeReadableByteStreamControllerCodeConstructorKind = JSC::ConstructorKind::None; +const JSC::ImplementationVisibility s_readableByteStreamControllerInitializeReadableByteStreamControllerCodeImplementationVisibility = JSC::ImplementationVisibility::Public; +const int s_readableByteStreamControllerInitializeReadableByteStreamControllerCodeLength = 351; +static const JSC::Intrinsic s_readableByteStreamControllerInitializeReadableByteStreamControllerCodeIntrinsic = JSC::NoIntrinsic; +const char* const s_readableByteStreamControllerInitializeReadableByteStreamControllerCode = "(function (stream, underlyingByteSource, highWaterMark) {\"use strict\";\n if (arguments.length !== 4 && arguments[3] !== @isReadableStream)\n @throwTypeError(\"ReadableByteStreamController constructor should not be called directly\");\n return @privateInitializeReadableByteStreamController.@call(this, stream, underlyingByteSource, highWaterMark);\n})\n"; -// readMany -const JSC::ConstructAbility s_readableStreamDefaultReaderReadManyCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; -const JSC::ConstructorKind s_readableStreamDefaultReaderReadManyCodeConstructorKind = JSC::ConstructorKind::None; -const JSC::ImplementationVisibility s_readableStreamDefaultReaderReadManyCodeImplementationVisibility = JSC::ImplementationVisibility::Public; -const int s_readableStreamDefaultReaderReadManyCodeLength = 3873; -static const JSC::Intrinsic s_readableStreamDefaultReaderReadManyCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_readableStreamDefaultReaderReadManyCode = "(function () {\"use strict\";\n if (!@isReadableStreamDefaultReader(this))\n @throwTypeError(\"ReadableStreamDefaultReader.readMany() should not be called directly\");\n const stream = @getByIdDirectPrivate(this, \"ownerReadableStream\");\n if (!stream)\n @throwTypeError(\"readMany() called on a reader owned by no readable stream\");\n const state = @getByIdDirectPrivate(stream, \"state\");\n if (@putByIdDirectPrivate(stream, \"disturbed\", !0), state === 1)\n return { value: [], size: 0, done: !0 };\n else if (state === 3)\n throw @getByIdDirectPrivate(stream, \"storedError\");\n var controller = @getByIdDirectPrivate(stream, \"readableStreamController\"), queue = @getByIdDirectPrivate(controller, \"queue\");\n if (!queue)\n return controller.@pull(controller).@then(function({ done, value }) {\n return done \? { done: !0, value: [], size: 0 } : { value: [value], size: 1, done: !1 };\n });\n const content = queue.content;\n var size = queue.size, values = content.toArray(!1), length = values.length;\n if (length > 0) {\n var outValues = @newArrayWithSize(length);\n if (@isReadableByteStreamController(controller)) {\n {\n const buf = values[0];\n if (!(@ArrayBuffer.@isView(buf) || buf instanceof @ArrayBuffer))\n @putByValDirect(outValues, 0, new @Uint8Array(buf.buffer, buf.byteOffset, buf.byteLength));\n else\n @putByValDirect(outValues, 0, buf);\n }\n for (var i = 1;i < length; i++) {\n const buf = values[i];\n if (!(@ArrayBuffer.@isView(buf) || buf instanceof @ArrayBuffer))\n @putByValDirect(outValues, i, new @Uint8Array(buf.buffer, buf.byteOffset, buf.byteLength));\n else\n @putByValDirect(outValues, i, buf);\n }\n } else {\n @putByValDirect(outValues, 0, values[0].value);\n for (var i = 1;i < length; i++)\n @putByValDirect(outValues, i, values[i].value);\n }\n if (@resetQueue(@getByIdDirectPrivate(controller, \"queue\")), @getByIdDirectPrivate(controller, \"closeRequested\"))\n @readableStreamClose(@getByIdDirectPrivate(controller, \"controlledReadableStream\"));\n else if (@isReadableStreamDefaultController(controller))\n @readableStreamDefaultControllerCallPullIfNeeded(controller);\n else if (@isReadableByteStreamController(controller))\n @readableByteStreamControllerCallPullIfNeeded(controller);\n return { value: outValues, size, done: !1 };\n }\n var onPullMany = (result) => {\n if (result.done)\n return { value: [], size: 0, done: !0 };\n var controller2 = @getByIdDirectPrivate(stream, \"readableStreamController\"), queue2 = @getByIdDirectPrivate(controller2, \"queue\"), value = [result.value].concat(queue2.content.toArray(!1)), length2 = value.length;\n if (@isReadableByteStreamController(controller2))\n for (var i2 = 0;i2 < length2; i2++) {\n const buf = value[i2];\n if (!(@ArrayBuffer.@isView(buf) || buf instanceof @ArrayBuffer)) {\n const { buffer, byteOffset, byteLength } = buf;\n @putByValDirect(value, i2, new @Uint8Array(buffer, byteOffset, byteLength));\n }\n }\n else\n for (var i2 = 1;i2 < length2; i2++)\n @putByValDirect(value, i2, value[i2].value);\n var size2 = queue2.size;\n if (@resetQueue(queue2), @getByIdDirectPrivate(controller2, \"closeRequested\"))\n @readableStreamClose(@getByIdDirectPrivate(controller2, \"controlledReadableStream\"));\n else if (@isReadableStreamDefaultController(controller2))\n @readableStreamDefaultControllerCallPullIfNeeded(controller2);\n else if (@isReadableByteStreamController(controller2))\n @readableByteStreamControllerCallPullIfNeeded(controller2);\n return { value, size: size2, done: !1 };\n }, pullResult = controller.@pull(controller);\n if (pullResult && @isPromise(pullResult))\n return pullResult.@then(onPullMany);\n return onPullMany(pullResult);\n})\n"; +// enqueue +const JSC::ConstructAbility s_readableByteStreamControllerEnqueueCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; +const JSC::ConstructorKind s_readableByteStreamControllerEnqueueCodeConstructorKind = JSC::ConstructorKind::None; +const JSC::ImplementationVisibility s_readableByteStreamControllerEnqueueCodeImplementationVisibility = JSC::ImplementationVisibility::Public; +const int s_readableByteStreamControllerEnqueueCodeLength = 615; +static const JSC::Intrinsic s_readableByteStreamControllerEnqueueCodeIntrinsic = JSC::NoIntrinsic; +const char* const s_readableByteStreamControllerEnqueueCode = "(function (chunk) {\"use strict\";\n if (!@isReadableByteStreamController(this))\n throw @makeThisTypeError(\"ReadableByteStreamController\", \"enqueue\");\n if (@getByIdDirectPrivate(this, \"closeRequested\"))\n @throwTypeError(\"ReadableByteStreamController is requested to close\");\n if (@getByIdDirectPrivate(@getByIdDirectPrivate(this, \"controlledReadableStream\"), \"state\") !== 4)\n @throwTypeError(\"ReadableStream is not readable\");\n if (!@isObject(chunk) || !@ArrayBuffer.@isView(chunk))\n @throwTypeError(\"Provided chunk is not a TypedArray\");\n return @readableByteStreamControllerEnqueue(this, chunk);\n})\n"; -// read -const JSC::ConstructAbility s_readableStreamDefaultReaderReadCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; -const JSC::ConstructorKind s_readableStreamDefaultReaderReadCodeConstructorKind = JSC::ConstructorKind::None; -const JSC::ImplementationVisibility s_readableStreamDefaultReaderReadCodeImplementationVisibility = JSC::ImplementationVisibility::Public; -const int s_readableStreamDefaultReaderReadCodeLength = 374; -static const JSC::Intrinsic s_readableStreamDefaultReaderReadCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_readableStreamDefaultReaderReadCode = "(function () {\"use strict\";\n if (!@isReadableStreamDefaultReader(this))\n return @Promise.@reject(@makeThisTypeError(\"ReadableStreamDefaultReader\", \"read\"));\n if (!@getByIdDirectPrivate(this, \"ownerReadableStream\"))\n return @Promise.@reject(@makeTypeError(\"read() called on a reader owned by no readable stream\"));\n return @readableStreamDefaultReaderRead(this);\n})\n"; +// error +const JSC::ConstructAbility s_readableByteStreamControllerErrorCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; +const JSC::ConstructorKind s_readableByteStreamControllerErrorCodeConstructorKind = JSC::ConstructorKind::None; +const JSC::ImplementationVisibility s_readableByteStreamControllerErrorCodeImplementationVisibility = JSC::ImplementationVisibility::Public; +const int s_readableByteStreamControllerErrorCodeLength = 360; +static const JSC::Intrinsic s_readableByteStreamControllerErrorCodeIntrinsic = JSC::NoIntrinsic; +const char* const s_readableByteStreamControllerErrorCode = "(function (error) {\"use strict\";\n if (!@isReadableByteStreamController(this))\n throw @makeThisTypeError(\"ReadableByteStreamController\", \"error\");\n if (@getByIdDirectPrivate(@getByIdDirectPrivate(this, \"controlledReadableStream\"), \"state\") !== 4)\n @throwTypeError(\"ReadableStream is not readable\");\n @readableByteStreamControllerError(this, error);\n})\n"; -// releaseLock -const JSC::ConstructAbility s_readableStreamDefaultReaderReleaseLockCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; -const JSC::ConstructorKind s_readableStreamDefaultReaderReleaseLockCodeConstructorKind = JSC::ConstructorKind::None; -const JSC::ImplementationVisibility s_readableStreamDefaultReaderReleaseLockCodeImplementationVisibility = JSC::ImplementationVisibility::Public; -const int s_readableStreamDefaultReaderReleaseLockCodeLength = 420; -static const JSC::Intrinsic s_readableStreamDefaultReaderReleaseLockCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_readableStreamDefaultReaderReleaseLockCode = "(function () {\"use strict\";\n if (!@isReadableStreamDefaultReader(this))\n throw @makeThisTypeError(\"ReadableStreamDefaultReader\", \"releaseLock\");\n if (!@getByIdDirectPrivate(this, \"ownerReadableStream\"))\n return;\n if (@getByIdDirectPrivate(this, \"readRequests\")\?.isNotEmpty())\n @throwTypeError(\"There are still pending read requests, cannot release the lock\");\n @readableStreamReaderGenericRelease(this);\n})\n"; +// close +const JSC::ConstructAbility s_readableByteStreamControllerCloseCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; +const JSC::ConstructorKind s_readableByteStreamControllerCloseCodeConstructorKind = JSC::ConstructorKind::None; +const JSC::ImplementationVisibility s_readableByteStreamControllerCloseCodeImplementationVisibility = JSC::ImplementationVisibility::Public; +const int s_readableByteStreamControllerCloseCodeLength = 458; +static const JSC::Intrinsic s_readableByteStreamControllerCloseCodeIntrinsic = JSC::NoIntrinsic; +const char* const s_readableByteStreamControllerCloseCode = "(function () {\"use strict\";\n if (!@isReadableByteStreamController(this))\n throw @makeThisTypeError(\"ReadableByteStreamController\", \"close\");\n if (@getByIdDirectPrivate(this, \"closeRequested\"))\n @throwTypeError(\"Close has already been requested\");\n if (@getByIdDirectPrivate(@getByIdDirectPrivate(this, \"controlledReadableStream\"), \"state\") !== 4)\n @throwTypeError(\"ReadableStream is not readable\");\n @readableByteStreamControllerClose(this);\n})\n"; -// closed -const JSC::ConstructAbility s_readableStreamDefaultReaderClosedCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; -const JSC::ConstructorKind s_readableStreamDefaultReaderClosedCodeConstructorKind = JSC::ConstructorKind::None; -const JSC::ImplementationVisibility s_readableStreamDefaultReaderClosedCodeImplementationVisibility = JSC::ImplementationVisibility::Public; -const int s_readableStreamDefaultReaderClosedCodeLength = 241; -static const JSC::Intrinsic s_readableStreamDefaultReaderClosedCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_readableStreamDefaultReaderClosedCode = "(function () {\"use strict\";\n if (!@isReadableStreamDefaultReader(this))\n return @Promise.@reject(@makeGetterTypeError(\"ReadableStreamDefaultReader\", \"closed\"));\n return @getByIdDirectPrivate(this, \"closedPromiseCapability\").promise;\n})\n"; +// byobRequest +const JSC::ConstructAbility s_readableByteStreamControllerByobRequestCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; +const JSC::ConstructorKind s_readableByteStreamControllerByobRequestCodeConstructorKind = JSC::ConstructorKind::None; +const JSC::ImplementationVisibility s_readableByteStreamControllerByobRequestCodeImplementationVisibility = JSC::ImplementationVisibility::Public; +const int s_readableByteStreamControllerByobRequestCodeLength = 738; +static const JSC::Intrinsic s_readableByteStreamControllerByobRequestCodeIntrinsic = JSC::NoIntrinsic; +const char* const s_readableByteStreamControllerByobRequestCode = "(function () {\"use strict\";\n if (!@isReadableByteStreamController(this))\n throw @makeGetterTypeError(\"ReadableByteStreamController\", \"byobRequest\");\n var request = @getByIdDirectPrivate(this, \"byobRequest\");\n if (request === @undefined) {\n var pending = @getByIdDirectPrivate(this, \"pendingPullIntos\");\n const firstDescriptor = pending.peek();\n if (firstDescriptor) {\n const view = new @Uint8Array(firstDescriptor.buffer, firstDescriptor.byteOffset + firstDescriptor.bytesFilled, firstDescriptor.byteLength - firstDescriptor.bytesFilled);\n @putByIdDirectPrivate(this, \"byobRequest\", new @ReadableStreamBYOBRequest(this, view, @isReadableStream));\n }\n }\n return @getByIdDirectPrivate(this, \"byobRequest\");\n})\n"; + +// desiredSize +const JSC::ConstructAbility s_readableByteStreamControllerDesiredSizeCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; +const JSC::ConstructorKind s_readableByteStreamControllerDesiredSizeCodeConstructorKind = JSC::ConstructorKind::None; +const JSC::ImplementationVisibility s_readableByteStreamControllerDesiredSizeCodeImplementationVisibility = JSC::ImplementationVisibility::Public; +const int s_readableByteStreamControllerDesiredSizeCodeLength = 216; +static const JSC::Intrinsic s_readableByteStreamControllerDesiredSizeCodeIntrinsic = JSC::NoIntrinsic; +const char* const s_readableByteStreamControllerDesiredSizeCode = "(function () {\"use strict\";\n if (!@isReadableByteStreamController(this))\n throw @makeGetterTypeError(\"ReadableByteStreamController\", \"desiredSize\");\n return @readableByteStreamControllerGetDesiredSize(this);\n})\n"; #define DEFINE_BUILTIN_GENERATOR(codeName, functionName, overriddenName, argumentCount) \ JSC::FunctionExecutable* codeName##Generator(JSC::VM& vm) \ {\ JSVMClientData* clientData = static_cast(vm.clientData); \ - return clientData->builtinFunctions().readableStreamDefaultReaderBuiltins().codeName##Executable()->link(vm, nullptr, clientData->builtinFunctions().readableStreamDefaultReaderBuiltins().codeName##Source(), std::nullopt, s_##codeName##Intrinsic); \ + return clientData->builtinFunctions().readableByteStreamControllerBuiltins().codeName##Executable()->link(vm, nullptr, clientData->builtinFunctions().readableByteStreamControllerBuiltins().codeName##Source(), std::nullopt, s_##codeName##Intrinsic); \ } -WEBCORE_FOREACH_READABLESTREAMDEFAULTREADER_BUILTIN_CODE(DEFINE_BUILTIN_GENERATOR) +WEBCORE_FOREACH_READABLEBYTESTREAMCONTROLLER_BUILTIN_CODE(DEFINE_BUILTIN_GENERATOR) #undef DEFINE_BUILTIN_GENERATOR /* StreamInternals.ts */ @@ -2267,706 +2271,720 @@ JSC::FunctionExecutable* codeName##Generator(JSC::VM& vm) \ WEBCORE_FOREACH_STREAMINTERNALS_BUILTIN_CODE(DEFINE_BUILTIN_GENERATOR) #undef DEFINE_BUILTIN_GENERATOR -/* ImportMetaObject.ts */ -// loadCJS2ESM -const JSC::ConstructAbility s_importMetaObjectLoadCJS2ESMCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; -const JSC::ConstructorKind s_importMetaObjectLoadCJS2ESMCodeConstructorKind = JSC::ConstructorKind::None; -const JSC::ImplementationVisibility s_importMetaObjectLoadCJS2ESMCodeImplementationVisibility = JSC::ImplementationVisibility::Public; -const int s_importMetaObjectLoadCJS2ESMCodeLength = 2569; -static const JSC::Intrinsic s_importMetaObjectLoadCJS2ESMCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_importMetaObjectLoadCJS2ESMCode = "(function (resolvedSpecifier) {\"use strict\";\n var loader = @Loader, queue = @createFIFO(), key = resolvedSpecifier;\n while (key) {\n var entry = loader.registry.@get(key);\n if ((entry\?.state \?\? 0) <= @ModuleFetch)\n @fulfillModuleSync(key), entry = loader.registry.@get(key);\n var sourceCodeObject = @getPromiseInternalField(entry.fetch, @promiseFieldReactionsOrResult), moduleRecordPromise = loader.parseModule(key, sourceCodeObject), mod = entry.module;\n if (moduleRecordPromise && @isPromise(moduleRecordPromise)) {\n var reactionsOrResult = @getPromiseInternalField(moduleRecordPromise, @promiseFieldReactionsOrResult), flags = @getPromiseInternalField(moduleRecordPromise, @promiseFieldFlags), state = flags & @promiseStateMask;\n if (state === @promiseStatePending || reactionsOrResult && @isPromise(reactionsOrResult))\n @throwTypeError(`require() async module \"${key}\" is unsupported. use \"await import()\" instead.`);\n else if (state === @promiseStateRejected) {\n if (!reactionsOrResult\?.message)\n @throwTypeError(`${reactionsOrResult + \"\" \? reactionsOrResult : \"An error occurred\"} occurred while parsing module \\\"${key}\\\"`);\n throw reactionsOrResult;\n }\n entry.module = mod = reactionsOrResult;\n } else if (moduleRecordPromise && !mod)\n entry.module = mod = moduleRecordPromise;\n @setStateToMax(entry, @ModuleLink);\n var dependenciesMap = mod.dependenciesMap, requestedModules = loader.requestedModules(mod), dependencies = @newArrayWithSize(requestedModules.length);\n for (var i = 0, length = requestedModules.length;i < length; ++i) {\n var depName = requestedModules[i], depKey = depName[0] === \"/\" \? depName : loader.resolve(depName, key), depEntry = loader.ensureRegistered(depKey);\n if (depEntry.state < @ModuleLink)\n queue.push(depKey);\n @putByValDirect(dependencies, i, depEntry), dependenciesMap.@set(depName, depEntry);\n }\n entry.dependencies = dependencies, entry.instantiate = @Promise.@resolve(entry), entry.satisfy = @Promise.@resolve(entry), entry.isSatisfied = !0, key = queue.shift();\n while (key && (loader.registry.@get(key)\?.state \?\? @ModuleFetch) >= @ModuleLink)\n key = queue.shift();\n }\n var linkAndEvaluateResult = loader.linkAndEvaluateModule(resolvedSpecifier, @undefined);\n if (linkAndEvaluateResult && @isPromise(linkAndEvaluateResult))\n @throwTypeError(`require() async module \\\"${resolvedSpecifier}\\\" is unsupported. use \"await import()\" instead.`);\n return loader.registry.@get(resolvedSpecifier);\n})\n"; +/* ReadableStreamDefaultController.ts */ +// initializeReadableStreamDefaultController +const JSC::ConstructAbility s_readableStreamDefaultControllerInitializeReadableStreamDefaultControllerCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; +const JSC::ConstructorKind s_readableStreamDefaultControllerInitializeReadableStreamDefaultControllerCodeConstructorKind = JSC::ConstructorKind::None; +const JSC::ImplementationVisibility s_readableStreamDefaultControllerInitializeReadableStreamDefaultControllerCodeImplementationVisibility = JSC::ImplementationVisibility::Public; +const int s_readableStreamDefaultControllerInitializeReadableStreamDefaultControllerCodeLength = 361; +static const JSC::Intrinsic s_readableStreamDefaultControllerInitializeReadableStreamDefaultControllerCodeIntrinsic = JSC::NoIntrinsic; +const char* const s_readableStreamDefaultControllerInitializeReadableStreamDefaultControllerCode = "(function (stream, underlyingSource, size, highWaterMark) {\"use strict\";\n if (arguments.length !== 5 && arguments[4] !== @isReadableStream)\n @throwTypeError(\"ReadableStreamDefaultController constructor should not be called directly\");\n return @privateInitializeReadableStreamDefaultController.@call(this, stream, underlyingSource, size, highWaterMark);\n})\n"; -// requireESM -const JSC::ConstructAbility s_importMetaObjectRequireESMCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; -const JSC::ConstructorKind s_importMetaObjectRequireESMCodeConstructorKind = JSC::ConstructorKind::None; -const JSC::ImplementationVisibility s_importMetaObjectRequireESMCodeImplementationVisibility = JSC::ImplementationVisibility::Public; -const int s_importMetaObjectRequireESMCodeLength = 406; -static const JSC::Intrinsic s_importMetaObjectRequireESMCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_importMetaObjectRequireESMCode = "(function (resolved) {\"use strict\";\n var entry = @Loader.registry.@get(resolved);\n if (!entry || !entry.evaluated)\n entry = @loadCJS2ESM(resolved);\n if (!entry || !entry.evaluated || !entry.module)\n @throwTypeError(`require() failed to evaluate module \"${resolved}\". This is an internal consistentency error.`);\n var exports = @Loader.getModuleNamespaceObject(entry.module);\n return exports;\n})\n"; +// enqueue +const JSC::ConstructAbility s_readableStreamDefaultControllerEnqueueCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; +const JSC::ConstructorKind s_readableStreamDefaultControllerEnqueueCodeConstructorKind = JSC::ConstructorKind::None; +const JSC::ImplementationVisibility s_readableStreamDefaultControllerEnqueueCodeImplementationVisibility = JSC::ImplementationVisibility::Public; +const int s_readableStreamDefaultControllerEnqueueCodeLength = 390; +static const JSC::Intrinsic s_readableStreamDefaultControllerEnqueueCodeIntrinsic = JSC::NoIntrinsic; +const char* const s_readableStreamDefaultControllerEnqueueCode = "(function (chunk) {\"use strict\";\n if (!@isReadableStreamDefaultController(this))\n throw @makeThisTypeError(\"ReadableStreamDefaultController\", \"enqueue\");\n if (!@readableStreamDefaultControllerCanCloseOrEnqueue(this))\n @throwTypeError(\"ReadableStreamDefaultController is not in a state where chunk can be enqueued\");\n return @readableStreamDefaultControllerEnqueue(this, chunk);\n})\n"; -// internalRequire -const JSC::ConstructAbility s_importMetaObjectInternalRequireCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; -const JSC::ConstructorKind s_importMetaObjectInternalRequireCodeConstructorKind = JSC::ConstructorKind::None; -const JSC::ImplementationVisibility s_importMetaObjectInternalRequireCodeImplementationVisibility = JSC::ImplementationVisibility::Public; -const int s_importMetaObjectInternalRequireCodeLength = 1010; -static const JSC::Intrinsic s_importMetaObjectInternalRequireCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_importMetaObjectInternalRequireCode = "(function (id) {\"use strict\";\n var cached = @requireMap.@get(id);\n const last5 = id.substring(id.length - 5);\n if (cached)\n return cached.exports;\n if (last5 === \".json\") {\n var fs = globalThis[Symbol.for(\"_fs\")] ||= Bun.fs(), exports = JSON.parse(fs.readFileSync(id, \"utf8\"));\n return @requireMap.@set(id, @createCommonJSModule(id, exports, !0)), exports;\n } else if (last5 === \".node\") {\n const module = @createCommonJSModule(id, {}, !0);\n return process.dlopen(module, id), @requireMap.@set(id, module), module.exports;\n } else if (last5 === \".toml\") {\n var fs = globalThis[Symbol.for(\"_fs\")] ||= Bun.fs(), exports = Bun.TOML.parse(fs.readFileSync(id, \"utf8\"));\n return @requireMap.@set(id, @createCommonJSModule(id, exports, !0)), exports;\n } else {\n var exports = @requireESM(id);\n const cachedModule = @requireMap.@get(id);\n if (cachedModule)\n return cachedModule.exports;\n return @requireMap.@set(id, @createCommonJSModule(id, exports, !0)), exports;\n }\n})\n"; +// error +const JSC::ConstructAbility s_readableStreamDefaultControllerErrorCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; +const JSC::ConstructorKind s_readableStreamDefaultControllerErrorCodeConstructorKind = JSC::ConstructorKind::None; +const JSC::ImplementationVisibility s_readableStreamDefaultControllerErrorCodeImplementationVisibility = JSC::ImplementationVisibility::Public; +const int s_readableStreamDefaultControllerErrorCodeLength = 209; +static const JSC::Intrinsic s_readableStreamDefaultControllerErrorCodeIntrinsic = JSC::NoIntrinsic; +const char* const s_readableStreamDefaultControllerErrorCode = "(function (err) {\"use strict\";\n if (!@isReadableStreamDefaultController(this))\n throw @makeThisTypeError(\"ReadableStreamDefaultController\", \"error\");\n @readableStreamDefaultControllerError(this, err);\n})\n"; -// createRequireCache -const JSC::ConstructAbility s_importMetaObjectCreateRequireCacheCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; -const JSC::ConstructorKind s_importMetaObjectCreateRequireCacheCodeConstructorKind = JSC::ConstructorKind::None; -const JSC::ImplementationVisibility s_importMetaObjectCreateRequireCacheCodeImplementationVisibility = JSC::ImplementationVisibility::Public; -const int s_importMetaObjectCreateRequireCacheCodeLength = 1321; -static const JSC::Intrinsic s_importMetaObjectCreateRequireCacheCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_importMetaObjectCreateRequireCacheCode = "(function () {\"use strict\";\n var moduleMap = new Map, inner = {};\n return new Proxy(inner, {\n get(target, key) {\n const entry = @requireMap.@get(key);\n if (entry)\n return entry;\n const esm = @Loader.registry.@get(key);\n if (esm\?.evaluated) {\n const namespace = @Loader.getModuleNamespaceObject(esm.module), mod = @createCommonJSModule(key, namespace, !0);\n return @requireMap.@set(key, mod), mod;\n }\n return inner[key];\n },\n set(target, key, value) {\n return @requireMap.@set(key, value), !0;\n },\n has(target, key) {\n return @requireMap.@has(key) || @Loader.registry.@has(key);\n },\n deleteProperty(target, key) {\n return moduleMap.@delete(key), @requireMap.@delete(key), @Loader.registry.@delete(key), !0;\n },\n ownKeys(target) {\n var array = [...@requireMap.@keys()];\n for (let key of @Loader.registry.@keys())\n if (!array.includes(key) && @Loader.registry.@get(key)\?.evaluated)\n @arrayPush(array, key);\n return array;\n },\n getPrototypeOf(target) {\n return null;\n },\n getOwnPropertyDescriptor(target, key) {\n if (@requireMap.@has(key) || @Loader.registry.@get(key)\?.evaluated)\n return {\n configurable: !0,\n enumerable: !0\n };\n }\n });\n})\n"; +// close +const JSC::ConstructAbility s_readableStreamDefaultControllerCloseCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; +const JSC::ConstructorKind s_readableStreamDefaultControllerCloseCodeConstructorKind = JSC::ConstructorKind::None; +const JSC::ImplementationVisibility s_readableStreamDefaultControllerCloseCodeImplementationVisibility = JSC::ImplementationVisibility::Public; +const int s_readableStreamDefaultControllerCloseCodeLength = 362; +static const JSC::Intrinsic s_readableStreamDefaultControllerCloseCodeIntrinsic = JSC::NoIntrinsic; +const char* const s_readableStreamDefaultControllerCloseCode = "(function () {\"use strict\";\n if (!@isReadableStreamDefaultController(this))\n throw @makeThisTypeError(\"ReadableStreamDefaultController\", \"close\");\n if (!@readableStreamDefaultControllerCanCloseOrEnqueue(this))\n @throwTypeError(\"ReadableStreamDefaultController is not in a state where it can be closed\");\n @readableStreamDefaultControllerClose(this);\n})\n"; -// main -const JSC::ConstructAbility s_importMetaObjectMainCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; -const JSC::ConstructorKind s_importMetaObjectMainCodeConstructorKind = JSC::ConstructorKind::None; -const JSC::ImplementationVisibility s_importMetaObjectMainCodeImplementationVisibility = JSC::ImplementationVisibility::Public; -const int s_importMetaObjectMainCodeLength = 84; -static const JSC::Intrinsic s_importMetaObjectMainCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_importMetaObjectMainCode = "(function () {\"use strict\";\n return this.path === Bun.main && Bun.isMainThread;\n})\n"; +// desiredSize +const JSC::ConstructAbility s_readableStreamDefaultControllerDesiredSizeCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; +const JSC::ConstructorKind s_readableStreamDefaultControllerDesiredSizeCodeConstructorKind = JSC::ConstructorKind::None; +const JSC::ImplementationVisibility s_readableStreamDefaultControllerDesiredSizeCodeImplementationVisibility = JSC::ImplementationVisibility::Public; +const int s_readableStreamDefaultControllerDesiredSizeCodeLength = 225; +static const JSC::Intrinsic s_readableStreamDefaultControllerDesiredSizeCodeIntrinsic = JSC::NoIntrinsic; +const char* const s_readableStreamDefaultControllerDesiredSizeCode = "(function () {\"use strict\";\n if (!@isReadableStreamDefaultController(this))\n throw @makeGetterTypeError(\"ReadableStreamDefaultController\", \"desiredSize\");\n return @readableStreamDefaultControllerGetDesiredSize(this);\n})\n"; #define DEFINE_BUILTIN_GENERATOR(codeName, functionName, overriddenName, argumentCount) \ JSC::FunctionExecutable* codeName##Generator(JSC::VM& vm) \ {\ JSVMClientData* clientData = static_cast(vm.clientData); \ - return clientData->builtinFunctions().importMetaObjectBuiltins().codeName##Executable()->link(vm, nullptr, clientData->builtinFunctions().importMetaObjectBuiltins().codeName##Source(), std::nullopt, s_##codeName##Intrinsic); \ + return clientData->builtinFunctions().readableStreamDefaultControllerBuiltins().codeName##Executable()->link(vm, nullptr, clientData->builtinFunctions().readableStreamDefaultControllerBuiltins().codeName##Source(), std::nullopt, s_##codeName##Intrinsic); \ } -WEBCORE_FOREACH_IMPORTMETAOBJECT_BUILTIN_CODE(DEFINE_BUILTIN_GENERATOR) +WEBCORE_FOREACH_READABLESTREAMDEFAULTCONTROLLER_BUILTIN_CODE(DEFINE_BUILTIN_GENERATOR) #undef DEFINE_BUILTIN_GENERATOR -/* CountQueuingStrategy.ts */ -// highWaterMark -const JSC::ConstructAbility s_countQueuingStrategyHighWaterMarkCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; -const JSC::ConstructorKind s_countQueuingStrategyHighWaterMarkCodeConstructorKind = JSC::ConstructorKind::None; -const JSC::ImplementationVisibility s_countQueuingStrategyHighWaterMarkCodeImplementationVisibility = JSC::ImplementationVisibility::Public; -const int s_countQueuingStrategyHighWaterMarkCodeLength = 264; -static const JSC::Intrinsic s_countQueuingStrategyHighWaterMarkCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_countQueuingStrategyHighWaterMarkCode = "(function () {\"use strict\";\n const highWaterMark = @getByIdDirectPrivate(this, \"highWaterMark\");\n if (highWaterMark === @undefined)\n @throwTypeError(\"CountQueuingStrategy.highWaterMark getter called on incompatible |this| value.\");\n return highWaterMark;\n})\n"; +/* BundlerPlugin.ts */ +// runSetupFunction +const JSC::ConstructAbility s_bundlerPluginRunSetupFunctionCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; +const JSC::ConstructorKind s_bundlerPluginRunSetupFunctionCodeConstructorKind = JSC::ConstructorKind::None; +const JSC::ImplementationVisibility s_bundlerPluginRunSetupFunctionCodeImplementationVisibility = JSC::ImplementationVisibility::Public; +const int s_bundlerPluginRunSetupFunctionCodeLength = 4001; +static const JSC::Intrinsic s_bundlerPluginRunSetupFunctionCodeIntrinsic = JSC::NoIntrinsic; +const char* const s_bundlerPluginRunSetupFunctionCode = "(function (setup, config) {\"use strict\";\n var onLoadPlugins = new Map, onResolvePlugins = new Map;\n function validate(filterObject, callback, map) {\n if (!filterObject || !@isObject(filterObject))\n @throwTypeError('Expected an object with \"filter\" RegExp');\n if (!callback || !@isCallable(callback))\n @throwTypeError(\"callback must be a function\");\n var { filter, namespace = \"file\" } = filterObject;\n if (!filter)\n @throwTypeError('Expected an object with \"filter\" RegExp');\n if (!@isRegExpObject(filter))\n @throwTypeError(\"filter must be a RegExp\");\n if (namespace && typeof namespace !== \"string\")\n @throwTypeError(\"namespace must be a string\");\n if ((namespace\?.length \?\? 0) === 0)\n namespace = \"file\";\n if (!/^([/@a-zA-Z0-9_\\\\-]+)$/.test(namespace))\n @throwTypeError(\"namespace can only contain $a-zA-Z0-9_\\\\-\");\n var callbacks = map.@get(namespace);\n if (!callbacks)\n map.@set(namespace, [[filter, callback]]);\n else\n @arrayPush(callbacks, [filter, callback]);\n }\n function onLoad(filterObject, callback) {\n validate(filterObject, callback, onLoadPlugins);\n }\n function onResolve(filterObject, callback) {\n validate(filterObject, callback, onResolvePlugins);\n }\n const processSetupResult = () => {\n var anyOnLoad = !1, anyOnResolve = !1;\n for (var [namespace, callbacks] of onLoadPlugins.entries())\n for (var [filter] of callbacks)\n this.addFilter(filter, namespace, 1), anyOnLoad = !0;\n for (var [namespace, callbacks] of onResolvePlugins.entries())\n for (var [filter] of callbacks)\n this.addFilter(filter, namespace, 0), anyOnResolve = !0;\n if (anyOnResolve) {\n var onResolveObject = this.onResolve;\n if (!onResolveObject)\n this.onResolve = onResolvePlugins;\n else\n for (var [namespace, callbacks] of onResolvePlugins.entries()) {\n var existing = onResolveObject.@get(namespace);\n if (!existing)\n onResolveObject.@set(namespace, callbacks);\n else\n onResolveObject.@set(namespace, existing.concat(callbacks));\n }\n }\n if (anyOnLoad) {\n var onLoadObject = this.onLoad;\n if (!onLoadObject)\n this.onLoad = onLoadPlugins;\n else\n for (var [namespace, callbacks] of onLoadPlugins.entries()) {\n var existing = onLoadObject.@get(namespace);\n if (!existing)\n onLoadObject.@set(namespace, callbacks);\n else\n onLoadObject.@set(namespace, existing.concat(callbacks));\n }\n }\n return anyOnLoad || anyOnResolve;\n };\n var setupResult = setup({\n config,\n onDispose: () => @throwTypeError(\"@{@2} is not implemented yet. See https://github.com/oven-sh/bun/issues/@1\"),\n onEnd: () => @throwTypeError(\"@{@2} is not implemented yet. See https://github.com/oven-sh/bun/issues/@1\"),\n onLoad,\n onResolve,\n onStart: () => @throwTypeError(\"@{@2} is not implemented yet. See https://github.com/oven-sh/bun/issues/@1\"),\n resolve: () => @throwTypeError(\"@{@2} is not implemented yet. See https://github.com/oven-sh/bun/issues/@1\"),\n initialOptions: {\n ...config,\n bundle: !0,\n entryPoints: config.entrypoints \?\? config.entryPoints \?\? [],\n minify: typeof config.minify === \"boolean\" \? config.minify : !1,\n minifyIdentifiers: config.minify === !0 || config.minify\?.identifiers,\n minifyWhitespace: config.minify === !0 || config.minify\?.whitespace,\n minifySyntax: config.minify === !0 || config.minify\?.syntax,\n outbase: config.root,\n platform: config.target === \"bun\" \? \"node\" : config.target\n },\n esbuild: {}\n });\n if (setupResult && @isPromise(setupResult))\n if (@getPromiseInternalField(setupResult, @promiseFieldFlags) & @promiseStateFulfilled)\n setupResult = @getPromiseInternalField(setupResult, @promiseFieldReactionsOrResult);\n else\n return setupResult.@then(processSetupResult);\n return processSetupResult();\n})\n"; -// size -const JSC::ConstructAbility s_countQueuingStrategySizeCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; -const JSC::ConstructorKind s_countQueuingStrategySizeCodeConstructorKind = JSC::ConstructorKind::None; -const JSC::ImplementationVisibility s_countQueuingStrategySizeCodeImplementationVisibility = JSC::ImplementationVisibility::Public; -const int s_countQueuingStrategySizeCodeLength = 43; -static const JSC::Intrinsic s_countQueuingStrategySizeCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_countQueuingStrategySizeCode = "(function () {\"use strict\";\n return 1;\n})\n"; +// runOnResolvePlugins +const JSC::ConstructAbility s_bundlerPluginRunOnResolvePluginsCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; +const JSC::ConstructorKind s_bundlerPluginRunOnResolvePluginsCodeConstructorKind = JSC::ConstructorKind::None; +const JSC::ImplementationVisibility s_bundlerPluginRunOnResolvePluginsCodeImplementationVisibility = JSC::ImplementationVisibility::Public; +const int s_bundlerPluginRunOnResolvePluginsCodeLength = 3000; +static const JSC::Intrinsic s_bundlerPluginRunOnResolvePluginsCodeIntrinsic = JSC::NoIntrinsic; +const char* const s_bundlerPluginRunOnResolvePluginsCode = "(function (specifier, inputNamespace, importer, internalID, kindId) {\"use strict\";\n const kind = [\"entry-point\", \"import-statement\", \"require-call\", \"dynamic-import\", \"require-resolve\", \"import-rule\", \"url-token\", \"internal\"][kindId];\n var promiseResult = (async (inputPath, inputNamespace2, importer2, kind2) => {\n var { onResolve, onLoad } = this, results = onResolve.@get(inputNamespace2);\n if (!results)\n return this.onResolveAsync(internalID, null, null, null), null;\n for (let [filter, callback] of results)\n if (filter.test(inputPath)) {\n var result = callback({\n path: inputPath,\n importer: importer2,\n namespace: inputNamespace2,\n kind: kind2\n });\n while (result && @isPromise(result) && (@getPromiseInternalField(result, @promiseFieldFlags) & @promiseStateMask) === @promiseStateFulfilled)\n result = @getPromiseInternalField(result, @promiseFieldReactionsOrResult);\n if (result && @isPromise(result))\n result = await result;\n if (!result || !@isObject(result))\n continue;\n var { path, namespace: userNamespace = inputNamespace2, external } = result;\n if (typeof path !== \"string\" || typeof userNamespace !== \"string\")\n @throwTypeError(\"onResolve plugins must return an object with a string 'path' and string 'loader' field\");\n if (!path)\n continue;\n if (!userNamespace)\n userNamespace = inputNamespace2;\n if (typeof external !== \"boolean\" && !@isUndefinedOrNull(external))\n @throwTypeError('onResolve plugins \"external\" field must be boolean or unspecified');\n if (!external) {\n if (userNamespace === \"file\") {\n if (process.platform !== \"win32\") {\n if (path[0] !== \"/\" || path.includes(\"..\"))\n @throwTypeError('onResolve plugin \"path\" must be absolute when the namespace is \"file\"');\n }\n }\n if (userNamespace === \"dataurl\") {\n if (!path.startsWith(\"data:\"))\n @throwTypeError('onResolve plugin \"path\" must start with \"data:\" when the namespace is \"dataurl\"');\n }\n if (userNamespace && userNamespace !== \"file\" && (!onLoad || !onLoad.@has(userNamespace)))\n @throwTypeError(`Expected onLoad plugin for namespace ${userNamespace} to exist`);\n }\n return this.onResolveAsync(internalID, path, userNamespace, external), null;\n }\n return this.onResolveAsync(internalID, null, null, null), null;\n })(specifier, inputNamespace, importer, kind);\n while (promiseResult && @isPromise(promiseResult) && (@getPromiseInternalField(promiseResult, @promiseFieldFlags) & @promiseStateMask) === @promiseStateFulfilled)\n promiseResult = @getPromiseInternalField(promiseResult, @promiseFieldReactionsOrResult);\n if (promiseResult && @isPromise(promiseResult))\n promiseResult.then(() => {\n }, (e) => {\n this.addError(internalID, e, 0);\n });\n})\n"; -// initializeCountQueuingStrategy -const JSC::ConstructAbility s_countQueuingStrategyInitializeCountQueuingStrategyCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; -const JSC::ConstructorKind s_countQueuingStrategyInitializeCountQueuingStrategyCodeConstructorKind = JSC::ConstructorKind::None; -const JSC::ImplementationVisibility s_countQueuingStrategyInitializeCountQueuingStrategyCodeImplementationVisibility = JSC::ImplementationVisibility::Public; -const int s_countQueuingStrategyInitializeCountQueuingStrategyCodeLength = 147; -static const JSC::Intrinsic s_countQueuingStrategyInitializeCountQueuingStrategyCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_countQueuingStrategyInitializeCountQueuingStrategyCode = "(function (parameters) {\"use strict\";\n @putByIdDirectPrivate(this, \"highWaterMark\", @extractHighWaterMarkFromQueuingStrategyInit(parameters));\n})\n"; +// runOnLoadPlugins +const JSC::ConstructAbility s_bundlerPluginRunOnLoadPluginsCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; +const JSC::ConstructorKind s_bundlerPluginRunOnLoadPluginsCodeConstructorKind = JSC::ConstructorKind::None; +const JSC::ImplementationVisibility s_bundlerPluginRunOnLoadPluginsCodeImplementationVisibility = JSC::ImplementationVisibility::Public; +const int s_bundlerPluginRunOnLoadPluginsCodeLength = 2268; +static const JSC::Intrinsic s_bundlerPluginRunOnLoadPluginsCodeIntrinsic = JSC::NoIntrinsic; +const char* const s_bundlerPluginRunOnLoadPluginsCode = "(function (internalID, path, namespace, defaultLoaderId) {\"use strict\";\n const LOADERS_MAP = { 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 }, loaderName = [\"jsx\", \"js\", \"ts\", \"tsx\", \"css\", \"file\", \"json\", \"toml\", \"wasm\", \"napi\", \"base64\", \"dataurl\", \"text\"][defaultLoaderId];\n var promiseResult = (async (internalID2, path2, namespace2, defaultLoader) => {\n var results = this.onLoad.@get(namespace2);\n if (!results)\n return this.onLoadAsync(internalID2, null, null), null;\n for (let [filter, callback] of results)\n if (filter.test(path2)) {\n var result = callback({\n path: path2,\n namespace: namespace2,\n loader: defaultLoader\n });\n while (result && @isPromise(result) && (@getPromiseInternalField(result, @promiseFieldFlags) & @promiseStateMask) === @promiseStateFulfilled)\n result = @getPromiseInternalField(result, @promiseFieldReactionsOrResult);\n if (result && @isPromise(result))\n result = await result;\n if (!result || !@isObject(result))\n continue;\n var { contents, loader = defaultLoader } = result;\n if (typeof contents !== \"string\" && !@isTypedArrayView(contents))\n @throwTypeError('onLoad plugins must return an object with \"contents\" as a string or Uint8Array');\n if (typeof loader !== \"string\")\n @throwTypeError('onLoad plugins must return an object with \"loader\" as a string');\n const chosenLoader = LOADERS_MAP[loader];\n if (chosenLoader === @undefined)\n @throwTypeError(`Loader ${loader} is not supported.`);\n return this.onLoadAsync(internalID2, contents, chosenLoader), null;\n }\n return this.onLoadAsync(internalID2, null, null), null;\n })(internalID, path, namespace, loaderName);\n while (promiseResult && @isPromise(promiseResult) && (@getPromiseInternalField(promiseResult, @promiseFieldFlags) & @promiseStateMask) === @promiseStateFulfilled)\n promiseResult = @getPromiseInternalField(promiseResult, @promiseFieldReactionsOrResult);\n if (promiseResult && @isPromise(promiseResult))\n promiseResult.then(() => {\n }, (e) => {\n this.addError(internalID, e, 1);\n });\n})\n"; #define DEFINE_BUILTIN_GENERATOR(codeName, functionName, overriddenName, argumentCount) \ JSC::FunctionExecutable* codeName##Generator(JSC::VM& vm) \ {\ JSVMClientData* clientData = static_cast(vm.clientData); \ - return clientData->builtinFunctions().countQueuingStrategyBuiltins().codeName##Executable()->link(vm, nullptr, clientData->builtinFunctions().countQueuingStrategyBuiltins().codeName##Source(), std::nullopt, s_##codeName##Intrinsic); \ + return clientData->builtinFunctions().bundlerPluginBuiltins().codeName##Executable()->link(vm, nullptr, clientData->builtinFunctions().bundlerPluginBuiltins().codeName##Source(), std::nullopt, s_##codeName##Intrinsic); \ } -WEBCORE_FOREACH_COUNTQUEUINGSTRATEGY_BUILTIN_CODE(DEFINE_BUILTIN_GENERATOR) +WEBCORE_FOREACH_BUNDLERPLUGIN_BUILTIN_CODE(DEFINE_BUILTIN_GENERATOR) #undef DEFINE_BUILTIN_GENERATOR -/* ReadableStreamBYOBRequest.ts */ -// initializeReadableStreamBYOBRequest -const JSC::ConstructAbility s_readableStreamBYOBRequestInitializeReadableStreamBYOBRequestCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; -const JSC::ConstructorKind s_readableStreamBYOBRequestInitializeReadableStreamBYOBRequestCodeConstructorKind = JSC::ConstructorKind::None; -const JSC::ImplementationVisibility s_readableStreamBYOBRequestInitializeReadableStreamBYOBRequestCodeImplementationVisibility = JSC::ImplementationVisibility::Public; -const int s_readableStreamBYOBRequestInitializeReadableStreamBYOBRequestCodeLength = 291; -static const JSC::Intrinsic s_readableStreamBYOBRequestInitializeReadableStreamBYOBRequestCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_readableStreamBYOBRequestInitializeReadableStreamBYOBRequestCode = "(function (controller, view) {\"use strict\";\n if (arguments.length !== 3 && arguments[2] !== @isReadableStream)\n @throwTypeError(\"ReadableStreamBYOBRequest constructor should not be called directly\");\n return @privateInitializeReadableStreamBYOBRequest.@call(this, controller, view);\n})\n"; - -// respond -const JSC::ConstructAbility s_readableStreamBYOBRequestRespondCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; -const JSC::ConstructorKind s_readableStreamBYOBRequestRespondCodeConstructorKind = JSC::ConstructorKind::None; -const JSC::ImplementationVisibility s_readableStreamBYOBRequestRespondCodeImplementationVisibility = JSC::ImplementationVisibility::Public; -const int s_readableStreamBYOBRequestRespondCodeLength = 482; -static const JSC::Intrinsic s_readableStreamBYOBRequestRespondCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_readableStreamBYOBRequestRespondCode = "(function (bytesWritten) {\"use strict\";\n if (!@isReadableStreamBYOBRequest(this))\n throw @makeThisTypeError(\"ReadableStreamBYOBRequest\", \"respond\");\n if (@getByIdDirectPrivate(this, \"associatedReadableByteStreamController\") === @undefined)\n @throwTypeError(\"ReadableStreamBYOBRequest.associatedReadableByteStreamController is undefined\");\n return @readableByteStreamControllerRespond(@getByIdDirectPrivate(this, \"associatedReadableByteStreamController\"), bytesWritten);\n})\n"; +/* TransformStream.ts */ +// initializeTransformStream +const JSC::ConstructAbility s_transformStreamInitializeTransformStreamCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; +const JSC::ConstructorKind s_transformStreamInitializeTransformStreamCodeConstructorKind = JSC::ConstructorKind::None; +const JSC::ImplementationVisibility s_transformStreamInitializeTransformStreamCodeImplementationVisibility = JSC::ImplementationVisibility::Public; +const int s_transformStreamInitializeTransformStreamCodeLength = 2355; +static const JSC::Intrinsic s_transformStreamInitializeTransformStreamCodeIntrinsic = JSC::NoIntrinsic; +const char* const s_transformStreamInitializeTransformStreamCode = "(function () {\"use strict\";\n let transformer = arguments[0];\n if (@isObject(transformer) && @getByIdDirectPrivate(transformer, \"TransformStream\"))\n return this;\n let writableStrategy = arguments[1], readableStrategy = arguments[2];\n if (transformer === @undefined)\n transformer = null;\n if (readableStrategy === @undefined)\n readableStrategy = {};\n if (writableStrategy === @undefined)\n writableStrategy = {};\n let transformerDict = {};\n if (transformer !== null) {\n if (\"start\" in transformer) {\n if (transformerDict.start = transformer.start, typeof transformerDict.start !== \"function\")\n @throwTypeError(\"transformer.start should be a function\");\n }\n if (\"transform\" in transformer) {\n if (transformerDict.transform = transformer.transform, typeof transformerDict.transform !== \"function\")\n @throwTypeError(\"transformer.transform should be a function\");\n }\n if (\"flush\" in transformer) {\n if (transformerDict.flush = transformer.flush, typeof transformerDict.flush !== \"function\")\n @throwTypeError(\"transformer.flush should be a function\");\n }\n if (\"readableType\" in transformer)\n @throwRangeError(\"TransformStream transformer has a readableType\");\n if (\"writableType\" in transformer)\n @throwRangeError(\"TransformStream transformer has a writableType\");\n }\n const readableHighWaterMark = @extractHighWaterMark(readableStrategy, 0), readableSizeAlgorithm = @extractSizeAlgorithm(readableStrategy), writableHighWaterMark = @extractHighWaterMark(writableStrategy, 1), writableSizeAlgorithm = @extractSizeAlgorithm(writableStrategy), startPromiseCapability = @newPromiseCapability(@Promise);\n if (@initializeTransformStream(this, startPromiseCapability.promise, writableHighWaterMark, writableSizeAlgorithm, readableHighWaterMark, readableSizeAlgorithm), @setUpTransformStreamDefaultControllerFromTransformer(this, transformer, transformerDict), (\"start\" in transformerDict)) {\n const controller = @getByIdDirectPrivate(this, \"controller\");\n (() => @promiseInvokeOrNoopMethodNoCatch(transformer, transformerDict.start, [controller]))().@then(() => {\n startPromiseCapability.resolve.@call();\n }, (error) => {\n startPromiseCapability.reject.@call(@undefined, error);\n });\n } else\n startPromiseCapability.resolve.@call();\n return this;\n})\n"; -// respondWithNewView -const JSC::ConstructAbility s_readableStreamBYOBRequestRespondWithNewViewCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; -const JSC::ConstructorKind s_readableStreamBYOBRequestRespondWithNewViewCodeConstructorKind = JSC::ConstructorKind::None; -const JSC::ImplementationVisibility s_readableStreamBYOBRequestRespondWithNewViewCodeImplementationVisibility = JSC::ImplementationVisibility::Public; -const int s_readableStreamBYOBRequestRespondWithNewViewCodeLength = 655; -static const JSC::Intrinsic s_readableStreamBYOBRequestRespondWithNewViewCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_readableStreamBYOBRequestRespondWithNewViewCode = "(function (view) {\"use strict\";\n if (!@isReadableStreamBYOBRequest(this))\n throw @makeThisTypeError(\"ReadableStreamBYOBRequest\", \"respond\");\n if (@getByIdDirectPrivate(this, \"associatedReadableByteStreamController\") === @undefined)\n @throwTypeError(\"ReadableStreamBYOBRequest.associatedReadableByteStreamController is undefined\");\n if (!@isObject(view))\n @throwTypeError(\"Provided view is not an object\");\n if (!@ArrayBuffer.@isView(view))\n @throwTypeError(\"Provided view is not an ArrayBufferView\");\n return @readableByteStreamControllerRespondWithNewView(@getByIdDirectPrivate(this, \"associatedReadableByteStreamController\"), view);\n})\n"; +// readable +const JSC::ConstructAbility s_transformStreamReadableCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; +const JSC::ConstructorKind s_transformStreamReadableCodeConstructorKind = JSC::ConstructorKind::None; +const JSC::ImplementationVisibility s_transformStreamReadableCodeImplementationVisibility = JSC::ImplementationVisibility::Public; +const int s_transformStreamReadableCodeLength = 175; +static const JSC::Intrinsic s_transformStreamReadableCodeIntrinsic = JSC::NoIntrinsic; +const char* const s_transformStreamReadableCode = "(function () {\"use strict\";\n if (!@isTransformStream(this))\n throw @makeThisTypeError(\"TransformStream\", \"readable\");\n return @getByIdDirectPrivate(this, \"readable\");\n})\n"; -// view -const JSC::ConstructAbility s_readableStreamBYOBRequestViewCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; -const JSC::ConstructorKind s_readableStreamBYOBRequestViewCodeConstructorKind = JSC::ConstructorKind::None; -const JSC::ImplementationVisibility s_readableStreamBYOBRequestViewCodeImplementationVisibility = JSC::ImplementationVisibility::Public; -const int s_readableStreamBYOBRequestViewCodeLength = 189; -static const JSC::Intrinsic s_readableStreamBYOBRequestViewCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_readableStreamBYOBRequestViewCode = "(function () {\"use strict\";\n if (!@isReadableStreamBYOBRequest(this))\n throw @makeGetterTypeError(\"ReadableStreamBYOBRequest\", \"view\");\n return @getByIdDirectPrivate(this, \"view\");\n})\n"; +// writable +const JSC::ConstructAbility s_transformStreamWritableCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; +const JSC::ConstructorKind s_transformStreamWritableCodeConstructorKind = JSC::ConstructorKind::None; +const JSC::ImplementationVisibility s_transformStreamWritableCodeImplementationVisibility = JSC::ImplementationVisibility::Public; +const int s_transformStreamWritableCodeLength = 175; +static const JSC::Intrinsic s_transformStreamWritableCodeIntrinsic = JSC::NoIntrinsic; +const char* const s_transformStreamWritableCode = "(function () {\"use strict\";\n if (!@isTransformStream(this))\n throw @makeThisTypeError(\"TransformStream\", \"writable\");\n return @getByIdDirectPrivate(this, \"writable\");\n})\n"; #define DEFINE_BUILTIN_GENERATOR(codeName, functionName, overriddenName, argumentCount) \ JSC::FunctionExecutable* codeName##Generator(JSC::VM& vm) \ {\ JSVMClientData* clientData = static_cast(vm.clientData); \ - return clientData->builtinFunctions().readableStreamBYOBRequestBuiltins().codeName##Executable()->link(vm, nullptr, clientData->builtinFunctions().readableStreamBYOBRequestBuiltins().codeName##Source(), std::nullopt, s_##codeName##Intrinsic); \ + return clientData->builtinFunctions().transformStreamBuiltins().codeName##Executable()->link(vm, nullptr, clientData->builtinFunctions().transformStreamBuiltins().codeName##Source(), std::nullopt, s_##codeName##Intrinsic); \ } -WEBCORE_FOREACH_READABLESTREAMBYOBREQUEST_BUILTIN_CODE(DEFINE_BUILTIN_GENERATOR) +WEBCORE_FOREACH_TRANSFORMSTREAM_BUILTIN_CODE(DEFINE_BUILTIN_GENERATOR) #undef DEFINE_BUILTIN_GENERATOR -/* WritableStreamDefaultWriter.ts */ -// initializeWritableStreamDefaultWriter -const JSC::ConstructAbility s_writableStreamDefaultWriterInitializeWritableStreamDefaultWriterCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; -const JSC::ConstructorKind s_writableStreamDefaultWriterInitializeWritableStreamDefaultWriterCodeConstructorKind = JSC::ConstructorKind::None; -const JSC::ImplementationVisibility s_writableStreamDefaultWriterInitializeWritableStreamDefaultWriterCodeImplementationVisibility = JSC::ImplementationVisibility::Public; -const int s_writableStreamDefaultWriterInitializeWritableStreamDefaultWriterCodeLength = 334; -static const JSC::Intrinsic s_writableStreamDefaultWriterInitializeWritableStreamDefaultWriterCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_writableStreamDefaultWriterInitializeWritableStreamDefaultWriterCode = "(function (stream) {\"use strict\";\n const internalStream = @getInternalWritableStream(stream);\n if (internalStream)\n stream = internalStream;\n if (!@isWritableStream(stream))\n @throwTypeError(\"WritableStreamDefaultWriter constructor takes a WritableStream\");\n return @setUpWritableStreamDefaultWriter(this, stream), this;\n})\n"; - -// closed -const JSC::ConstructAbility s_writableStreamDefaultWriterClosedCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; -const JSC::ConstructorKind s_writableStreamDefaultWriterClosedCodeConstructorKind = JSC::ConstructorKind::None; -const JSC::ImplementationVisibility s_writableStreamDefaultWriterClosedCodeImplementationVisibility = JSC::ImplementationVisibility::Public; -const int s_writableStreamDefaultWriterClosedCodeLength = 231; -static const JSC::Intrinsic s_writableStreamDefaultWriterClosedCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_writableStreamDefaultWriterClosedCode = "(function () {\"use strict\";\n if (!@isWritableStreamDefaultWriter(this))\n return @Promise.@reject(@makeGetterTypeError(\"WritableStreamDefaultWriter\", \"closed\"));\n return @getByIdDirectPrivate(this, \"closedPromise\").promise;\n})\n"; - -// desiredSize -const JSC::ConstructAbility s_writableStreamDefaultWriterDesiredSizeCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; -const JSC::ConstructorKind s_writableStreamDefaultWriterDesiredSizeCodeConstructorKind = JSC::ConstructorKind::None; -const JSC::ImplementationVisibility s_writableStreamDefaultWriterDesiredSizeCodeImplementationVisibility = JSC::ImplementationVisibility::Public; -const int s_writableStreamDefaultWriterDesiredSizeCodeLength = 337; -static const JSC::Intrinsic s_writableStreamDefaultWriterDesiredSizeCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_writableStreamDefaultWriterDesiredSizeCode = "(function () {\"use strict\";\n if (!@isWritableStreamDefaultWriter(this))\n throw @makeThisTypeError(\"WritableStreamDefaultWriter\", \"desiredSize\");\n if (@getByIdDirectPrivate(this, \"stream\") === @undefined)\n @throwTypeError(\"WritableStreamDefaultWriter has no stream\");\n return @writableStreamDefaultWriterGetDesiredSize(this);\n})\n"; - -// ready -const JSC::ConstructAbility s_writableStreamDefaultWriterReadyCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; -const JSC::ConstructorKind s_writableStreamDefaultWriterReadyCodeConstructorKind = JSC::ConstructorKind::None; -const JSC::ImplementationVisibility s_writableStreamDefaultWriterReadyCodeImplementationVisibility = JSC::ImplementationVisibility::Public; -const int s_writableStreamDefaultWriterReadyCodeLength = 227; -static const JSC::Intrinsic s_writableStreamDefaultWriterReadyCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_writableStreamDefaultWriterReadyCode = "(function () {\"use strict\";\n if (!@isWritableStreamDefaultWriter(this))\n return @Promise.@reject(@makeThisTypeError(\"WritableStreamDefaultWriter\", \"ready\"));\n return @getByIdDirectPrivate(this, \"readyPromise\").promise;\n})\n"; +/* ReadableStreamBYOBReader.ts */ +// initializeReadableStreamBYOBReader +const JSC::ConstructAbility s_readableStreamBYOBReaderInitializeReadableStreamBYOBReaderCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; +const JSC::ConstructorKind s_readableStreamBYOBReaderInitializeReadableStreamBYOBReaderCodeConstructorKind = JSC::ConstructorKind::None; +const JSC::ImplementationVisibility s_readableStreamBYOBReaderInitializeReadableStreamBYOBReaderCodeImplementationVisibility = JSC::ImplementationVisibility::Public; +const int s_readableStreamBYOBReaderInitializeReadableStreamBYOBReaderCodeLength = 549; +static const JSC::Intrinsic s_readableStreamBYOBReaderInitializeReadableStreamBYOBReaderCodeIntrinsic = JSC::NoIntrinsic; +const char* const s_readableStreamBYOBReaderInitializeReadableStreamBYOBReaderCode = "(function (stream) {\"use strict\";\n if (!@isReadableStream(stream))\n @throwTypeError(\"ReadableStreamBYOBReader needs a ReadableStream\");\n if (!@isReadableByteStreamController(@getByIdDirectPrivate(stream, \"readableStreamController\")))\n @throwTypeError(\"ReadableStreamBYOBReader needs a ReadableByteStreamController\");\n if (@isReadableStreamLocked(stream))\n @throwTypeError(\"ReadableStream is locked\");\n return @readableStreamReaderGenericInitialize(this, stream), @putByIdDirectPrivate(this, \"readIntoRequests\", @createFIFO()), this;\n})\n"; -// abort -const JSC::ConstructAbility s_writableStreamDefaultWriterAbortCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; -const JSC::ConstructorKind s_writableStreamDefaultWriterAbortCodeConstructorKind = JSC::ConstructorKind::None; -const JSC::ImplementationVisibility s_writableStreamDefaultWriterAbortCodeImplementationVisibility = JSC::ImplementationVisibility::Public; -const int s_writableStreamDefaultWriterAbortCodeLength = 379; -static const JSC::Intrinsic s_writableStreamDefaultWriterAbortCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_writableStreamDefaultWriterAbortCode = "(function (reason) {\"use strict\";\n if (!@isWritableStreamDefaultWriter(this))\n return @Promise.@reject(@makeThisTypeError(\"WritableStreamDefaultWriter\", \"abort\"));\n if (@getByIdDirectPrivate(this, \"stream\") === @undefined)\n return @Promise.@reject(@makeTypeError(\"WritableStreamDefaultWriter has no stream\"));\n return @writableStreamDefaultWriterAbort(this, reason);\n})\n"; +// cancel +const JSC::ConstructAbility s_readableStreamBYOBReaderCancelCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; +const JSC::ConstructorKind s_readableStreamBYOBReaderCancelCodeConstructorKind = JSC::ConstructorKind::None; +const JSC::ImplementationVisibility s_readableStreamBYOBReaderCancelCodeImplementationVisibility = JSC::ImplementationVisibility::Public; +const int s_readableStreamBYOBReaderCancelCodeLength = 388; +static const JSC::Intrinsic s_readableStreamBYOBReaderCancelCodeIntrinsic = JSC::NoIntrinsic; +const char* const s_readableStreamBYOBReaderCancelCode = "(function (reason) {\"use strict\";\n if (!@isReadableStreamBYOBReader(this))\n return @Promise.@reject(@makeThisTypeError(\"ReadableStreamBYOBReader\", \"cancel\"));\n if (!@getByIdDirectPrivate(this, \"ownerReadableStream\"))\n return @Promise.@reject(@makeTypeError(\"cancel() called on a reader owned by no readable stream\"));\n return @readableStreamReaderGenericCancel(this, reason);\n})\n"; -// close -const JSC::ConstructAbility s_writableStreamDefaultWriterCloseCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; -const JSC::ConstructorKind s_writableStreamDefaultWriterCloseCodeConstructorKind = JSC::ConstructorKind::None; -const JSC::ImplementationVisibility s_writableStreamDefaultWriterCloseCodeImplementationVisibility = JSC::ImplementationVisibility::Public; -const int s_writableStreamDefaultWriterCloseCodeLength = 534; -static const JSC::Intrinsic s_writableStreamDefaultWriterCloseCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_writableStreamDefaultWriterCloseCode = "(function () {\"use strict\";\n if (!@isWritableStreamDefaultWriter(this))\n return @Promise.@reject(@makeThisTypeError(\"WritableStreamDefaultWriter\", \"close\"));\n const stream = @getByIdDirectPrivate(this, \"stream\");\n if (stream === @undefined)\n return @Promise.@reject(@makeTypeError(\"WritableStreamDefaultWriter has no stream\"));\n if (@writableStreamCloseQueuedOrInFlight(stream))\n return @Promise.@reject(@makeTypeError(\"WritableStreamDefaultWriter is being closed\"));\n return @writableStreamDefaultWriterClose(this);\n})\n"; +// read +const JSC::ConstructAbility s_readableStreamBYOBReaderReadCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; +const JSC::ConstructorKind s_readableStreamBYOBReaderReadCodeConstructorKind = JSC::ConstructorKind::None; +const JSC::ImplementationVisibility s_readableStreamBYOBReaderReadCodeImplementationVisibility = JSC::ImplementationVisibility::Public; +const int s_readableStreamBYOBReaderReadCodeLength = 719; +static const JSC::Intrinsic s_readableStreamBYOBReaderReadCodeIntrinsic = JSC::NoIntrinsic; +const char* const s_readableStreamBYOBReaderReadCode = "(function (view) {\"use strict\";\n if (!@isReadableStreamBYOBReader(this))\n return @Promise.@reject(@makeThisTypeError(\"ReadableStreamBYOBReader\", \"read\"));\n if (!@getByIdDirectPrivate(this, \"ownerReadableStream\"))\n return @Promise.@reject(@makeTypeError(\"read() called on a reader owned by no readable stream\"));\n if (!@isObject(view))\n return @Promise.@reject(@makeTypeError(\"Provided view is not an object\"));\n if (!@ArrayBuffer.@isView(view))\n return @Promise.@reject(@makeTypeError(\"Provided view is not an ArrayBufferView\"));\n if (view.byteLength === 0)\n return @Promise.@reject(@makeTypeError(\"Provided view cannot have a 0 byteLength\"));\n return @readableStreamBYOBReaderRead(this, view);\n})\n"; // releaseLock -const JSC::ConstructAbility s_writableStreamDefaultWriterReleaseLockCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; -const JSC::ConstructorKind s_writableStreamDefaultWriterReleaseLockCodeConstructorKind = JSC::ConstructorKind::None; -const JSC::ImplementationVisibility s_writableStreamDefaultWriterReleaseLockCodeImplementationVisibility = JSC::ImplementationVisibility::Public; -const int s_writableStreamDefaultWriterReleaseLockCodeLength = 269; -static const JSC::Intrinsic s_writableStreamDefaultWriterReleaseLockCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_writableStreamDefaultWriterReleaseLockCode = "(function () {\"use strict\";\n if (!@isWritableStreamDefaultWriter(this))\n throw @makeThisTypeError(\"WritableStreamDefaultWriter\", \"releaseLock\");\n if (@getByIdDirectPrivate(this, \"stream\") === @undefined)\n return;\n @writableStreamDefaultWriterRelease(this);\n})\n"; +const JSC::ConstructAbility s_readableStreamBYOBReaderReleaseLockCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; +const JSC::ConstructorKind s_readableStreamBYOBReaderReleaseLockCodeConstructorKind = JSC::ConstructorKind::None; +const JSC::ImplementationVisibility s_readableStreamBYOBReaderReleaseLockCodeImplementationVisibility = JSC::ImplementationVisibility::Public; +const int s_readableStreamBYOBReaderReleaseLockCodeLength = 418; +static const JSC::Intrinsic s_readableStreamBYOBReaderReleaseLockCodeIntrinsic = JSC::NoIntrinsic; +const char* const s_readableStreamBYOBReaderReleaseLockCode = "(function () {\"use strict\";\n if (!@isReadableStreamBYOBReader(this))\n throw @makeThisTypeError(\"ReadableStreamBYOBReader\", \"releaseLock\");\n if (!@getByIdDirectPrivate(this, \"ownerReadableStream\"))\n return;\n if (@getByIdDirectPrivate(this, \"readIntoRequests\")\?.isNotEmpty())\n @throwTypeError(\"There are still pending read requests, cannot release the lock\");\n @readableStreamReaderGenericRelease(this);\n})\n"; -// write -const JSC::ConstructAbility s_writableStreamDefaultWriterWriteCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; -const JSC::ConstructorKind s_writableStreamDefaultWriterWriteCodeConstructorKind = JSC::ConstructorKind::None; -const JSC::ImplementationVisibility s_writableStreamDefaultWriterWriteCodeImplementationVisibility = JSC::ImplementationVisibility::Public; -const int s_writableStreamDefaultWriterWriteCodeLength = 377; -static const JSC::Intrinsic s_writableStreamDefaultWriterWriteCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_writableStreamDefaultWriterWriteCode = "(function (chunk) {\"use strict\";\n if (!@isWritableStreamDefaultWriter(this))\n return @Promise.@reject(@makeThisTypeError(\"WritableStreamDefaultWriter\", \"write\"));\n if (@getByIdDirectPrivate(this, \"stream\") === @undefined)\n return @Promise.@reject(@makeTypeError(\"WritableStreamDefaultWriter has no stream\"));\n return @writableStreamDefaultWriterWrite(this, chunk);\n})\n"; +// closed +const JSC::ConstructAbility s_readableStreamBYOBReaderClosedCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; +const JSC::ConstructorKind s_readableStreamBYOBReaderClosedCodeConstructorKind = JSC::ConstructorKind::None; +const JSC::ImplementationVisibility s_readableStreamBYOBReaderClosedCodeImplementationVisibility = JSC::ImplementationVisibility::Public; +const int s_readableStreamBYOBReaderClosedCodeLength = 235; +static const JSC::Intrinsic s_readableStreamBYOBReaderClosedCodeIntrinsic = JSC::NoIntrinsic; +const char* const s_readableStreamBYOBReaderClosedCode = "(function () {\"use strict\";\n if (!@isReadableStreamBYOBReader(this))\n return @Promise.@reject(@makeGetterTypeError(\"ReadableStreamBYOBReader\", \"closed\"));\n return @getByIdDirectPrivate(this, \"closedPromiseCapability\").promise;\n})\n"; #define DEFINE_BUILTIN_GENERATOR(codeName, functionName, overriddenName, argumentCount) \ JSC::FunctionExecutable* codeName##Generator(JSC::VM& vm) \ {\ JSVMClientData* clientData = static_cast(vm.clientData); \ - return clientData->builtinFunctions().writableStreamDefaultWriterBuiltins().codeName##Executable()->link(vm, nullptr, clientData->builtinFunctions().writableStreamDefaultWriterBuiltins().codeName##Source(), std::nullopt, s_##codeName##Intrinsic); \ + return clientData->builtinFunctions().readableStreamBYOBReaderBuiltins().codeName##Executable()->link(vm, nullptr, clientData->builtinFunctions().readableStreamBYOBReaderBuiltins().codeName##Source(), std::nullopt, s_##codeName##Intrinsic); \ } -WEBCORE_FOREACH_WRITABLESTREAMDEFAULTWRITER_BUILTIN_CODE(DEFINE_BUILTIN_GENERATOR) +WEBCORE_FOREACH_READABLESTREAMBYOBREADER_BUILTIN_CODE(DEFINE_BUILTIN_GENERATOR) #undef DEFINE_BUILTIN_GENERATOR -/* ReadableStream.ts */ -// initializeReadableStream -const JSC::ConstructAbility s_readableStreamInitializeReadableStreamCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; -const JSC::ConstructorKind s_readableStreamInitializeReadableStreamCodeConstructorKind = JSC::ConstructorKind::None; -const JSC::ImplementationVisibility s_readableStreamInitializeReadableStreamCodeImplementationVisibility = JSC::ImplementationVisibility::Public; -const int s_readableStreamInitializeReadableStreamCodeLength = 2962; -static const JSC::Intrinsic s_readableStreamInitializeReadableStreamCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_readableStreamInitializeReadableStreamCode = "(function (underlyingSource, strategy) {\"use strict\";\n if (underlyingSource === @undefined)\n underlyingSource = { @bunNativeType: 0, @bunNativePtr: 0, @lazy: !1 };\n if (strategy === @undefined)\n strategy = {};\n if (!@isObject(underlyingSource))\n @throwTypeError(\"ReadableStream constructor takes an object as first argument\");\n if (strategy !== @undefined && !@isObject(strategy))\n @throwTypeError(\"ReadableStream constructor takes an object as second argument, if any\");\n @putByIdDirectPrivate(this, \"state\", 4), @putByIdDirectPrivate(this, \"reader\", @undefined), @putByIdDirectPrivate(this, \"storedError\", @undefined), @putByIdDirectPrivate(this, \"disturbed\", !1), @putByIdDirectPrivate(this, \"readableStreamController\", null), @putByIdDirectPrivate(this, \"bunNativeType\", @getByIdDirectPrivate(underlyingSource, \"bunNativeType\") \?\? 0), @putByIdDirectPrivate(this, \"bunNativePtr\", @getByIdDirectPrivate(underlyingSource, \"bunNativePtr\") \?\? 0), @putByIdDirectPrivate(this, \"asyncContext\", @getInternalField(@asyncContext, 0));\n const isDirect = underlyingSource.type === \"direct\", isUnderlyingSourceLazy = !!underlyingSource.@lazy, isLazy = isDirect || isUnderlyingSourceLazy;\n if (@getByIdDirectPrivate(underlyingSource, \"pull\") !== @undefined && !isLazy) {\n const size = @getByIdDirectPrivate(strategy, \"size\"), highWaterMark = @getByIdDirectPrivate(strategy, \"highWaterMark\");\n return @putByIdDirectPrivate(this, \"highWaterMark\", highWaterMark), @putByIdDirectPrivate(this, \"underlyingSource\", @undefined), @setupReadableStreamDefaultController(this, underlyingSource, size, highWaterMark !== @undefined \? highWaterMark : 1, @getByIdDirectPrivate(underlyingSource, \"start\"), @getByIdDirectPrivate(underlyingSource, \"pull\"), @getByIdDirectPrivate(underlyingSource, \"cancel\")), this;\n }\n if (isDirect)\n @putByIdDirectPrivate(this, \"underlyingSource\", underlyingSource), @putByIdDirectPrivate(this, \"highWaterMark\", @getByIdDirectPrivate(strategy, \"highWaterMark\")), @putByIdDirectPrivate(this, \"start\", () => @createReadableStreamController(this, underlyingSource, strategy));\n else if (isLazy) {\n const autoAllocateChunkSize = underlyingSource.autoAllocateChunkSize;\n @putByIdDirectPrivate(this, \"highWaterMark\", @undefined), @putByIdDirectPrivate(this, \"underlyingSource\", @undefined), @putByIdDirectPrivate(this, \"highWaterMark\", autoAllocateChunkSize || @getByIdDirectPrivate(strategy, \"highWaterMark\")), @putByIdDirectPrivate(this, \"start\", () => {\n const instance = @lazyLoadStream(this, autoAllocateChunkSize);\n if (instance)\n @createReadableStreamController(this, instance, strategy);\n });\n } else\n @putByIdDirectPrivate(this, \"underlyingSource\", @undefined), @putByIdDirectPrivate(this, \"highWaterMark\", @getByIdDirectPrivate(strategy, \"highWaterMark\")), @putByIdDirectPrivate(this, \"start\", @undefined), @createReadableStreamController(this, underlyingSource, strategy);\n return this;\n})\n"; +/* ReadableStreamInternals.ts */ +// readableStreamReaderGenericInitialize +const JSC::ConstructAbility s_readableStreamInternalsReadableStreamReaderGenericInitializeCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; +const JSC::ConstructorKind s_readableStreamInternalsReadableStreamReaderGenericInitializeCodeConstructorKind = JSC::ConstructorKind::None; +const JSC::ImplementationVisibility s_readableStreamInternalsReadableStreamReaderGenericInitializeCodeImplementationVisibility = JSC::ImplementationVisibility::Public; +const int s_readableStreamInternalsReadableStreamReaderGenericInitializeCodeLength = 632; +static const JSC::Intrinsic s_readableStreamInternalsReadableStreamReaderGenericInitializeCodeIntrinsic = JSC::NoIntrinsic; +const char* const s_readableStreamInternalsReadableStreamReaderGenericInitializeCode = "(function (reader, stream) {\"use strict\";\n if (@putByIdDirectPrivate(reader, \"ownerReadableStream\", stream), @putByIdDirectPrivate(stream, \"reader\", reader), @getByIdDirectPrivate(stream, \"state\") === 4)\n @putByIdDirectPrivate(reader, \"closedPromiseCapability\", @newPromiseCapability(@Promise));\n else if (@getByIdDirectPrivate(stream, \"state\") === 1)\n @putByIdDirectPrivate(reader, \"closedPromiseCapability\", {\n promise: @Promise.@resolve()\n });\n else\n @putByIdDirectPrivate(reader, \"closedPromiseCapability\", {\n promise: @newHandledRejectedPromise(@getByIdDirectPrivate(stream, \"storedError\"))\n });\n})\n"; -// readableStreamToArray -const JSC::ConstructAbility s_readableStreamReadableStreamToArrayCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; -const JSC::ConstructorKind s_readableStreamReadableStreamToArrayCodeConstructorKind = JSC::ConstructorKind::None; -const JSC::ImplementationVisibility s_readableStreamReadableStreamToArrayCodeImplementationVisibility = JSC::ImplementationVisibility::Private; -const int s_readableStreamReadableStreamToArrayCodeLength = 262; -static const JSC::Intrinsic s_readableStreamReadableStreamToArrayCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_readableStreamReadableStreamToArrayCode = "(function (stream) {\"use strict\";\n var underlyingSource = @getByIdDirectPrivate(stream, \"underlyingSource\");\n if (underlyingSource !== @undefined)\n return @readableStreamToArrayDirect(stream, underlyingSource);\n return @readableStreamIntoArray(stream);\n})\n"; +// privateInitializeReadableStreamDefaultController +const JSC::ConstructAbility s_readableStreamInternalsPrivateInitializeReadableStreamDefaultControllerCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; +const JSC::ConstructorKind s_readableStreamInternalsPrivateInitializeReadableStreamDefaultControllerCodeConstructorKind = JSC::ConstructorKind::None; +const JSC::ImplementationVisibility s_readableStreamInternalsPrivateInitializeReadableStreamDefaultControllerCodeImplementationVisibility = JSC::ImplementationVisibility::Public; +const int s_readableStreamInternalsPrivateInitializeReadableStreamDefaultControllerCodeLength = 810; +static const JSC::Intrinsic s_readableStreamInternalsPrivateInitializeReadableStreamDefaultControllerCodeIntrinsic = JSC::NoIntrinsic; +const char* const s_readableStreamInternalsPrivateInitializeReadableStreamDefaultControllerCode = "(function (stream, underlyingSource, size, highWaterMark) {\"use strict\";\n if (!@isReadableStream(stream))\n @throwTypeError(\"ReadableStreamDefaultController needs a ReadableStream\");\n if (@getByIdDirectPrivate(stream, \"readableStreamController\") !== null)\n @throwTypeError(\"ReadableStream already has a controller\");\n return @putByIdDirectPrivate(this, \"controlledReadableStream\", stream), @putByIdDirectPrivate(this, \"underlyingSource\", 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(size, highWaterMark)), this;\n})\n"; -// readableStreamToText -const JSC::ConstructAbility s_readableStreamReadableStreamToTextCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; -const JSC::ConstructorKind s_readableStreamReadableStreamToTextCodeConstructorKind = JSC::ConstructorKind::None; -const JSC::ImplementationVisibility s_readableStreamReadableStreamToTextCodeImplementationVisibility = JSC::ImplementationVisibility::Private; -const int s_readableStreamReadableStreamToTextCodeLength = 260; -static const JSC::Intrinsic s_readableStreamReadableStreamToTextCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_readableStreamReadableStreamToTextCode = "(function (stream) {\"use strict\";\n var underlyingSource = @getByIdDirectPrivate(stream, \"underlyingSource\");\n if (underlyingSource !== @undefined)\n return @readableStreamToTextDirect(stream, underlyingSource);\n return @readableStreamIntoText(stream);\n})\n"; +// readableStreamDefaultControllerError +const JSC::ConstructAbility s_readableStreamInternalsReadableStreamDefaultControllerErrorCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; +const JSC::ConstructorKind s_readableStreamInternalsReadableStreamDefaultControllerErrorCodeConstructorKind = JSC::ConstructorKind::None; +const JSC::ImplementationVisibility s_readableStreamInternalsReadableStreamDefaultControllerErrorCodeImplementationVisibility = JSC::ImplementationVisibility::Public; +const int s_readableStreamInternalsReadableStreamDefaultControllerErrorCodeLength = 288; +static const JSC::Intrinsic s_readableStreamInternalsReadableStreamDefaultControllerErrorCodeIntrinsic = JSC::NoIntrinsic; +const char* const s_readableStreamInternalsReadableStreamDefaultControllerErrorCode = "(function (controller, error) {\"use strict\";\n const stream = @getByIdDirectPrivate(controller, \"controlledReadableStream\");\n if (@getByIdDirectPrivate(stream, \"state\") !== 4)\n return;\n @putByIdDirectPrivate(controller, \"queue\", @newQueue()), @readableStreamError(stream, error);\n})\n"; -// readableStreamToArrayBuffer -const JSC::ConstructAbility s_readableStreamReadableStreamToArrayBufferCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; -const JSC::ConstructorKind s_readableStreamReadableStreamToArrayBufferCodeConstructorKind = JSC::ConstructorKind::None; -const JSC::ImplementationVisibility s_readableStreamReadableStreamToArrayBufferCodeImplementationVisibility = JSC::ImplementationVisibility::Private; -const int s_readableStreamReadableStreamToArrayBufferCodeLength = 390; -static const JSC::Intrinsic s_readableStreamReadableStreamToArrayBufferCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_readableStreamReadableStreamToArrayBufferCode = "(function (stream) {\"use strict\";\n var underlyingSource = @getByIdDirectPrivate(stream, \"underlyingSource\");\n if (underlyingSource !== @undefined)\n return @readableStreamToArrayBufferDirect(stream, underlyingSource);\n var result = Bun.readableStreamToArray(stream);\n if (@isPromise(result))\n return result.then(Bun.concatArrayBuffers);\n return Bun.concatArrayBuffers(result);\n})\n"; +// readableStreamPipeTo +const JSC::ConstructAbility s_readableStreamInternalsReadableStreamPipeToCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; +const JSC::ConstructorKind s_readableStreamInternalsReadableStreamPipeToCodeConstructorKind = JSC::ConstructorKind::None; +const JSC::ImplementationVisibility s_readableStreamInternalsReadableStreamPipeToCodeImplementationVisibility = JSC::ImplementationVisibility::Public; +const int s_readableStreamInternalsReadableStreamPipeToCodeLength = 633; +static const JSC::Intrinsic s_readableStreamInternalsReadableStreamPipeToCodeIntrinsic = JSC::NoIntrinsic; +const char* const s_readableStreamInternalsReadableStreamPipeToCode = "(function (stream, sink) {\"use strict\";\n const reader = new @ReadableStreamDefaultReader(stream);\n @getByIdDirectPrivate(reader, \"closedPromiseCapability\").promise.@then(() => {\n }, (e) => {\n sink.error(e);\n });\n function doPipe() {\n @readableStreamDefaultReaderRead(reader).@then(function(result) {\n if (result.done) {\n sink.close();\n return;\n }\n try {\n sink.enqueue(result.value);\n } catch (e) {\n sink.error(\"ReadableStream chunk enqueueing in the sink failed\");\n return;\n }\n doPipe();\n }, function(e) {\n sink.error(e);\n });\n }\n doPipe();\n})\n"; -// readableStreamToFormData -const JSC::ConstructAbility s_readableStreamReadableStreamToFormDataCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; -const JSC::ConstructorKind s_readableStreamReadableStreamToFormDataCodeConstructorKind = JSC::ConstructorKind::None; -const JSC::ImplementationVisibility s_readableStreamReadableStreamToFormDataCodeImplementationVisibility = JSC::ImplementationVisibility::Private; -const int s_readableStreamReadableStreamToFormDataCodeLength = 160; -static const JSC::Intrinsic s_readableStreamReadableStreamToFormDataCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_readableStreamReadableStreamToFormDataCode = "(function (stream, contentType) {\"use strict\";\n return Bun.readableStreamToBlob(stream).then((blob) => {\n return FormData.from(blob, contentType);\n });\n})\n"; +// acquireReadableStreamDefaultReader +const JSC::ConstructAbility s_readableStreamInternalsAcquireReadableStreamDefaultReaderCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; +const JSC::ConstructorKind s_readableStreamInternalsAcquireReadableStreamDefaultReaderCodeConstructorKind = JSC::ConstructorKind::None; +const JSC::ImplementationVisibility s_readableStreamInternalsAcquireReadableStreamDefaultReaderCodeImplementationVisibility = JSC::ImplementationVisibility::Public; +const int s_readableStreamInternalsAcquireReadableStreamDefaultReaderCodeLength = 180; +static const JSC::Intrinsic s_readableStreamInternalsAcquireReadableStreamDefaultReaderCodeIntrinsic = JSC::NoIntrinsic; +const char* const s_readableStreamInternalsAcquireReadableStreamDefaultReaderCode = "(function (stream) {\"use strict\";\n var start = @getByIdDirectPrivate(stream, \"start\");\n if (start)\n start.@call(stream);\n return new @ReadableStreamDefaultReader(stream);\n})\n"; -// readableStreamToJSON -const JSC::ConstructAbility s_readableStreamReadableStreamToJSONCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; -const JSC::ConstructorKind s_readableStreamReadableStreamToJSONCodeConstructorKind = JSC::ConstructorKind::None; -const JSC::ImplementationVisibility s_readableStreamReadableStreamToJSONCodeImplementationVisibility = JSC::ImplementationVisibility::Private; -const int s_readableStreamReadableStreamToJSONCodeLength = 109; -static const JSC::Intrinsic s_readableStreamReadableStreamToJSONCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_readableStreamReadableStreamToJSONCode = "(function (stream) {\"use strict\";\n return Bun.readableStreamToText(stream).@then(globalThis.JSON.parse);\n})\n"; +// setupReadableStreamDefaultController +const JSC::ConstructAbility s_readableStreamInternalsSetupReadableStreamDefaultControllerCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; +const JSC::ConstructorKind s_readableStreamInternalsSetupReadableStreamDefaultControllerCodeConstructorKind = JSC::ConstructorKind::None; +const JSC::ImplementationVisibility s_readableStreamInternalsSetupReadableStreamDefaultControllerCodeImplementationVisibility = JSC::ImplementationVisibility::Public; +const int s_readableStreamInternalsSetupReadableStreamDefaultControllerCodeLength = 1204; +static const JSC::Intrinsic s_readableStreamInternalsSetupReadableStreamDefaultControllerCodeIntrinsic = JSC::NoIntrinsic; +const char* const s_readableStreamInternalsSetupReadableStreamDefaultControllerCode = "(function (stream, underlyingSource, size, highWaterMark, startMethod, pullMethod, cancelMethod) {\"use strict\";\n const controller = new @ReadableStreamDefaultController(stream, underlyingSource, size, highWaterMark, @isReadableStream);\n var asyncContext = stream.@asyncContext;\n const pullAlgorithm = () => @promiseInvokeOrNoopMethod(underlyingSource, pullMethod, [controller]), cancelAlgorithm = asyncContext \? (reason) => {\n var prev = @getInternalField(@asyncContext, 0);\n @putInternalField(@asyncContext, 0, asyncContext);\n var result = @promiseInvokeOrNoopMethod(underlyingSource, cancelMethod, [reason]);\n return @putInternalField(@asyncContext, 0, prev), result;\n } : (reason) => @promiseInvokeOrNoopMethod(underlyingSource, cancelMethod, [reason]);\n @putByIdDirectPrivate(controller, \"pullAlgorithm\", pullAlgorithm), @putByIdDirectPrivate(controller, \"cancelAlgorithm\", cancelAlgorithm), @putByIdDirectPrivate(controller, \"pull\", @readableStreamDefaultControllerPull), @putByIdDirectPrivate(controller, \"cancel\", @readableStreamDefaultControllerCancel), @putByIdDirectPrivate(stream, \"readableStreamController\", controller), @readableStreamDefaultControllerStart(controller);\n})\n"; -// readableStreamToBlob -const JSC::ConstructAbility s_readableStreamReadableStreamToBlobCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; -const JSC::ConstructorKind s_readableStreamReadableStreamToBlobCodeConstructorKind = JSC::ConstructorKind::None; -const JSC::ImplementationVisibility s_readableStreamReadableStreamToBlobCodeImplementationVisibility = JSC::ImplementationVisibility::Private; -const int s_readableStreamReadableStreamToBlobCodeLength = 133; -static const JSC::Intrinsic s_readableStreamReadableStreamToBlobCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_readableStreamReadableStreamToBlobCode = "(function (stream) {\"use strict\";\n return @Promise.resolve(Bun.readableStreamToArray(stream)).@then((array) => new Blob(array));\n})\n"; +// createReadableStreamController +const JSC::ConstructAbility s_readableStreamInternalsCreateReadableStreamControllerCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; +const JSC::ConstructorKind s_readableStreamInternalsCreateReadableStreamControllerCodeConstructorKind = JSC::ConstructorKind::None; +const JSC::ImplementationVisibility s_readableStreamInternalsCreateReadableStreamControllerCodeImplementationVisibility = JSC::ImplementationVisibility::Public; +const int s_readableStreamInternalsCreateReadableStreamControllerCodeLength = 1077; +static const JSC::Intrinsic s_readableStreamInternalsCreateReadableStreamControllerCodeIntrinsic = JSC::NoIntrinsic; +const char* const s_readableStreamInternalsCreateReadableStreamControllerCode = "(function (stream, underlyingSource, strategy) {\"use strict\";\n const type = underlyingSource.type, typeString = @toString(type);\n if (typeString === \"bytes\") {\n if (strategy.highWaterMark === @undefined)\n strategy.highWaterMark = 0;\n if (strategy.size !== @undefined)\n @throwRangeError(\"Strategy for a ReadableByteStreamController cannot have a size\");\n @putByIdDirectPrivate(stream, \"readableStreamController\", new @ReadableByteStreamController(stream, underlyingSource, strategy.highWaterMark, @isReadableStream));\n } else if (typeString === \"direct\") {\n var highWaterMark = strategy\?.highWaterMark;\n @initializeArrayBufferStream.@call(stream, underlyingSource, highWaterMark);\n } else if (type === @undefined) {\n if (strategy.highWaterMark === @undefined)\n strategy.highWaterMark = 1;\n @setupReadableStreamDefaultController(stream, underlyingSource, strategy.size, strategy.highWaterMark, underlyingSource.start, underlyingSource.pull, underlyingSource.cancel);\n } else\n @throwRangeError(\"Invalid type for underlying source\");\n})\n"; -// consumeReadableStream -const JSC::ConstructAbility s_readableStreamConsumeReadableStreamCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; -const JSC::ConstructorKind s_readableStreamConsumeReadableStreamCodeConstructorKind = JSC::ConstructorKind::None; -const JSC::ImplementationVisibility s_readableStreamConsumeReadableStreamCodeImplementationVisibility = JSC::ImplementationVisibility::Private; -const int s_readableStreamConsumeReadableStreamCodeLength = 2830; -static const JSC::Intrinsic s_readableStreamConsumeReadableStreamCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_readableStreamConsumeReadableStreamCode = "(function (nativePtr, nativeType, inputStream) {\"use strict\";\n const symbol = globalThis.Symbol.for(\"Bun.consumeReadableStreamPrototype\");\n var cached = globalThis[symbol];\n if (!cached)\n cached = globalThis[symbol] = [];\n var Prototype = cached[nativeType];\n if (Prototype === @undefined) {\n var [doRead, doError, doReadMany, doClose, onClose, deinit] = @lazy(nativeType);\n Prototype = class NativeReadableStreamSink {\n handleError;\n handleClosed;\n processResult;\n constructor(reader, ptr) {\n this.#ptr = ptr, this.#reader = reader, this.#didClose = !1, this.handleError = this._handleError.bind(this), this.handleClosed = this._handleClosed.bind(this), this.processResult = this._processResult.bind(this), reader.closed.then(this.handleClosed, this.handleError);\n }\n _handleClosed() {\n if (this.#didClose)\n return;\n this.#didClose = !0;\n var ptr = this.#ptr;\n this.#ptr = 0, doClose(ptr), deinit(ptr);\n }\n _handleError(error) {\n if (this.#didClose)\n return;\n this.#didClose = !0;\n var ptr = this.#ptr;\n this.#ptr = 0, doError(ptr, error), deinit(ptr);\n }\n #ptr;\n #didClose = !1;\n #reader;\n _handleReadMany({ value, done, size }) {\n if (done) {\n this.handleClosed();\n return;\n }\n if (this.#didClose)\n return;\n doReadMany(this.#ptr, value, done, size);\n }\n read() {\n if (!this.#ptr)\n return @throwTypeError(\"ReadableStreamSink is already closed\");\n return this.processResult(this.#reader.read());\n }\n _processResult(result) {\n if (result && @isPromise(result)) {\n if (@getPromiseInternalField(result, @promiseFieldFlags) & @promiseStateFulfilled) {\n const fulfilledValue = @getPromiseInternalField(result, @promiseFieldReactionsOrResult);\n if (fulfilledValue)\n result = fulfilledValue;\n }\n }\n if (result && @isPromise(result))\n return result.then(this.processResult, this.handleError), null;\n if (result.done)\n return this.handleClosed(), 0;\n else if (result.value)\n return result.value;\n else\n return -1;\n }\n readMany() {\n if (!this.#ptr)\n return @throwTypeError(\"ReadableStreamSink is already closed\");\n return this.processResult(this.#reader.readMany());\n }\n };\n const minlength = nativeType + 1;\n if (cached.length < minlength)\n cached.length = minlength;\n @putByValDirect(cached, nativeType, Prototype);\n }\n if (@isReadableStreamLocked(inputStream))\n @throwTypeError(\"Cannot start reading from a locked stream\");\n return new Prototype(inputStream.getReader(), nativePtr);\n})\n"; +// readableStreamDefaultControllerStart +const JSC::ConstructAbility s_readableStreamInternalsReadableStreamDefaultControllerStartCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; +const JSC::ConstructorKind s_readableStreamInternalsReadableStreamDefaultControllerStartCodeConstructorKind = JSC::ConstructorKind::None; +const JSC::ImplementationVisibility s_readableStreamInternalsReadableStreamDefaultControllerStartCodeImplementationVisibility = JSC::ImplementationVisibility::Public; +const int s_readableStreamInternalsReadableStreamDefaultControllerStartCodeLength = 577; +static const JSC::Intrinsic s_readableStreamInternalsReadableStreamDefaultControllerStartCodeIntrinsic = JSC::NoIntrinsic; +const char* const s_readableStreamInternalsReadableStreamDefaultControllerStartCode = "(function (controller) {\"use strict\";\n if (@getByIdDirectPrivate(controller, \"started\") !== -1)\n return;\n const underlyingSource = @getByIdDirectPrivate(controller, \"underlyingSource\"), startMethod = underlyingSource.start;\n @putByIdDirectPrivate(controller, \"started\", 0), @promiseInvokeOrNoopMethodNoCatch(underlyingSource, startMethod, [controller]).@then(() => {\n @putByIdDirectPrivate(controller, \"started\", 1), @readableStreamDefaultControllerCallPullIfNeeded(controller);\n }, (error) => {\n @readableStreamDefaultControllerError(controller, error);\n });\n})\n"; -// createEmptyReadableStream -const JSC::ConstructAbility s_readableStreamCreateEmptyReadableStreamCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; -const JSC::ConstructorKind s_readableStreamCreateEmptyReadableStreamCodeConstructorKind = JSC::ConstructorKind::None; -const JSC::ImplementationVisibility s_readableStreamCreateEmptyReadableStreamCodeImplementationVisibility = JSC::ImplementationVisibility::Private; -const int s_readableStreamCreateEmptyReadableStreamCodeLength = 140; -static const JSC::Intrinsic s_readableStreamCreateEmptyReadableStreamCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_readableStreamCreateEmptyReadableStreamCode = "(function () {\"use strict\";\n var stream = new @ReadableStream({\n pull() {\n }\n });\n return @readableStreamClose(stream), stream;\n})\n"; +// readableStreamPipeToWritableStream +const JSC::ConstructAbility s_readableStreamInternalsReadableStreamPipeToWritableStreamCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; +const JSC::ConstructorKind s_readableStreamInternalsReadableStreamPipeToWritableStreamCodeConstructorKind = JSC::ConstructorKind::None; +const JSC::ImplementationVisibility s_readableStreamInternalsReadableStreamPipeToWritableStreamCodeImplementationVisibility = JSC::ImplementationVisibility::Public; +const int s_readableStreamInternalsReadableStreamPipeToWritableStreamCodeLength = 2342; +static const JSC::Intrinsic s_readableStreamInternalsReadableStreamPipeToWritableStreamCodeIntrinsic = JSC::NoIntrinsic; +const char* const s_readableStreamInternalsReadableStreamPipeToWritableStreamCode = "(function (source, destination, preventClose, preventAbort, preventCancel, signal) {\"use strict\";\n if (@getByIdDirectPrivate(source, \"underlyingByteSource\") !== @undefined)\n return @Promise.@reject(\"Piping to a readable bytestream is not supported\");\n let pipeState = {\n source,\n destination,\n preventAbort,\n preventCancel,\n preventClose,\n signal\n };\n if (pipeState.reader = @acquireReadableStreamDefaultReader(source), pipeState.writer = @acquireWritableStreamDefaultWriter(destination), @putByIdDirectPrivate(source, \"disturbed\", !0), pipeState.finalized = !1, pipeState.shuttingDown = !1, pipeState.promiseCapability = @newPromiseCapability(@Promise), pipeState.pendingReadPromiseCapability = @newPromiseCapability(@Promise), pipeState.pendingReadPromiseCapability.resolve.@call(), pipeState.pendingWritePromise = @Promise.@resolve(), signal !== @undefined) {\n const algorithm = (reason) => {\n if (pipeState.finalized)\n return;\n @pipeToShutdownWithAction(pipeState, () => {\n const promiseDestination = !pipeState.preventAbort && @getByIdDirectPrivate(pipeState.destination, \"state\") === \"writable\" \? @writableStreamAbort(pipeState.destination, reason) : @Promise.@resolve(), promiseSource = !pipeState.preventCancel && @getByIdDirectPrivate(pipeState.source, \"state\") === 4 \? @readableStreamCancel(pipeState.source, reason) : @Promise.@resolve();\n let promiseCapability = @newPromiseCapability(@Promise), shouldWait = !0, handleResolvedPromise = () => {\n if (shouldWait) {\n shouldWait = !1;\n return;\n }\n promiseCapability.resolve.@call();\n }, handleRejectedPromise = (e) => {\n promiseCapability.reject.@call(@undefined, e);\n };\n return promiseDestination.@then(handleResolvedPromise, handleRejectedPromise), promiseSource.@then(handleResolvedPromise, handleRejectedPromise), promiseCapability.promise;\n }, reason);\n };\n if (@whenSignalAborted(signal, algorithm))\n return pipeState.promiseCapability.promise;\n }\n return @pipeToErrorsMustBePropagatedForward(pipeState), @pipeToErrorsMustBePropagatedBackward(pipeState), @pipeToClosingMustBePropagatedForward(pipeState), @pipeToClosingMustBePropagatedBackward(pipeState), @pipeToLoop(pipeState), pipeState.promiseCapability.promise;\n})\n"; -// createNativeReadableStream -const JSC::ConstructAbility s_readableStreamCreateNativeReadableStreamCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; -const JSC::ConstructorKind s_readableStreamCreateNativeReadableStreamCodeConstructorKind = JSC::ConstructorKind::None; -const JSC::ImplementationVisibility s_readableStreamCreateNativeReadableStreamCodeImplementationVisibility = JSC::ImplementationVisibility::Private; -const int s_readableStreamCreateNativeReadableStreamCodeLength = 215; -static const JSC::Intrinsic s_readableStreamCreateNativeReadableStreamCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_readableStreamCreateNativeReadableStreamCode = "(function (nativePtr, nativeType, autoAllocateChunkSize) {\"use strict\";\n return new @ReadableStream({\n @lazy: !0,\n @bunNativeType: nativeType,\n @bunNativePtr: nativePtr,\n autoAllocateChunkSize\n });\n})\n"; +// pipeToLoop +const JSC::ConstructAbility s_readableStreamInternalsPipeToLoopCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; +const JSC::ConstructorKind s_readableStreamInternalsPipeToLoopCodeConstructorKind = JSC::ConstructorKind::None; +const JSC::ImplementationVisibility s_readableStreamInternalsPipeToLoopCodeImplementationVisibility = JSC::ImplementationVisibility::Public; +const int s_readableStreamInternalsPipeToLoopCodeLength = 186; +static const JSC::Intrinsic s_readableStreamInternalsPipeToLoopCodeIntrinsic = JSC::NoIntrinsic; +const char* const s_readableStreamInternalsPipeToLoopCode = "(function (pipeState) {\"use strict\";\n if (pipeState.shuttingDown)\n return;\n @pipeToDoReadWrite(pipeState).@then((result) => {\n if (result)\n @pipeToLoop(pipeState);\n });\n})\n"; -// cancel -const JSC::ConstructAbility s_readableStreamCancelCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; -const JSC::ConstructorKind s_readableStreamCancelCodeConstructorKind = JSC::ConstructorKind::None; -const JSC::ImplementationVisibility s_readableStreamCancelCodeImplementationVisibility = JSC::ImplementationVisibility::Public; -const int s_readableStreamCancelCodeLength = 302; -static const JSC::Intrinsic s_readableStreamCancelCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_readableStreamCancelCode = "(function (reason) {\"use strict\";\n if (!@isReadableStream(this))\n return @Promise.@reject(@makeThisTypeError(\"ReadableStream\", \"cancel\"));\n if (@isReadableStreamLocked(this))\n return @Promise.@reject(@makeTypeError(\"ReadableStream is locked\"));\n return @readableStreamCancel(this, reason);\n})\n"; +// pipeToDoReadWrite +const JSC::ConstructAbility s_readableStreamInternalsPipeToDoReadWriteCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; +const JSC::ConstructorKind s_readableStreamInternalsPipeToDoReadWriteCodeConstructorKind = JSC::ConstructorKind::None; +const JSC::ImplementationVisibility s_readableStreamInternalsPipeToDoReadWriteCodeImplementationVisibility = JSC::ImplementationVisibility::Public; +const int s_readableStreamInternalsPipeToDoReadWriteCodeLength = 971; +static const JSC::Intrinsic s_readableStreamInternalsPipeToDoReadWriteCodeIntrinsic = JSC::NoIntrinsic; +const char* const s_readableStreamInternalsPipeToDoReadWriteCode = "(function (pipeState) {\"use strict\";\n return pipeState.pendingReadPromiseCapability = @newPromiseCapability(@Promise), @getByIdDirectPrivate(pipeState.writer, \"readyPromise\").promise.@then(() => {\n if (pipeState.shuttingDown) {\n pipeState.pendingReadPromiseCapability.resolve.@call(@undefined, !1);\n return;\n }\n @readableStreamDefaultReaderRead(pipeState.reader).@then((result) => {\n const canWrite = !result.done && @getByIdDirectPrivate(pipeState.writer, \"stream\") !== @undefined;\n if (pipeState.pendingReadPromiseCapability.resolve.@call(@undefined, canWrite), !canWrite)\n return;\n pipeState.pendingWritePromise = @writableStreamDefaultWriterWrite(pipeState.writer, result.value);\n }, (e) => {\n pipeState.pendingReadPromiseCapability.resolve.@call(@undefined, !1);\n });\n }, (e) => {\n pipeState.pendingReadPromiseCapability.resolve.@call(@undefined, !1);\n }), pipeState.pendingReadPromiseCapability.promise;\n})\n"; + +// pipeToErrorsMustBePropagatedForward +const JSC::ConstructAbility s_readableStreamInternalsPipeToErrorsMustBePropagatedForwardCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; +const JSC::ConstructorKind s_readableStreamInternalsPipeToErrorsMustBePropagatedForwardCodeConstructorKind = JSC::ConstructorKind::None; +const JSC::ImplementationVisibility s_readableStreamInternalsPipeToErrorsMustBePropagatedForwardCodeImplementationVisibility = JSC::ImplementationVisibility::Public; +const int s_readableStreamInternalsPipeToErrorsMustBePropagatedForwardCodeLength = 619; +static const JSC::Intrinsic s_readableStreamInternalsPipeToErrorsMustBePropagatedForwardCodeIntrinsic = JSC::NoIntrinsic; +const char* const s_readableStreamInternalsPipeToErrorsMustBePropagatedForwardCode = "(function (pipeState) {\"use strict\";\n const action = () => {\n pipeState.pendingReadPromiseCapability.resolve.@call(@undefined, !1);\n const error = @getByIdDirectPrivate(pipeState.source, \"storedError\");\n if (!pipeState.preventAbort) {\n @pipeToShutdownWithAction(pipeState, () => @writableStreamAbort(pipeState.destination, error), error);\n return;\n }\n @pipeToShutdown(pipeState, error);\n };\n if (@getByIdDirectPrivate(pipeState.source, \"state\") === 3) {\n action();\n return;\n }\n @getByIdDirectPrivate(pipeState.reader, \"closedPromiseCapability\").promise.@then(@undefined, action);\n})\n"; + +// pipeToErrorsMustBePropagatedBackward +const JSC::ConstructAbility s_readableStreamInternalsPipeToErrorsMustBePropagatedBackwardCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; +const JSC::ConstructorKind s_readableStreamInternalsPipeToErrorsMustBePropagatedBackwardCodeConstructorKind = JSC::ConstructorKind::None; +const JSC::ImplementationVisibility s_readableStreamInternalsPipeToErrorsMustBePropagatedBackwardCodeImplementationVisibility = JSC::ImplementationVisibility::Public; +const int s_readableStreamInternalsPipeToErrorsMustBePropagatedBackwardCodeLength = 550; +static const JSC::Intrinsic s_readableStreamInternalsPipeToErrorsMustBePropagatedBackwardCodeIntrinsic = JSC::NoIntrinsic; +const char* const s_readableStreamInternalsPipeToErrorsMustBePropagatedBackwardCode = "(function (pipeState) {\"use strict\";\n const action = () => {\n const error = @getByIdDirectPrivate(pipeState.destination, \"storedError\");\n if (!pipeState.preventCancel) {\n @pipeToShutdownWithAction(pipeState, () => @readableStreamCancel(pipeState.source, error), error);\n return;\n }\n @pipeToShutdown(pipeState, error);\n };\n if (@getByIdDirectPrivate(pipeState.destination, \"state\") === \"errored\") {\n action();\n return;\n }\n @getByIdDirectPrivate(pipeState.writer, \"closedPromise\").promise.@then(@undefined, action);\n})\n"; + +// pipeToClosingMustBePropagatedForward +const JSC::ConstructAbility s_readableStreamInternalsPipeToClosingMustBePropagatedForwardCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; +const JSC::ConstructorKind s_readableStreamInternalsPipeToClosingMustBePropagatedForwardCodeConstructorKind = JSC::ConstructorKind::None; +const JSC::ImplementationVisibility s_readableStreamInternalsPipeToClosingMustBePropagatedForwardCodeImplementationVisibility = JSC::ImplementationVisibility::Public; +const int s_readableStreamInternalsPipeToClosingMustBePropagatedForwardCodeLength = 548; +static const JSC::Intrinsic s_readableStreamInternalsPipeToClosingMustBePropagatedForwardCodeIntrinsic = JSC::NoIntrinsic; +const char* const s_readableStreamInternalsPipeToClosingMustBePropagatedForwardCode = "(function (pipeState) {\"use strict\";\n const action = () => {\n if (pipeState.pendingReadPromiseCapability.resolve.@call(@undefined, !1), !pipeState.preventClose) {\n @pipeToShutdownWithAction(pipeState, () => @writableStreamDefaultWriterCloseWithErrorPropagation(pipeState.writer));\n return;\n }\n @pipeToShutdown(pipeState);\n };\n if (@getByIdDirectPrivate(pipeState.source, \"state\") === 1) {\n action();\n return;\n }\n @getByIdDirectPrivate(pipeState.reader, \"closedPromiseCapability\").promise.@then(action, @undefined);\n})\n"; + +// pipeToClosingMustBePropagatedBackward +const JSC::ConstructAbility s_readableStreamInternalsPipeToClosingMustBePropagatedBackwardCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; +const JSC::ConstructorKind s_readableStreamInternalsPipeToClosingMustBePropagatedBackwardCodeConstructorKind = JSC::ConstructorKind::None; +const JSC::ImplementationVisibility s_readableStreamInternalsPipeToClosingMustBePropagatedBackwardCodeImplementationVisibility = JSC::ImplementationVisibility::Public; +const int s_readableStreamInternalsPipeToClosingMustBePropagatedBackwardCodeLength = 446; +static const JSC::Intrinsic s_readableStreamInternalsPipeToClosingMustBePropagatedBackwardCodeIntrinsic = JSC::NoIntrinsic; +const char* const s_readableStreamInternalsPipeToClosingMustBePropagatedBackwardCode = "(function (pipeState) {\"use strict\";\n if (!@writableStreamCloseQueuedOrInFlight(pipeState.destination) && @getByIdDirectPrivate(pipeState.destination, \"state\") !== \"closed\")\n return;\n const error = @makeTypeError(\"closing is propagated backward\");\n if (!pipeState.preventCancel) {\n @pipeToShutdownWithAction(pipeState, () => @readableStreamCancel(pipeState.source, error), error);\n return;\n }\n @pipeToShutdown(pipeState, error);\n})\n"; + +// pipeToShutdownWithAction +const JSC::ConstructAbility s_readableStreamInternalsPipeToShutdownWithActionCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; +const JSC::ConstructorKind s_readableStreamInternalsPipeToShutdownWithActionCodeConstructorKind = JSC::ConstructorKind::None; +const JSC::ImplementationVisibility s_readableStreamInternalsPipeToShutdownWithActionCodeImplementationVisibility = JSC::ImplementationVisibility::Public; +const int s_readableStreamInternalsPipeToShutdownWithActionCodeLength = 752; +static const JSC::Intrinsic s_readableStreamInternalsPipeToShutdownWithActionCodeIntrinsic = JSC::NoIntrinsic; +const char* const s_readableStreamInternalsPipeToShutdownWithActionCode = "(function (pipeState, action) {\"use strict\";\n if (pipeState.shuttingDown)\n return;\n pipeState.shuttingDown = !0;\n const hasError = arguments.length > 2, error = arguments[2], finalize = () => {\n action().@then(() => {\n if (hasError)\n @pipeToFinalize(pipeState, error);\n else\n @pipeToFinalize(pipeState);\n }, (e) => {\n @pipeToFinalize(pipeState, e);\n });\n };\n if (@getByIdDirectPrivate(pipeState.destination, \"state\") === \"writable\" && !@writableStreamCloseQueuedOrInFlight(pipeState.destination)) {\n pipeState.pendingReadPromiseCapability.promise.@then(() => {\n pipeState.pendingWritePromise.@then(finalize, finalize);\n }, (e) => @pipeToFinalize(pipeState, e));\n return;\n }\n finalize();\n})\n"; -// getReader -const JSC::ConstructAbility s_readableStreamGetReaderCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; -const JSC::ConstructorKind s_readableStreamGetReaderCodeConstructorKind = JSC::ConstructorKind::None; -const JSC::ImplementationVisibility s_readableStreamGetReaderCodeImplementationVisibility = JSC::ImplementationVisibility::Public; -const int s_readableStreamGetReaderCodeLength = 580; -static const JSC::Intrinsic s_readableStreamGetReaderCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_readableStreamGetReaderCode = "(function (options) {\"use strict\";\n if (!@isReadableStream(this))\n throw @makeThisTypeError(\"ReadableStream\", \"getReader\");\n const mode = @toDictionary(options, {}, \"ReadableStream.getReader takes an object as first argument\").mode;\n if (mode === @undefined) {\n var start_ = @getByIdDirectPrivate(this, \"start\");\n if (start_)\n @putByIdDirectPrivate(this, \"start\", @undefined), start_();\n return new @ReadableStreamDefaultReader(this);\n }\n if (mode == \"byob\")\n return new @ReadableStreamBYOBReader(this);\n @throwTypeError(\"Invalid mode is specified\");\n})\n"; +// pipeToShutdown +const JSC::ConstructAbility s_readableStreamInternalsPipeToShutdownCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; +const JSC::ConstructorKind s_readableStreamInternalsPipeToShutdownCodeConstructorKind = JSC::ConstructorKind::None; +const JSC::ImplementationVisibility s_readableStreamInternalsPipeToShutdownCodeImplementationVisibility = JSC::ImplementationVisibility::Public; +const int s_readableStreamInternalsPipeToShutdownCodeLength = 648; +static const JSC::Intrinsic s_readableStreamInternalsPipeToShutdownCodeIntrinsic = JSC::NoIntrinsic; +const char* const s_readableStreamInternalsPipeToShutdownCode = "(function (pipeState) {\"use strict\";\n if (pipeState.shuttingDown)\n return;\n pipeState.shuttingDown = !0;\n const hasError = arguments.length > 1, error = arguments[1], finalize = () => {\n if (hasError)\n @pipeToFinalize(pipeState, error);\n else\n @pipeToFinalize(pipeState);\n };\n if (@getByIdDirectPrivate(pipeState.destination, \"state\") === \"writable\" && !@writableStreamCloseQueuedOrInFlight(pipeState.destination)) {\n pipeState.pendingReadPromiseCapability.promise.@then(() => {\n pipeState.pendingWritePromise.@then(finalize, finalize);\n }, (e) => @pipeToFinalize(pipeState, e));\n return;\n }\n finalize();\n})\n"; -// pipeThrough -const JSC::ConstructAbility s_readableStreamPipeThroughCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; -const JSC::ConstructorKind s_readableStreamPipeThroughCodeConstructorKind = JSC::ConstructorKind::None; -const JSC::ImplementationVisibility s_readableStreamPipeThroughCodeImplementationVisibility = JSC::ImplementationVisibility::Public; -const int s_readableStreamPipeThroughCodeLength = 1300; -static const JSC::Intrinsic s_readableStreamPipeThroughCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_readableStreamPipeThroughCode = "(function (streams, options) {\"use strict\";\n const transforms = streams, readable = transforms.readable;\n if (!@isReadableStream(readable))\n throw @makeTypeError(\"readable should be ReadableStream\");\n const writable = transforms.writable, internalWritable = @getInternalWritableStream(writable);\n if (!@isWritableStream(internalWritable))\n throw @makeTypeError(\"writable should be WritableStream\");\n let preventClose = !1, preventAbort = !1, preventCancel = !1, signal;\n if (!@isUndefinedOrNull(options)) {\n if (!@isObject(options))\n throw @makeTypeError(\"options must be an object\");\n if (preventAbort = !!options.preventAbort, preventCancel = !!options.preventCancel, preventClose = !!options.preventClose, signal = options.signal, signal !== @undefined && !@isAbortSignal(signal))\n throw @makeTypeError(\"options.signal must be AbortSignal\");\n }\n if (!@isReadableStream(this))\n throw @makeThisTypeError(\"ReadableStream\", \"pipeThrough\");\n if (@isReadableStreamLocked(this))\n throw @makeTypeError(\"ReadableStream is locked\");\n if (@isWritableStreamLocked(internalWritable))\n throw @makeTypeError(\"WritableStream is locked\");\n return @readableStreamPipeToWritableStream(this, internalWritable, preventClose, preventAbort, preventCancel, signal), readable;\n})\n"; +// pipeToFinalize +const JSC::ConstructAbility s_readableStreamInternalsPipeToFinalizeCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; +const JSC::ConstructorKind s_readableStreamInternalsPipeToFinalizeCodeConstructorKind = JSC::ConstructorKind::None; +const JSC::ImplementationVisibility s_readableStreamInternalsPipeToFinalizeCodeImplementationVisibility = JSC::ImplementationVisibility::Public; +const int s_readableStreamInternalsPipeToFinalizeCodeLength = 332; +static const JSC::Intrinsic s_readableStreamInternalsPipeToFinalizeCodeIntrinsic = JSC::NoIntrinsic; +const char* const s_readableStreamInternalsPipeToFinalizeCode = "(function (pipeState) {\"use strict\";\n if (@writableStreamDefaultWriterRelease(pipeState.writer), @readableStreamReaderGenericRelease(pipeState.reader), pipeState.finalized = !0, arguments.length > 1)\n pipeState.promiseCapability.reject.@call(@undefined, arguments[1]);\n else\n pipeState.promiseCapability.resolve.@call();\n})\n"; -// pipeTo -const JSC::ConstructAbility s_readableStreamPipeToCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; -const JSC::ConstructorKind s_readableStreamPipeToCodeConstructorKind = JSC::ConstructorKind::None; -const JSC::ImplementationVisibility s_readableStreamPipeToCodeImplementationVisibility = JSC::ImplementationVisibility::Public; -const int s_readableStreamPipeToCodeLength = 1328; -static const JSC::Intrinsic s_readableStreamPipeToCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_readableStreamPipeToCode = "(function (destination) {\"use strict\";\n if (!@isReadableStream(this))\n return @Promise.@reject(@makeThisTypeError(\"ReadableStream\", \"pipeTo\"));\n if (@isReadableStreamLocked(this))\n return @Promise.@reject(@makeTypeError(\"ReadableStream is locked\"));\n let options = @argument(1), preventClose = !1, preventAbort = !1, preventCancel = !1, signal;\n if (!@isUndefinedOrNull(options)) {\n if (!@isObject(options))\n return @Promise.@reject(@makeTypeError(\"options must be an object\"));\n try {\n preventAbort = !!options.preventAbort, preventCancel = !!options.preventCancel, preventClose = !!options.preventClose, signal = options.signal;\n } catch (e) {\n return @Promise.@reject(e);\n }\n if (signal !== @undefined && !@isAbortSignal(signal))\n return @Promise.@reject(@makeTypeError(\"options.signal must be AbortSignal\"));\n }\n const internalDestination = @getInternalWritableStream(destination);\n if (!@isWritableStream(internalDestination))\n return @Promise.@reject(@makeTypeError(\"ReadableStream pipeTo requires a WritableStream\"));\n if (@isWritableStreamLocked(internalDestination))\n return @Promise.@reject(@makeTypeError(\"WritableStream is locked\"));\n return @readableStreamPipeToWritableStream(this, internalDestination, preventClose, preventAbort, preventCancel, signal);\n})\n"; +// readableStreamTee +const JSC::ConstructAbility s_readableStreamInternalsReadableStreamTeeCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; +const JSC::ConstructorKind s_readableStreamInternalsReadableStreamTeeCodeConstructorKind = JSC::ConstructorKind::None; +const JSC::ImplementationVisibility s_readableStreamInternalsReadableStreamTeeCodeImplementationVisibility = JSC::ImplementationVisibility::Public; +const int s_readableStreamInternalsReadableStreamTeeCodeLength = 1545; +static const JSC::Intrinsic s_readableStreamInternalsReadableStreamTeeCodeIntrinsic = JSC::NoIntrinsic; +const char* const s_readableStreamInternalsReadableStreamTeeCode = "(function (stream, shouldClone) {\"use strict\";\n var start_ = @getByIdDirectPrivate(stream, \"start\");\n if (start_)\n @putByIdDirectPrivate(stream, \"start\", @undefined), start_();\n const reader = new @ReadableStreamDefaultReader(stream), teeState = {\n closedOrErrored: !1,\n canceled1: !1,\n canceled2: !1,\n reason1: @undefined,\n reason2: @undefined\n };\n teeState.cancelPromiseCapability = @newPromiseCapability(@Promise);\n const pullFunction = @readableStreamTeePullFunction(teeState, reader, shouldClone), branch1Source = {};\n @putByIdDirectPrivate(branch1Source, \"pull\", pullFunction), @putByIdDirectPrivate(branch1Source, \"cancel\", @readableStreamTeeBranch1CancelFunction(teeState, stream));\n const branch2Source = {};\n @putByIdDirectPrivate(branch2Source, \"pull\", pullFunction), @putByIdDirectPrivate(branch2Source, \"cancel\", @readableStreamTeeBranch2CancelFunction(teeState, stream));\n const branch1 = new @ReadableStream(branch1Source), branch2 = new @ReadableStream(branch2Source);\n return @getByIdDirectPrivate(reader, \"closedPromiseCapability\").promise.@then(@undefined, function(e) {\n if (teeState.closedOrErrored)\n return;\n if (@readableStreamDefaultControllerError(branch1.@readableStreamController, e), @readableStreamDefaultControllerError(branch2.@readableStreamController, e), teeState.closedOrErrored = !0, !teeState.canceled1 || !teeState.canceled2)\n teeState.cancelPromiseCapability.resolve.@call();\n }), teeState.branch1 = branch1, teeState.branch2 = branch2, [branch1, branch2];\n})\n"; -// tee -const JSC::ConstructAbility s_readableStreamTeeCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; -const JSC::ConstructorKind s_readableStreamTeeCodeConstructorKind = JSC::ConstructorKind::None; -const JSC::ImplementationVisibility s_readableStreamTeeCodeImplementationVisibility = JSC::ImplementationVisibility::Public; -const int s_readableStreamTeeCodeLength = 157; -static const JSC::Intrinsic s_readableStreamTeeCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_readableStreamTeeCode = "(function () {\"use strict\";\n if (!@isReadableStream(this))\n throw @makeThisTypeError(\"ReadableStream\", \"tee\");\n return @readableStreamTee(this, !1);\n})\n"; +// readableStreamTeePullFunction +const JSC::ConstructAbility s_readableStreamInternalsReadableStreamTeePullFunctionCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; +const JSC::ConstructorKind s_readableStreamInternalsReadableStreamTeePullFunctionCodeConstructorKind = JSC::ConstructorKind::None; +const JSC::ImplementationVisibility s_readableStreamInternalsReadableStreamTeePullFunctionCodeImplementationVisibility = JSC::ImplementationVisibility::Public; +const int s_readableStreamInternalsReadableStreamTeePullFunctionCodeLength = 1036; +static const JSC::Intrinsic s_readableStreamInternalsReadableStreamTeePullFunctionCodeIntrinsic = JSC::NoIntrinsic; +const char* const s_readableStreamInternalsReadableStreamTeePullFunctionCode = "(function (teeState, reader, shouldClone) {\"use strict\";\n return function() {\n @Promise.prototype.@then.@call(@readableStreamDefaultReaderRead(reader), function(result) {\n if (result.done && !teeState.closedOrErrored) {\n if (!teeState.canceled1)\n @readableStreamDefaultControllerClose(teeState.branch1.@readableStreamController);\n if (!teeState.canceled2)\n @readableStreamDefaultControllerClose(teeState.branch2.@readableStreamController);\n if (teeState.closedOrErrored = !0, !teeState.canceled1 || !teeState.canceled2)\n teeState.cancelPromiseCapability.resolve.@call();\n }\n if (teeState.closedOrErrored)\n return;\n if (!teeState.canceled1)\n @readableStreamDefaultControllerEnqueue(teeState.branch1.@readableStreamController, result.value);\n if (!teeState.canceled2)\n @readableStreamDefaultControllerEnqueue(teeState.branch2.@readableStreamController, shouldClone \? @structuredCloneForStream(result.value) : result.value);\n });\n };\n})\n"; -// locked -const JSC::ConstructAbility s_readableStreamLockedCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; -const JSC::ConstructorKind s_readableStreamLockedCodeConstructorKind = JSC::ConstructorKind::None; -const JSC::ImplementationVisibility s_readableStreamLockedCodeImplementationVisibility = JSC::ImplementationVisibility::Public; -const int s_readableStreamLockedCodeLength = 163; -static const JSC::Intrinsic s_readableStreamLockedCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_readableStreamLockedCode = "(function () {\"use strict\";\n if (!@isReadableStream(this))\n throw @makeGetterTypeError(\"ReadableStream\", \"locked\");\n return @isReadableStreamLocked(this);\n})\n"; +// readableStreamTeeBranch1CancelFunction +const JSC::ConstructAbility s_readableStreamInternalsReadableStreamTeeBranch1CancelFunctionCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; +const JSC::ConstructorKind s_readableStreamInternalsReadableStreamTeeBranch1CancelFunctionCodeConstructorKind = JSC::ConstructorKind::None; +const JSC::ImplementationVisibility s_readableStreamInternalsReadableStreamTeeBranch1CancelFunctionCodeImplementationVisibility = JSC::ImplementationVisibility::Public; +const int s_readableStreamInternalsReadableStreamTeeBranch1CancelFunctionCodeLength = 369; +static const JSC::Intrinsic s_readableStreamInternalsReadableStreamTeeBranch1CancelFunctionCodeIntrinsic = JSC::NoIntrinsic; +const char* const s_readableStreamInternalsReadableStreamTeeBranch1CancelFunctionCode = "(function (teeState, stream) {\"use strict\";\n return function(r) {\n if (teeState.canceled1 = !0, teeState.reason1 = r, teeState.canceled2)\n @readableStreamCancel(stream, [teeState.reason1, teeState.reason2]).@then(teeState.cancelPromiseCapability.@resolve, teeState.cancelPromiseCapability.@reject);\n return teeState.cancelPromiseCapability.promise;\n };\n})\n"; -// values -const JSC::ConstructAbility s_readableStreamValuesCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; -const JSC::ConstructorKind s_readableStreamValuesCodeConstructorKind = JSC::ConstructorKind::None; -const JSC::ImplementationVisibility s_readableStreamValuesCodeImplementationVisibility = JSC::ImplementationVisibility::Public; -const int s_readableStreamValuesCodeLength = 178; -static const JSC::Intrinsic s_readableStreamValuesCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_readableStreamValuesCode = "(function (options) {\"use strict\";\n var prototype = @ReadableStream.prototype;\n return @readableStreamDefineLazyIterators(prototype), prototype.values.@call(this, options);\n})\n"; +// readableStreamTeeBranch2CancelFunction +const JSC::ConstructAbility s_readableStreamInternalsReadableStreamTeeBranch2CancelFunctionCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; +const JSC::ConstructorKind s_readableStreamInternalsReadableStreamTeeBranch2CancelFunctionCodeConstructorKind = JSC::ConstructorKind::None; +const JSC::ImplementationVisibility s_readableStreamInternalsReadableStreamTeeBranch2CancelFunctionCodeImplementationVisibility = JSC::ImplementationVisibility::Public; +const int s_readableStreamInternalsReadableStreamTeeBranch2CancelFunctionCodeLength = 369; +static const JSC::Intrinsic s_readableStreamInternalsReadableStreamTeeBranch2CancelFunctionCodeIntrinsic = JSC::NoIntrinsic; +const char* const s_readableStreamInternalsReadableStreamTeeBranch2CancelFunctionCode = "(function (teeState, stream) {\"use strict\";\n return function(r) {\n if (teeState.canceled2 = !0, teeState.reason2 = r, teeState.canceled1)\n @readableStreamCancel(stream, [teeState.reason1, teeState.reason2]).@then(teeState.cancelPromiseCapability.@resolve, teeState.cancelPromiseCapability.@reject);\n return teeState.cancelPromiseCapability.promise;\n };\n})\n"; -// lazyAsyncIterator -const JSC::ConstructAbility s_readableStreamLazyAsyncIteratorCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; -const JSC::ConstructorKind s_readableStreamLazyAsyncIteratorCodeConstructorKind = JSC::ConstructorKind::None; -const JSC::ImplementationVisibility s_readableStreamLazyAsyncIteratorCodeImplementationVisibility = JSC::ImplementationVisibility::Private; -const int s_readableStreamLazyAsyncIteratorCodeLength = 188; -static const JSC::Intrinsic s_readableStreamLazyAsyncIteratorCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_readableStreamLazyAsyncIteratorCode = "(function () {\"use strict\";\n var prototype = @ReadableStream.prototype;\n return @readableStreamDefineLazyIterators(prototype), prototype[globalThis.Symbol.asyncIterator].@call(this);\n})\n"; +// isReadableStream +const JSC::ConstructAbility s_readableStreamInternalsIsReadableStreamCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; +const JSC::ConstructorKind s_readableStreamInternalsIsReadableStreamCodeConstructorKind = JSC::ConstructorKind::None; +const JSC::ImplementationVisibility s_readableStreamInternalsIsReadableStreamCodeImplementationVisibility = JSC::ImplementationVisibility::Public; +const int s_readableStreamInternalsIsReadableStreamCodeLength = 141; +static const JSC::Intrinsic s_readableStreamInternalsIsReadableStreamCodeIntrinsic = JSC::NoIntrinsic; +const char* const s_readableStreamInternalsIsReadableStreamCode = "(function (stream) {\"use strict\";\n return @isObject(stream) && @getByIdDirectPrivate(stream, \"readableStreamController\") !== @undefined;\n})\n"; -#define DEFINE_BUILTIN_GENERATOR(codeName, functionName, overriddenName, argumentCount) \ -JSC::FunctionExecutable* codeName##Generator(JSC::VM& vm) \ -{\ - JSVMClientData* clientData = static_cast(vm.clientData); \ - return clientData->builtinFunctions().readableStreamBuiltins().codeName##Executable()->link(vm, nullptr, clientData->builtinFunctions().readableStreamBuiltins().codeName##Source(), std::nullopt, s_##codeName##Intrinsic); \ -} -WEBCORE_FOREACH_READABLESTREAM_BUILTIN_CODE(DEFINE_BUILTIN_GENERATOR) -#undef DEFINE_BUILTIN_GENERATOR +// isReadableStreamDefaultReader +const JSC::ConstructAbility s_readableStreamInternalsIsReadableStreamDefaultReaderCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; +const JSC::ConstructorKind s_readableStreamInternalsIsReadableStreamDefaultReaderCodeConstructorKind = JSC::ConstructorKind::None; +const JSC::ImplementationVisibility s_readableStreamInternalsIsReadableStreamDefaultReaderCodeImplementationVisibility = JSC::ImplementationVisibility::Public; +const int s_readableStreamInternalsIsReadableStreamDefaultReaderCodeLength = 116; +static const JSC::Intrinsic s_readableStreamInternalsIsReadableStreamDefaultReaderCodeIntrinsic = JSC::NoIntrinsic; +const char* const s_readableStreamInternalsIsReadableStreamDefaultReaderCode = "(function (reader) {\"use strict\";\n return @isObject(reader) && !!@getByIdDirectPrivate(reader, \"readRequests\");\n})\n"; -/* ReadableStreamDefaultController.ts */ -// initializeReadableStreamDefaultController -const JSC::ConstructAbility s_readableStreamDefaultControllerInitializeReadableStreamDefaultControllerCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; -const JSC::ConstructorKind s_readableStreamDefaultControllerInitializeReadableStreamDefaultControllerCodeConstructorKind = JSC::ConstructorKind::None; -const JSC::ImplementationVisibility s_readableStreamDefaultControllerInitializeReadableStreamDefaultControllerCodeImplementationVisibility = JSC::ImplementationVisibility::Public; -const int s_readableStreamDefaultControllerInitializeReadableStreamDefaultControllerCodeLength = 361; -static const JSC::Intrinsic s_readableStreamDefaultControllerInitializeReadableStreamDefaultControllerCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_readableStreamDefaultControllerInitializeReadableStreamDefaultControllerCode = "(function (stream, underlyingSource, size, highWaterMark) {\"use strict\";\n if (arguments.length !== 5 && arguments[4] !== @isReadableStream)\n @throwTypeError(\"ReadableStreamDefaultController constructor should not be called directly\");\n return @privateInitializeReadableStreamDefaultController.@call(this, stream, underlyingSource, size, highWaterMark);\n})\n"; +// isReadableStreamDefaultController +const JSC::ConstructAbility s_readableStreamInternalsIsReadableStreamDefaultControllerCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; +const JSC::ConstructorKind s_readableStreamInternalsIsReadableStreamDefaultControllerCodeConstructorKind = JSC::ConstructorKind::None; +const JSC::ImplementationVisibility s_readableStreamInternalsIsReadableStreamDefaultControllerCodeImplementationVisibility = JSC::ImplementationVisibility::Public; +const int s_readableStreamInternalsIsReadableStreamDefaultControllerCodeLength = 132; +static const JSC::Intrinsic s_readableStreamInternalsIsReadableStreamDefaultControllerCodeIntrinsic = JSC::NoIntrinsic; +const char* const s_readableStreamInternalsIsReadableStreamDefaultControllerCode = "(function (controller) {\"use strict\";\n return @isObject(controller) && !!@getByIdDirectPrivate(controller, \"underlyingSource\");\n})\n"; -// enqueue -const JSC::ConstructAbility s_readableStreamDefaultControllerEnqueueCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; -const JSC::ConstructorKind s_readableStreamDefaultControllerEnqueueCodeConstructorKind = JSC::ConstructorKind::None; -const JSC::ImplementationVisibility s_readableStreamDefaultControllerEnqueueCodeImplementationVisibility = JSC::ImplementationVisibility::Public; -const int s_readableStreamDefaultControllerEnqueueCodeLength = 390; -static const JSC::Intrinsic s_readableStreamDefaultControllerEnqueueCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_readableStreamDefaultControllerEnqueueCode = "(function (chunk) {\"use strict\";\n if (!@isReadableStreamDefaultController(this))\n throw @makeThisTypeError(\"ReadableStreamDefaultController\", \"enqueue\");\n if (!@readableStreamDefaultControllerCanCloseOrEnqueue(this))\n @throwTypeError(\"ReadableStreamDefaultController is not in a state where chunk can be enqueued\");\n return @readableStreamDefaultControllerEnqueue(this, chunk);\n})\n"; +// readDirectStream +const JSC::ConstructAbility s_readableStreamInternalsReadDirectStreamCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; +const JSC::ConstructorKind s_readableStreamInternalsReadDirectStreamCodeConstructorKind = JSC::ConstructorKind::None; +const JSC::ImplementationVisibility s_readableStreamInternalsReadDirectStreamCodeImplementationVisibility = JSC::ImplementationVisibility::Public; +const int s_readableStreamInternalsReadDirectStreamCodeLength = 1518; +static const JSC::Intrinsic s_readableStreamInternalsReadDirectStreamCodeIntrinsic = JSC::NoIntrinsic; +const char* const s_readableStreamInternalsReadDirectStreamCode = "(function (stream, sink, underlyingSource) {\"use strict\";\n @putByIdDirectPrivate(stream, \"underlyingSource\", @undefined), @putByIdDirectPrivate(stream, \"start\", @undefined);\n function close(stream2, reason) {\n if (reason && underlyingSource\?.cancel) {\n try {\n var prom = underlyingSource.cancel(reason);\n @markPromiseAsHandled(prom);\n } catch (e) {\n }\n underlyingSource = @undefined;\n }\n if (stream2) {\n if (@putByIdDirectPrivate(stream2, \"readableStreamController\", @undefined), @putByIdDirectPrivate(stream2, \"reader\", @undefined), reason)\n @putByIdDirectPrivate(stream2, \"state\", 3), @putByIdDirectPrivate(stream2, \"storedError\", reason);\n else\n @putByIdDirectPrivate(stream2, \"state\", 1);\n stream2 = @undefined;\n }\n }\n if (!underlyingSource.pull) {\n close();\n return;\n }\n if (!@isCallable(underlyingSource.pull)) {\n close(), @throwTypeError(\"pull is not a function\");\n return;\n }\n @putByIdDirectPrivate(stream, \"readableStreamController\", sink);\n const highWaterMark = @getByIdDirectPrivate(stream, \"highWaterMark\");\n sink.start({\n highWaterMark: !highWaterMark || highWaterMark < 64 \? 64 : highWaterMark\n }), @startDirectStream.@call(sink, stream, underlyingSource.pull, close, stream.@asyncContext), @putByIdDirectPrivate(stream, \"reader\", {});\n var maybePromise = underlyingSource.pull(sink);\n if (sink = @undefined, maybePromise && @isPromise(maybePromise))\n return maybePromise.@then(() => {\n });\n})\n"; -// error -const JSC::ConstructAbility s_readableStreamDefaultControllerErrorCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; -const JSC::ConstructorKind s_readableStreamDefaultControllerErrorCodeConstructorKind = JSC::ConstructorKind::None; -const JSC::ImplementationVisibility s_readableStreamDefaultControllerErrorCodeImplementationVisibility = JSC::ImplementationVisibility::Public; -const int s_readableStreamDefaultControllerErrorCodeLength = 209; -static const JSC::Intrinsic s_readableStreamDefaultControllerErrorCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_readableStreamDefaultControllerErrorCode = "(function (err) {\"use strict\";\n if (!@isReadableStreamDefaultController(this))\n throw @makeThisTypeError(\"ReadableStreamDefaultController\", \"error\");\n @readableStreamDefaultControllerError(this, err);\n})\n"; +// assignToStream +const JSC::ConstructAbility s_readableStreamInternalsAssignToStreamCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; +const JSC::ConstructorKind s_readableStreamInternalsAssignToStreamCodeConstructorKind = JSC::ConstructorKind::None; +const JSC::ImplementationVisibility s_readableStreamInternalsAssignToStreamCodeImplementationVisibility = JSC::ImplementationVisibility::Private; +const int s_readableStreamInternalsAssignToStreamCodeLength = 397; +static const JSC::Intrinsic s_readableStreamInternalsAssignToStreamCodeIntrinsic = JSC::NoIntrinsic; +const char* const s_readableStreamInternalsAssignToStreamCode = "(function (stream, sink) {\"use strict\";\n var underlyingSource = @getByIdDirectPrivate(stream, \"underlyingSource\");\n if (underlyingSource)\n try {\n return @readDirectStream(stream, sink, underlyingSource);\n } catch (e) {\n throw e;\n } finally {\n underlyingSource = @undefined, stream = @undefined, sink = @undefined;\n }\n return @readStreamIntoSink(stream, sink, !0);\n})\n"; -// close -const JSC::ConstructAbility s_readableStreamDefaultControllerCloseCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; -const JSC::ConstructorKind s_readableStreamDefaultControllerCloseCodeConstructorKind = JSC::ConstructorKind::None; -const JSC::ImplementationVisibility s_readableStreamDefaultControllerCloseCodeImplementationVisibility = JSC::ImplementationVisibility::Public; -const int s_readableStreamDefaultControllerCloseCodeLength = 362; -static const JSC::Intrinsic s_readableStreamDefaultControllerCloseCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_readableStreamDefaultControllerCloseCode = "(function () {\"use strict\";\n if (!@isReadableStreamDefaultController(this))\n throw @makeThisTypeError(\"ReadableStreamDefaultController\", \"close\");\n if (!@readableStreamDefaultControllerCanCloseOrEnqueue(this))\n @throwTypeError(\"ReadableStreamDefaultController is not in a state where it can be closed\");\n @readableStreamDefaultControllerClose(this);\n})\n"; +// readStreamIntoSink +const JSC::ConstructAbility s_readableStreamInternalsReadStreamIntoSinkCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; +const JSC::ConstructorKind s_readableStreamInternalsReadStreamIntoSinkCodeConstructorKind = JSC::ConstructorKind::None; +const JSC::ImplementationVisibility s_readableStreamInternalsReadStreamIntoSinkCodeImplementationVisibility = JSC::ImplementationVisibility::Public; +const int s_readableStreamInternalsReadStreamIntoSinkCodeLength = 2487; +static const JSC::Intrinsic s_readableStreamInternalsReadStreamIntoSinkCodeIntrinsic = JSC::NoIntrinsic; +const char* const s_readableStreamInternalsReadStreamIntoSinkCode = "(async function (stream, sink, isNative) {\"use strict\";\n var didClose = !1, didThrow = !1;\n try {\n var reader = stream.getReader(), many = reader.readMany();\n if (many && @isPromise(many))\n many = await many;\n if (many.done)\n return didClose = !0, sink.end();\n var wroteCount = many.value.length;\n const highWaterMark = @getByIdDirectPrivate(stream, \"highWaterMark\");\n if (isNative)\n @startDirectStream.@call(sink, stream, @undefined, () => !didThrow && @markPromiseAsHandled(stream.cancel()), stream.@asyncContext);\n sink.start({ highWaterMark: highWaterMark || 0 });\n for (var i = 0, values = many.value, length = many.value.length;i < length; i++)\n sink.write(values[i]);\n var streamState = @getByIdDirectPrivate(stream, \"state\");\n if (streamState === 1)\n return didClose = !0, sink.end();\n while (!0) {\n var { value, done } = await reader.read();\n if (done)\n return didClose = !0, sink.end();\n sink.write(value);\n }\n } catch (e) {\n didThrow = !0;\n try {\n reader = @undefined;\n const prom = stream.cancel(e);\n @markPromiseAsHandled(prom);\n } catch (j) {\n }\n if (sink && !didClose) {\n didClose = !0;\n try {\n sink.close(e);\n } catch (j) {\n throw new globalThis.AggregateError([e, j]);\n }\n }\n throw e;\n } finally {\n if (reader) {\n try {\n reader.releaseLock();\n } catch (e) {\n }\n reader = @undefined;\n }\n sink = @undefined;\n var streamState = @getByIdDirectPrivate(stream, \"state\");\n if (stream) {\n var readableStreamController = @getByIdDirectPrivate(stream, \"readableStreamController\");\n if (readableStreamController) {\n if (@getByIdDirectPrivate(readableStreamController, \"underlyingSource\"))\n @putByIdDirectPrivate(readableStreamController, \"underlyingSource\", @undefined);\n if (@getByIdDirectPrivate(readableStreamController, \"controlledReadableStream\"))\n @putByIdDirectPrivate(readableStreamController, \"controlledReadableStream\", @undefined);\n if (@putByIdDirectPrivate(stream, \"readableStreamController\", null), @getByIdDirectPrivate(stream, \"underlyingSource\"))\n @putByIdDirectPrivate(stream, \"underlyingSource\", @undefined);\n readableStreamController = @undefined;\n }\n if (!didThrow && streamState !== 1 && streamState !== 3)\n @readableStreamClose(stream);\n stream = @undefined;\n }\n }\n})\n"; -// desiredSize -const JSC::ConstructAbility s_readableStreamDefaultControllerDesiredSizeCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; -const JSC::ConstructorKind s_readableStreamDefaultControllerDesiredSizeCodeConstructorKind = JSC::ConstructorKind::None; -const JSC::ImplementationVisibility s_readableStreamDefaultControllerDesiredSizeCodeImplementationVisibility = JSC::ImplementationVisibility::Public; -const int s_readableStreamDefaultControllerDesiredSizeCodeLength = 225; -static const JSC::Intrinsic s_readableStreamDefaultControllerDesiredSizeCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_readableStreamDefaultControllerDesiredSizeCode = "(function () {\"use strict\";\n if (!@isReadableStreamDefaultController(this))\n throw @makeGetterTypeError(\"ReadableStreamDefaultController\", \"desiredSize\");\n return @readableStreamDefaultControllerGetDesiredSize(this);\n})\n"; +// handleDirectStreamError +const JSC::ConstructAbility s_readableStreamInternalsHandleDirectStreamErrorCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; +const JSC::ConstructorKind s_readableStreamInternalsHandleDirectStreamErrorCodeConstructorKind = JSC::ConstructorKind::None; +const JSC::ImplementationVisibility s_readableStreamInternalsHandleDirectStreamErrorCodeImplementationVisibility = JSC::ImplementationVisibility::Public; +const int s_readableStreamInternalsHandleDirectStreamErrorCodeLength = 735; +static const JSC::Intrinsic s_readableStreamInternalsHandleDirectStreamErrorCodeIntrinsic = JSC::NoIntrinsic; +const char* const s_readableStreamInternalsHandleDirectStreamErrorCode = "(function (e) {\"use strict\";\n var controller = this, sink = controller.@sink;\n if (sink) {\n @putByIdDirectPrivate(controller, \"sink\", @undefined);\n try {\n sink.close(e);\n } catch (f) {\n }\n }\n if (this.error = this.flush = this.write = this.close = this.end = @onReadableStreamDirectControllerClosed, typeof this.@underlyingSource.close === \"function\")\n try {\n this.@underlyingSource.close.@call(this.@underlyingSource, e);\n } catch (e2) {\n }\n try {\n var pend = controller._pendingRead;\n if (pend)\n controller._pendingRead = @undefined, @rejectPromise(pend, e);\n } catch (f) {\n }\n var stream = controller.@controlledReadableStream;\n if (stream)\n @readableStreamError(stream, e);\n})\n"; -#define DEFINE_BUILTIN_GENERATOR(codeName, functionName, overriddenName, argumentCount) \ -JSC::FunctionExecutable* codeName##Generator(JSC::VM& vm) \ -{\ - JSVMClientData* clientData = static_cast(vm.clientData); \ - return clientData->builtinFunctions().readableStreamDefaultControllerBuiltins().codeName##Executable()->link(vm, nullptr, clientData->builtinFunctions().readableStreamDefaultControllerBuiltins().codeName##Source(), std::nullopt, s_##codeName##Intrinsic); \ -} -WEBCORE_FOREACH_READABLESTREAMDEFAULTCONTROLLER_BUILTIN_CODE(DEFINE_BUILTIN_GENERATOR) -#undef DEFINE_BUILTIN_GENERATOR +// handleDirectStreamErrorReject +const JSC::ConstructAbility s_readableStreamInternalsHandleDirectStreamErrorRejectCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; +const JSC::ConstructorKind s_readableStreamInternalsHandleDirectStreamErrorRejectCodeConstructorKind = JSC::ConstructorKind::None; +const JSC::ImplementationVisibility s_readableStreamInternalsHandleDirectStreamErrorRejectCodeImplementationVisibility = JSC::ImplementationVisibility::Public; +const int s_readableStreamInternalsHandleDirectStreamErrorRejectCodeLength = 103; +static const JSC::Intrinsic s_readableStreamInternalsHandleDirectStreamErrorRejectCodeIntrinsic = JSC::NoIntrinsic; +const char* const s_readableStreamInternalsHandleDirectStreamErrorRejectCode = "(function (e) {\"use strict\";\n return @handleDirectStreamError.@call(this, e), @Promise.@reject(e);\n})\n"; -/* ReadableByteStreamInternals.ts */ -// privateInitializeReadableByteStreamController -const JSC::ConstructAbility s_readableByteStreamInternalsPrivateInitializeReadableByteStreamControllerCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; -const JSC::ConstructorKind s_readableByteStreamInternalsPrivateInitializeReadableByteStreamControllerCodeConstructorKind = JSC::ConstructorKind::None; -const JSC::ImplementationVisibility s_readableByteStreamInternalsPrivateInitializeReadableByteStreamControllerCodeImplementationVisibility = JSC::ImplementationVisibility::Public; -const int s_readableByteStreamInternalsPrivateInitializeReadableByteStreamControllerCodeLength = 2063; -static const JSC::Intrinsic s_readableByteStreamInternalsPrivateInitializeReadableByteStreamControllerCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_readableByteStreamInternalsPrivateInitializeReadableByteStreamControllerCode = "(function (stream, underlyingByteSource, highWaterMark) {\"use strict\";\n if (!@isReadableStream(stream))\n @throwTypeError(\"ReadableByteStreamController needs a ReadableStream\");\n if (@getByIdDirectPrivate(stream, \"readableStreamController\") !== null)\n @throwTypeError(\"ReadableStream already has a controller\");\n @putByIdDirectPrivate(this, \"controlledReadableStream\", stream), @putByIdDirectPrivate(this, \"underlyingByteSource\", underlyingByteSource), @putByIdDirectPrivate(this, \"pullAgain\", !1), @putByIdDirectPrivate(this, \"pulling\", !1), @readableByteStreamControllerClearPendingPullIntos(this), @putByIdDirectPrivate(this, \"queue\", @newQueue()), @putByIdDirectPrivate(this, \"started\", 0), @putByIdDirectPrivate(this, \"closeRequested\", !1);\n let hwm = @toNumber(highWaterMark);\n if (hwm !== hwm || hwm < 0)\n @throwRangeError(\"highWaterMark value is negative or not a number\");\n @putByIdDirectPrivate(this, \"strategyHWM\", hwm);\n let autoAllocateChunkSize = underlyingByteSource.autoAllocateChunkSize;\n if (autoAllocateChunkSize !== @undefined) {\n if (autoAllocateChunkSize = @toNumber(autoAllocateChunkSize), autoAllocateChunkSize <= 0 || autoAllocateChunkSize === @Infinity || autoAllocateChunkSize === -@Infinity)\n @throwRangeError(\"autoAllocateChunkSize value is negative or equal to positive or negative infinity\");\n }\n @putByIdDirectPrivate(this, \"autoAllocateChunkSize\", autoAllocateChunkSize), @putByIdDirectPrivate(this, \"pendingPullIntos\", @createFIFO());\n const controller = this;\n return @promiseInvokeOrNoopNoCatch(@getByIdDirectPrivate(controller, \"underlyingByteSource\"), \"start\", [controller]).@then(() => {\n @putByIdDirectPrivate(controller, \"started\", 1), @readableByteStreamControllerCallPullIfNeeded(controller);\n }, (error) => {\n if (@getByIdDirectPrivate(stream, \"state\") === 4)\n @readableByteStreamControllerError(controller, error);\n }), @putByIdDirectPrivate(this, \"cancel\", @readableByteStreamControllerCancel), @putByIdDirectPrivate(this, \"pull\", @readableByteStreamControllerPull), this;\n})\n"; +// onPullDirectStream +const JSC::ConstructAbility s_readableStreamInternalsOnPullDirectStreamCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; +const JSC::ConstructorKind s_readableStreamInternalsOnPullDirectStreamCodeConstructorKind = JSC::ConstructorKind::None; +const JSC::ImplementationVisibility s_readableStreamInternalsOnPullDirectStreamCodeImplementationVisibility = JSC::ImplementationVisibility::Public; +const int s_readableStreamInternalsOnPullDirectStreamCodeLength = 1586; +static const JSC::Intrinsic s_readableStreamInternalsOnPullDirectStreamCodeIntrinsic = JSC::NoIntrinsic; +const char* const s_readableStreamInternalsOnPullDirectStreamCode = "(function (controller) {\"use strict\";\n var stream = controller.@controlledReadableStream;\n if (!stream || @getByIdDirectPrivate(stream, \"state\") !== 4)\n return;\n if (controller._deferClose === -1)\n return;\n controller._deferClose = -1, controller._deferFlush = -1;\n var deferClose, deferFlush, asyncContext = stream.@asyncContext;\n if (asyncContext) {\n var prev = @getInternalField(@asyncContext, 0);\n @putInternalField(@asyncContext, 0, asyncContext);\n }\n try {\n var result = controller.@underlyingSource.pull(controller);\n if (result && @isPromise(result)) {\n if (controller._handleError === @undefined)\n controller._handleError = @handleDirectStreamErrorReject.bind(controller);\n @Promise.prototype.catch.@call(result, controller._handleError);\n }\n } catch (e) {\n return @handleDirectStreamErrorReject.@call(controller, e);\n } finally {\n if (deferClose = controller._deferClose, deferFlush = controller._deferFlush, controller._deferFlush = controller._deferClose = 0, asyncContext)\n @putInternalField(@asyncContext, 0, prev);\n }\n var promiseToReturn;\n if (controller._pendingRead === @undefined)\n controller._pendingRead = promiseToReturn = @newPromise();\n else\n promiseToReturn = @readableStreamAddReadRequest(stream);\n if (deferClose === 1) {\n var reason = controller._deferCloseReason;\n return controller._deferCloseReason = @undefined, @onCloseDirectStream.@call(controller, reason), promiseToReturn;\n }\n if (deferFlush === 1)\n @onFlushDirectStream.@call(controller);\n return promiseToReturn;\n})\n"; -// readableStreamByteStreamControllerStart -const JSC::ConstructAbility s_readableByteStreamInternalsReadableStreamByteStreamControllerStartCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; -const JSC::ConstructorKind s_readableByteStreamInternalsReadableStreamByteStreamControllerStartCodeConstructorKind = JSC::ConstructorKind::None; -const JSC::ImplementationVisibility s_readableByteStreamInternalsReadableStreamByteStreamControllerStartCodeImplementationVisibility = JSC::ImplementationVisibility::Public; -const int s_readableByteStreamInternalsReadableStreamByteStreamControllerStartCodeLength = 99; -static const JSC::Intrinsic s_readableByteStreamInternalsReadableStreamByteStreamControllerStartCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_readableByteStreamInternalsReadableStreamByteStreamControllerStartCode = "(function (controller) {\"use strict\";\n @putByIdDirectPrivate(controller, \"start\", @undefined);\n})\n"; +// noopDoneFunction +const JSC::ConstructAbility s_readableStreamInternalsNoopDoneFunctionCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; +const JSC::ConstructorKind s_readableStreamInternalsNoopDoneFunctionCodeConstructorKind = JSC::ConstructorKind::None; +const JSC::ImplementationVisibility s_readableStreamInternalsNoopDoneFunctionCodeImplementationVisibility = JSC::ImplementationVisibility::Public; +const int s_readableStreamInternalsNoopDoneFunctionCodeLength = 92; +static const JSC::Intrinsic s_readableStreamInternalsNoopDoneFunctionCodeIntrinsic = JSC::NoIntrinsic; +const char* const s_readableStreamInternalsNoopDoneFunctionCode = "(function () {\"use strict\";\n return @Promise.@resolve({ value: @undefined, done: !0 });\n})\n"; -// privateInitializeReadableStreamBYOBRequest -const JSC::ConstructAbility s_readableByteStreamInternalsPrivateInitializeReadableStreamBYOBRequestCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; -const JSC::ConstructorKind s_readableByteStreamInternalsPrivateInitializeReadableStreamBYOBRequestCodeConstructorKind = JSC::ConstructorKind::None; -const JSC::ImplementationVisibility s_readableByteStreamInternalsPrivateInitializeReadableStreamBYOBRequestCodeImplementationVisibility = JSC::ImplementationVisibility::Public; -const int s_readableByteStreamInternalsPrivateInitializeReadableStreamBYOBRequestCodeLength = 175; -static const JSC::Intrinsic s_readableByteStreamInternalsPrivateInitializeReadableStreamBYOBRequestCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_readableByteStreamInternalsPrivateInitializeReadableStreamBYOBRequestCode = "(function (controller, view) {\"use strict\";\n @putByIdDirectPrivate(this, \"associatedReadableByteStreamController\", controller), @putByIdDirectPrivate(this, \"view\", view);\n})\n"; +// onReadableStreamDirectControllerClosed +const JSC::ConstructAbility s_readableStreamInternalsOnReadableStreamDirectControllerClosedCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; +const JSC::ConstructorKind s_readableStreamInternalsOnReadableStreamDirectControllerClosedCodeConstructorKind = JSC::ConstructorKind::None; +const JSC::ImplementationVisibility s_readableStreamInternalsOnReadableStreamDirectControllerClosedCodeImplementationVisibility = JSC::ImplementationVisibility::Public; +const int s_readableStreamInternalsOnReadableStreamDirectControllerClosedCodeLength = 104; +static const JSC::Intrinsic s_readableStreamInternalsOnReadableStreamDirectControllerClosedCodeIntrinsic = JSC::NoIntrinsic; +const char* const s_readableStreamInternalsOnReadableStreamDirectControllerClosedCode = "(function (reason) {\"use strict\";\n @throwTypeError(\"ReadableStreamDirectController is now closed\");\n})\n"; -// isReadableByteStreamController -const JSC::ConstructAbility s_readableByteStreamInternalsIsReadableByteStreamControllerCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; -const JSC::ConstructorKind s_readableByteStreamInternalsIsReadableByteStreamControllerCodeConstructorKind = JSC::ConstructorKind::None; -const JSC::ImplementationVisibility s_readableByteStreamInternalsIsReadableByteStreamControllerCodeImplementationVisibility = JSC::ImplementationVisibility::Public; -const int s_readableByteStreamInternalsIsReadableByteStreamControllerCodeLength = 136; -static const JSC::Intrinsic s_readableByteStreamInternalsIsReadableByteStreamControllerCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_readableByteStreamInternalsIsReadableByteStreamControllerCode = "(function (controller) {\"use strict\";\n return @isObject(controller) && !!@getByIdDirectPrivate(controller, \"underlyingByteSource\");\n})\n"; +// onCloseDirectStream +const JSC::ConstructAbility s_readableStreamInternalsOnCloseDirectStreamCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; +const JSC::ConstructorKind s_readableStreamInternalsOnCloseDirectStreamCodeConstructorKind = JSC::ConstructorKind::None; +const JSC::ImplementationVisibility s_readableStreamInternalsOnCloseDirectStreamCodeImplementationVisibility = JSC::ImplementationVisibility::Public; +const int s_readableStreamInternalsOnCloseDirectStreamCodeLength = 2038; +static const JSC::Intrinsic s_readableStreamInternalsOnCloseDirectStreamCodeIntrinsic = JSC::NoIntrinsic; +const char* const s_readableStreamInternalsOnCloseDirectStreamCode = "(function (reason) {\"use strict\";\n var stream = this.@controlledReadableStream;\n if (!stream || @getByIdDirectPrivate(stream, \"state\") !== 4)\n return;\n if (this._deferClose !== 0) {\n this._deferClose = 1, this._deferCloseReason = reason;\n return;\n }\n if (@putByIdDirectPrivate(stream, \"state\", 2), typeof this.@underlyingSource.close === \"function\")\n try {\n this.@underlyingSource.close.@call(this.@underlyingSource, reason);\n } catch (e) {\n }\n var flushed;\n try {\n flushed = this.@sink.end(), @putByIdDirectPrivate(this, \"sink\", @undefined);\n } catch (e) {\n if (this._pendingRead) {\n var read = this._pendingRead;\n this._pendingRead = @undefined, @rejectPromise(read, e);\n }\n @readableStreamError(stream, e);\n return;\n }\n this.error = this.flush = this.write = this.close = this.end = @onReadableStreamDirectControllerClosed;\n var reader = @getByIdDirectPrivate(stream, \"reader\");\n if (reader && @isReadableStreamDefaultReader(reader)) {\n var _pendingRead = this._pendingRead;\n if (_pendingRead && @isPromise(_pendingRead) && flushed\?.byteLength) {\n this._pendingRead = @undefined, @fulfillPromise(_pendingRead, { value: flushed, done: !1 }), @readableStreamClose(stream);\n return;\n }\n }\n if (flushed\?.byteLength) {\n var requests = @getByIdDirectPrivate(reader, \"readRequests\");\n if (requests\?.isNotEmpty()) {\n @readableStreamFulfillReadRequest(stream, flushed, !1), @readableStreamClose(stream);\n return;\n }\n @putByIdDirectPrivate(stream, \"state\", 4), this.@pull = () => {\n var thisResult = @createFulfilledPromise({\n value: flushed,\n done: !1\n });\n return flushed = @undefined, @readableStreamClose(stream), stream = @undefined, thisResult;\n };\n } else if (this._pendingRead) {\n var read = this._pendingRead;\n this._pendingRead = @undefined, @putByIdDirectPrivate(this, \"pull\", @noopDoneFunction), @fulfillPromise(read, { value: @undefined, done: !0 });\n }\n @readableStreamClose(stream);\n})\n"; -// isReadableStreamBYOBRequest -const JSC::ConstructAbility s_readableByteStreamInternalsIsReadableStreamBYOBRequestCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; -const JSC::ConstructorKind s_readableByteStreamInternalsIsReadableStreamBYOBRequestCodeConstructorKind = JSC::ConstructorKind::None; -const JSC::ImplementationVisibility s_readableByteStreamInternalsIsReadableStreamBYOBRequestCodeImplementationVisibility = JSC::ImplementationVisibility::Public; -const int s_readableByteStreamInternalsIsReadableStreamBYOBRequestCodeLength = 157; -static const JSC::Intrinsic s_readableByteStreamInternalsIsReadableStreamBYOBRequestCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_readableByteStreamInternalsIsReadableStreamBYOBRequestCode = "(function (byobRequest) {\"use strict\";\n return @isObject(byobRequest) && !!@getByIdDirectPrivate(byobRequest, \"associatedReadableByteStreamController\");\n})\n"; +// onFlushDirectStream +const JSC::ConstructAbility s_readableStreamInternalsOnFlushDirectStreamCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; +const JSC::ConstructorKind s_readableStreamInternalsOnFlushDirectStreamCodeConstructorKind = JSC::ConstructorKind::None; +const JSC::ImplementationVisibility s_readableStreamInternalsOnFlushDirectStreamCodeImplementationVisibility = JSC::ImplementationVisibility::Public; +const int s_readableStreamInternalsOnFlushDirectStreamCodeLength = 848; +static const JSC::Intrinsic s_readableStreamInternalsOnFlushDirectStreamCodeIntrinsic = JSC::NoIntrinsic; +const char* const s_readableStreamInternalsOnFlushDirectStreamCode = "(function () {\"use strict\";\n var stream = this.@controlledReadableStream, reader = @getByIdDirectPrivate(stream, \"reader\");\n if (!reader || !@isReadableStreamDefaultReader(reader))\n return;\n var _pendingRead = this._pendingRead;\n if (this._pendingRead = @undefined, _pendingRead && @isPromise(_pendingRead)) {\n var flushed = this.@sink.flush();\n if (flushed\?.byteLength)\n this._pendingRead = @getByIdDirectPrivate(stream, \"readRequests\")\?.shift(), @fulfillPromise(_pendingRead, { value: flushed, done: !1 });\n else\n this._pendingRead = _pendingRead;\n } else if (@getByIdDirectPrivate(stream, \"readRequests\")\?.isNotEmpty()) {\n var flushed = this.@sink.flush();\n if (flushed\?.byteLength)\n @readableStreamFulfillReadRequest(stream, flushed, !1);\n } else if (this._deferFlush === -1)\n this._deferFlush = 1;\n})\n"; -// isReadableStreamBYOBReader -const JSC::ConstructAbility s_readableByteStreamInternalsIsReadableStreamBYOBReaderCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; -const JSC::ConstructorKind s_readableByteStreamInternalsIsReadableStreamBYOBReaderCodeConstructorKind = JSC::ConstructorKind::None; -const JSC::ImplementationVisibility s_readableByteStreamInternalsIsReadableStreamBYOBReaderCodeImplementationVisibility = JSC::ImplementationVisibility::Public; -const int s_readableByteStreamInternalsIsReadableStreamBYOBReaderCodeLength = 120; -static const JSC::Intrinsic s_readableByteStreamInternalsIsReadableStreamBYOBReaderCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_readableByteStreamInternalsIsReadableStreamBYOBReaderCode = "(function (reader) {\"use strict\";\n return @isObject(reader) && !!@getByIdDirectPrivate(reader, \"readIntoRequests\");\n})\n"; +// createTextStream +const JSC::ConstructAbility s_readableStreamInternalsCreateTextStreamCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; +const JSC::ConstructorKind s_readableStreamInternalsCreateTextStreamCodeConstructorKind = JSC::ConstructorKind::None; +const JSC::ImplementationVisibility s_readableStreamInternalsCreateTextStreamCodeImplementationVisibility = JSC::ImplementationVisibility::Public; +const int s_readableStreamInternalsCreateTextStreamCodeLength = 2026; +static const JSC::Intrinsic s_readableStreamInternalsCreateTextStreamCodeIntrinsic = JSC::NoIntrinsic; +const char* const s_readableStreamInternalsCreateTextStreamCode = "(function (highWaterMark) {\"use strict\";\n var sink, array = [], hasString = !1, hasBuffer = !1, rope = \"\", estimatedLength = @toLength(0), capability = @newPromiseCapability(@Promise), calledDone = !1;\n return sink = {\n start() {\n },\n write(chunk) {\n if (typeof chunk === \"string\") {\n var chunkLength = @toLength(chunk.length);\n if (chunkLength > 0)\n rope += chunk, hasString = !0, estimatedLength += chunkLength;\n return chunkLength;\n }\n if (!chunk || !(@ArrayBuffer.@isView(chunk) || chunk instanceof @ArrayBuffer))\n @throwTypeError(\"Expected text, ArrayBuffer or ArrayBufferView\");\n const byteLength = @toLength(chunk.byteLength);\n if (byteLength > 0)\n if (hasBuffer = !0, rope.length > 0)\n @arrayPush(array, rope, chunk), rope = \"\";\n else\n @arrayPush(array, chunk);\n return estimatedLength += byteLength, byteLength;\n },\n flush() {\n return 0;\n },\n end() {\n if (calledDone)\n return \"\";\n return sink.fulfill();\n },\n fulfill() {\n calledDone = !0;\n const result = sink.finishInternal();\n return @fulfillPromise(capability.promise, result), result;\n },\n finishInternal() {\n if (!hasString && !hasBuffer)\n return \"\";\n if (hasString && !hasBuffer)\n return rope;\n if (hasBuffer && !hasString)\n return new globalThis.TextDecoder().decode(Bun.concatArrayBuffers(array));\n var arrayBufferSink = new Bun.ArrayBufferSink;\n arrayBufferSink.start({\n highWaterMark: estimatedLength,\n asUint8Array: !0\n });\n for (let item of array)\n arrayBufferSink.write(item);\n if (array.length = 0, rope.length > 0)\n arrayBufferSink.write(rope), rope = \"\";\n return new globalThis.TextDecoder().decode(arrayBufferSink.end());\n },\n close() {\n try {\n if (!calledDone)\n calledDone = !0, sink.fulfill();\n } catch (e) {\n }\n }\n }, [sink, capability];\n})\n"; -// readableByteStreamControllerCancel -const JSC::ConstructAbility s_readableByteStreamInternalsReadableByteStreamControllerCancelCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; -const JSC::ConstructorKind s_readableByteStreamInternalsReadableByteStreamControllerCancelCodeConstructorKind = JSC::ConstructorKind::None; -const JSC::ImplementationVisibility s_readableByteStreamInternalsReadableByteStreamControllerCancelCodeImplementationVisibility = JSC::ImplementationVisibility::Public; -const int s_readableByteStreamInternalsReadableByteStreamControllerCancelCodeLength = 369; -static const JSC::Intrinsic s_readableByteStreamInternalsReadableByteStreamControllerCancelCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_readableByteStreamInternalsReadableByteStreamControllerCancelCode = "(function (controller, reason) {\"use strict\";\n var pendingPullIntos = @getByIdDirectPrivate(controller, \"pendingPullIntos\"), first = pendingPullIntos.peek();\n if (first)\n first.bytesFilled = 0;\n return @putByIdDirectPrivate(controller, \"queue\", @newQueue()), @promiseInvokeOrNoop(@getByIdDirectPrivate(controller, \"underlyingByteSource\"), \"cancel\", [reason]);\n})\n"; +// initializeTextStream +const JSC::ConstructAbility s_readableStreamInternalsInitializeTextStreamCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; +const JSC::ConstructorKind s_readableStreamInternalsInitializeTextStreamCodeConstructorKind = JSC::ConstructorKind::None; +const JSC::ImplementationVisibility s_readableStreamInternalsInitializeTextStreamCodeImplementationVisibility = JSC::ImplementationVisibility::Public; +const int s_readableStreamInternalsInitializeTextStreamCodeLength = 804; +static const JSC::Intrinsic s_readableStreamInternalsInitializeTextStreamCodeIntrinsic = JSC::NoIntrinsic; +const char* const s_readableStreamInternalsInitializeTextStreamCode = "(function (underlyingSource, highWaterMark) {\"use strict\";\n var [sink, closingPromise] = @createTextStream(highWaterMark), controller = {\n @underlyingSource: underlyingSource,\n @pull: @onPullDirectStream,\n @controlledReadableStream: this,\n @sink: sink,\n close: @onCloseDirectStream,\n write: sink.write,\n error: @handleDirectStreamError,\n end: @onCloseDirectStream,\n @close: @onCloseDirectStream,\n flush: @onFlushDirectStream,\n _pendingRead: @undefined,\n _deferClose: 0,\n _deferFlush: 0,\n _deferCloseReason: @undefined,\n _handleError: @undefined\n };\n return @putByIdDirectPrivate(this, \"readableStreamController\", controller), @putByIdDirectPrivate(this, \"underlyingSource\", @undefined), @putByIdDirectPrivate(this, \"start\", @undefined), closingPromise;\n})\n"; -// readableByteStreamControllerError -const JSC::ConstructAbility s_readableByteStreamInternalsReadableByteStreamControllerErrorCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; -const JSC::ConstructorKind s_readableByteStreamInternalsReadableByteStreamControllerErrorCodeConstructorKind = JSC::ConstructorKind::None; -const JSC::ImplementationVisibility s_readableByteStreamInternalsReadableByteStreamControllerErrorCodeImplementationVisibility = JSC::ImplementationVisibility::Public; -const int s_readableByteStreamInternalsReadableByteStreamControllerErrorCodeLength = 255; -static const JSC::Intrinsic s_readableByteStreamInternalsReadableByteStreamControllerErrorCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_readableByteStreamInternalsReadableByteStreamControllerErrorCode = "(function (controller, e) {\"use strict\";\n @readableByteStreamControllerClearPendingPullIntos(controller), @putByIdDirectPrivate(controller, \"queue\", @newQueue()), @readableStreamError(@getByIdDirectPrivate(controller, \"controlledReadableStream\"), e);\n})\n"; +// initializeArrayStream +const JSC::ConstructAbility s_readableStreamInternalsInitializeArrayStreamCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; +const JSC::ConstructorKind s_readableStreamInternalsInitializeArrayStreamCodeConstructorKind = JSC::ConstructorKind::None; +const JSC::ImplementationVisibility s_readableStreamInternalsInitializeArrayStreamCodeImplementationVisibility = JSC::ImplementationVisibility::Public; +const int s_readableStreamInternalsInitializeArrayStreamCodeLength = 1258; +static const JSC::Intrinsic s_readableStreamInternalsInitializeArrayStreamCodeIntrinsic = JSC::NoIntrinsic; +const char* const s_readableStreamInternalsInitializeArrayStreamCode = "(function (underlyingSource, highWaterMark) {\"use strict\";\n var array = [], closingPromise = @newPromiseCapability(@Promise), calledDone = !1;\n function fulfill() {\n return calledDone = !0, closingPromise.resolve.@call(@undefined, array), array;\n }\n var sink = {\n start() {\n },\n write(chunk) {\n return @arrayPush(array, chunk), chunk.byteLength || chunk.length;\n },\n flush() {\n return 0;\n },\n end() {\n if (calledDone)\n return [];\n return fulfill();\n },\n close() {\n if (!calledDone)\n fulfill();\n }\n }, controller = {\n @underlyingSource: underlyingSource,\n @pull: @onPullDirectStream,\n @controlledReadableStream: this,\n @sink: sink,\n close: @onCloseDirectStream,\n write: sink.write,\n error: @handleDirectStreamError,\n end: @onCloseDirectStream,\n @close: @onCloseDirectStream,\n flush: @onFlushDirectStream,\n _pendingRead: @undefined,\n _deferClose: 0,\n _deferFlush: 0,\n _deferCloseReason: @undefined,\n _handleError: @undefined\n };\n return @putByIdDirectPrivate(this, \"readableStreamController\", controller), @putByIdDirectPrivate(this, \"underlyingSource\", @undefined), @putByIdDirectPrivate(this, \"start\", @undefined), closingPromise;\n})\n"; -// readableByteStreamControllerClose -const JSC::ConstructAbility s_readableByteStreamInternalsReadableByteStreamControllerCloseCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; -const JSC::ConstructorKind s_readableByteStreamInternalsReadableByteStreamControllerCloseCodeConstructorKind = JSC::ConstructorKind::None; -const JSC::ImplementationVisibility s_readableByteStreamInternalsReadableByteStreamControllerCloseCodeImplementationVisibility = JSC::ImplementationVisibility::Public; -const int s_readableByteStreamInternalsReadableByteStreamControllerCloseCodeLength = 551; -static const JSC::Intrinsic s_readableByteStreamInternalsReadableByteStreamControllerCloseCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_readableByteStreamInternalsReadableByteStreamControllerCloseCode = "(function (controller) {\"use strict\";\n if (@getByIdDirectPrivate(controller, \"queue\").size > 0) {\n @putByIdDirectPrivate(controller, \"closeRequested\", !0);\n return;\n }\n var first = @getByIdDirectPrivate(controller, \"pendingPullIntos\")\?.peek();\n if (first) {\n if (first.bytesFilled > 0) {\n const e = @makeTypeError(\"Close requested while there remain pending bytes\");\n throw @readableByteStreamControllerError(controller, e), e;\n }\n }\n @readableStreamClose(@getByIdDirectPrivate(controller, \"controlledReadableStream\"));\n})\n"; +// initializeArrayBufferStream +const JSC::ConstructAbility s_readableStreamInternalsInitializeArrayBufferStreamCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; +const JSC::ConstructorKind s_readableStreamInternalsInitializeArrayBufferStreamCodeConstructorKind = JSC::ConstructorKind::None; +const JSC::ImplementationVisibility s_readableStreamInternalsInitializeArrayBufferStreamCodeImplementationVisibility = JSC::ImplementationVisibility::Public; +const int s_readableStreamInternalsInitializeArrayBufferStreamCodeLength = 935; +static const JSC::Intrinsic s_readableStreamInternalsInitializeArrayBufferStreamCodeIntrinsic = JSC::NoIntrinsic; +const char* const s_readableStreamInternalsInitializeArrayBufferStreamCode = "(function (underlyingSource, highWaterMark) {\"use strict\";\n var opts = highWaterMark && typeof highWaterMark === \"number\" \? { highWaterMark, stream: !0, asUint8Array: !0 } : { stream: !0, asUint8Array: !0 }, sink = new Bun.ArrayBufferSink;\n sink.start(opts);\n var controller = {\n @underlyingSource: underlyingSource,\n @pull: @onPullDirectStream,\n @controlledReadableStream: this,\n @sink: sink,\n close: @onCloseDirectStream,\n write: sink.write.bind(sink),\n error: @handleDirectStreamError,\n end: @onCloseDirectStream,\n @close: @onCloseDirectStream,\n flush: @onFlushDirectStream,\n _pendingRead: @undefined,\n _deferClose: 0,\n _deferFlush: 0,\n _deferCloseReason: @undefined,\n _handleError: @undefined\n };\n @putByIdDirectPrivate(this, \"readableStreamController\", controller), @putByIdDirectPrivate(this, \"underlyingSource\", @undefined), @putByIdDirectPrivate(this, \"start\", @undefined);\n})\n"; -// readableByteStreamControllerClearPendingPullIntos -const JSC::ConstructAbility s_readableByteStreamInternalsReadableByteStreamControllerClearPendingPullIntosCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; -const JSC::ConstructorKind s_readableByteStreamInternalsReadableByteStreamControllerClearPendingPullIntosCodeConstructorKind = JSC::ConstructorKind::None; -const JSC::ImplementationVisibility s_readableByteStreamInternalsReadableByteStreamControllerClearPendingPullIntosCodeImplementationVisibility = JSC::ImplementationVisibility::Public; -const int s_readableByteStreamInternalsReadableByteStreamControllerClearPendingPullIntosCodeLength = 313; -static const JSC::Intrinsic s_readableByteStreamInternalsReadableByteStreamControllerClearPendingPullIntosCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_readableByteStreamInternalsReadableByteStreamControllerClearPendingPullIntosCode = "(function (controller) {\"use strict\";\n @readableByteStreamControllerInvalidateBYOBRequest(controller);\n var existing = @getByIdDirectPrivate(controller, \"pendingPullIntos\");\n if (existing !== @undefined)\n existing.clear();\n else\n @putByIdDirectPrivate(controller, \"pendingPullIntos\", @createFIFO());\n})\n"; +// readableStreamError +const JSC::ConstructAbility s_readableStreamInternalsReadableStreamErrorCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; +const JSC::ConstructorKind s_readableStreamInternalsReadableStreamErrorCodeConstructorKind = JSC::ConstructorKind::None; +const JSC::ImplementationVisibility s_readableStreamInternalsReadableStreamErrorCodeImplementationVisibility = JSC::ImplementationVisibility::Public; +const int s_readableStreamInternalsReadableStreamErrorCodeLength = 1006; +static const JSC::Intrinsic s_readableStreamInternalsReadableStreamErrorCodeIntrinsic = JSC::NoIntrinsic; +const char* const s_readableStreamInternalsReadableStreamErrorCode = "(function (stream, error) {\"use strict\";\n @putByIdDirectPrivate(stream, \"state\", 3), @putByIdDirectPrivate(stream, \"storedError\", error);\n const reader = @getByIdDirectPrivate(stream, \"reader\");\n if (!reader)\n return;\n if (@isReadableStreamDefaultReader(reader)) {\n const requests = @getByIdDirectPrivate(reader, \"readRequests\");\n @putByIdDirectPrivate(reader, \"readRequests\", @createFIFO());\n for (var request = requests.shift();request; request = requests.shift())\n @rejectPromise(request, error);\n } else {\n const requests = @getByIdDirectPrivate(reader, \"readIntoRequests\");\n @putByIdDirectPrivate(reader, \"readIntoRequests\", @createFIFO());\n for (var request = requests.shift();request; request = requests.shift())\n @rejectPromise(request, error);\n }\n @getByIdDirectPrivate(reader, \"closedPromiseCapability\").reject.@call(@undefined, error);\n const promise = @getByIdDirectPrivate(reader, \"closedPromiseCapability\").promise;\n @markPromiseAsHandled(promise);\n})\n"; -// readableByteStreamControllerGetDesiredSize -const JSC::ConstructAbility s_readableByteStreamInternalsReadableByteStreamControllerGetDesiredSizeCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; -const JSC::ConstructorKind s_readableByteStreamInternalsReadableByteStreamControllerGetDesiredSizeCodeConstructorKind = JSC::ConstructorKind::None; -const JSC::ImplementationVisibility s_readableByteStreamInternalsReadableByteStreamControllerGetDesiredSizeCodeImplementationVisibility = JSC::ImplementationVisibility::Public; -const int s_readableByteStreamInternalsReadableByteStreamControllerGetDesiredSizeCodeLength = 347; -static const JSC::Intrinsic s_readableByteStreamInternalsReadableByteStreamControllerGetDesiredSizeCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_readableByteStreamInternalsReadableByteStreamControllerGetDesiredSizeCode = "(function (controller) {\"use strict\";\n const stream = @getByIdDirectPrivate(controller, \"controlledReadableStream\"), state = @getByIdDirectPrivate(stream, \"state\");\n if (state === 3)\n return null;\n if (state === 1)\n return 0;\n return @getByIdDirectPrivate(controller, \"strategyHWM\") - @getByIdDirectPrivate(controller, \"queue\").size;\n})\n"; +// readableStreamDefaultControllerShouldCallPull +const JSC::ConstructAbility s_readableStreamInternalsReadableStreamDefaultControllerShouldCallPullCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; +const JSC::ConstructorKind s_readableStreamInternalsReadableStreamDefaultControllerShouldCallPullCodeConstructorKind = JSC::ConstructorKind::None; +const JSC::ImplementationVisibility s_readableStreamInternalsReadableStreamDefaultControllerShouldCallPullCodeImplementationVisibility = JSC::ImplementationVisibility::Public; +const int s_readableStreamInternalsReadableStreamDefaultControllerShouldCallPullCodeLength = 573; +static const JSC::Intrinsic s_readableStreamInternalsReadableStreamDefaultControllerShouldCallPullCodeIntrinsic = JSC::NoIntrinsic; +const char* const s_readableStreamInternalsReadableStreamDefaultControllerShouldCallPullCode = "(function (controller) {\"use strict\";\n const stream = @getByIdDirectPrivate(controller, \"controlledReadableStream\");\n if (!@readableStreamDefaultControllerCanCloseOrEnqueue(controller))\n return !1;\n if (@getByIdDirectPrivate(controller, \"started\") !== 1)\n return !1;\n if ((!@isReadableStreamLocked(stream) || !@getByIdDirectPrivate(@getByIdDirectPrivate(stream, \"reader\"), \"readRequests\")\?.isNotEmpty()) && @readableStreamDefaultControllerGetDesiredSize(controller) <= 0)\n return !1;\n return @readableStreamDefaultControllerGetDesiredSize(controller) > 0;\n})\n"; -// readableStreamHasBYOBReader -const JSC::ConstructAbility s_readableByteStreamInternalsReadableStreamHasBYOBReaderCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; -const JSC::ConstructorKind s_readableByteStreamInternalsReadableStreamHasBYOBReaderCodeConstructorKind = JSC::ConstructorKind::None; -const JSC::ImplementationVisibility s_readableByteStreamInternalsReadableStreamHasBYOBReaderCodeImplementationVisibility = JSC::ImplementationVisibility::Public; -const int s_readableByteStreamInternalsReadableStreamHasBYOBReaderCodeLength = 166; -static const JSC::Intrinsic s_readableByteStreamInternalsReadableStreamHasBYOBReaderCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_readableByteStreamInternalsReadableStreamHasBYOBReaderCode = "(function (stream) {\"use strict\";\n const reader = @getByIdDirectPrivate(stream, \"reader\");\n return reader !== @undefined && @isReadableStreamBYOBReader(reader);\n})\n"; +// readableStreamDefaultControllerCallPullIfNeeded +const JSC::ConstructAbility s_readableStreamInternalsReadableStreamDefaultControllerCallPullIfNeededCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; +const JSC::ConstructorKind s_readableStreamInternalsReadableStreamDefaultControllerCallPullIfNeededCodeConstructorKind = JSC::ConstructorKind::None; +const JSC::ImplementationVisibility s_readableStreamInternalsReadableStreamDefaultControllerCallPullIfNeededCodeImplementationVisibility = JSC::ImplementationVisibility::Public; +const int s_readableStreamInternalsReadableStreamDefaultControllerCallPullIfNeededCodeLength = 1074; +static const JSC::Intrinsic s_readableStreamInternalsReadableStreamDefaultControllerCallPullIfNeededCodeIntrinsic = JSC::NoIntrinsic; +const char* const s_readableStreamInternalsReadableStreamDefaultControllerCallPullIfNeededCode = "(function (controller) {\"use strict\";\n const stream = @getByIdDirectPrivate(controller, \"controlledReadableStream\");\n if (!@readableStreamDefaultControllerCanCloseOrEnqueue(controller))\n return;\n if (@getByIdDirectPrivate(controller, \"started\") !== 1)\n return;\n if ((!@isReadableStreamLocked(stream) || !@getByIdDirectPrivate(@getByIdDirectPrivate(stream, \"reader\"), \"readRequests\")\?.isNotEmpty()) && @readableStreamDefaultControllerGetDesiredSize(controller) <= 0)\n return;\n if (@getByIdDirectPrivate(controller, \"pulling\")) {\n @putByIdDirectPrivate(controller, \"pullAgain\", !0);\n return;\n }\n @putByIdDirectPrivate(controller, \"pulling\", !0), @getByIdDirectPrivate(controller, \"pullAlgorithm\").@call(@undefined).@then(function() {\n if (@putByIdDirectPrivate(controller, \"pulling\", !1), @getByIdDirectPrivate(controller, \"pullAgain\"))\n @putByIdDirectPrivate(controller, \"pullAgain\", !1), @readableStreamDefaultControllerCallPullIfNeeded(controller);\n }, function(error) {\n @readableStreamDefaultControllerError(controller, error);\n });\n})\n"; -// readableStreamHasDefaultReader -const JSC::ConstructAbility s_readableByteStreamInternalsReadableStreamHasDefaultReaderCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; -const JSC::ConstructorKind s_readableByteStreamInternalsReadableStreamHasDefaultReaderCodeConstructorKind = JSC::ConstructorKind::None; -const JSC::ImplementationVisibility s_readableByteStreamInternalsReadableStreamHasDefaultReaderCodeImplementationVisibility = JSC::ImplementationVisibility::Public; -const int s_readableByteStreamInternalsReadableStreamHasDefaultReaderCodeLength = 169; -static const JSC::Intrinsic s_readableByteStreamInternalsReadableStreamHasDefaultReaderCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_readableByteStreamInternalsReadableStreamHasDefaultReaderCode = "(function (stream) {\"use strict\";\n const reader = @getByIdDirectPrivate(stream, \"reader\");\n return reader !== @undefined && @isReadableStreamDefaultReader(reader);\n})\n"; +// isReadableStreamLocked +const JSC::ConstructAbility s_readableStreamInternalsIsReadableStreamLockedCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; +const JSC::ConstructorKind s_readableStreamInternalsIsReadableStreamLockedCodeConstructorKind = JSC::ConstructorKind::None; +const JSC::ImplementationVisibility s_readableStreamInternalsIsReadableStreamLockedCodeImplementationVisibility = JSC::ImplementationVisibility::Public; +const int s_readableStreamInternalsIsReadableStreamLockedCodeLength = 89; +static const JSC::Intrinsic s_readableStreamInternalsIsReadableStreamLockedCodeIntrinsic = JSC::NoIntrinsic; +const char* const s_readableStreamInternalsIsReadableStreamLockedCode = "(function (stream) {\"use strict\";\n return !!@getByIdDirectPrivate(stream, \"reader\");\n})\n"; -// readableByteStreamControllerHandleQueueDrain -const JSC::ConstructAbility s_readableByteStreamInternalsReadableByteStreamControllerHandleQueueDrainCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; -const JSC::ConstructorKind s_readableByteStreamInternalsReadableByteStreamControllerHandleQueueDrainCodeConstructorKind = JSC::ConstructorKind::None; -const JSC::ImplementationVisibility s_readableByteStreamInternalsReadableByteStreamControllerHandleQueueDrainCodeImplementationVisibility = JSC::ImplementationVisibility::Public; -const int s_readableByteStreamInternalsReadableByteStreamControllerHandleQueueDrainCodeLength = 311; -static const JSC::Intrinsic s_readableByteStreamInternalsReadableByteStreamControllerHandleQueueDrainCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_readableByteStreamInternalsReadableByteStreamControllerHandleQueueDrainCode = "(function (controller) {\"use strict\";\n if (!@getByIdDirectPrivate(controller, \"queue\").size && @getByIdDirectPrivate(controller, \"closeRequested\"))\n @readableStreamClose(@getByIdDirectPrivate(controller, \"controlledReadableStream\"));\n else\n @readableByteStreamControllerCallPullIfNeeded(controller);\n})\n"; +// readableStreamDefaultControllerGetDesiredSize +const JSC::ConstructAbility s_readableStreamInternalsReadableStreamDefaultControllerGetDesiredSizeCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; +const JSC::ConstructorKind s_readableStreamInternalsReadableStreamDefaultControllerGetDesiredSizeCodeConstructorKind = JSC::ConstructorKind::None; +const JSC::ImplementationVisibility s_readableStreamInternalsReadableStreamDefaultControllerGetDesiredSizeCodeImplementationVisibility = JSC::ImplementationVisibility::Public; +const int s_readableStreamInternalsReadableStreamDefaultControllerGetDesiredSizeCodeLength = 358; +static const JSC::Intrinsic s_readableStreamInternalsReadableStreamDefaultControllerGetDesiredSizeCodeIntrinsic = JSC::NoIntrinsic; +const char* const s_readableStreamInternalsReadableStreamDefaultControllerGetDesiredSizeCode = "(function (controller) {\"use strict\";\n const stream = @getByIdDirectPrivate(controller, \"controlledReadableStream\"), state = @getByIdDirectPrivate(stream, \"state\");\n if (state === 3)\n return null;\n if (state === 1)\n return 0;\n return @getByIdDirectPrivate(controller, \"strategy\").highWaterMark - @getByIdDirectPrivate(controller, \"queue\").size;\n})\n"; -// readableByteStreamControllerPull -const JSC::ConstructAbility s_readableByteStreamInternalsReadableByteStreamControllerPullCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; -const JSC::ConstructorKind s_readableByteStreamInternalsReadableByteStreamControllerPullCodeConstructorKind = JSC::ConstructorKind::None; -const JSC::ImplementationVisibility s_readableByteStreamInternalsReadableByteStreamControllerPullCodeImplementationVisibility = JSC::ImplementationVisibility::Public; -const int s_readableByteStreamInternalsReadableByteStreamControllerPullCodeLength = 1397; -static const JSC::Intrinsic s_readableByteStreamInternalsReadableByteStreamControllerPullCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_readableByteStreamInternalsReadableByteStreamControllerPullCode = "(function (controller) {\"use strict\";\n const stream = @getByIdDirectPrivate(controller, \"controlledReadableStream\");\n if (@getByIdDirectPrivate(controller, \"queue\").content\?.isNotEmpty()) {\n const entry = @getByIdDirectPrivate(controller, \"queue\").content.shift();\n @getByIdDirectPrivate(controller, \"queue\").size -= entry.byteLength, @readableByteStreamControllerHandleQueueDrain(controller);\n let view;\n try {\n view = new @Uint8Array(entry.buffer, entry.byteOffset, entry.byteLength);\n } catch (error) {\n return @Promise.@reject(error);\n }\n return @createFulfilledPromise({ value: view, done: !1 });\n }\n if (@getByIdDirectPrivate(controller, \"autoAllocateChunkSize\") !== @undefined) {\n let buffer;\n try {\n buffer = @createUninitializedArrayBuffer(@getByIdDirectPrivate(controller, \"autoAllocateChunkSize\"));\n } catch (error) {\n return @Promise.@reject(error);\n }\n const pullIntoDescriptor = {\n buffer,\n byteOffset: 0,\n byteLength: @getByIdDirectPrivate(controller, \"autoAllocateChunkSize\"),\n bytesFilled: 0,\n elementSize: 1,\n ctor: @Uint8Array,\n readerType: \"default\"\n };\n @getByIdDirectPrivate(controller, \"pendingPullIntos\").push(pullIntoDescriptor);\n }\n const promise = @readableStreamAddReadRequest(stream);\n return @readableByteStreamControllerCallPullIfNeeded(controller), promise;\n})\n"; +// readableStreamReaderGenericCancel +const JSC::ConstructAbility s_readableStreamInternalsReadableStreamReaderGenericCancelCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; +const JSC::ConstructorKind s_readableStreamInternalsReadableStreamReaderGenericCancelCodeConstructorKind = JSC::ConstructorKind::None; +const JSC::ImplementationVisibility s_readableStreamInternalsReadableStreamReaderGenericCancelCodeImplementationVisibility = JSC::ImplementationVisibility::Public; +const int s_readableStreamInternalsReadableStreamReaderGenericCancelCodeLength = 164; +static const JSC::Intrinsic s_readableStreamInternalsReadableStreamReaderGenericCancelCodeIntrinsic = JSC::NoIntrinsic; +const char* const s_readableStreamInternalsReadableStreamReaderGenericCancelCode = "(function (reader, reason) {\"use strict\";\n const stream = @getByIdDirectPrivate(reader, \"ownerReadableStream\");\n return @readableStreamCancel(stream, reason);\n})\n"; -// readableByteStreamControllerShouldCallPull -const JSC::ConstructAbility s_readableByteStreamInternalsReadableByteStreamControllerShouldCallPullCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; -const JSC::ConstructorKind s_readableByteStreamInternalsReadableByteStreamControllerShouldCallPullCodeConstructorKind = JSC::ConstructorKind::None; -const JSC::ImplementationVisibility s_readableByteStreamInternalsReadableByteStreamControllerShouldCallPullCodeImplementationVisibility = JSC::ImplementationVisibility::Public; -const int s_readableByteStreamInternalsReadableByteStreamControllerShouldCallPullCodeLength = 793; -static const JSC::Intrinsic s_readableByteStreamInternalsReadableByteStreamControllerShouldCallPullCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_readableByteStreamInternalsReadableByteStreamControllerShouldCallPullCode = "(function (controller) {\"use strict\";\n const stream = @getByIdDirectPrivate(controller, \"controlledReadableStream\");\n if (@getByIdDirectPrivate(stream, \"state\") !== 4)\n return !1;\n if (@getByIdDirectPrivate(controller, \"closeRequested\"))\n return !1;\n if (!(@getByIdDirectPrivate(controller, \"started\") > 0))\n return !1;\n const reader = @getByIdDirectPrivate(stream, \"reader\");\n if (reader && (@getByIdDirectPrivate(reader, \"readRequests\")\?.isNotEmpty() || !!@getByIdDirectPrivate(reader, \"bunNativePtr\")))\n return !0;\n if (@readableStreamHasBYOBReader(stream) && @getByIdDirectPrivate(@getByIdDirectPrivate(stream, \"reader\"), \"readIntoRequests\")\?.isNotEmpty())\n return !0;\n if (@readableByteStreamControllerGetDesiredSize(controller) > 0)\n return !0;\n return !1;\n})\n"; +// readableStreamCancel +const JSC::ConstructAbility s_readableStreamInternalsReadableStreamCancelCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; +const JSC::ConstructorKind s_readableStreamInternalsReadableStreamCancelCodeConstructorKind = JSC::ConstructorKind::None; +const JSC::ImplementationVisibility s_readableStreamInternalsReadableStreamCancelCodeImplementationVisibility = JSC::ImplementationVisibility::Public; +const int s_readableStreamInternalsReadableStreamCancelCodeLength = 692; +static const JSC::Intrinsic s_readableStreamInternalsReadableStreamCancelCodeIntrinsic = JSC::NoIntrinsic; +const char* const s_readableStreamInternalsReadableStreamCancelCode = "(function (stream, reason) {\"use strict\";\n @putByIdDirectPrivate(stream, \"disturbed\", !0);\n const state = @getByIdDirectPrivate(stream, \"state\");\n if (state === 1)\n return @Promise.@resolve();\n if (state === 3)\n return @Promise.@reject(@getByIdDirectPrivate(stream, \"storedError\"));\n @readableStreamClose(stream);\n var controller = @getByIdDirectPrivate(stream, \"readableStreamController\"), cancel = controller.@cancel;\n if (cancel)\n return cancel(controller, reason).@then(function() {\n });\n var close = controller.close;\n if (close)\n return @Promise.@resolve(controller.close(reason));\n @throwTypeError(\"ReadableStreamController has no cancel or close method\");\n})\n"; -// readableByteStreamControllerCallPullIfNeeded -const JSC::ConstructAbility s_readableByteStreamInternalsReadableByteStreamControllerCallPullIfNeededCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; -const JSC::ConstructorKind s_readableByteStreamInternalsReadableByteStreamControllerCallPullIfNeededCodeConstructorKind = JSC::ConstructorKind::None; -const JSC::ImplementationVisibility s_readableByteStreamInternalsReadableByteStreamControllerCallPullIfNeededCodeImplementationVisibility = JSC::ImplementationVisibility::Public; -const int s_readableByteStreamInternalsReadableByteStreamControllerCallPullIfNeededCodeLength = 828; -static const JSC::Intrinsic s_readableByteStreamInternalsReadableByteStreamControllerCallPullIfNeededCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_readableByteStreamInternalsReadableByteStreamControllerCallPullIfNeededCode = "(function (controller) {\"use strict\";\n if (!@readableByteStreamControllerShouldCallPull(controller))\n return;\n if (@getByIdDirectPrivate(controller, \"pulling\")) {\n @putByIdDirectPrivate(controller, \"pullAgain\", !0);\n return;\n }\n @putByIdDirectPrivate(controller, \"pulling\", !0), @promiseInvokeOrNoop(@getByIdDirectPrivate(controller, \"underlyingByteSource\"), \"pull\", [controller]).@then(() => {\n if (@putByIdDirectPrivate(controller, \"pulling\", !1), @getByIdDirectPrivate(controller, \"pullAgain\"))\n @putByIdDirectPrivate(controller, \"pullAgain\", !1), @readableByteStreamControllerCallPullIfNeeded(controller);\n }, (error) => {\n if (@getByIdDirectPrivate(@getByIdDirectPrivate(controller, \"controlledReadableStream\"), \"state\") === 4)\n @readableByteStreamControllerError(controller, error);\n });\n})\n"; +// readableStreamDefaultControllerCancel +const JSC::ConstructAbility s_readableStreamInternalsReadableStreamDefaultControllerCancelCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; +const JSC::ConstructorKind s_readableStreamInternalsReadableStreamDefaultControllerCancelCodeConstructorKind = JSC::ConstructorKind::None; +const JSC::ImplementationVisibility s_readableStreamInternalsReadableStreamDefaultControllerCancelCodeImplementationVisibility = JSC::ImplementationVisibility::Public; +const int s_readableStreamInternalsReadableStreamDefaultControllerCancelCodeLength = 195; +static const JSC::Intrinsic s_readableStreamInternalsReadableStreamDefaultControllerCancelCodeIntrinsic = JSC::NoIntrinsic; +const char* const s_readableStreamInternalsReadableStreamDefaultControllerCancelCode = "(function (controller, reason) {\"use strict\";\n return @putByIdDirectPrivate(controller, \"queue\", @newQueue()), @getByIdDirectPrivate(controller, \"cancelAlgorithm\").@call(@undefined, reason);\n})\n"; -// transferBufferToCurrentRealm -const JSC::ConstructAbility s_readableByteStreamInternalsTransferBufferToCurrentRealmCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; -const JSC::ConstructorKind s_readableByteStreamInternalsTransferBufferToCurrentRealmCodeConstructorKind = JSC::ConstructorKind::None; -const JSC::ImplementationVisibility s_readableByteStreamInternalsTransferBufferToCurrentRealmCodeImplementationVisibility = JSC::ImplementationVisibility::Public; -const int s_readableByteStreamInternalsTransferBufferToCurrentRealmCodeLength = 54; -static const JSC::Intrinsic s_readableByteStreamInternalsTransferBufferToCurrentRealmCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_readableByteStreamInternalsTransferBufferToCurrentRealmCode = "(function (buffer) {\"use strict\";\n return buffer;\n})\n"; +// readableStreamDefaultControllerPull +const JSC::ConstructAbility s_readableStreamInternalsReadableStreamDefaultControllerPullCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; +const JSC::ConstructorKind s_readableStreamInternalsReadableStreamDefaultControllerPullCodeConstructorKind = JSC::ConstructorKind::None; +const JSC::ImplementationVisibility s_readableStreamInternalsReadableStreamDefaultControllerPullCodeImplementationVisibility = JSC::ImplementationVisibility::Public; +const int s_readableStreamInternalsReadableStreamDefaultControllerPullCodeLength = 705; +static const JSC::Intrinsic s_readableStreamInternalsReadableStreamDefaultControllerPullCodeIntrinsic = JSC::NoIntrinsic; +const char* const s_readableStreamInternalsReadableStreamDefaultControllerPullCode = "(function (controller) {\"use strict\";\n var queue = @getByIdDirectPrivate(controller, \"queue\");\n if (queue.content.isNotEmpty()) {\n const chunk = @dequeueValue(queue);\n if (@getByIdDirectPrivate(controller, \"closeRequested\") && queue.content.isEmpty())\n @readableStreamClose(@getByIdDirectPrivate(controller, \"controlledReadableStream\"));\n else\n @readableStreamDefaultControllerCallPullIfNeeded(controller);\n return @createFulfilledPromise({ value: chunk, done: !1 });\n }\n const pendingPromise = @readableStreamAddReadRequest(@getByIdDirectPrivate(controller, \"controlledReadableStream\"));\n return @readableStreamDefaultControllerCallPullIfNeeded(controller), pendingPromise;\n})\n"; -// readableStreamReaderKind -const JSC::ConstructAbility s_readableByteStreamInternalsReadableStreamReaderKindCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; -const JSC::ConstructorKind s_readableByteStreamInternalsReadableStreamReaderKindCodeConstructorKind = JSC::ConstructorKind::None; -const JSC::ImplementationVisibility s_readableByteStreamInternalsReadableStreamReaderKindCodeImplementationVisibility = JSC::ImplementationVisibility::Public; -const int s_readableByteStreamInternalsReadableStreamReaderKindCodeLength = 239; -static const JSC::Intrinsic s_readableByteStreamInternalsReadableStreamReaderKindCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_readableByteStreamInternalsReadableStreamReaderKindCode = "(function (reader) {\"use strict\";\n if (@getByIdDirectPrivate(reader, \"readRequests\"))\n return @getByIdDirectPrivate(reader, \"bunNativePtr\") \? 3 : 1;\n if (@getByIdDirectPrivate(reader, \"readIntoRequests\"))\n return 2;\n return 0;\n})\n"; +// readableStreamDefaultControllerClose +const JSC::ConstructAbility s_readableStreamInternalsReadableStreamDefaultControllerCloseCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; +const JSC::ConstructorKind s_readableStreamInternalsReadableStreamDefaultControllerCloseCodeConstructorKind = JSC::ConstructorKind::None; +const JSC::ImplementationVisibility s_readableStreamInternalsReadableStreamDefaultControllerCloseCodeImplementationVisibility = JSC::ImplementationVisibility::Public; +const int s_readableStreamInternalsReadableStreamDefaultControllerCloseCodeLength = 257; +static const JSC::Intrinsic s_readableStreamInternalsReadableStreamDefaultControllerCloseCodeIntrinsic = JSC::NoIntrinsic; +const char* const s_readableStreamInternalsReadableStreamDefaultControllerCloseCode = "(function (controller) {\"use strict\";\n if (@putByIdDirectPrivate(controller, \"closeRequested\", !0), @getByIdDirectPrivate(controller, \"queue\")\?.content\?.isEmpty())\n @readableStreamClose(@getByIdDirectPrivate(controller, \"controlledReadableStream\"));\n})\n"; -// readableByteStreamControllerEnqueue -const JSC::ConstructAbility s_readableByteStreamInternalsReadableByteStreamControllerEnqueueCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; -const JSC::ConstructorKind s_readableByteStreamInternalsReadableByteStreamControllerEnqueueCodeConstructorKind = JSC::ConstructorKind::None; -const JSC::ImplementationVisibility s_readableByteStreamInternalsReadableByteStreamControllerEnqueueCodeImplementationVisibility = JSC::ImplementationVisibility::Public; -const int s_readableByteStreamInternalsReadableByteStreamControllerEnqueueCodeLength = 1217; -static const JSC::Intrinsic s_readableByteStreamInternalsReadableByteStreamControllerEnqueueCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_readableByteStreamInternalsReadableByteStreamControllerEnqueueCode = "(function (controller, chunk) {\"use strict\";\n const stream = @getByIdDirectPrivate(controller, \"controlledReadableStream\");\n switch (@getByIdDirectPrivate(stream, \"reader\") \? @readableStreamReaderKind(@getByIdDirectPrivate(stream, \"reader\")) : 0) {\n case 1: {\n if (!@getByIdDirectPrivate(@getByIdDirectPrivate(stream, \"reader\"), \"readRequests\")\?.isNotEmpty())\n @readableByteStreamControllerEnqueueChunk(controller, @transferBufferToCurrentRealm(chunk.buffer), chunk.byteOffset, chunk.byteLength);\n else {\n const transferredView = chunk.constructor === @Uint8Array \? chunk : new @Uint8Array(chunk.buffer, chunk.byteOffset, chunk.byteLength);\n @readableStreamFulfillReadRequest(stream, transferredView, !1);\n }\n break;\n }\n case 2: {\n @readableByteStreamControllerEnqueueChunk(controller, @transferBufferToCurrentRealm(chunk.buffer), chunk.byteOffset, chunk.byteLength), @readableByteStreamControllerProcessPullDescriptors(controller);\n break;\n }\n case 3:\n break;\n default: {\n @readableByteStreamControllerEnqueueChunk(controller, @transferBufferToCurrentRealm(chunk.buffer), chunk.byteOffset, chunk.byteLength);\n break;\n }\n }\n})\n"; +// readableStreamClose +const JSC::ConstructAbility s_readableStreamInternalsReadableStreamCloseCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; +const JSC::ConstructorKind s_readableStreamInternalsReadableStreamCloseCodeConstructorKind = JSC::ConstructorKind::None; +const JSC::ImplementationVisibility s_readableStreamInternalsReadableStreamCloseCodeImplementationVisibility = JSC::ImplementationVisibility::Public; +const int s_readableStreamInternalsReadableStreamCloseCodeLength = 721; +static const JSC::Intrinsic s_readableStreamInternalsReadableStreamCloseCodeIntrinsic = JSC::NoIntrinsic; +const char* const s_readableStreamInternalsReadableStreamCloseCode = "(function (stream) {\"use strict\";\n if (@putByIdDirectPrivate(stream, \"state\", 1), !@getByIdDirectPrivate(stream, \"reader\"))\n return;\n if (@isReadableStreamDefaultReader(@getByIdDirectPrivate(stream, \"reader\"))) {\n const requests = @getByIdDirectPrivate(@getByIdDirectPrivate(stream, \"reader\"), \"readRequests\");\n if (requests.isNotEmpty()) {\n @putByIdDirectPrivate(@getByIdDirectPrivate(stream, \"reader\"), \"readRequests\", @createFIFO());\n for (var request = requests.shift();request; request = requests.shift())\n @fulfillPromise(request, { value: @undefined, done: !0 });\n }\n }\n @getByIdDirectPrivate(@getByIdDirectPrivate(stream, \"reader\"), \"closedPromiseCapability\").resolve.@call();\n})\n"; -// readableByteStreamControllerEnqueueChunk -const JSC::ConstructAbility s_readableByteStreamInternalsReadableByteStreamControllerEnqueueChunkCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; -const JSC::ConstructorKind s_readableByteStreamInternalsReadableByteStreamControllerEnqueueChunkCodeConstructorKind = JSC::ConstructorKind::None; -const JSC::ImplementationVisibility s_readableByteStreamInternalsReadableByteStreamControllerEnqueueChunkCodeImplementationVisibility = JSC::ImplementationVisibility::Public; -const int s_readableByteStreamInternalsReadableByteStreamControllerEnqueueChunkCodeLength = 245; -static const JSC::Intrinsic s_readableByteStreamInternalsReadableByteStreamControllerEnqueueChunkCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_readableByteStreamInternalsReadableByteStreamControllerEnqueueChunkCode = "(function (controller, buffer, byteOffset, byteLength) {\"use strict\";\n @getByIdDirectPrivate(controller, \"queue\").content.push({\n buffer,\n byteOffset,\n byteLength\n }), @getByIdDirectPrivate(controller, \"queue\").size += byteLength;\n})\n"; +// readableStreamFulfillReadRequest +const JSC::ConstructAbility s_readableStreamInternalsReadableStreamFulfillReadRequestCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; +const JSC::ConstructorKind s_readableStreamInternalsReadableStreamFulfillReadRequestCodeConstructorKind = JSC::ConstructorKind::None; +const JSC::ImplementationVisibility s_readableStreamInternalsReadableStreamFulfillReadRequestCodeImplementationVisibility = JSC::ImplementationVisibility::Public; +const int s_readableStreamInternalsReadableStreamFulfillReadRequestCodeLength = 216; +static const JSC::Intrinsic s_readableStreamInternalsReadableStreamFulfillReadRequestCodeIntrinsic = JSC::NoIntrinsic; +const char* const s_readableStreamInternalsReadableStreamFulfillReadRequestCode = "(function (stream, chunk, done) {\"use strict\";\n const readRequest = @getByIdDirectPrivate(@getByIdDirectPrivate(stream, \"reader\"), \"readRequests\").shift();\n @fulfillPromise(readRequest, { value: chunk, done });\n})\n"; -// readableByteStreamControllerRespondWithNewView -const JSC::ConstructAbility s_readableByteStreamInternalsReadableByteStreamControllerRespondWithNewViewCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; -const JSC::ConstructorKind s_readableByteStreamInternalsReadableByteStreamControllerRespondWithNewViewCodeConstructorKind = JSC::ConstructorKind::None; -const JSC::ImplementationVisibility s_readableByteStreamInternalsReadableByteStreamControllerRespondWithNewViewCodeImplementationVisibility = JSC::ImplementationVisibility::Public; -const int s_readableByteStreamInternalsReadableByteStreamControllerRespondWithNewViewCodeLength = 504; -static const JSC::Intrinsic s_readableByteStreamInternalsReadableByteStreamControllerRespondWithNewViewCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_readableByteStreamInternalsReadableByteStreamControllerRespondWithNewViewCode = "(function (controller, view) {\"use strict\";\n let firstDescriptor = @getByIdDirectPrivate(controller, \"pendingPullIntos\").peek();\n if (firstDescriptor.byteOffset + firstDescriptor.bytesFilled !== view.byteOffset)\n @throwRangeError(\"Invalid value for view.byteOffset\");\n if (firstDescriptor.byteLength !== view.byteLength)\n @throwRangeError(\"Invalid value for view.byteLength\");\n firstDescriptor.buffer = view.buffer, @readableByteStreamControllerRespondInternal(controller, view.byteLength);\n})\n"; +// readableStreamDefaultControllerEnqueue +const JSC::ConstructAbility s_readableStreamInternalsReadableStreamDefaultControllerEnqueueCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; +const JSC::ConstructorKind s_readableStreamInternalsReadableStreamDefaultControllerEnqueueCodeConstructorKind = JSC::ConstructorKind::None; +const JSC::ImplementationVisibility s_readableStreamInternalsReadableStreamDefaultControllerEnqueueCodeImplementationVisibility = JSC::ImplementationVisibility::Public; +const int s_readableStreamInternalsReadableStreamDefaultControllerEnqueueCodeLength = 836; +static const JSC::Intrinsic s_readableStreamInternalsReadableStreamDefaultControllerEnqueueCodeIntrinsic = JSC::NoIntrinsic; +const char* const s_readableStreamInternalsReadableStreamDefaultControllerEnqueueCode = "(function (controller, chunk) {\"use strict\";\n const stream = @getByIdDirectPrivate(controller, \"controlledReadableStream\");\n if (@isReadableStreamLocked(stream) && @getByIdDirectPrivate(@getByIdDirectPrivate(stream, \"reader\"), \"readRequests\")\?.isNotEmpty()) {\n @readableStreamFulfillReadRequest(stream, chunk, !1), @readableStreamDefaultControllerCallPullIfNeeded(controller);\n return;\n }\n try {\n let chunkSize = 1;\n if (@getByIdDirectPrivate(controller, \"strategy\").size !== @undefined)\n chunkSize = @getByIdDirectPrivate(controller, \"strategy\").size(chunk);\n @enqueueValueWithSize(@getByIdDirectPrivate(controller, \"queue\"), chunk, chunkSize);\n } catch (error) {\n throw @readableStreamDefaultControllerError(controller, error), error;\n }\n @readableStreamDefaultControllerCallPullIfNeeded(controller);\n})\n"; -// readableByteStreamControllerRespond -const JSC::ConstructAbility s_readableByteStreamInternalsReadableByteStreamControllerRespondCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; -const JSC::ConstructorKind s_readableByteStreamInternalsReadableByteStreamControllerRespondCodeConstructorKind = JSC::ConstructorKind::None; -const JSC::ImplementationVisibility s_readableByteStreamInternalsReadableByteStreamControllerRespondCodeImplementationVisibility = JSC::ImplementationVisibility::Public; -const int s_readableByteStreamInternalsReadableByteStreamControllerRespondCodeLength = 317; -static const JSC::Intrinsic s_readableByteStreamInternalsReadableByteStreamControllerRespondCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_readableByteStreamInternalsReadableByteStreamControllerRespondCode = "(function (controller, bytesWritten) {\"use strict\";\n if (bytesWritten = @toNumber(bytesWritten), bytesWritten !== bytesWritten || bytesWritten === @Infinity || bytesWritten < 0)\n @throwRangeError(\"bytesWritten has an incorrect value\");\n @readableByteStreamControllerRespondInternal(controller, bytesWritten);\n})\n"; +// readableStreamDefaultReaderRead +const JSC::ConstructAbility s_readableStreamInternalsReadableStreamDefaultReaderReadCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; +const JSC::ConstructorKind s_readableStreamInternalsReadableStreamDefaultReaderReadCodeConstructorKind = JSC::ConstructorKind::None; +const JSC::ImplementationVisibility s_readableStreamInternalsReadableStreamDefaultReaderReadCodeImplementationVisibility = JSC::ImplementationVisibility::Public; +const int s_readableStreamInternalsReadableStreamDefaultReaderReadCodeLength = 519; +static const JSC::Intrinsic s_readableStreamInternalsReadableStreamDefaultReaderReadCodeIntrinsic = JSC::NoIntrinsic; +const char* const s_readableStreamInternalsReadableStreamDefaultReaderReadCode = "(function (reader) {\"use strict\";\n const stream = @getByIdDirectPrivate(reader, \"ownerReadableStream\"), state = @getByIdDirectPrivate(stream, \"state\");\n if (@putByIdDirectPrivate(stream, \"disturbed\", !0), state === 1)\n return @createFulfilledPromise({ value: @undefined, done: !0 });\n if (state === 3)\n return @Promise.@reject(@getByIdDirectPrivate(stream, \"storedError\"));\n return @getByIdDirectPrivate(stream, \"readableStreamController\").@pull(@getByIdDirectPrivate(stream, \"readableStreamController\"));\n})\n"; -// readableByteStreamControllerRespondInternal -const JSC::ConstructAbility s_readableByteStreamInternalsReadableByteStreamControllerRespondInternalCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; -const JSC::ConstructorKind s_readableByteStreamInternalsReadableByteStreamControllerRespondInternalCodeConstructorKind = JSC::ConstructorKind::None; -const JSC::ImplementationVisibility s_readableByteStreamInternalsReadableByteStreamControllerRespondInternalCodeImplementationVisibility = JSC::ImplementationVisibility::Public; -const int s_readableByteStreamInternalsReadableByteStreamControllerRespondInternalCodeLength = 576; -static const JSC::Intrinsic s_readableByteStreamInternalsReadableByteStreamControllerRespondInternalCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_readableByteStreamInternalsReadableByteStreamControllerRespondInternalCode = "(function (controller, bytesWritten) {\"use strict\";\n let firstDescriptor = @getByIdDirectPrivate(controller, \"pendingPullIntos\").peek(), stream = @getByIdDirectPrivate(controller, \"controlledReadableStream\");\n if (@getByIdDirectPrivate(stream, \"state\") === 1) {\n if (bytesWritten !== 0)\n @throwTypeError(\"bytesWritten is different from 0 even though stream is closed\");\n @readableByteStreamControllerRespondInClosedState(controller, firstDescriptor);\n } else\n @readableByteStreamControllerRespondInReadableState(controller, bytesWritten, firstDescriptor);\n})\n"; +// readableStreamAddReadRequest +const JSC::ConstructAbility s_readableStreamInternalsReadableStreamAddReadRequestCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; +const JSC::ConstructorKind s_readableStreamInternalsReadableStreamAddReadRequestCodeConstructorKind = JSC::ConstructorKind::None; +const JSC::ImplementationVisibility s_readableStreamInternalsReadableStreamAddReadRequestCodeImplementationVisibility = JSC::ImplementationVisibility::Public; +const int s_readableStreamInternalsReadableStreamAddReadRequestCodeLength = 194; +static const JSC::Intrinsic s_readableStreamInternalsReadableStreamAddReadRequestCodeIntrinsic = JSC::NoIntrinsic; +const char* const s_readableStreamInternalsReadableStreamAddReadRequestCode = "(function (stream) {\"use strict\";\n const readRequest = @newPromise();\n return @getByIdDirectPrivate(@getByIdDirectPrivate(stream, \"reader\"), \"readRequests\").push(readRequest), readRequest;\n})\n"; -// readableByteStreamControllerRespondInReadableState -const JSC::ConstructAbility s_readableByteStreamInternalsReadableByteStreamControllerRespondInReadableStateCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; -const JSC::ConstructorKind s_readableByteStreamInternalsReadableByteStreamControllerRespondInReadableStateCodeConstructorKind = JSC::ConstructorKind::None; -const JSC::ImplementationVisibility s_readableByteStreamInternalsReadableByteStreamControllerRespondInReadableStateCodeImplementationVisibility = JSC::ImplementationVisibility::Public; -const int s_readableByteStreamInternalsReadableByteStreamControllerRespondInReadableStateCodeLength = 1200; -static const JSC::Intrinsic s_readableByteStreamInternalsReadableByteStreamControllerRespondInReadableStateCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_readableByteStreamInternalsReadableByteStreamControllerRespondInReadableStateCode = "(function (controller, bytesWritten, pullIntoDescriptor) {\"use strict\";\n if (pullIntoDescriptor.bytesFilled + bytesWritten > pullIntoDescriptor.byteLength)\n @throwRangeError(\"bytesWritten value is too great\");\n if (@readableByteStreamControllerInvalidateBYOBRequest(controller), pullIntoDescriptor.bytesFilled += bytesWritten, pullIntoDescriptor.bytesFilled < pullIntoDescriptor.elementSize)\n return;\n @readableByteStreamControllerShiftPendingDescriptor(controller);\n const remainderSize = pullIntoDescriptor.bytesFilled % pullIntoDescriptor.elementSize;\n if (remainderSize > 0) {\n const end = pullIntoDescriptor.byteOffset + pullIntoDescriptor.bytesFilled, remainder = @cloneArrayBuffer(pullIntoDescriptor.buffer, end - remainderSize, remainderSize);\n @readableByteStreamControllerEnqueueChunk(controller, remainder, 0, remainder.byteLength);\n }\n pullIntoDescriptor.buffer = @transferBufferToCurrentRealm(pullIntoDescriptor.buffer), pullIntoDescriptor.bytesFilled -= remainderSize, @readableByteStreamControllerCommitDescriptor(@getByIdDirectPrivate(controller, \"controlledReadableStream\"), pullIntoDescriptor), @readableByteStreamControllerProcessPullDescriptors(controller);\n})\n"; +// isReadableStreamDisturbed +const JSC::ConstructAbility s_readableStreamInternalsIsReadableStreamDisturbedCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; +const JSC::ConstructorKind s_readableStreamInternalsIsReadableStreamDisturbedCodeConstructorKind = JSC::ConstructorKind::None; +const JSC::ImplementationVisibility s_readableStreamInternalsIsReadableStreamDisturbedCodeImplementationVisibility = JSC::ImplementationVisibility::Public; +const int s_readableStreamInternalsIsReadableStreamDisturbedCodeLength = 90; +static const JSC::Intrinsic s_readableStreamInternalsIsReadableStreamDisturbedCodeIntrinsic = JSC::NoIntrinsic; +const char* const s_readableStreamInternalsIsReadableStreamDisturbedCode = "(function (stream) {\"use strict\";\n return @getByIdDirectPrivate(stream, \"disturbed\");\n})\n"; -// readableByteStreamControllerRespondInClosedState -const JSC::ConstructAbility s_readableByteStreamInternalsReadableByteStreamControllerRespondInClosedStateCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; -const JSC::ConstructorKind s_readableByteStreamInternalsReadableByteStreamControllerRespondInClosedStateCodeConstructorKind = JSC::ConstructorKind::None; -const JSC::ImplementationVisibility s_readableByteStreamInternalsReadableByteStreamControllerRespondInClosedStateCodeImplementationVisibility = JSC::ImplementationVisibility::Public; -const int s_readableByteStreamInternalsReadableByteStreamControllerRespondInClosedStateCodeLength = 641; -static const JSC::Intrinsic s_readableByteStreamInternalsReadableByteStreamControllerRespondInClosedStateCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_readableByteStreamInternalsReadableByteStreamControllerRespondInClosedStateCode = "(function (controller, firstDescriptor) {\"use strict\";\n if (firstDescriptor.buffer = @transferBufferToCurrentRealm(firstDescriptor.buffer), @readableStreamHasBYOBReader(@getByIdDirectPrivate(controller, \"controlledReadableStream\")))\n while (@getByIdDirectPrivate(@getByIdDirectPrivate(@getByIdDirectPrivate(controller, \"controlledReadableStream\"), \"reader\"), \"readIntoRequests\")\?.isNotEmpty()) {\n let pullIntoDescriptor = @readableByteStreamControllerShiftPendingDescriptor(controller);\n @readableByteStreamControllerCommitDescriptor(@getByIdDirectPrivate(controller, \"controlledReadableStream\"), pullIntoDescriptor);\n }\n})\n"; +// readableStreamReaderGenericRelease +const JSC::ConstructAbility s_readableStreamInternalsReadableStreamReaderGenericReleaseCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; +const JSC::ConstructorKind s_readableStreamInternalsReadableStreamReaderGenericReleaseCodeConstructorKind = JSC::ConstructorKind::None; +const JSC::ImplementationVisibility s_readableStreamInternalsReadableStreamReaderGenericReleaseCodeImplementationVisibility = JSC::ImplementationVisibility::Public; +const int s_readableStreamInternalsReadableStreamReaderGenericReleaseCodeLength = 749; +static const JSC::Intrinsic s_readableStreamInternalsReadableStreamReaderGenericReleaseCodeIntrinsic = JSC::NoIntrinsic; +const char* const s_readableStreamInternalsReadableStreamReaderGenericReleaseCode = "(function (reader) {\"use strict\";\n if (@getByIdDirectPrivate(@getByIdDirectPrivate(reader, \"ownerReadableStream\"), \"state\") === 4)\n @getByIdDirectPrivate(reader, \"closedPromiseCapability\").reject.@call(@undefined, @makeTypeError(\"releasing lock of reader whose stream is still in readable state\"));\n else\n @putByIdDirectPrivate(reader, \"closedPromiseCapability\", {\n promise: @newHandledRejectedPromise(@makeTypeError(\"reader released lock\"))\n });\n const promise = @getByIdDirectPrivate(reader, \"closedPromiseCapability\").promise;\n @markPromiseAsHandled(promise), @putByIdDirectPrivate(@getByIdDirectPrivate(reader, \"ownerReadableStream\"), \"reader\", @undefined), @putByIdDirectPrivate(reader, \"ownerReadableStream\", @undefined);\n})\n"; -// readableByteStreamControllerProcessPullDescriptors -const JSC::ConstructAbility s_readableByteStreamInternalsReadableByteStreamControllerProcessPullDescriptorsCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; -const JSC::ConstructorKind s_readableByteStreamInternalsReadableByteStreamControllerProcessPullDescriptorsCodeConstructorKind = JSC::ConstructorKind::None; -const JSC::ImplementationVisibility s_readableByteStreamInternalsReadableByteStreamControllerProcessPullDescriptorsCodeImplementationVisibility = JSC::ImplementationVisibility::Public; -const int s_readableByteStreamInternalsReadableByteStreamControllerProcessPullDescriptorsCodeLength = 587; -static const JSC::Intrinsic s_readableByteStreamInternalsReadableByteStreamControllerProcessPullDescriptorsCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_readableByteStreamInternalsReadableByteStreamControllerProcessPullDescriptorsCode = "(function (controller) {\"use strict\";\n while (@getByIdDirectPrivate(controller, \"pendingPullIntos\").isNotEmpty()) {\n if (@getByIdDirectPrivate(controller, \"queue\").size === 0)\n return;\n let pullIntoDescriptor = @getByIdDirectPrivate(controller, \"pendingPullIntos\").peek();\n if (@readableByteStreamControllerFillDescriptorFromQueue(controller, pullIntoDescriptor))\n @readableByteStreamControllerShiftPendingDescriptor(controller), @readableByteStreamControllerCommitDescriptor(@getByIdDirectPrivate(controller, \"controlledReadableStream\"), pullIntoDescriptor);\n }\n})\n"; +// readableStreamDefaultControllerCanCloseOrEnqueue +const JSC::ConstructAbility s_readableStreamInternalsReadableStreamDefaultControllerCanCloseOrEnqueueCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; +const JSC::ConstructorKind s_readableStreamInternalsReadableStreamDefaultControllerCanCloseOrEnqueueCodeConstructorKind = JSC::ConstructorKind::None; +const JSC::ImplementationVisibility s_readableStreamInternalsReadableStreamDefaultControllerCanCloseOrEnqueueCodeImplementationVisibility = JSC::ImplementationVisibility::Public; +const int s_readableStreamInternalsReadableStreamDefaultControllerCanCloseOrEnqueueCodeLength = 207; +static const JSC::Intrinsic s_readableStreamInternalsReadableStreamDefaultControllerCanCloseOrEnqueueCodeIntrinsic = JSC::NoIntrinsic; +const char* const s_readableStreamInternalsReadableStreamDefaultControllerCanCloseOrEnqueueCode = "(function (controller) {\"use strict\";\n return !@getByIdDirectPrivate(controller, \"closeRequested\") && @getByIdDirectPrivate(@getByIdDirectPrivate(controller, \"controlledReadableStream\"), \"state\") === 4;\n})\n"; -// readableByteStreamControllerFillDescriptorFromQueue -const JSC::ConstructAbility s_readableByteStreamInternalsReadableByteStreamControllerFillDescriptorFromQueueCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; -const JSC::ConstructorKind s_readableByteStreamInternalsReadableByteStreamControllerFillDescriptorFromQueueCodeConstructorKind = JSC::ConstructorKind::None; -const JSC::ImplementationVisibility s_readableByteStreamInternalsReadableByteStreamControllerFillDescriptorFromQueueCodeImplementationVisibility = JSC::ImplementationVisibility::Public; -const int s_readableByteStreamInternalsReadableByteStreamControllerFillDescriptorFromQueueCodeLength = 1695; -static const JSC::Intrinsic s_readableByteStreamInternalsReadableByteStreamControllerFillDescriptorFromQueueCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_readableByteStreamInternalsReadableByteStreamControllerFillDescriptorFromQueueCode = "(function (controller, pullIntoDescriptor) {\"use strict\";\n const currentAlignedBytes = pullIntoDescriptor.bytesFilled - pullIntoDescriptor.bytesFilled % pullIntoDescriptor.elementSize, maxBytesToCopy = @getByIdDirectPrivate(controller, \"queue\").size < pullIntoDescriptor.byteLength - pullIntoDescriptor.bytesFilled \? @getByIdDirectPrivate(controller, \"queue\").size : pullIntoDescriptor.byteLength - pullIntoDescriptor.bytesFilled, maxBytesFilled = pullIntoDescriptor.bytesFilled + maxBytesToCopy, maxAlignedBytes = maxBytesFilled - maxBytesFilled % pullIntoDescriptor.elementSize;\n let totalBytesToCopyRemaining = maxBytesToCopy, ready = !1;\n if (maxAlignedBytes > currentAlignedBytes)\n totalBytesToCopyRemaining = maxAlignedBytes - pullIntoDescriptor.bytesFilled, ready = !0;\n while (totalBytesToCopyRemaining > 0) {\n let headOfQueue = @getByIdDirectPrivate(controller, \"queue\").content.peek();\n const bytesToCopy = totalBytesToCopyRemaining < headOfQueue.byteLength \? totalBytesToCopyRemaining : headOfQueue.byteLength, destStart = pullIntoDescriptor.byteOffset + pullIntoDescriptor.bytesFilled;\n if (new @Uint8Array(pullIntoDescriptor.buffer).set(new @Uint8Array(headOfQueue.buffer, headOfQueue.byteOffset, bytesToCopy), destStart), headOfQueue.byteLength === bytesToCopy)\n @getByIdDirectPrivate(controller, \"queue\").content.shift();\n else\n headOfQueue.byteOffset += bytesToCopy, headOfQueue.byteLength -= bytesToCopy;\n @getByIdDirectPrivate(controller, \"queue\").size -= bytesToCopy, @readableByteStreamControllerInvalidateBYOBRequest(controller), pullIntoDescriptor.bytesFilled += bytesToCopy, totalBytesToCopyRemaining -= bytesToCopy;\n }\n return ready;\n})\n"; +// lazyLoadStream +const JSC::ConstructAbility s_readableStreamInternalsLazyLoadStreamCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; +const JSC::ConstructorKind s_readableStreamInternalsLazyLoadStreamCodeConstructorKind = JSC::ConstructorKind::None; +const JSC::ImplementationVisibility s_readableStreamInternalsLazyLoadStreamCodeImplementationVisibility = JSC::ImplementationVisibility::Public; +const int s_readableStreamInternalsLazyLoadStreamCodeLength = 3907; +static const JSC::Intrinsic s_readableStreamInternalsLazyLoadStreamCodeIntrinsic = JSC::NoIntrinsic; +const char* const s_readableStreamInternalsLazyLoadStreamCode = "(function (stream, autoAllocateChunkSize) {\"use strict\";\n var nativeType = @getByIdDirectPrivate(stream, \"bunNativeType\"), nativePtr = @getByIdDirectPrivate(stream, \"bunNativePtr\"), Prototype = @lazyStreamPrototypeMap.@get(nativeType);\n if (Prototype === @undefined) {\n let handleNativeReadableStreamPromiseResult2 = function(val) {\n var { c, v } = this;\n this.c = @undefined, this.v = @undefined, handleResult(val, c, v);\n }, callClose2 = function(controller) {\n try {\n if (@getByIdDirectPrivate(@getByIdDirectPrivate(controller, \"controlledReadableStream\"), \"state\") === 4)\n controller.close();\n } catch (e) {\n globalThis.reportError(e);\n }\n }, createResult2 = function(tag, controller, view, closer2) {\n closer2[0] = !1;\n var result;\n try {\n result = pull(tag, view, closer2);\n } catch (err) {\n return controller.error(err);\n }\n return handleResult(result, controller, view);\n };\n var handleNativeReadableStreamPromiseResult = handleNativeReadableStreamPromiseResult2, callClose = callClose2, createResult = createResult2, [pull, start, cancel, setClose, deinit, setRefOrUnref, drain] = @lazy(nativeType), closer = [!1], handleResult;\n handleResult = function handleResult(result, controller, view) {\n if (result && @isPromise(result))\n return result.then(handleNativeReadableStreamPromiseResult2.bind({\n c: controller,\n v: view\n }), (err) => controller.error(err));\n else if (typeof result === \"number\")\n if (view && view.byteLength === result && view.buffer === controller.byobRequest\?.view\?.buffer)\n controller.byobRequest.respondWithNewView(view);\n else\n controller.byobRequest.respond(result);\n else if (result.constructor === @Uint8Array)\n controller.enqueue(result);\n if (closer[0] || result === !1)\n @enqueueJob(callClose2, controller), closer[0] = !1;\n };\n const registry = deinit \? new FinalizationRegistry(deinit) : null;\n Prototype = class NativeReadableStreamSource {\n constructor(tag, autoAllocateChunkSize2, drainValue2) {\n if (this.#tag = tag, this.#cancellationToken = {}, this.pull = this.#pull.bind(this), this.cancel = this.#cancel.bind(this), this.autoAllocateChunkSize = autoAllocateChunkSize2, drainValue2 !== @undefined)\n this.start = (controller) => {\n controller.enqueue(drainValue2);\n };\n if (registry)\n registry.register(this, tag, this.#cancellationToken);\n }\n #cancellationToken;\n pull;\n cancel;\n start;\n #tag;\n type = \"bytes\";\n autoAllocateChunkSize = 0;\n static startSync = start;\n #pull(controller) {\n var tag = this.#tag;\n if (!tag) {\n controller.close();\n return;\n }\n createResult2(tag, controller, controller.byobRequest.view, closer);\n }\n #cancel(reason) {\n var tag = this.#tag;\n registry && registry.unregister(this.#cancellationToken), setRefOrUnref && setRefOrUnref(tag, !1), cancel(tag, reason);\n }\n static deinit = deinit;\n static drain = drain;\n }, @lazyStreamPrototypeMap.@set(nativeType, Prototype);\n }\n const chunkSize = Prototype.startSync(nativePtr, autoAllocateChunkSize);\n var drainValue;\n const { drain: drainFn, deinit: deinitFn } = Prototype;\n if (drainFn)\n drainValue = drainFn(nativePtr);\n if (chunkSize === 0) {\n if (deinit && nativePtr && @enqueueJob(deinit, nativePtr), (drainValue\?.byteLength \?\? 0) > 0)\n return {\n start(controller) {\n controller.enqueue(drainValue), controller.close();\n },\n type: \"bytes\"\n };\n return {\n start(controller) {\n controller.close();\n },\n type: \"bytes\"\n };\n }\n return new Prototype(nativePtr, chunkSize, drainValue);\n})\n"; -// readableByteStreamControllerShiftPendingDescriptor -const JSC::ConstructAbility s_readableByteStreamInternalsReadableByteStreamControllerShiftPendingDescriptorCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; -const JSC::ConstructorKind s_readableByteStreamInternalsReadableByteStreamControllerShiftPendingDescriptorCodeConstructorKind = JSC::ConstructorKind::None; -const JSC::ImplementationVisibility s_readableByteStreamInternalsReadableByteStreamControllerShiftPendingDescriptorCodeImplementationVisibility = JSC::ImplementationVisibility::Public; -const int s_readableByteStreamInternalsReadableByteStreamControllerShiftPendingDescriptorCodeLength = 208; -static const JSC::Intrinsic s_readableByteStreamInternalsReadableByteStreamControllerShiftPendingDescriptorCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_readableByteStreamInternalsReadableByteStreamControllerShiftPendingDescriptorCode = "(function (controller) {\"use strict\";\n let descriptor = @getByIdDirectPrivate(controller, \"pendingPullIntos\").shift();\n return @readableByteStreamControllerInvalidateBYOBRequest(controller), descriptor;\n})\n"; +// readableStreamIntoArray +const JSC::ConstructAbility s_readableStreamInternalsReadableStreamIntoArrayCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; +const JSC::ConstructorKind s_readableStreamInternalsReadableStreamIntoArrayCodeConstructorKind = JSC::ConstructorKind::None; +const JSC::ImplementationVisibility s_readableStreamInternalsReadableStreamIntoArrayCodeImplementationVisibility = JSC::ImplementationVisibility::Public; +const int s_readableStreamInternalsReadableStreamIntoArrayCodeLength = 536; +static const JSC::Intrinsic s_readableStreamInternalsReadableStreamIntoArrayCodeIntrinsic = JSC::NoIntrinsic; +const char* const s_readableStreamInternalsReadableStreamIntoArrayCode = "(function (stream) {\"use strict\";\n var reader = stream.getReader(), manyResult = reader.readMany();\n async function processManyResult(result) {\n if (result.done)\n return [];\n var chunks = result.value || [];\n while (!0) {\n var thisResult = await reader.read();\n if (thisResult.done)\n break;\n chunks = chunks.concat(thisResult.value);\n }\n return chunks;\n }\n if (manyResult && @isPromise(manyResult))\n return manyResult.@then(processManyResult);\n return processManyResult(manyResult);\n})\n"; -// readableByteStreamControllerInvalidateBYOBRequest -const JSC::ConstructAbility s_readableByteStreamInternalsReadableByteStreamControllerInvalidateBYOBRequestCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; -const JSC::ConstructorKind s_readableByteStreamInternalsReadableByteStreamControllerInvalidateBYOBRequestCodeConstructorKind = JSC::ConstructorKind::None; -const JSC::ImplementationVisibility s_readableByteStreamInternalsReadableByteStreamControllerInvalidateBYOBRequestCodeImplementationVisibility = JSC::ImplementationVisibility::Public; -const int s_readableByteStreamInternalsReadableByteStreamControllerInvalidateBYOBRequestCodeLength = 406; -static const JSC::Intrinsic s_readableByteStreamInternalsReadableByteStreamControllerInvalidateBYOBRequestCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_readableByteStreamInternalsReadableByteStreamControllerInvalidateBYOBRequestCode = "(function (controller) {\"use strict\";\n if (@getByIdDirectPrivate(controller, \"byobRequest\") === @undefined)\n return;\n const byobRequest = @getByIdDirectPrivate(controller, \"byobRequest\");\n @putByIdDirectPrivate(byobRequest, \"associatedReadableByteStreamController\", @undefined), @putByIdDirectPrivate(byobRequest, \"view\", @undefined), @putByIdDirectPrivate(controller, \"byobRequest\", @undefined);\n})\n"; +// readableStreamIntoText +const JSC::ConstructAbility s_readableStreamInternalsReadableStreamIntoTextCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; +const JSC::ConstructorKind s_readableStreamInternalsReadableStreamIntoTextCodeConstructorKind = JSC::ConstructorKind::None; +const JSC::ImplementationVisibility s_readableStreamInternalsReadableStreamIntoTextCodeImplementationVisibility = JSC::ImplementationVisibility::Public; +const int s_readableStreamInternalsReadableStreamIntoTextCodeLength = 302; +static const JSC::Intrinsic s_readableStreamInternalsReadableStreamIntoTextCodeIntrinsic = JSC::NoIntrinsic; +const char* const s_readableStreamInternalsReadableStreamIntoTextCode = "(function (stream) {\"use strict\";\n const [textStream, closer] = @createTextStream(@getByIdDirectPrivate(stream, \"highWaterMark\")), prom = @readStreamIntoSink(stream, textStream, !1);\n if (prom && @isPromise(prom))\n return @Promise.@resolve(prom).@then(closer.promise);\n return closer.promise;\n})\n"; -// readableByteStreamControllerCommitDescriptor -const JSC::ConstructAbility s_readableByteStreamInternalsReadableByteStreamControllerCommitDescriptorCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; -const JSC::ConstructorKind s_readableByteStreamInternalsReadableByteStreamControllerCommitDescriptorCodeConstructorKind = JSC::ConstructorKind::None; -const JSC::ImplementationVisibility s_readableByteStreamInternalsReadableByteStreamControllerCommitDescriptorCodeImplementationVisibility = JSC::ImplementationVisibility::Public; -const int s_readableByteStreamInternalsReadableByteStreamControllerCommitDescriptorCodeLength = 420; -static const JSC::Intrinsic s_readableByteStreamInternalsReadableByteStreamControllerCommitDescriptorCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_readableByteStreamInternalsReadableByteStreamControllerCommitDescriptorCode = "(function (stream, pullIntoDescriptor) {\"use strict\";\n let done = !1;\n if (@getByIdDirectPrivate(stream, \"state\") === 1)\n done = !0;\n let filledView = @readableByteStreamControllerConvertDescriptor(pullIntoDescriptor);\n if (pullIntoDescriptor.readerType === \"default\")\n @readableStreamFulfillReadRequest(stream, filledView, done);\n else\n @readableStreamFulfillReadIntoRequest(stream, filledView, done);\n})\n"; +// readableStreamToArrayBufferDirect +const JSC::ConstructAbility s_readableStreamInternalsReadableStreamToArrayBufferDirectCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; +const JSC::ConstructorKind s_readableStreamInternalsReadableStreamToArrayBufferDirectCodeConstructorKind = JSC::ConstructorKind::None; +const JSC::ImplementationVisibility s_readableStreamInternalsReadableStreamToArrayBufferDirectCodeImplementationVisibility = JSC::ImplementationVisibility::Public; +const int s_readableStreamInternalsReadableStreamToArrayBufferDirectCodeLength = 1422; +static const JSC::Intrinsic s_readableStreamInternalsReadableStreamToArrayBufferDirectCodeIntrinsic = JSC::NoIntrinsic; +const char* const s_readableStreamInternalsReadableStreamToArrayBufferDirectCode = "(function (stream, underlyingSource) {\"use strict\";\n var sink = new Bun.ArrayBufferSink;\n @putByIdDirectPrivate(stream, \"underlyingSource\", @undefined);\n var highWaterMark = @getByIdDirectPrivate(stream, \"highWaterMark\");\n sink.start(highWaterMark \? { highWaterMark } : {});\n var capability = @newPromiseCapability(@Promise), ended = !1, pull = underlyingSource.pull, close = underlyingSource.close, controller = {\n start() {\n },\n close(reason) {\n if (!ended) {\n if (ended = !0, close)\n close();\n @fulfillPromise(capability.promise, sink.end());\n }\n },\n end() {\n if (!ended) {\n if (ended = !0, close)\n close();\n @fulfillPromise(capability.promise, sink.end());\n }\n },\n flush() {\n return 0;\n },\n write: sink.write.bind(sink)\n }, didError = !1;\n try {\n const firstPull = pull(controller);\n if (firstPull && @isObject(firstPull) && @isPromise(firstPull))\n return async function(controller2, promise2, pull2) {\n while (!ended)\n await pull2(controller2);\n return await promise2;\n }(controller, promise, pull);\n return capability.promise;\n } catch (e) {\n return didError = !0, @readableStreamError(stream, e), @Promise.@reject(e);\n } finally {\n if (!didError && stream)\n @readableStreamClose(stream);\n controller = close = sink = pull = stream = @undefined;\n }\n})\n"; -// readableByteStreamControllerConvertDescriptor -const JSC::ConstructAbility s_readableByteStreamInternalsReadableByteStreamControllerConvertDescriptorCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; -const JSC::ConstructorKind s_readableByteStreamInternalsReadableByteStreamControllerConvertDescriptorCodeConstructorKind = JSC::ConstructorKind::None; -const JSC::ImplementationVisibility s_readableByteStreamInternalsReadableByteStreamControllerConvertDescriptorCodeImplementationVisibility = JSC::ImplementationVisibility::Public; -const int s_readableByteStreamInternalsReadableByteStreamControllerConvertDescriptorCodeLength = 210; -static const JSC::Intrinsic s_readableByteStreamInternalsReadableByteStreamControllerConvertDescriptorCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_readableByteStreamInternalsReadableByteStreamControllerConvertDescriptorCode = "(function (pullIntoDescriptor) {\"use strict\";\n return new pullIntoDescriptor.ctor(pullIntoDescriptor.buffer, pullIntoDescriptor.byteOffset, pullIntoDescriptor.bytesFilled / pullIntoDescriptor.elementSize);\n})\n"; +// readableStreamToTextDirect +const JSC::ConstructAbility s_readableStreamInternalsReadableStreamToTextDirectCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; +const JSC::ConstructorKind s_readableStreamInternalsReadableStreamToTextDirectCodeConstructorKind = JSC::ConstructorKind::None; +const JSC::ImplementationVisibility s_readableStreamInternalsReadableStreamToTextDirectCodeImplementationVisibility = JSC::ImplementationVisibility::Public; +const int s_readableStreamInternalsReadableStreamToTextDirectCodeLength = 450; +static const JSC::Intrinsic s_readableStreamInternalsReadableStreamToTextDirectCodeIntrinsic = JSC::NoIntrinsic; +const char* const s_readableStreamInternalsReadableStreamToTextDirectCode = "(async function (stream, underlyingSource) {\"use strict\";\n const capability = @initializeTextStream.@call(stream, underlyingSource, @undefined);\n var reader = stream.getReader();\n while (@getByIdDirectPrivate(stream, \"state\") === 4) {\n var thisResult = await reader.read();\n if (thisResult.done)\n break;\n }\n try {\n reader.releaseLock();\n } catch (e) {\n }\n return reader = @undefined, stream = @undefined, capability.promise;\n})\n"; -// readableStreamFulfillReadIntoRequest -const JSC::ConstructAbility s_readableByteStreamInternalsReadableStreamFulfillReadIntoRequestCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; -const JSC::ConstructorKind s_readableByteStreamInternalsReadableStreamFulfillReadIntoRequestCodeConstructorKind = JSC::ConstructorKind::None; -const JSC::ImplementationVisibility s_readableByteStreamInternalsReadableStreamFulfillReadIntoRequestCodeImplementationVisibility = JSC::ImplementationVisibility::Public; -const int s_readableByteStreamInternalsReadableStreamFulfillReadIntoRequestCodeLength = 228; -static const JSC::Intrinsic s_readableByteStreamInternalsReadableStreamFulfillReadIntoRequestCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_readableByteStreamInternalsReadableStreamFulfillReadIntoRequestCode = "(function (stream, chunk, done) {\"use strict\";\n const readIntoRequest = @getByIdDirectPrivate(@getByIdDirectPrivate(stream, \"reader\"), \"readIntoRequests\").shift();\n @fulfillPromise(readIntoRequest, { value: chunk, done });\n})\n"; +// readableStreamToArrayDirect +const JSC::ConstructAbility s_readableStreamInternalsReadableStreamToArrayDirectCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; +const JSC::ConstructorKind s_readableStreamInternalsReadableStreamToArrayDirectCodeConstructorKind = JSC::ConstructorKind::None; +const JSC::ImplementationVisibility s_readableStreamInternalsReadableStreamToArrayDirectCodeImplementationVisibility = JSC::ImplementationVisibility::Public; +const int s_readableStreamInternalsReadableStreamToArrayDirectCodeLength = 603; +static const JSC::Intrinsic s_readableStreamInternalsReadableStreamToArrayDirectCodeIntrinsic = JSC::NoIntrinsic; +const char* const s_readableStreamInternalsReadableStreamToArrayDirectCode = "(async function (stream, underlyingSource) {\"use strict\";\n const capability = @initializeArrayStream.@call(stream, underlyingSource, @undefined);\n underlyingSource = @undefined;\n var reader = stream.getReader();\n try {\n while (@getByIdDirectPrivate(stream, \"state\") === 4) {\n var thisResult = await reader.read();\n if (thisResult.done)\n break;\n }\n try {\n reader.releaseLock();\n } catch (e) {\n }\n return reader = @undefined, @Promise.@resolve(capability.promise);\n } catch (e) {\n throw e;\n } finally {\n stream = @undefined, reader = @undefined;\n }\n})\n"; -// readableStreamBYOBReaderRead -const JSC::ConstructAbility s_readableByteStreamInternalsReadableStreamBYOBReaderReadCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; -const JSC::ConstructorKind s_readableByteStreamInternalsReadableStreamBYOBReaderReadCodeConstructorKind = JSC::ConstructorKind::None; -const JSC::ImplementationVisibility s_readableByteStreamInternalsReadableStreamBYOBReaderReadCodeImplementationVisibility = JSC::ImplementationVisibility::Public; -const int s_readableByteStreamInternalsReadableStreamBYOBReaderReadCodeLength = 402; -static const JSC::Intrinsic s_readableByteStreamInternalsReadableStreamBYOBReaderReadCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_readableByteStreamInternalsReadableStreamBYOBReaderReadCode = "(function (reader, view) {\"use strict\";\n const stream = @getByIdDirectPrivate(reader, \"ownerReadableStream\");\n if (@putByIdDirectPrivate(stream, \"disturbed\", !0), @getByIdDirectPrivate(stream, \"state\") === 3)\n return @Promise.@reject(@getByIdDirectPrivate(stream, \"storedError\"));\n return @readableByteStreamControllerPullInto(@getByIdDirectPrivate(stream, \"readableStreamController\"), view);\n})\n"; +// readableStreamDefineLazyIterators +const JSC::ConstructAbility s_readableStreamInternalsReadableStreamDefineLazyIteratorsCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; +const JSC::ConstructorKind s_readableStreamInternalsReadableStreamDefineLazyIteratorsCodeConstructorKind = JSC::ConstructorKind::None; +const JSC::ImplementationVisibility s_readableStreamInternalsReadableStreamDefineLazyIteratorsCodeImplementationVisibility = JSC::ImplementationVisibility::Public; +const int s_readableStreamInternalsReadableStreamDefineLazyIteratorsCodeLength = 1190; +static const JSC::Intrinsic s_readableStreamInternalsReadableStreamDefineLazyIteratorsCodeIntrinsic = JSC::NoIntrinsic; +const char* const s_readableStreamInternalsReadableStreamDefineLazyIteratorsCode = "(function (prototype) {\"use strict\";\n var asyncIterator = globalThis.Symbol.asyncIterator, ReadableStreamAsyncIterator = async function* ReadableStreamAsyncIterator(stream, preventCancel) {\n var reader = stream.getReader(), deferredError;\n try {\n while (!0) {\n var done, value;\n const firstResult = reader.readMany();\n if (@isPromise(firstResult))\n ({ done, value } = await firstResult);\n else\n ({ done, value } = firstResult);\n if (done)\n return;\n yield* value;\n }\n } catch (e) {\n deferredError = e;\n } finally {\n if (reader.releaseLock(), !preventCancel)\n stream.cancel(deferredError);\n if (deferredError)\n throw deferredError;\n }\n }, createAsyncIterator = function asyncIterator() {\n return ReadableStreamAsyncIterator(this, !1);\n }, createValues = function values({ preventCancel = !1 } = { preventCancel: !1 }) {\n return ReadableStreamAsyncIterator(this, preventCancel);\n };\n return @Object.@defineProperty(prototype, asyncIterator, { value: createAsyncIterator }), @Object.@defineProperty(prototype, \"values\", { value: createValues }), prototype;\n})\n"; -// readableByteStreamControllerPullInto -const JSC::ConstructAbility s_readableByteStreamInternalsReadableByteStreamControllerPullIntoCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; -const JSC::ConstructorKind s_readableByteStreamInternalsReadableByteStreamControllerPullIntoCodeConstructorKind = JSC::ConstructorKind::None; -const JSC::ImplementationVisibility s_readableByteStreamInternalsReadableByteStreamControllerPullIntoCodeImplementationVisibility = JSC::ImplementationVisibility::Public; -const int s_readableByteStreamInternalsReadableByteStreamControllerPullIntoCodeLength = 1871; -static const JSC::Intrinsic s_readableByteStreamInternalsReadableByteStreamControllerPullIntoCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_readableByteStreamInternalsReadableByteStreamControllerPullIntoCode = "(function (controller, view) {\"use strict\";\n const stream = @getByIdDirectPrivate(controller, \"controlledReadableStream\");\n let elementSize = 1;\n if (view.BYTES_PER_ELEMENT !== @undefined)\n elementSize = view.BYTES_PER_ELEMENT;\n const ctor = view.constructor, pullIntoDescriptor = {\n buffer: view.buffer,\n byteOffset: view.byteOffset,\n byteLength: view.byteLength,\n bytesFilled: 0,\n elementSize,\n ctor,\n readerType: \"byob\"\n };\n var pending = @getByIdDirectPrivate(controller, \"pendingPullIntos\");\n if (pending\?.isNotEmpty())\n return pullIntoDescriptor.buffer = @transferBufferToCurrentRealm(pullIntoDescriptor.buffer), pending.push(pullIntoDescriptor), @readableStreamAddReadIntoRequest(stream);\n if (@getByIdDirectPrivate(stream, \"state\") === 1) {\n const emptyView = new ctor(pullIntoDescriptor.buffer, pullIntoDescriptor.byteOffset, 0);\n return @createFulfilledPromise({ value: emptyView, done: !0 });\n }\n if (@getByIdDirectPrivate(controller, \"queue\").size > 0) {\n if (@readableByteStreamControllerFillDescriptorFromQueue(controller, pullIntoDescriptor)) {\n const filledView = @readableByteStreamControllerConvertDescriptor(pullIntoDescriptor);\n return @readableByteStreamControllerHandleQueueDrain(controller), @createFulfilledPromise({ value: filledView, done: !1 });\n }\n if (@getByIdDirectPrivate(controller, \"closeRequested\")) {\n const e = @makeTypeError(\"Closing stream has been requested\");\n return @readableByteStreamControllerError(controller, e), @Promise.@reject(e);\n }\n }\n pullIntoDescriptor.buffer = @transferBufferToCurrentRealm(pullIntoDescriptor.buffer), @getByIdDirectPrivate(controller, \"pendingPullIntos\").push(pullIntoDescriptor);\n const promise = @readableStreamAddReadIntoRequest(stream);\n return @readableByteStreamControllerCallPullIfNeeded(controller), promise;\n})\n"; +#define DEFINE_BUILTIN_GENERATOR(codeName, functionName, overriddenName, argumentCount) \ +JSC::FunctionExecutable* codeName##Generator(JSC::VM& vm) \ +{\ + JSVMClientData* clientData = static_cast(vm.clientData); \ + return clientData->builtinFunctions().readableStreamInternalsBuiltins().codeName##Executable()->link(vm, nullptr, clientData->builtinFunctions().readableStreamInternalsBuiltins().codeName##Source(), std::nullopt, s_##codeName##Intrinsic); \ +} +WEBCORE_FOREACH_READABLESTREAMINTERNALS_BUILTIN_CODE(DEFINE_BUILTIN_GENERATOR) +#undef DEFINE_BUILTIN_GENERATOR -// readableStreamAddReadIntoRequest -const JSC::ConstructAbility s_readableByteStreamInternalsReadableStreamAddReadIntoRequestCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; -const JSC::ConstructorKind s_readableByteStreamInternalsReadableStreamAddReadIntoRequestCodeConstructorKind = JSC::ConstructorKind::None; -const JSC::ImplementationVisibility s_readableByteStreamInternalsReadableStreamAddReadIntoRequestCodeImplementationVisibility = JSC::ImplementationVisibility::Public; -const int s_readableByteStreamInternalsReadableStreamAddReadIntoRequestCodeLength = 198; -static const JSC::Intrinsic s_readableByteStreamInternalsReadableStreamAddReadIntoRequestCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_readableByteStreamInternalsReadableStreamAddReadIntoRequestCode = "(function (stream) {\"use strict\";\n const readRequest = @newPromise();\n return @getByIdDirectPrivate(@getByIdDirectPrivate(stream, \"reader\"), \"readIntoRequests\").push(readRequest), readRequest;\n})\n"; +/* UtilInspect.ts */ +// getStylizeWithColor +const JSC::ConstructAbility s_utilInspectGetStylizeWithColorCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; +const JSC::ConstructorKind s_utilInspectGetStylizeWithColorCodeConstructorKind = JSC::ConstructorKind::None; +const JSC::ImplementationVisibility s_utilInspectGetStylizeWithColorCodeImplementationVisibility = JSC::ImplementationVisibility::Public; +const int s_utilInspectGetStylizeWithColorCodeLength = 329; +static const JSC::Intrinsic s_utilInspectGetStylizeWithColorCodeIntrinsic = JSC::NoIntrinsic; +const char* const s_utilInspectGetStylizeWithColorCode = "(function (inspect) {\"use strict\";\n return function stylizeWithColor(str, styleType) {\n const style = inspect.styles[styleType];\n if (style !== @undefined) {\n const color = inspect.colors[style];\n if (color !== @undefined)\n return `\\x1B[${color[0]}m${str}\\x1B[${color[1]}m`;\n }\n return str;\n };\n})\n"; + +// stylizeWithNoColor +const JSC::ConstructAbility s_utilInspectStylizeWithNoColorCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; +const JSC::ConstructorKind s_utilInspectStylizeWithNoColorCodeConstructorKind = JSC::ConstructorKind::None; +const JSC::ImplementationVisibility s_utilInspectStylizeWithNoColorCodeImplementationVisibility = JSC::ImplementationVisibility::Public; +const int s_utilInspectStylizeWithNoColorCodeLength = 48; +static const JSC::Intrinsic s_utilInspectStylizeWithNoColorCodeIntrinsic = JSC::NoIntrinsic; +const char* const s_utilInspectStylizeWithNoColorCode = "(function (str) {\"use strict\";\n return str;\n})\n"; #define DEFINE_BUILTIN_GENERATOR(codeName, functionName, overriddenName, argumentCount) \ JSC::FunctionExecutable* codeName##Generator(JSC::VM& vm) \ {\ JSVMClientData* clientData = static_cast(vm.clientData); \ - return clientData->builtinFunctions().readableByteStreamInternalsBuiltins().codeName##Executable()->link(vm, nullptr, clientData->builtinFunctions().readableByteStreamInternalsBuiltins().codeName##Source(), std::nullopt, s_##codeName##Intrinsic); \ + return clientData->builtinFunctions().utilInspectBuiltins().codeName##Executable()->link(vm, nullptr, clientData->builtinFunctions().utilInspectBuiltins().codeName##Source(), std::nullopt, s_##codeName##Intrinsic); \ } -WEBCORE_FOREACH_READABLEBYTESTREAMINTERNALS_BUILTIN_CODE(DEFINE_BUILTIN_GENERATOR) +WEBCORE_FOREACH_UTILINSPECT_BUILTIN_CODE(DEFINE_BUILTIN_GENERATOR) #undef DEFINE_BUILTIN_GENERATOR /* WritableStreamDefaultController.ts */ @@ -2995,33 +3013,15 @@ JSC::FunctionExecutable* codeName##Generator(JSC::VM& vm) \ WEBCORE_FOREACH_WRITABLESTREAMDEFAULTCONTROLLER_BUILTIN_CODE(DEFINE_BUILTIN_GENERATOR) #undef DEFINE_BUILTIN_GENERATOR -/* EventSource.ts */ -// getEventSource -const JSC::ConstructAbility s_eventSourceGetEventSourceCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; -const JSC::ConstructorKind s_eventSourceGetEventSourceCodeConstructorKind = JSC::ConstructorKind::None; -const JSC::ImplementationVisibility s_eventSourceGetEventSourceCodeImplementationVisibility = JSC::ImplementationVisibility::Public; -const int s_eventSourceGetEventSourceCodeLength = 12373; -static const JSC::Intrinsic s_eventSourceGetEventSourceCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_eventSourceGetEventSourceCode = "(function () {\"use strict\";\n\n class EventSource extends EventTarget {\n #url;\n #state;\n #onerror;\n #onmessage;\n #onopen;\n #is_tls = !1;\n #socket = null;\n #data_buffer = \"\";\n #send_buffer = \"\";\n #lastEventID = \"\";\n #reconnect = !0;\n #content_length = 0;\n #received_length = 0;\n #reconnection_time = 0;\n #reconnection_timer = null;\n static #ConnectNextTick(self) {\n self.#connect();\n }\n static #SendRequest(socket, url) {\n const self = socket.data, last_event_header = self.#lastEventID \? `Last-Event-ID: ${self.#lastEventID}\\r\\n` : \"\", request = `GET ${url.pathname}${url.search} HTTP/1.1\\r\\nHost: bun\\r\\nContent-type: text/event-stream\\r\\nContent-length: 0\\r\\n${last_event_header}\\r\\n`, sended = socket.write(request);\n if (sended !== request.length)\n self.#send_buffer = request.substring(sended);\n }\n static #ProcessChunk(self, chunks, offset) {\n for (;; ) {\n if (offset >= chunks.length)\n return;\n let chunk_end_idx = -1, start_idx = chunks.indexOf(\"\\r\\n\", offset);\n const chunk_start_idx = start_idx + 2;\n if (start_idx > 0)\n if (self.#content_length === 0) {\n const chunk_size = parseInt(chunks.substring(offset, start_idx), 16);\n if (chunk_size === 0) {\n self.#state = 2, self.#socket\?.end();\n return;\n }\n chunk_end_idx = chunk_start_idx + chunk_size;\n } else\n chunk_end_idx = chunks.length;\n else {\n if (self.#data_buffer.length === 0) {\n self.#data_buffer += chunks.substring(offset);\n return;\n }\n chunk_end_idx = chunks.length;\n }\n let chunk = chunks.substring(chunk_start_idx, chunk_end_idx);\n offset = chunk_end_idx + 2;\n let chunk_offset = 0, event_idx = chunk.indexOf(\"\\n\\n\");\n if (event_idx == -1) {\n self.#data_buffer += chunks.substring(chunk_start_idx);\n return;\n }\n if (self.#data_buffer.length)\n self.#data_buffer += chunk, chunk = self.#data_buffer, self.#data_buffer = \"\";\n let more_events = !0;\n while (more_events) {\n const event_data = chunk.substring(chunk_offset, event_idx);\n let type, data = \"\", id, event_line_idx = 0, retry = -1;\n for (;; ) {\n let idx = event_data.indexOf(\"\\n\", event_line_idx);\n if (idx === -1) {\n if (event_line_idx >= event_data.length)\n break;\n idx = event_data.length;\n }\n const line = event_data.substring(event_line_idx, idx);\n if (line.startsWith(\"data:\"))\n if (data.length)\n data += `\\n${line.substring(5).trim()}`;\n else\n data = line.substring(5).trim();\n else if (line.startsWith(\"event:\"))\n type = line.substring(6).trim();\n else if (line.startsWith(\"id:\"))\n id = line.substring(3).trim();\n else if (line.startsWith(\"retry:\")) {\n if (retry = parseInt(line.substring(6).trim(), 10), retry !== retry)\n retry = -1;\n }\n event_line_idx = idx + 1;\n }\n if (self.#lastEventID = id || \"\", retry >= 0)\n self.#reconnection_time = retry;\n if (data || id || type)\n self.dispatchEvent(new MessageEvent(type || \"message\", {\n data: data || \"\",\n origin: self.#url.origin,\n source: self,\n lastEventId: id\n }));\n if (chunk.length === event_idx + 2) {\n more_events = !1;\n break;\n }\n const next_event_idx = chunk.indexOf(\"\\n\\n\", event_idx + 1);\n if (next_event_idx === -1)\n break;\n chunk_offset = event_idx, event_idx = next_event_idx;\n }\n }\n }\n static #Handlers = {\n open(socket) {\n const self = socket.data;\n if (self.#socket = socket, !self.#is_tls)\n EventSource.#SendRequest(socket, self.#url);\n },\n handshake(socket, success, verifyError) {\n const self = socket.data;\n if (success)\n EventSource.#SendRequest(socket, self.#url);\n else\n self.#state = 2, self.dispatchEvent(new ErrorEvent(\"error\", { error: verifyError })), socket.end();\n },\n data(socket, buffer) {\n const self = socket.data;\n switch (self.#state) {\n case 0: {\n let text = buffer.toString();\n const headers_idx = text.indexOf(\"\\r\\n\\r\\n\");\n if (headers_idx === -1) {\n self.#data_buffer += text;\n return;\n }\n if (self.#data_buffer.length)\n self.#data_buffer += text, text = self.#data_buffer, self.#data_buffer = \"\";\n const headers = text.substring(0, headers_idx), status_idx = headers.indexOf(\"\\r\\n\");\n if (status_idx === -1) {\n self.#state = 2, self.dispatchEvent(new ErrorEvent(\"error\", { error: new Error(\"Invalid HTTP request\") })), socket.end();\n return;\n }\n const status = headers.substring(0, status_idx);\n if (status !== \"HTTP/1.1 200 OK\") {\n self.#state = 2, self.dispatchEvent(new ErrorEvent(\"error\", { error: new Error(status) })), socket.end();\n return;\n }\n let start_idx = status_idx + 1, mime_type_ok = !1, content_length = -1;\n for (;; ) {\n let header_idx = headers.indexOf(\"\\r\\n\", start_idx);\n if (header_idx === -1) {\n if (start_idx >= headers.length) {\n if (!mime_type_ok)\n self.#state = 2, self.dispatchEvent(new ErrorEvent(\"error\", {\n error: new Error(`EventSource's response has no MIME type and \"text/event-stream\" is required. Aborting the connection.`)\n })), socket.end();\n return;\n }\n header_idx = headers.length;\n }\n const header = headers.substring(start_idx + 1, header_idx), header_name_idx = header.indexOf(\":\"), header_name = header.substring(0, header_name_idx), is_content_type = header_name.localeCompare(\"content-type\", @undefined, { sensitivity: \"accent\" }) === 0;\n if (start_idx = header_idx + 1, is_content_type)\n if (header.endsWith(\" text/event-stream\"))\n mime_type_ok = !0;\n else {\n self.#state = 2, self.dispatchEvent(new ErrorEvent(\"error\", {\n error: new Error(`EventSource's response has a MIME type that is not \"text/event-stream\". Aborting the connection.`)\n })), socket.end();\n return;\n }\n else if (header_name.localeCompare(\"content-length\", @undefined, { sensitivity: \"accent\" }) === 0) {\n if (content_length = parseInt(header.substring(header_name_idx + 1).trim(), 10), content_length !== content_length || content_length <= 0) {\n self.dispatchEvent(new ErrorEvent(\"error\", {\n error: new Error(\"EventSource's Content-Length is invalid. Aborting the connection.\")\n })), socket.end();\n return;\n }\n if (mime_type_ok)\n break;\n } else if (header_name.localeCompare(\"transfer-encoding\", @undefined, { sensitivity: \"accent\" }) === 0) {\n if (header.substring(header_name_idx + 1).trim() !== \"chunked\") {\n self.dispatchEvent(new ErrorEvent(\"error\", {\n error: new Error(\"EventSource's Transfer-Encoding is invalid. Aborting the connection.\")\n })), socket.end();\n return;\n }\n if (content_length = 0, mime_type_ok)\n break;\n }\n }\n self.#content_length = content_length, self.#state = 1, self.dispatchEvent(new Event(\"open\"));\n const chunks = text.substring(headers_idx + 4);\n if (EventSource.#ProcessChunk(self, chunks, 0), self.#content_length > 0) {\n if (self.#received_length += chunks.length, self.#received_length >= self.#content_length)\n self.#state = 2, socket.end();\n }\n return;\n }\n case 1:\n if (EventSource.#ProcessChunk(self, buffer.toString(), 2), self.#content_length > 0) {\n if (self.#received_length += buffer.byteLength, self.#received_length >= self.#content_length)\n self.#state = 2, socket.end();\n }\n return;\n default:\n break;\n }\n },\n drain(socket) {\n const self = socket.data;\n if (self.#state === 0) {\n const request = self.#data_buffer;\n if (request.length) {\n const sended = socket.write(request);\n if (sended !== request.length)\n socket.data.#send_buffer = request.substring(sended);\n else\n socket.data.#send_buffer = \"\";\n }\n }\n },\n close: EventSource.#Close,\n end(socket) {\n EventSource.#Close(socket).dispatchEvent(new ErrorEvent(\"error\", { error: new Error(\"Connection closed by server\") }));\n },\n timeout(socket) {\n EventSource.#Close(socket).dispatchEvent(new ErrorEvent(\"error\", { error: new Error(\"Timeout\") }));\n },\n binaryType: \"buffer\"\n };\n static #Close(socket) {\n const self = socket.data;\n if (self.#socket = null, self.#received_length = 0, self.#state = 2, self.#reconnect) {\n if (self.#reconnection_timer)\n clearTimeout(self.#reconnection_timer);\n self.#reconnection_timer = setTimeout(EventSource.#ConnectNextTick, self.#reconnection_time, self);\n }\n return self;\n }\n constructor(url, options = @undefined) {\n super();\n const uri = new URL(url);\n this.#is_tls = uri.protocol === \"https:\", this.#url = uri, this.#state = 2, process.nextTick(EventSource.#ConnectNextTick, this);\n }\n ref() {\n this.#reconnection_timer\?.ref(), this.#socket\?.ref();\n }\n unref() {\n this.#reconnection_timer\?.unref(), this.#socket\?.unref();\n }\n #connect() {\n if (this.#state !== 2)\n return;\n const uri = this.#url, is_tls = this.#is_tls;\n this.#state = 0, Bun.connect({\n data: this,\n socket: EventSource.#Handlers,\n hostname: uri.hostname,\n port: parseInt(uri.port || (is_tls \? \"443\" : \"80\"), 10),\n tls: is_tls \? {\n requestCert: !0,\n rejectUnauthorized: !1\n } : !1\n }).catch((err) => {\n if (super.dispatchEvent(new ErrorEvent(\"error\", { error: err })), this.#reconnect) {\n if (this.#reconnection_timer)\n this.#reconnection_timer.unref\?.();\n this.#reconnection_timer = setTimeout(EventSource.#ConnectNextTick, 1000, this);\n }\n });\n }\n get url() {\n return this.#url.href;\n }\n get readyState() {\n return this.#state;\n }\n close() {\n this.#reconnect = !1, this.#state = 2, this.#socket\?.unref(), this.#socket\?.end();\n }\n get onopen() {\n return this.#onopen;\n }\n get onerror() {\n return this.#onerror;\n }\n get onmessage() {\n return this.#onmessage;\n }\n set onopen(cb) {\n if (this.#onopen)\n super.removeEventListener(\"close\", this.#onopen);\n super.addEventListener(\"open\", cb), this.#onopen = cb;\n }\n set onerror(cb) {\n if (this.#onerror)\n super.removeEventListener(\"error\", this.#onerror);\n super.addEventListener(\"error\", cb), this.#onerror = cb;\n }\n set onmessage(cb) {\n if (this.#onmessage)\n super.removeEventListener(\"message\", this.#onmessage);\n super.addEventListener(\"message\", cb), this.#onmessage = cb;\n }\n }\n return Object.defineProperty(EventSource.prototype, \"CONNECTING\", {\n enumerable: !0,\n value: 0\n }), Object.defineProperty(EventSource.prototype, \"OPEN\", {\n enumerable: !0,\n value: 1\n }), Object.defineProperty(EventSource.prototype, \"CLOSED\", {\n enumerable: !0,\n value: 2\n }), EventSource;\n})\n"; - -#define DEFINE_BUILTIN_GENERATOR(codeName, functionName, overriddenName, argumentCount) \ -JSC::FunctionExecutable* codeName##Generator(JSC::VM& vm) \ -{\ - JSVMClientData* clientData = static_cast(vm.clientData); \ - return clientData->builtinFunctions().eventSourceBuiltins().codeName##Executable()->link(vm, nullptr, clientData->builtinFunctions().eventSourceBuiltins().codeName##Source(), std::nullopt, s_##codeName##Intrinsic); \ -} -WEBCORE_FOREACH_EVENTSOURCE_BUILTIN_CODE(DEFINE_BUILTIN_GENERATOR) -#undef DEFINE_BUILTIN_GENERATOR - JSBuiltinInternalFunctions::JSBuiltinInternalFunctions(JSC::VM& vm) : m_vm(vm) + , m_readableByteStreamInternals(vm) , m_writableStreamInternals(vm) , m_transformStreamInternals(vm) - , m_readableStreamInternals(vm) , m_streamInternals(vm) - , m_readableByteStreamInternals(vm) + , m_readableStreamInternals(vm) { UNUSED_PARAM(vm); @@ -3030,11 +3030,11 @@ JSBuiltinInternalFunctions::JSBuiltinInternalFunctions(JSC::VM& vm) template void JSBuiltinInternalFunctions::visit(Visitor& visitor) { + m_readableByteStreamInternals.visit(visitor); m_writableStreamInternals.visit(visitor); m_transformStreamInternals.visit(visitor); - m_readableStreamInternals.visit(visitor); m_streamInternals.visit(visitor); - m_readableByteStreamInternals.visit(visitor); + m_readableStreamInternals.visit(visitor); UNUSED_PARAM(visitor); } @@ -3045,15 +3045,20 @@ template void JSBuiltinInternalFunctions::visit(SlotVisitor&); SUPPRESS_ASAN void JSBuiltinInternalFunctions::initialize(Zig::GlobalObject& globalObject) { UNUSED_PARAM(globalObject); + m_readableByteStreamInternals.init(globalObject); m_writableStreamInternals.init(globalObject); m_transformStreamInternals.init(globalObject); - m_readableStreamInternals.init(globalObject); m_streamInternals.init(globalObject); - m_readableByteStreamInternals.init(globalObject); + m_readableStreamInternals.init(globalObject); JSVMClientData& clientData = *static_cast(m_vm.clientData); Zig::GlobalObject::GlobalPropertyInfo staticGlobals[] = { #define DECLARE_GLOBAL_STATIC(name) \ + Zig::GlobalObject::GlobalPropertyInfo( \ + clientData.builtinFunctions().readableByteStreamInternalsBuiltins().name##PrivateName(), readableByteStreamInternals().m_##name##Function.get() , JSC::PropertyAttribute::DontDelete | JSC::PropertyAttribute::ReadOnly), + WEBCORE_FOREACH_READABLEBYTESTREAMINTERNALS_BUILTIN_FUNCTION_NAME(DECLARE_GLOBAL_STATIC) + #undef DECLARE_GLOBAL_STATIC + #define DECLARE_GLOBAL_STATIC(name) \ Zig::GlobalObject::GlobalPropertyInfo( \ clientData.builtinFunctions().writableStreamInternalsBuiltins().name##PrivateName(), writableStreamInternals().m_##name##Function.get() , JSC::PropertyAttribute::DontDelete | JSC::PropertyAttribute::ReadOnly), WEBCORE_FOREACH_WRITABLESTREAMINTERNALS_BUILTIN_FUNCTION_NAME(DECLARE_GLOBAL_STATIC) @@ -3063,11 +3068,6 @@ SUPPRESS_ASAN void JSBuiltinInternalFunctions::initialize(Zig::GlobalObject& glo clientData.builtinFunctions().transformStreamInternalsBuiltins().name##PrivateName(), transformStreamInternals().m_##name##Function.get() , JSC::PropertyAttribute::DontDelete | JSC::PropertyAttribute::ReadOnly), WEBCORE_FOREACH_TRANSFORMSTREAMINTERNALS_BUILTIN_FUNCTION_NAME(DECLARE_GLOBAL_STATIC) #undef DECLARE_GLOBAL_STATIC - #define DECLARE_GLOBAL_STATIC(name) \ - Zig::GlobalObject::GlobalPropertyInfo( \ - clientData.builtinFunctions().readableStreamInternalsBuiltins().name##PrivateName(), readableStreamInternals().m_##name##Function.get() , JSC::PropertyAttribute::DontDelete | JSC::PropertyAttribute::ReadOnly), - WEBCORE_FOREACH_READABLESTREAMINTERNALS_BUILTIN_FUNCTION_NAME(DECLARE_GLOBAL_STATIC) - #undef DECLARE_GLOBAL_STATIC #define DECLARE_GLOBAL_STATIC(name) \ Zig::GlobalObject::GlobalPropertyInfo( \ clientData.builtinFunctions().streamInternalsBuiltins().name##PrivateName(), streamInternals().m_##name##Function.get() , JSC::PropertyAttribute::DontDelete | JSC::PropertyAttribute::ReadOnly), @@ -3075,8 +3075,8 @@ SUPPRESS_ASAN void JSBuiltinInternalFunctions::initialize(Zig::GlobalObject& glo #undef DECLARE_GLOBAL_STATIC #define DECLARE_GLOBAL_STATIC(name) \ Zig::GlobalObject::GlobalPropertyInfo( \ - clientData.builtinFunctions().readableByteStreamInternalsBuiltins().name##PrivateName(), readableByteStreamInternals().m_##name##Function.get() , JSC::PropertyAttribute::DontDelete | JSC::PropertyAttribute::ReadOnly), - WEBCORE_FOREACH_READABLEBYTESTREAMINTERNALS_BUILTIN_FUNCTION_NAME(DECLARE_GLOBAL_STATIC) + clientData.builtinFunctions().readableStreamInternalsBuiltins().name##PrivateName(), readableStreamInternals().m_##name##Function.get() , JSC::PropertyAttribute::DontDelete | JSC::PropertyAttribute::ReadOnly), + WEBCORE_FOREACH_READABLESTREAMINTERNALS_BUILTIN_FUNCTION_NAME(DECLARE_GLOBAL_STATIC) #undef DECLARE_GLOBAL_STATIC }; diff --git a/src/js/out/WebCoreJSBuiltins.d.ts b/src/js/out/WebCoreJSBuiltins.d.ts index b05f2b681..e196affc1 100644 --- a/src/js/out/WebCoreJSBuiltins.d.ts +++ b/src/js/out/WebCoreJSBuiltins.d.ts @@ -2,6 +2,44 @@ // Do not edit by hand. type RemoveThis = F extends (this: infer T, ...args: infer A) => infer R ? (...args: A) => R : F; +// ReadableByteStreamInternals.ts +declare const $privateInitializeReadableByteStreamController: RemoveThis; +declare const $readableStreamByteStreamControllerStart: RemoveThis; +declare const $privateInitializeReadableStreamBYOBRequest: RemoveThis; +declare const $isReadableByteStreamController: RemoveThis; +declare const $isReadableStreamBYOBRequest: RemoveThis; +declare const $isReadableStreamBYOBReader: RemoveThis; +declare const $readableByteStreamControllerCancel: RemoveThis; +declare const $readableByteStreamControllerError: RemoveThis; +declare const $readableByteStreamControllerClose: RemoveThis; +declare const $readableByteStreamControllerClearPendingPullIntos: RemoveThis; +declare const $readableByteStreamControllerGetDesiredSize: RemoveThis; +declare const $readableStreamHasBYOBReader: RemoveThis; +declare const $readableStreamHasDefaultReader: RemoveThis; +declare const $readableByteStreamControllerHandleQueueDrain: RemoveThis; +declare const $readableByteStreamControllerPull: RemoveThis; +declare const $readableByteStreamControllerShouldCallPull: RemoveThis; +declare const $readableByteStreamControllerCallPullIfNeeded: RemoveThis; +declare const $transferBufferToCurrentRealm: RemoveThis; +declare const $readableStreamReaderKind: RemoveThis; +declare const $readableByteStreamControllerEnqueue: RemoveThis; +declare const $readableByteStreamControllerEnqueueChunk: RemoveThis; +declare const $readableByteStreamControllerRespondWithNewView: RemoveThis; +declare const $readableByteStreamControllerRespond: RemoveThis; +declare const $readableByteStreamControllerRespondInternal: RemoveThis; +declare const $readableByteStreamControllerRespondInReadableState: RemoveThis; +declare const $readableByteStreamControllerRespondInClosedState: RemoveThis; +declare const $readableByteStreamControllerProcessPullDescriptors: RemoveThis; +declare const $readableByteStreamControllerFillDescriptorFromQueue: RemoveThis; +declare const $readableByteStreamControllerShiftPendingDescriptor: RemoveThis; +declare const $readableByteStreamControllerInvalidateBYOBRequest: RemoveThis; +declare const $readableByteStreamControllerCommitDescriptor: RemoveThis; +declare const $readableByteStreamControllerConvertDescriptor: RemoveThis; +declare const $readableStreamFulfillReadIntoRequest: RemoveThis; +declare const $readableStreamBYOBReaderRead: RemoveThis; +declare const $readableByteStreamControllerPullInto: RemoveThis; +declare const $readableStreamAddReadIntoRequest: RemoveThis; + // WritableStreamInternals.ts declare const $isWritableStream: RemoveThis; declare const $isWritableStreamDefaultWriter: RemoveThis; @@ -73,6 +111,27 @@ declare const $transformStreamDefaultSinkAbortAlgorithm: RemoveThis; declare const $transformStreamDefaultSourcePullAlgorithm: RemoveThis; +// StreamInternals.ts +declare const $markPromiseAsHandled: RemoveThis; +declare const $shieldingPromiseResolve: RemoveThis; +declare const $promiseInvokeOrNoopMethodNoCatch: RemoveThis; +declare const $promiseInvokeOrNoopNoCatch: RemoveThis; +declare const $promiseInvokeOrNoopMethod: RemoveThis; +declare const $promiseInvokeOrNoop: RemoveThis; +declare const $promiseInvokeOrFallbackOrNoop: RemoveThis; +declare const $validateAndNormalizeQueuingStrategy: RemoveThis; +declare const $createFIFO: RemoveThis; +declare const $newQueue: RemoveThis; +declare const $dequeueValue: RemoveThis; +declare const $enqueueValueWithSize: RemoveThis; +declare const $peekQueueValue: RemoveThis; +declare const $resetQueue: RemoveThis; +declare const $extractSizeAlgorithm: RemoveThis; +declare const $extractHighWaterMark: RemoveThis; +declare const $extractHighWaterMarkFromQueuingStrategyInit: RemoveThis; +declare const $createFulfilledPromise: RemoveThis; +declare const $toDictionary: RemoveThis; + // ReadableStreamInternals.ts declare const $readableStreamReaderGenericInitialize: RemoveThis; declare const $privateInitializeReadableStreamDefaultController: RemoveThis; @@ -138,62 +197,3 @@ declare const $readableStreamToArrayBufferDirect: RemoveThis; declare const $readableStreamToArrayDirect: RemoveThis; declare const $readableStreamDefineLazyIterators: RemoveThis; - -// StreamInternals.ts -declare const $markPromiseAsHandled: RemoveThis; -declare const $shieldingPromiseResolve: RemoveThis; -declare const $promiseInvokeOrNoopMethodNoCatch: RemoveThis; -declare const $promiseInvokeOrNoopNoCatch: RemoveThis; -declare const $promiseInvokeOrNoopMethod: RemoveThis; -declare const $promiseInvokeOrNoop: RemoveThis; -declare const $promiseInvokeOrFallbackOrNoop: RemoveThis; -declare const $validateAndNormalizeQueuingStrategy: RemoveThis; -declare const $createFIFO: RemoveThis; -declare const $newQueue: RemoveThis; -declare const $dequeueValue: RemoveThis; -declare const $enqueueValueWithSize: RemoveThis; -declare const $peekQueueValue: RemoveThis; -declare const $resetQueue: RemoveThis; -declare const $extractSizeAlgorithm: RemoveThis; -declare const $extractHighWaterMark: RemoveThis; -declare const $extractHighWaterMarkFromQueuingStrategyInit: RemoveThis; -declare const $createFulfilledPromise: RemoveThis; -declare const $toDictionary: RemoveThis; - -// ReadableByteStreamInternals.ts -declare const $privateInitializeReadableByteStreamController: RemoveThis; -declare const $readableStreamByteStreamControllerStart: RemoveThis; -declare const $privateInitializeReadableStreamBYOBRequest: RemoveThis; -declare const $isReadableByteStreamController: RemoveThis; -declare const $isReadableStreamBYOBRequest: RemoveThis; -declare const $isReadableStreamBYOBReader: RemoveThis; -declare const $readableByteStreamControllerCancel: RemoveThis; -declare const $readableByteStreamControllerError: RemoveThis; -declare const $readableByteStreamControllerClose: RemoveThis; -declare const $readableByteStreamControllerClearPendingPullIntos: RemoveThis; -declare const $readableByteStreamControllerGetDesiredSize: RemoveThis; -declare const $readableStreamHasBYOBReader: RemoveThis; -declare const $readableStreamHasDefaultReader: RemoveThis; -declare const $readableByteStreamControllerHandleQueueDrain: RemoveThis; -declare const $readableByteStreamControllerPull: RemoveThis; -declare const $readableByteStreamControllerShouldCallPull: RemoveThis; -declare const $readableByteStreamControllerCallPullIfNeeded: RemoveThis; -declare const $transferBufferToCurrentRealm: RemoveThis; -declare const $readableStreamReaderKind: RemoveThis; -declare const $readableByteStreamControllerEnqueue: RemoveThis; -declare const $readableByteStreamControllerEnqueueChunk: RemoveThis; -declare const $readableByteStreamControllerRespondWithNewView: RemoveThis; -declare const $readableByteStreamControllerRespond: RemoveThis; -declare const $readableByteStreamControllerRespondInternal: RemoveThis; -declare const $readableByteStreamControllerRespondInReadableState: RemoveThis; -declare const $readableByteStreamControllerRespondInClosedState: RemoveThis; -declare const $readableByteStreamControllerProcessPullDescriptors: RemoveThis; -declare const $readableByteStreamControllerFillDescriptorFromQueue: RemoveThis; -declare const $readableByteStreamControllerShiftPendingDescriptor: RemoveThis; -declare const $readableByteStreamControllerInvalidateBYOBRequest: RemoveThis; -declare const $readableByteStreamControllerCommitDescriptor: RemoveThis; -declare const $readableByteStreamControllerConvertDescriptor: RemoveThis; -declare const $readableStreamFulfillReadIntoRequest: RemoveThis; -declare const $readableStreamBYOBReaderRead: RemoveThis; -declare const $readableByteStreamControllerPullInto: RemoveThis; -declare const $readableStreamAddReadIntoRequest: RemoveThis; diff --git a/src/js/out/WebCoreJSBuiltins.h b/src/js/out/WebCoreJSBuiltins.h index 08945eff1..f920df4b6 100644 --- a/src/js/out/WebCoreJSBuiltins.h +++ b/src/js/out/WebCoreJSBuiltins.h @@ -15,59 +15,59 @@ class FunctionExecutable; } namespace WebCore { -/* BundlerPlugin.ts */ -// runSetupFunction -#define WEBCORE_BUILTIN_BUNDLERPLUGIN_RUNSETUPFUNCTION 1 -extern const char* const s_bundlerPluginRunSetupFunctionCode; -extern const int s_bundlerPluginRunSetupFunctionCodeLength; -extern const JSC::ConstructAbility s_bundlerPluginRunSetupFunctionCodeConstructAbility; -extern const JSC::ConstructorKind s_bundlerPluginRunSetupFunctionCodeConstructorKind; -extern const JSC::ImplementationVisibility s_bundlerPluginRunSetupFunctionCodeImplementationVisibility; +/* CountQueuingStrategy.ts */ +// highWaterMark +#define WEBCORE_BUILTIN_COUNTQUEUINGSTRATEGY_HIGHWATERMARK 1 +extern const char* const s_countQueuingStrategyHighWaterMarkCode; +extern const int s_countQueuingStrategyHighWaterMarkCodeLength; +extern const JSC::ConstructAbility s_countQueuingStrategyHighWaterMarkCodeConstructAbility; +extern const JSC::ConstructorKind s_countQueuingStrategyHighWaterMarkCodeConstructorKind; +extern const JSC::ImplementationVisibility s_countQueuingStrategyHighWaterMarkCodeImplementationVisibility; -// runOnResolvePlugins -#define WEBCORE_BUILTIN_BUNDLERPLUGIN_RUNONRESOLVEPLUGINS 1 -extern const char* const s_bundlerPluginRunOnResolvePluginsCode; -extern const int s_bundlerPluginRunOnResolvePluginsCodeLength; -extern const JSC::ConstructAbility s_bundlerPluginRunOnResolvePluginsCodeConstructAbility; -extern const JSC::ConstructorKind s_bundlerPluginRunOnResolvePluginsCodeConstructorKind; -extern const JSC::ImplementationVisibility s_bundlerPluginRunOnResolvePluginsCodeImplementationVisibility; +// size +#define WEBCORE_BUILTIN_COUNTQUEUINGSTRATEGY_SIZE 1 +extern const char* const s_countQueuingStrategySizeCode; +extern const int s_countQueuingStrategySizeCodeLength; +extern const JSC::ConstructAbility s_countQueuingStrategySizeCodeConstructAbility; +extern const JSC::ConstructorKind s_countQueuingStrategySizeCodeConstructorKind; +extern const JSC::ImplementationVisibility s_countQueuingStrategySizeCodeImplementationVisibility; -// runOnLoadPlugins -#define WEBCORE_BUILTIN_BUNDLERPLUGIN_RUNONLOADPLUGINS 1 -extern const char* const s_bundlerPluginRunOnLoadPluginsCode; -extern const int s_bundlerPluginRunOnLoadPluginsCodeLength; -extern const JSC::ConstructAbility s_bundlerPluginRunOnLoadPluginsCodeConstructAbility; -extern const JSC::ConstructorKind s_bundlerPluginRunOnLoadPluginsCodeConstructorKind; -extern const JSC::ImplementationVisibility s_bundlerPluginRunOnLoadPluginsCodeImplementationVisibility; +// initializeCountQueuingStrategy +#define WEBCORE_BUILTIN_COUNTQUEUINGSTRATEGY_INITIALIZECOUNTQUEUINGSTRATEGY 1 +extern const char* const s_countQueuingStrategyInitializeCountQueuingStrategyCode; +extern const int s_countQueuingStrategyInitializeCountQueuingStrategyCodeLength; +extern const JSC::ConstructAbility s_countQueuingStrategyInitializeCountQueuingStrategyCodeConstructAbility; +extern const JSC::ConstructorKind s_countQueuingStrategyInitializeCountQueuingStrategyCodeConstructorKind; +extern const JSC::ImplementationVisibility s_countQueuingStrategyInitializeCountQueuingStrategyCodeImplementationVisibility; -#define WEBCORE_FOREACH_BUNDLERPLUGIN_BUILTIN_DATA(macro) \ - macro(runSetupFunction, bundlerPluginRunSetupFunction, 2) \ - macro(runOnResolvePlugins, bundlerPluginRunOnResolvePlugins, 5) \ - macro(runOnLoadPlugins, bundlerPluginRunOnLoadPlugins, 4) \ +#define WEBCORE_FOREACH_COUNTQUEUINGSTRATEGY_BUILTIN_DATA(macro) \ + macro(highWaterMark, countQueuingStrategyHighWaterMark, 0) \ + macro(size, countQueuingStrategySize, 0) \ + macro(initializeCountQueuingStrategy, countQueuingStrategyInitializeCountQueuingStrategy, 1) \ -#define WEBCORE_FOREACH_BUNDLERPLUGIN_BUILTIN_CODE(macro) \ - macro(bundlerPluginRunSetupFunctionCode, runSetupFunction, ASCIILiteral(), s_bundlerPluginRunSetupFunctionCodeLength) \ - macro(bundlerPluginRunOnResolvePluginsCode, runOnResolvePlugins, ASCIILiteral(), s_bundlerPluginRunOnResolvePluginsCodeLength) \ - macro(bundlerPluginRunOnLoadPluginsCode, runOnLoadPlugins, ASCIILiteral(), s_bundlerPluginRunOnLoadPluginsCodeLength) \ +#define WEBCORE_FOREACH_COUNTQUEUINGSTRATEGY_BUILTIN_CODE(macro) \ + macro(countQueuingStrategyHighWaterMarkCode, highWaterMark, "get highWaterMark"_s, s_countQueuingStrategyHighWaterMarkCodeLength) \ + macro(countQueuingStrategySizeCode, size, ASCIILiteral(), s_countQueuingStrategySizeCodeLength) \ + macro(countQueuingStrategyInitializeCountQueuingStrategyCode, initializeCountQueuingStrategy, ASCIILiteral(), s_countQueuingStrategyInitializeCountQueuingStrategyCodeLength) \ -#define WEBCORE_FOREACH_BUNDLERPLUGIN_BUILTIN_FUNCTION_NAME(macro) \ - macro(runSetupFunction) \ - macro(runOnResolvePlugins) \ - macro(runOnLoadPlugins) \ +#define WEBCORE_FOREACH_COUNTQUEUINGSTRATEGY_BUILTIN_FUNCTION_NAME(macro) \ + macro(highWaterMark) \ + macro(size) \ + macro(initializeCountQueuingStrategy) \ #define DECLARE_BUILTIN_GENERATOR(codeName, functionName, overriddenName, argumentCount) \ JSC::FunctionExecutable* codeName##Generator(JSC::VM&); -WEBCORE_FOREACH_BUNDLERPLUGIN_BUILTIN_CODE(DECLARE_BUILTIN_GENERATOR) +WEBCORE_FOREACH_COUNTQUEUINGSTRATEGY_BUILTIN_CODE(DECLARE_BUILTIN_GENERATOR) #undef DECLARE_BUILTIN_GENERATOR -class BundlerPluginBuiltinsWrapper : private JSC::WeakHandleOwner { +class CountQueuingStrategyBuiltinsWrapper : private JSC::WeakHandleOwner { public: - explicit BundlerPluginBuiltinsWrapper(JSC::VM& vm) + explicit CountQueuingStrategyBuiltinsWrapper(JSC::VM& vm) : m_vm(vm) - WEBCORE_FOREACH_BUNDLERPLUGIN_BUILTIN_FUNCTION_NAME(INITIALIZE_BUILTIN_NAMES) + WEBCORE_FOREACH_COUNTQUEUINGSTRATEGY_BUILTIN_FUNCTION_NAME(INITIALIZE_BUILTIN_NAMES) #define INITIALIZE_BUILTIN_SOURCE_MEMBERS(name, functionName, overriddenName, length) , m_##name##Source(JSC::makeSource(StringImpl::createWithoutCopying(s_##name, length), { }, JSC::SourceTaintedOrigin::Untainted)) - WEBCORE_FOREACH_BUNDLERPLUGIN_BUILTIN_CODE(INITIALIZE_BUILTIN_SOURCE_MEMBERS) + WEBCORE_FOREACH_COUNTQUEUINGSTRATEGY_BUILTIN_CODE(INITIALIZE_BUILTIN_SOURCE_MEMBERS) #undef INITIALIZE_BUILTIN_SOURCE_MEMBERS { } @@ -75,28 +75,28 @@ public: #define EXPOSE_BUILTIN_EXECUTABLES(name, functionName, overriddenName, length) \ JSC::UnlinkedFunctionExecutable* name##Executable(); \ const JSC::SourceCode& name##Source() const { return m_##name##Source; } - WEBCORE_FOREACH_BUNDLERPLUGIN_BUILTIN_CODE(EXPOSE_BUILTIN_EXECUTABLES) + WEBCORE_FOREACH_COUNTQUEUINGSTRATEGY_BUILTIN_CODE(EXPOSE_BUILTIN_EXECUTABLES) #undef EXPOSE_BUILTIN_EXECUTABLES - WEBCORE_FOREACH_BUNDLERPLUGIN_BUILTIN_FUNCTION_NAME(DECLARE_BUILTIN_IDENTIFIER_ACCESSOR) + WEBCORE_FOREACH_COUNTQUEUINGSTRATEGY_BUILTIN_FUNCTION_NAME(DECLARE_BUILTIN_IDENTIFIER_ACCESSOR) void exportNames(); private: JSC::VM& m_vm; - WEBCORE_FOREACH_BUNDLERPLUGIN_BUILTIN_FUNCTION_NAME(DECLARE_BUILTIN_NAMES) + WEBCORE_FOREACH_COUNTQUEUINGSTRATEGY_BUILTIN_FUNCTION_NAME(DECLARE_BUILTIN_NAMES) #define DECLARE_BUILTIN_SOURCE_MEMBERS(name, functionName, overriddenName, length) \ JSC::SourceCode m_##name##Source;\ JSC::Weak m_##name##Executable; - WEBCORE_FOREACH_BUNDLERPLUGIN_BUILTIN_CODE(DECLARE_BUILTIN_SOURCE_MEMBERS) + WEBCORE_FOREACH_COUNTQUEUINGSTRATEGY_BUILTIN_CODE(DECLARE_BUILTIN_SOURCE_MEMBERS) #undef DECLARE_BUILTIN_SOURCE_MEMBERS }; #define DEFINE_BUILTIN_EXECUTABLES(name, functionName, overriddenName, length) \ -inline JSC::UnlinkedFunctionExecutable* BundlerPluginBuiltinsWrapper::name##Executable() \ +inline JSC::UnlinkedFunctionExecutable* CountQueuingStrategyBuiltinsWrapper::name##Executable() \ {\ if (!m_##name##Executable) {\ JSC::Identifier executableName = functionName##PublicName();\ @@ -106,13 +106,13 @@ inline JSC::UnlinkedFunctionExecutable* BundlerPluginBuiltinsWrapper::name##Exec }\ return m_##name##Executable.get();\ } -WEBCORE_FOREACH_BUNDLERPLUGIN_BUILTIN_CODE(DEFINE_BUILTIN_EXECUTABLES) +WEBCORE_FOREACH_COUNTQUEUINGSTRATEGY_BUILTIN_CODE(DEFINE_BUILTIN_EXECUTABLES) #undef DEFINE_BUILTIN_EXECUTABLES -inline void BundlerPluginBuiltinsWrapper::exportNames() +inline void CountQueuingStrategyBuiltinsWrapper::exportNames() { #define EXPORT_FUNCTION_NAME(name) m_vm.propertyNames->appendExternalName(name##PublicName(), name##PrivateName()); - WEBCORE_FOREACH_BUNDLERPLUGIN_BUILTIN_FUNCTION_NAME(EXPORT_FUNCTION_NAME) + WEBCORE_FOREACH_COUNTQUEUINGSTRATEGY_BUILTIN_FUNCTION_NAME(EXPORT_FUNCTION_NAME) #undef EXPORT_FUNCTION_NAME } /* ByteLengthQueuingStrategy.ts */ @@ -215,615 +215,627 @@ inline void ByteLengthQueuingStrategyBuiltinsWrapper::exportNames() WEBCORE_FOREACH_BYTELENGTHQUEUINGSTRATEGY_BUILTIN_FUNCTION_NAME(EXPORT_FUNCTION_NAME) #undef EXPORT_FUNCTION_NAME } -/* WritableStreamInternals.ts */ -// isWritableStream -#define WEBCORE_BUILTIN_WRITABLESTREAMINTERNALS_ISWRITABLESTREAM 1 -extern const char* const s_writableStreamInternalsIsWritableStreamCode; -extern const int s_writableStreamInternalsIsWritableStreamCodeLength; -extern const JSC::ConstructAbility s_writableStreamInternalsIsWritableStreamCodeConstructAbility; -extern const JSC::ConstructorKind s_writableStreamInternalsIsWritableStreamCodeConstructorKind; -extern const JSC::ImplementationVisibility s_writableStreamInternalsIsWritableStreamCodeImplementationVisibility; +/* WritableStreamDefaultWriter.ts */ +// initializeWritableStreamDefaultWriter +#define WEBCORE_BUILTIN_WRITABLESTREAMDEFAULTWRITER_INITIALIZEWRITABLESTREAMDEFAULTWRITER 1 +extern const char* const s_writableStreamDefaultWriterInitializeWritableStreamDefaultWriterCode; +extern const int s_writableStreamDefaultWriterInitializeWritableStreamDefaultWriterCodeLength; +extern const JSC::ConstructAbility s_writableStreamDefaultWriterInitializeWritableStreamDefaultWriterCodeConstructAbility; +extern const JSC::ConstructorKind s_writableStreamDefaultWriterInitializeWritableStreamDefaultWriterCodeConstructorKind; +extern const JSC::ImplementationVisibility s_writableStreamDefaultWriterInitializeWritableStreamDefaultWriterCodeImplementationVisibility; -// isWritableStreamDefaultWriter -#define WEBCORE_BUILTIN_WRITABLESTREAMINTERNALS_ISWRITABLESTREAMDEFAULTWRITER 1 -extern const char* const s_writableStreamInternalsIsWritableStreamDefaultWriterCode; -extern const int s_writableStreamInternalsIsWritableStreamDefaultWriterCodeLength; -extern const JSC::ConstructAbility s_writableStreamInternalsIsWritableStreamDefaultWriterCodeConstructAbility; -extern const JSC::ConstructorKind s_writableStreamInternalsIsWritableStreamDefaultWriterCodeConstructorKind; -extern const JSC::ImplementationVisibility s_writableStreamInternalsIsWritableStreamDefaultWriterCodeImplementationVisibility; +// closed +#define WEBCORE_BUILTIN_WRITABLESTREAMDEFAULTWRITER_CLOSED 1 +extern const char* const s_writableStreamDefaultWriterClosedCode; +extern const int s_writableStreamDefaultWriterClosedCodeLength; +extern const JSC::ConstructAbility s_writableStreamDefaultWriterClosedCodeConstructAbility; +extern const JSC::ConstructorKind s_writableStreamDefaultWriterClosedCodeConstructorKind; +extern const JSC::ImplementationVisibility s_writableStreamDefaultWriterClosedCodeImplementationVisibility; -// acquireWritableStreamDefaultWriter -#define WEBCORE_BUILTIN_WRITABLESTREAMINTERNALS_ACQUIREWRITABLESTREAMDEFAULTWRITER 1 -extern const char* const s_writableStreamInternalsAcquireWritableStreamDefaultWriterCode; -extern const int s_writableStreamInternalsAcquireWritableStreamDefaultWriterCodeLength; -extern const JSC::ConstructAbility s_writableStreamInternalsAcquireWritableStreamDefaultWriterCodeConstructAbility; -extern const JSC::ConstructorKind s_writableStreamInternalsAcquireWritableStreamDefaultWriterCodeConstructorKind; -extern const JSC::ImplementationVisibility s_writableStreamInternalsAcquireWritableStreamDefaultWriterCodeImplementationVisibility; +// desiredSize +#define WEBCORE_BUILTIN_WRITABLESTREAMDEFAULTWRITER_DESIREDSIZE 1 +extern const char* const s_writableStreamDefaultWriterDesiredSizeCode; +extern const int s_writableStreamDefaultWriterDesiredSizeCodeLength; +extern const JSC::ConstructAbility s_writableStreamDefaultWriterDesiredSizeCodeConstructAbility; +extern const JSC::ConstructorKind s_writableStreamDefaultWriterDesiredSizeCodeConstructorKind; +extern const JSC::ImplementationVisibility s_writableStreamDefaultWriterDesiredSizeCodeImplementationVisibility; -// createWritableStream -#define WEBCORE_BUILTIN_WRITABLESTREAMINTERNALS_CREATEWRITABLESTREAM 1 -extern const char* const s_writableStreamInternalsCreateWritableStreamCode; -extern const int s_writableStreamInternalsCreateWritableStreamCodeLength; -extern const JSC::ConstructAbility s_writableStreamInternalsCreateWritableStreamCodeConstructAbility; -extern const JSC::ConstructorKind s_writableStreamInternalsCreateWritableStreamCodeConstructorKind; -extern const JSC::ImplementationVisibility s_writableStreamInternalsCreateWritableStreamCodeImplementationVisibility; +// ready +#define WEBCORE_BUILTIN_WRITABLESTREAMDEFAULTWRITER_READY 1 +extern const char* const s_writableStreamDefaultWriterReadyCode; +extern const int s_writableStreamDefaultWriterReadyCodeLength; +extern const JSC::ConstructAbility s_writableStreamDefaultWriterReadyCodeConstructAbility; +extern const JSC::ConstructorKind s_writableStreamDefaultWriterReadyCodeConstructorKind; +extern const JSC::ImplementationVisibility s_writableStreamDefaultWriterReadyCodeImplementationVisibility; -// createInternalWritableStreamFromUnderlyingSink -#define WEBCORE_BUILTIN_WRITABLESTREAMINTERNALS_CREATEINTERNALWRITABLESTREAMFROMUNDERLYINGSINK 1 -extern const char* const s_writableStreamInternalsCreateInternalWritableStreamFromUnderlyingSinkCode; -extern const int s_writableStreamInternalsCreateInternalWritableStreamFromUnderlyingSinkCodeLength; -extern const JSC::ConstructAbility s_writableStreamInternalsCreateInternalWritableStreamFromUnderlyingSinkCodeConstructAbility; -extern const JSC::ConstructorKind s_writableStreamInternalsCreateInternalWritableStreamFromUnderlyingSinkCodeConstructorKind; -extern const JSC::ImplementationVisibility s_writableStreamInternalsCreateInternalWritableStreamFromUnderlyingSinkCodeImplementationVisibility; +// abort +#define WEBCORE_BUILTIN_WRITABLESTREAMDEFAULTWRITER_ABORT 1 +extern const char* const s_writableStreamDefaultWriterAbortCode; +extern const int s_writableStreamDefaultWriterAbortCodeLength; +extern const JSC::ConstructAbility s_writableStreamDefaultWriterAbortCodeConstructAbility; +extern const JSC::ConstructorKind s_writableStreamDefaultWriterAbortCodeConstructorKind; +extern const JSC::ImplementationVisibility s_writableStreamDefaultWriterAbortCodeImplementationVisibility; -// initializeWritableStreamSlots -#define WEBCORE_BUILTIN_WRITABLESTREAMINTERNALS_INITIALIZEWRITABLESTREAMSLOTS 1 -extern const char* const s_writableStreamInternalsInitializeWritableStreamSlotsCode; -extern const int s_writableStreamInternalsInitializeWritableStreamSlotsCodeLength; -extern const JSC::ConstructAbility s_writableStreamInternalsInitializeWritableStreamSlotsCodeConstructAbility; -extern const JSC::ConstructorKind s_writableStreamInternalsInitializeWritableStreamSlotsCodeConstructorKind; -extern const JSC::ImplementationVisibility s_writableStreamInternalsInitializeWritableStreamSlotsCodeImplementationVisibility; +// close +#define WEBCORE_BUILTIN_WRITABLESTREAMDEFAULTWRITER_CLOSE 1 +extern const char* const s_writableStreamDefaultWriterCloseCode; +extern const int s_writableStreamDefaultWriterCloseCodeLength; +extern const JSC::ConstructAbility s_writableStreamDefaultWriterCloseCodeConstructAbility; +extern const JSC::ConstructorKind s_writableStreamDefaultWriterCloseCodeConstructorKind; +extern const JSC::ImplementationVisibility s_writableStreamDefaultWriterCloseCodeImplementationVisibility; -// writableStreamCloseForBindings -#define WEBCORE_BUILTIN_WRITABLESTREAMINTERNALS_WRITABLESTREAMCLOSEFORBINDINGS 1 -extern const char* const s_writableStreamInternalsWritableStreamCloseForBindingsCode; -extern const int s_writableStreamInternalsWritableStreamCloseForBindingsCodeLength; -extern const JSC::ConstructAbility s_writableStreamInternalsWritableStreamCloseForBindingsCodeConstructAbility; -extern const JSC::ConstructorKind s_writableStreamInternalsWritableStreamCloseForBindingsCodeConstructorKind; -extern const JSC::ImplementationVisibility s_writableStreamInternalsWritableStreamCloseForBindingsCodeImplementationVisibility; +// releaseLock +#define WEBCORE_BUILTIN_WRITABLESTREAMDEFAULTWRITER_RELEASELOCK 1 +extern const char* const s_writableStreamDefaultWriterReleaseLockCode; +extern const int s_writableStreamDefaultWriterReleaseLockCodeLength; +extern const JSC::ConstructAbility s_writableStreamDefaultWriterReleaseLockCodeConstructAbility; +extern const JSC::ConstructorKind s_writableStreamDefaultWriterReleaseLockCodeConstructorKind; +extern const JSC::ImplementationVisibility s_writableStreamDefaultWriterReleaseLockCodeImplementationVisibility; -// writableStreamAbortForBindings -#define WEBCORE_BUILTIN_WRITABLESTREAMINTERNALS_WRITABLESTREAMABORTFORBINDINGS 1 -extern const char* const s_writableStreamInternalsWritableStreamAbortForBindingsCode; -extern const int s_writableStreamInternalsWritableStreamAbortForBindingsCodeLength; -extern const JSC::ConstructAbility s_writableStreamInternalsWritableStreamAbortForBindingsCodeConstructAbility; -extern const JSC::ConstructorKind s_writableStreamInternalsWritableStreamAbortForBindingsCodeConstructorKind; -extern const JSC::ImplementationVisibility s_writableStreamInternalsWritableStreamAbortForBindingsCodeImplementationVisibility; +// write +#define WEBCORE_BUILTIN_WRITABLESTREAMDEFAULTWRITER_WRITE 1 +extern const char* const s_writableStreamDefaultWriterWriteCode; +extern const int s_writableStreamDefaultWriterWriteCodeLength; +extern const JSC::ConstructAbility s_writableStreamDefaultWriterWriteCodeConstructAbility; +extern const JSC::ConstructorKind s_writableStreamDefaultWriterWriteCodeConstructorKind; +extern const JSC::ImplementationVisibility s_writableStreamDefaultWriterWriteCodeImplementationVisibility; -// isWritableStreamLocked -#define WEBCORE_BUILTIN_WRITABLESTREAMINTERNALS_ISWRITABLESTREAMLOCKED 1 -extern const char* const s_writableStreamInternalsIsWritableStreamLockedCode; -extern const int s_writableStreamInternalsIsWritableStreamLockedCodeLength; -extern const JSC::ConstructAbility s_writableStreamInternalsIsWritableStreamLockedCodeConstructAbility; -extern const JSC::ConstructorKind s_writableStreamInternalsIsWritableStreamLockedCodeConstructorKind; -extern const JSC::ImplementationVisibility s_writableStreamInternalsIsWritableStreamLockedCodeImplementationVisibility; +#define WEBCORE_FOREACH_WRITABLESTREAMDEFAULTWRITER_BUILTIN_DATA(macro) \ + macro(initializeWritableStreamDefaultWriter, writableStreamDefaultWriterInitializeWritableStreamDefaultWriter, 1) \ + macro(closed, writableStreamDefaultWriterClosed, 0) \ + macro(desiredSize, writableStreamDefaultWriterDesiredSize, 0) \ + macro(ready, writableStreamDefaultWriterReady, 0) \ + macro(abort, writableStreamDefaultWriterAbort, 1) \ + macro(close, writableStreamDefaultWriterClose, 0) \ + macro(releaseLock, writableStreamDefaultWriterReleaseLock, 0) \ + macro(write, writableStreamDefaultWriterWrite, 1) \ -// setUpWritableStreamDefaultWriter -#define WEBCORE_BUILTIN_WRITABLESTREAMINTERNALS_SETUPWRITABLESTREAMDEFAULTWRITER 1 -extern const char* const s_writableStreamInternalsSetUpWritableStreamDefaultWriterCode; -extern const int s_writableStreamInternalsSetUpWritableStreamDefaultWriterCodeLength; -extern const JSC::ConstructAbility s_writableStreamInternalsSetUpWritableStreamDefaultWriterCodeConstructAbility; -extern const JSC::ConstructorKind s_writableStreamInternalsSetUpWritableStreamDefaultWriterCodeConstructorKind; -extern const JSC::ImplementationVisibility s_writableStreamInternalsSetUpWritableStreamDefaultWriterCodeImplementationVisibility; +#define WEBCORE_FOREACH_WRITABLESTREAMDEFAULTWRITER_BUILTIN_CODE(macro) \ + macro(writableStreamDefaultWriterInitializeWritableStreamDefaultWriterCode, initializeWritableStreamDefaultWriter, ASCIILiteral(), s_writableStreamDefaultWriterInitializeWritableStreamDefaultWriterCodeLength) \ + macro(writableStreamDefaultWriterClosedCode, closed, "get closed"_s, s_writableStreamDefaultWriterClosedCodeLength) \ + macro(writableStreamDefaultWriterDesiredSizeCode, desiredSize, "get desiredSize"_s, s_writableStreamDefaultWriterDesiredSizeCodeLength) \ + macro(writableStreamDefaultWriterReadyCode, ready, "get ready"_s, s_writableStreamDefaultWriterReadyCodeLength) \ + macro(writableStreamDefaultWriterAbortCode, abort, ASCIILiteral(), s_writableStreamDefaultWriterAbortCodeLength) \ + macro(writableStreamDefaultWriterCloseCode, close, ASCIILiteral(), s_writableStreamDefaultWriterCloseCodeLength) \ + macro(writableStreamDefaultWriterReleaseLockCode, releaseLock, ASCIILiteral(), s_writableStreamDefaultWriterReleaseLockCodeLength) \ + macro(writableStreamDefaultWriterWriteCode, write, ASCIILiteral(), s_writableStreamDefaultWriterWriteCodeLength) \ -// writableStreamAbort -#define WEBCORE_BUILTIN_WRITABLESTREAMINTERNALS_WRITABLESTREAMABORT 1 -extern const char* const s_writableStreamInternalsWritableStreamAbortCode; -extern const int s_writableStreamInternalsWritableStreamAbortCodeLength; -extern const JSC::ConstructAbility s_writableStreamInternalsWritableStreamAbortCodeConstructAbility; -extern const JSC::ConstructorKind s_writableStreamInternalsWritableStreamAbortCodeConstructorKind; -extern const JSC::ImplementationVisibility s_writableStreamInternalsWritableStreamAbortCodeImplementationVisibility; +#define WEBCORE_FOREACH_WRITABLESTREAMDEFAULTWRITER_BUILTIN_FUNCTION_NAME(macro) \ + macro(initializeWritableStreamDefaultWriter) \ + macro(closed) \ + macro(desiredSize) \ + macro(ready) \ + macro(abort) \ + macro(close) \ + macro(releaseLock) \ + macro(write) \ -// writableStreamClose -#define WEBCORE_BUILTIN_WRITABLESTREAMINTERNALS_WRITABLESTREAMCLOSE 1 -extern const char* const s_writableStreamInternalsWritableStreamCloseCode; -extern const int s_writableStreamInternalsWritableStreamCloseCodeLength; -extern const JSC::ConstructAbility s_writableStreamInternalsWritableStreamCloseCodeConstructAbility; -extern const JSC::ConstructorKind s_writableStreamInternalsWritableStreamCloseCodeConstructorKind; -extern const JSC::ImplementationVisibility s_writableStreamInternalsWritableStreamCloseCodeImplementationVisibility; +#define DECLARE_BUILTIN_GENERATOR(codeName, functionName, overriddenName, argumentCount) \ + JSC::FunctionExecutable* codeName##Generator(JSC::VM&); -// writableStreamAddWriteRequest -#define WEBCORE_BUILTIN_WRITABLESTREAMINTERNALS_WRITABLESTREAMADDWRITEREQUEST 1 -extern const char* const s_writableStreamInternalsWritableStreamAddWriteRequestCode; -extern const int s_writableStreamInternalsWritableStreamAddWriteRequestCodeLength; -extern const JSC::ConstructAbility s_writableStreamInternalsWritableStreamAddWriteRequestCodeConstructAbility; -extern const JSC::ConstructorKind s_writableStreamInternalsWritableStreamAddWriteRequestCodeConstructorKind; -extern const JSC::ImplementationVisibility s_writableStreamInternalsWritableStreamAddWriteRequestCodeImplementationVisibility; +WEBCORE_FOREACH_WRITABLESTREAMDEFAULTWRITER_BUILTIN_CODE(DECLARE_BUILTIN_GENERATOR) +#undef DECLARE_BUILTIN_GENERATOR -// writableStreamCloseQueuedOrInFlight -#define WEBCORE_BUILTIN_WRITABLESTREAMINTERNALS_WRITABLESTREAMCLOSEQUEUEDORINFLIGHT 1 -extern const char* const s_writableStreamInternalsWritableStreamCloseQueuedOrInFlightCode; -extern const int s_writableStreamInternalsWritableStreamCloseQueuedOrInFlightCodeLength; -extern const JSC::ConstructAbility s_writableStreamInternalsWritableStreamCloseQueuedOrInFlightCodeConstructAbility; -extern const JSC::ConstructorKind s_writableStreamInternalsWritableStreamCloseQueuedOrInFlightCodeConstructorKind; -extern const JSC::ImplementationVisibility s_writableStreamInternalsWritableStreamCloseQueuedOrInFlightCodeImplementationVisibility; +class WritableStreamDefaultWriterBuiltinsWrapper : private JSC::WeakHandleOwner { +public: + explicit WritableStreamDefaultWriterBuiltinsWrapper(JSC::VM& vm) + : m_vm(vm) + WEBCORE_FOREACH_WRITABLESTREAMDEFAULTWRITER_BUILTIN_FUNCTION_NAME(INITIALIZE_BUILTIN_NAMES) +#define INITIALIZE_BUILTIN_SOURCE_MEMBERS(name, functionName, overriddenName, length) , m_##name##Source(JSC::makeSource(StringImpl::createWithoutCopying(s_##name, length), { }, JSC::SourceTaintedOrigin::Untainted)) + WEBCORE_FOREACH_WRITABLESTREAMDEFAULTWRITER_BUILTIN_CODE(INITIALIZE_BUILTIN_SOURCE_MEMBERS) +#undef INITIALIZE_BUILTIN_SOURCE_MEMBERS + { + } -// writableStreamDealWithRejection -#define WEBCORE_BUILTIN_WRITABLESTREAMINTERNALS_WRITABLESTREAMDEALWITHREJECTION 1 -extern const char* const s_writableStreamInternalsWritableStreamDealWithRejectionCode; -extern const int s_writableStreamInternalsWritableStreamDealWithRejectionCodeLength; -extern const JSC::ConstructAbility s_writableStreamInternalsWritableStreamDealWithRejectionCodeConstructAbility; -extern const JSC::ConstructorKind s_writableStreamInternalsWritableStreamDealWithRejectionCodeConstructorKind; -extern const JSC::ImplementationVisibility s_writableStreamInternalsWritableStreamDealWithRejectionCodeImplementationVisibility; +#define EXPOSE_BUILTIN_EXECUTABLES(name, functionName, overriddenName, length) \ + JSC::UnlinkedFunctionExecutable* name##Executable(); \ + const JSC::SourceCode& name##Source() const { return m_##name##Source; } + WEBCORE_FOREACH_WRITABLESTREAMDEFAULTWRITER_BUILTIN_CODE(EXPOSE_BUILTIN_EXECUTABLES) +#undef EXPOSE_BUILTIN_EXECUTABLES -// writableStreamFinishErroring -#define WEBCORE_BUILTIN_WRITABLESTREAMINTERNALS_WRITABLESTREAMFINISHERRORING 1 -extern const char* const s_writableStreamInternalsWritableStreamFinishErroringCode; -extern const int s_writableStreamInternalsWritableStreamFinishErroringCodeLength; -extern const JSC::ConstructAbility s_writableStreamInternalsWritableStreamFinishErroringCodeConstructAbility; -extern const JSC::ConstructorKind s_writableStreamInternalsWritableStreamFinishErroringCodeConstructorKind; -extern const JSC::ImplementationVisibility s_writableStreamInternalsWritableStreamFinishErroringCodeImplementationVisibility; + WEBCORE_FOREACH_WRITABLESTREAMDEFAULTWRITER_BUILTIN_FUNCTION_NAME(DECLARE_BUILTIN_IDENTIFIER_ACCESSOR) -// writableStreamFinishInFlightClose -#define WEBCORE_BUILTIN_WRITABLESTREAMINTERNALS_WRITABLESTREAMFINISHINFLIGHTCLOSE 1 -extern const char* const s_writableStreamInternalsWritableStreamFinishInFlightCloseCode; -extern const int s_writableStreamInternalsWritableStreamFinishInFlightCloseCodeLength; -extern const JSC::ConstructAbility s_writableStreamInternalsWritableStreamFinishInFlightCloseCodeConstructAbility; -extern const JSC::ConstructorKind s_writableStreamInternalsWritableStreamFinishInFlightCloseCodeConstructorKind; -extern const JSC::ImplementationVisibility s_writableStreamInternalsWritableStreamFinishInFlightCloseCodeImplementationVisibility; + void exportNames(); -// writableStreamFinishInFlightCloseWithError -#define WEBCORE_BUILTIN_WRITABLESTREAMINTERNALS_WRITABLESTREAMFINISHINFLIGHTCLOSEWITHERROR 1 -extern const char* const s_writableStreamInternalsWritableStreamFinishInFlightCloseWithErrorCode; -extern const int s_writableStreamInternalsWritableStreamFinishInFlightCloseWithErrorCodeLength; -extern const JSC::ConstructAbility s_writableStreamInternalsWritableStreamFinishInFlightCloseWithErrorCodeConstructAbility; -extern const JSC::ConstructorKind s_writableStreamInternalsWritableStreamFinishInFlightCloseWithErrorCodeConstructorKind; -extern const JSC::ImplementationVisibility s_writableStreamInternalsWritableStreamFinishInFlightCloseWithErrorCodeImplementationVisibility; +private: + JSC::VM& m_vm; -// writableStreamFinishInFlightWrite -#define WEBCORE_BUILTIN_WRITABLESTREAMINTERNALS_WRITABLESTREAMFINISHINFLIGHTWRITE 1 -extern const char* const s_writableStreamInternalsWritableStreamFinishInFlightWriteCode; -extern const int s_writableStreamInternalsWritableStreamFinishInFlightWriteCodeLength; -extern const JSC::ConstructAbility s_writableStreamInternalsWritableStreamFinishInFlightWriteCodeConstructAbility; -extern const JSC::ConstructorKind s_writableStreamInternalsWritableStreamFinishInFlightWriteCodeConstructorKind; -extern const JSC::ImplementationVisibility s_writableStreamInternalsWritableStreamFinishInFlightWriteCodeImplementationVisibility; + WEBCORE_FOREACH_WRITABLESTREAMDEFAULTWRITER_BUILTIN_FUNCTION_NAME(DECLARE_BUILTIN_NAMES) -// writableStreamFinishInFlightWriteWithError -#define WEBCORE_BUILTIN_WRITABLESTREAMINTERNALS_WRITABLESTREAMFINISHINFLIGHTWRITEWITHERROR 1 -extern const char* const s_writableStreamInternalsWritableStreamFinishInFlightWriteWithErrorCode; -extern const int s_writableStreamInternalsWritableStreamFinishInFlightWriteWithErrorCodeLength; -extern const JSC::ConstructAbility s_writableStreamInternalsWritableStreamFinishInFlightWriteWithErrorCodeConstructAbility; -extern const JSC::ConstructorKind s_writableStreamInternalsWritableStreamFinishInFlightWriteWithErrorCodeConstructorKind; -extern const JSC::ImplementationVisibility s_writableStreamInternalsWritableStreamFinishInFlightWriteWithErrorCodeImplementationVisibility; +#define DECLARE_BUILTIN_SOURCE_MEMBERS(name, functionName, overriddenName, length) \ + JSC::SourceCode m_##name##Source;\ + JSC::Weak m_##name##Executable; + WEBCORE_FOREACH_WRITABLESTREAMDEFAULTWRITER_BUILTIN_CODE(DECLARE_BUILTIN_SOURCE_MEMBERS) +#undef DECLARE_BUILTIN_SOURCE_MEMBERS -// writableStreamHasOperationMarkedInFlight -#define WEBCORE_BUILTIN_WRITABLESTREAMINTERNALS_WRITABLESTREAMHASOPERATIONMARKEDINFLIGHT 1 -extern const char* const s_writableStreamInternalsWritableStreamHasOperationMarkedInFlightCode; -extern const int s_writableStreamInternalsWritableStreamHasOperationMarkedInFlightCodeLength; -extern const JSC::ConstructAbility s_writableStreamInternalsWritableStreamHasOperationMarkedInFlightCodeConstructAbility; -extern const JSC::ConstructorKind s_writableStreamInternalsWritableStreamHasOperationMarkedInFlightCodeConstructorKind; -extern const JSC::ImplementationVisibility s_writableStreamInternalsWritableStreamHasOperationMarkedInFlightCodeImplementationVisibility; +}; -// writableStreamMarkCloseRequestInFlight -#define WEBCORE_BUILTIN_WRITABLESTREAMINTERNALS_WRITABLESTREAMMARKCLOSEREQUESTINFLIGHT 1 -extern const char* const s_writableStreamInternalsWritableStreamMarkCloseRequestInFlightCode; -extern const int s_writableStreamInternalsWritableStreamMarkCloseRequestInFlightCodeLength; -extern const JSC::ConstructAbility s_writableStreamInternalsWritableStreamMarkCloseRequestInFlightCodeConstructAbility; -extern const JSC::ConstructorKind s_writableStreamInternalsWritableStreamMarkCloseRequestInFlightCodeConstructorKind; -extern const JSC::ImplementationVisibility s_writableStreamInternalsWritableStreamMarkCloseRequestInFlightCodeImplementationVisibility; +#define DEFINE_BUILTIN_EXECUTABLES(name, functionName, overriddenName, length) \ +inline JSC::UnlinkedFunctionExecutable* WritableStreamDefaultWriterBuiltinsWrapper::name##Executable() \ +{\ + if (!m_##name##Executable) {\ + JSC::Identifier executableName = functionName##PublicName();\ + if (overriddenName)\ + executableName = JSC::Identifier::fromString(m_vm, overriddenName);\ + m_##name##Executable = JSC::Weak(JSC::createBuiltinExecutable(m_vm, m_##name##Source, executableName, s_##name##ImplementationVisibility, s_##name##ConstructorKind, s_##name##ConstructAbility), this, &m_##name##Executable);\ + }\ + return m_##name##Executable.get();\ +} +WEBCORE_FOREACH_WRITABLESTREAMDEFAULTWRITER_BUILTIN_CODE(DEFINE_BUILTIN_EXECUTABLES) +#undef DEFINE_BUILTIN_EXECUTABLES -// writableStreamMarkFirstWriteRequestInFlight -#define WEBCORE_BUILTIN_WRITABLESTREAMINTERNALS_WRITABLESTREAMMARKFIRSTWRITEREQUESTINFLIGHT 1 -extern const char* const s_writableStreamInternalsWritableStreamMarkFirstWriteRequestInFlightCode; -extern const int s_writableStreamInternalsWritableStreamMarkFirstWriteRequestInFlightCodeLength; -extern const JSC::ConstructAbility s_writableStreamInternalsWritableStreamMarkFirstWriteRequestInFlightCodeConstructAbility; -extern const JSC::ConstructorKind s_writableStreamInternalsWritableStreamMarkFirstWriteRequestInFlightCodeConstructorKind; -extern const JSC::ImplementationVisibility s_writableStreamInternalsWritableStreamMarkFirstWriteRequestInFlightCodeImplementationVisibility; +inline void WritableStreamDefaultWriterBuiltinsWrapper::exportNames() +{ +#define EXPORT_FUNCTION_NAME(name) m_vm.propertyNames->appendExternalName(name##PublicName(), name##PrivateName()); + WEBCORE_FOREACH_WRITABLESTREAMDEFAULTWRITER_BUILTIN_FUNCTION_NAME(EXPORT_FUNCTION_NAME) +#undef EXPORT_FUNCTION_NAME +} +/* ReadableByteStreamInternals.ts */ +// privateInitializeReadableByteStreamController +#define WEBCORE_BUILTIN_READABLEBYTESTREAMINTERNALS_PRIVATEINITIALIZEREADABLEBYTESTREAMCONTROLLER 1 +extern const char* const s_readableByteStreamInternalsPrivateInitializeReadableByteStreamControllerCode; +extern const int s_readableByteStreamInternalsPrivateInitializeReadableByteStreamControllerCodeLength; +extern const JSC::ConstructAbility s_readableByteStreamInternalsPrivateInitializeReadableByteStreamControllerCodeConstructAbility; +extern const JSC::ConstructorKind s_readableByteStreamInternalsPrivateInitializeReadableByteStreamControllerCodeConstructorKind; +extern const JSC::ImplementationVisibility s_readableByteStreamInternalsPrivateInitializeReadableByteStreamControllerCodeImplementationVisibility; -// writableStreamRejectCloseAndClosedPromiseIfNeeded -#define WEBCORE_BUILTIN_WRITABLESTREAMINTERNALS_WRITABLESTREAMREJECTCLOSEANDCLOSEDPROMISEIFNEEDED 1 -extern const char* const s_writableStreamInternalsWritableStreamRejectCloseAndClosedPromiseIfNeededCode; -extern const int s_writableStreamInternalsWritableStreamRejectCloseAndClosedPromiseIfNeededCodeLength; -extern const JSC::ConstructAbility s_writableStreamInternalsWritableStreamRejectCloseAndClosedPromiseIfNeededCodeConstructAbility; -extern const JSC::ConstructorKind s_writableStreamInternalsWritableStreamRejectCloseAndClosedPromiseIfNeededCodeConstructorKind; -extern const JSC::ImplementationVisibility s_writableStreamInternalsWritableStreamRejectCloseAndClosedPromiseIfNeededCodeImplementationVisibility; +// readableStreamByteStreamControllerStart +#define WEBCORE_BUILTIN_READABLEBYTESTREAMINTERNALS_READABLESTREAMBYTESTREAMCONTROLLERSTART 1 +extern const char* const s_readableByteStreamInternalsReadableStreamByteStreamControllerStartCode; +extern const int s_readableByteStreamInternalsReadableStreamByteStreamControllerStartCodeLength; +extern const JSC::ConstructAbility s_readableByteStreamInternalsReadableStreamByteStreamControllerStartCodeConstructAbility; +extern const JSC::ConstructorKind s_readableByteStreamInternalsReadableStreamByteStreamControllerStartCodeConstructorKind; +extern const JSC::ImplementationVisibility s_readableByteStreamInternalsReadableStreamByteStreamControllerStartCodeImplementationVisibility; -// writableStreamStartErroring -#define WEBCORE_BUILTIN_WRITABLESTREAMINTERNALS_WRITABLESTREAMSTARTERRORING 1 -extern const char* const s_writableStreamInternalsWritableStreamStartErroringCode; -extern const int s_writableStreamInternalsWritableStreamStartErroringCodeLength; -extern const JSC::ConstructAbility s_writableStreamInternalsWritableStreamStartErroringCodeConstructAbility; -extern const JSC::ConstructorKind s_writableStreamInternalsWritableStreamStartErroringCodeConstructorKind; -extern const JSC::ImplementationVisibility s_writableStreamInternalsWritableStreamStartErroringCodeImplementationVisibility; +// privateInitializeReadableStreamBYOBRequest +#define WEBCORE_BUILTIN_READABLEBYTESTREAMINTERNALS_PRIVATEINITIALIZEREADABLESTREAMBYOBREQUEST 1 +extern const char* const s_readableByteStreamInternalsPrivateInitializeReadableStreamBYOBRequestCode; +extern const int s_readableByteStreamInternalsPrivateInitializeReadableStreamBYOBRequestCodeLength; +extern const JSC::ConstructAbility s_readableByteStreamInternalsPrivateInitializeReadableStreamBYOBRequestCodeConstructAbility; +extern const JSC::ConstructorKind s_readableByteStreamInternalsPrivateInitializeReadableStreamBYOBRequestCodeConstructorKind; +extern const JSC::ImplementationVisibility s_readableByteStreamInternalsPrivateInitializeReadableStreamBYOBRequestCodeImplementationVisibility; -// writableStreamUpdateBackpressure -#define WEBCORE_BUILTIN_WRITABLESTREAMINTERNALS_WRITABLESTREAMUPDATEBACKPRESSURE 1 -extern const char* const s_writableStreamInternalsWritableStreamUpdateBackpressureCode; -extern const int s_writableStreamInternalsWritableStreamUpdateBackpressureCodeLength; -extern const JSC::ConstructAbility s_writableStreamInternalsWritableStreamUpdateBackpressureCodeConstructAbility; -extern const JSC::ConstructorKind s_writableStreamInternalsWritableStreamUpdateBackpressureCodeConstructorKind; -extern const JSC::ImplementationVisibility s_writableStreamInternalsWritableStreamUpdateBackpressureCodeImplementationVisibility; +// isReadableByteStreamController +#define WEBCORE_BUILTIN_READABLEBYTESTREAMINTERNALS_ISREADABLEBYTESTREAMCONTROLLER 1 +extern const char* const s_readableByteStreamInternalsIsReadableByteStreamControllerCode; +extern const int s_readableByteStreamInternalsIsReadableByteStreamControllerCodeLength; +extern const JSC::ConstructAbility s_readableByteStreamInternalsIsReadableByteStreamControllerCodeConstructAbility; +extern const JSC::ConstructorKind s_readableByteStreamInternalsIsReadableByteStreamControllerCodeConstructorKind; +extern const JSC::ImplementationVisibility s_readableByteStreamInternalsIsReadableByteStreamControllerCodeImplementationVisibility; -// writableStreamDefaultWriterAbort -#define WEBCORE_BUILTIN_WRITABLESTREAMINTERNALS_WRITABLESTREAMDEFAULTWRITERABORT 1 -extern const char* const s_writableStreamInternalsWritableStreamDefaultWriterAbortCode; -extern const int s_writableStreamInternalsWritableStreamDefaultWriterAbortCodeLength; -extern const JSC::ConstructAbility s_writableStreamInternalsWritableStreamDefaultWriterAbortCodeConstructAbility; -extern const JSC::ConstructorKind s_writableStreamInternalsWritableStreamDefaultWriterAbortCodeConstructorKind; -extern const JSC::ImplementationVisibility s_writableStreamInternalsWritableStreamDefaultWriterAbortCodeImplementationVisibility; +// isReadableStreamBYOBRequest +#define WEBCORE_BUILTIN_READABLEBYTESTREAMINTERNALS_ISREADABLESTREAMBYOBREQUEST 1 +extern const char* const s_readableByteStreamInternalsIsReadableStreamBYOBRequestCode; +extern const int s_readableByteStreamInternalsIsReadableStreamBYOBRequestCodeLength; +extern const JSC::ConstructAbility s_readableByteStreamInternalsIsReadableStreamBYOBRequestCodeConstructAbility; +extern const JSC::ConstructorKind s_readableByteStreamInternalsIsReadableStreamBYOBRequestCodeConstructorKind; +extern const JSC::ImplementationVisibility s_readableByteStreamInternalsIsReadableStreamBYOBRequestCodeImplementationVisibility; -// writableStreamDefaultWriterClose -#define WEBCORE_BUILTIN_WRITABLESTREAMINTERNALS_WRITABLESTREAMDEFAULTWRITERCLOSE 1 -extern const char* const s_writableStreamInternalsWritableStreamDefaultWriterCloseCode; -extern const int s_writableStreamInternalsWritableStreamDefaultWriterCloseCodeLength; -extern const JSC::ConstructAbility s_writableStreamInternalsWritableStreamDefaultWriterCloseCodeConstructAbility; -extern const JSC::ConstructorKind s_writableStreamInternalsWritableStreamDefaultWriterCloseCodeConstructorKind; -extern const JSC::ImplementationVisibility s_writableStreamInternalsWritableStreamDefaultWriterCloseCodeImplementationVisibility; +// isReadableStreamBYOBReader +#define WEBCORE_BUILTIN_READABLEBYTESTREAMINTERNALS_ISREADABLESTREAMBYOBREADER 1 +extern const char* const s_readableByteStreamInternalsIsReadableStreamBYOBReaderCode; +extern const int s_readableByteStreamInternalsIsReadableStreamBYOBReaderCodeLength; +extern const JSC::ConstructAbility s_readableByteStreamInternalsIsReadableStreamBYOBReaderCodeConstructAbility; +extern const JSC::ConstructorKind s_readableByteStreamInternalsIsReadableStreamBYOBReaderCodeConstructorKind; +extern const JSC::ImplementationVisibility s_readableByteStreamInternalsIsReadableStreamBYOBReaderCodeImplementationVisibility; -// writableStreamDefaultWriterCloseWithErrorPropagation -#define WEBCORE_BUILTIN_WRITABLESTREAMINTERNALS_WRITABLESTREAMDEFAULTWRITERCLOSEWITHERRORPROPAGATION 1 -extern const char* const s_writableStreamInternalsWritableStreamDefaultWriterCloseWithErrorPropagationCode; -extern const int s_writableStreamInternalsWritableStreamDefaultWriterCloseWithErrorPropagationCodeLength; -extern const JSC::ConstructAbility s_writableStreamInternalsWritableStreamDefaultWriterCloseWithErrorPropagationCodeConstructAbility; -extern const JSC::ConstructorKind s_writableStreamInternalsWritableStreamDefaultWriterCloseWithErrorPropagationCodeConstructorKind; -extern const JSC::ImplementationVisibility s_writableStreamInternalsWritableStreamDefaultWriterCloseWithErrorPropagationCodeImplementationVisibility; +// readableByteStreamControllerCancel +#define WEBCORE_BUILTIN_READABLEBYTESTREAMINTERNALS_READABLEBYTESTREAMCONTROLLERCANCEL 1 +extern const char* const s_readableByteStreamInternalsReadableByteStreamControllerCancelCode; +extern const int s_readableByteStreamInternalsReadableByteStreamControllerCancelCodeLength; +extern const JSC::ConstructAbility s_readableByteStreamInternalsReadableByteStreamControllerCancelCodeConstructAbility; +extern const JSC::ConstructorKind s_readableByteStreamInternalsReadableByteStreamControllerCancelCodeConstructorKind; +extern const JSC::ImplementationVisibility s_readableByteStreamInternalsReadableByteStreamControllerCancelCodeImplementationVisibility; -// writableStreamDefaultWriterEnsureClosedPromiseRejected -#define WEBCORE_BUILTIN_WRITABLESTREAMINTERNALS_WRITABLESTREAMDEFAULTWRITERENSURECLOSEDPROMISEREJECTED 1 -extern const char* const s_writableStreamInternalsWritableStreamDefaultWriterEnsureClosedPromiseRejectedCode; -extern const int s_writableStreamInternalsWritableStreamDefaultWriterEnsureClosedPromiseRejectedCodeLength; -extern const JSC::ConstructAbility s_writableStreamInternalsWritableStreamDefaultWriterEnsureClosedPromiseRejectedCodeConstructAbility; -extern const JSC::ConstructorKind s_writableStreamInternalsWritableStreamDefaultWriterEnsureClosedPromiseRejectedCodeConstructorKind; -extern const JSC::ImplementationVisibility s_writableStreamInternalsWritableStreamDefaultWriterEnsureClosedPromiseRejectedCodeImplementationVisibility; +// readableByteStreamControllerError +#define WEBCORE_BUILTIN_READABLEBYTESTREAMINTERNALS_READABLEBYTESTREAMCONTROLLERERROR 1 +extern const char* const s_readableByteStreamInternalsReadableByteStreamControllerErrorCode; +extern const int s_readableByteStreamInternalsReadableByteStreamControllerErrorCodeLength; +extern const JSC::ConstructAbility s_readableByteStreamInternalsReadableByteStreamControllerErrorCodeConstructAbility; +extern const JSC::ConstructorKind s_readableByteStreamInternalsReadableByteStreamControllerErrorCodeConstructorKind; +extern const JSC::ImplementationVisibility s_readableByteStreamInternalsReadableByteStreamControllerErrorCodeImplementationVisibility; -// writableStreamDefaultWriterEnsureReadyPromiseRejected -#define WEBCORE_BUILTIN_WRITABLESTREAMINTERNALS_WRITABLESTREAMDEFAULTWRITERENSUREREADYPROMISEREJECTED 1 -extern const char* const s_writableStreamInternalsWritableStreamDefaultWriterEnsureReadyPromiseRejectedCode; -extern const int s_writableStreamInternalsWritableStreamDefaultWriterEnsureReadyPromiseRejectedCodeLength; -extern const JSC::ConstructAbility s_writableStreamInternalsWritableStreamDefaultWriterEnsureReadyPromiseRejectedCodeConstructAbility; -extern const JSC::ConstructorKind s_writableStreamInternalsWritableStreamDefaultWriterEnsureReadyPromiseRejectedCodeConstructorKind; -extern const JSC::ImplementationVisibility s_writableStreamInternalsWritableStreamDefaultWriterEnsureReadyPromiseRejectedCodeImplementationVisibility; +// readableByteStreamControllerClose +#define WEBCORE_BUILTIN_READABLEBYTESTREAMINTERNALS_READABLEBYTESTREAMCONTROLLERCLOSE 1 +extern const char* const s_readableByteStreamInternalsReadableByteStreamControllerCloseCode; +extern const int s_readableByteStreamInternalsReadableByteStreamControllerCloseCodeLength; +extern const JSC::ConstructAbility s_readableByteStreamInternalsReadableByteStreamControllerCloseCodeConstructAbility; +extern const JSC::ConstructorKind s_readableByteStreamInternalsReadableByteStreamControllerCloseCodeConstructorKind; +extern const JSC::ImplementationVisibility s_readableByteStreamInternalsReadableByteStreamControllerCloseCodeImplementationVisibility; -// writableStreamDefaultWriterGetDesiredSize -#define WEBCORE_BUILTIN_WRITABLESTREAMINTERNALS_WRITABLESTREAMDEFAULTWRITERGETDESIREDSIZE 1 -extern const char* const s_writableStreamInternalsWritableStreamDefaultWriterGetDesiredSizeCode; -extern const int s_writableStreamInternalsWritableStreamDefaultWriterGetDesiredSizeCodeLength; -extern const JSC::ConstructAbility s_writableStreamInternalsWritableStreamDefaultWriterGetDesiredSizeCodeConstructAbility; -extern const JSC::ConstructorKind s_writableStreamInternalsWritableStreamDefaultWriterGetDesiredSizeCodeConstructorKind; -extern const JSC::ImplementationVisibility s_writableStreamInternalsWritableStreamDefaultWriterGetDesiredSizeCodeImplementationVisibility; +// readableByteStreamControllerClearPendingPullIntos +#define WEBCORE_BUILTIN_READABLEBYTESTREAMINTERNALS_READABLEBYTESTREAMCONTROLLERCLEARPENDINGPULLINTOS 1 +extern const char* const s_readableByteStreamInternalsReadableByteStreamControllerClearPendingPullIntosCode; +extern const int s_readableByteStreamInternalsReadableByteStreamControllerClearPendingPullIntosCodeLength; +extern const JSC::ConstructAbility s_readableByteStreamInternalsReadableByteStreamControllerClearPendingPullIntosCodeConstructAbility; +extern const JSC::ConstructorKind s_readableByteStreamInternalsReadableByteStreamControllerClearPendingPullIntosCodeConstructorKind; +extern const JSC::ImplementationVisibility s_readableByteStreamInternalsReadableByteStreamControllerClearPendingPullIntosCodeImplementationVisibility; -// writableStreamDefaultWriterRelease -#define WEBCORE_BUILTIN_WRITABLESTREAMINTERNALS_WRITABLESTREAMDEFAULTWRITERRELEASE 1 -extern const char* const s_writableStreamInternalsWritableStreamDefaultWriterReleaseCode; -extern const int s_writableStreamInternalsWritableStreamDefaultWriterReleaseCodeLength; -extern const JSC::ConstructAbility s_writableStreamInternalsWritableStreamDefaultWriterReleaseCodeConstructAbility; -extern const JSC::ConstructorKind s_writableStreamInternalsWritableStreamDefaultWriterReleaseCodeConstructorKind; -extern const JSC::ImplementationVisibility s_writableStreamInternalsWritableStreamDefaultWriterReleaseCodeImplementationVisibility; +// readableByteStreamControllerGetDesiredSize +#define WEBCORE_BUILTIN_READABLEBYTESTREAMINTERNALS_READABLEBYTESTREAMCONTROLLERGETDESIREDSIZE 1 +extern const char* const s_readableByteStreamInternalsReadableByteStreamControllerGetDesiredSizeCode; +extern const int s_readableByteStreamInternalsReadableByteStreamControllerGetDesiredSizeCodeLength; +extern const JSC::ConstructAbility s_readableByteStreamInternalsReadableByteStreamControllerGetDesiredSizeCodeConstructAbility; +extern const JSC::ConstructorKind s_readableByteStreamInternalsReadableByteStreamControllerGetDesiredSizeCodeConstructorKind; +extern const JSC::ImplementationVisibility s_readableByteStreamInternalsReadableByteStreamControllerGetDesiredSizeCodeImplementationVisibility; -// writableStreamDefaultWriterWrite -#define WEBCORE_BUILTIN_WRITABLESTREAMINTERNALS_WRITABLESTREAMDEFAULTWRITERWRITE 1 -extern const char* const s_writableStreamInternalsWritableStreamDefaultWriterWriteCode; -extern const int s_writableStreamInternalsWritableStreamDefaultWriterWriteCodeLength; -extern const JSC::ConstructAbility s_writableStreamInternalsWritableStreamDefaultWriterWriteCodeConstructAbility; -extern const JSC::ConstructorKind s_writableStreamInternalsWritableStreamDefaultWriterWriteCodeConstructorKind; -extern const JSC::ImplementationVisibility s_writableStreamInternalsWritableStreamDefaultWriterWriteCodeImplementationVisibility; +// readableStreamHasBYOBReader +#define WEBCORE_BUILTIN_READABLEBYTESTREAMINTERNALS_READABLESTREAMHASBYOBREADER 1 +extern const char* const s_readableByteStreamInternalsReadableStreamHasBYOBReaderCode; +extern const int s_readableByteStreamInternalsReadableStreamHasBYOBReaderCodeLength; +extern const JSC::ConstructAbility s_readableByteStreamInternalsReadableStreamHasBYOBReaderCodeConstructAbility; +extern const JSC::ConstructorKind s_readableByteStreamInternalsReadableStreamHasBYOBReaderCodeConstructorKind; +extern const JSC::ImplementationVisibility s_readableByteStreamInternalsReadableStreamHasBYOBReaderCodeImplementationVisibility; -// setUpWritableStreamDefaultController -#define WEBCORE_BUILTIN_WRITABLESTREAMINTERNALS_SETUPWRITABLESTREAMDEFAULTCONTROLLER 1 -extern const char* const s_writableStreamInternalsSetUpWritableStreamDefaultControllerCode; -extern const int s_writableStreamInternalsSetUpWritableStreamDefaultControllerCodeLength; -extern const JSC::ConstructAbility s_writableStreamInternalsSetUpWritableStreamDefaultControllerCodeConstructAbility; -extern const JSC::ConstructorKind s_writableStreamInternalsSetUpWritableStreamDefaultControllerCodeConstructorKind; -extern const JSC::ImplementationVisibility s_writableStreamInternalsSetUpWritableStreamDefaultControllerCodeImplementationVisibility; +// readableStreamHasDefaultReader +#define WEBCORE_BUILTIN_READABLEBYTESTREAMINTERNALS_READABLESTREAMHASDEFAULTREADER 1 +extern const char* const s_readableByteStreamInternalsReadableStreamHasDefaultReaderCode; +extern const int s_readableByteStreamInternalsReadableStreamHasDefaultReaderCodeLength; +extern const JSC::ConstructAbility s_readableByteStreamInternalsReadableStreamHasDefaultReaderCodeConstructAbility; +extern const JSC::ConstructorKind s_readableByteStreamInternalsReadableStreamHasDefaultReaderCodeConstructorKind; +extern const JSC::ImplementationVisibility s_readableByteStreamInternalsReadableStreamHasDefaultReaderCodeImplementationVisibility; -// writableStreamDefaultControllerStart -#define WEBCORE_BUILTIN_WRITABLESTREAMINTERNALS_WRITABLESTREAMDEFAULTCONTROLLERSTART 1 -extern const char* const s_writableStreamInternalsWritableStreamDefaultControllerStartCode; -extern const int s_writableStreamInternalsWritableStreamDefaultControllerStartCodeLength; -extern const JSC::ConstructAbility s_writableStreamInternalsWritableStreamDefaultControllerStartCodeConstructAbility; -extern const JSC::ConstructorKind s_writableStreamInternalsWritableStreamDefaultControllerStartCodeConstructorKind; -extern const JSC::ImplementationVisibility s_writableStreamInternalsWritableStreamDefaultControllerStartCodeImplementationVisibility; +// readableByteStreamControllerHandleQueueDrain +#define WEBCORE_BUILTIN_READABLEBYTESTREAMINTERNALS_READABLEBYTESTREAMCONTROLLERHANDLEQUEUEDRAIN 1 +extern const char* const s_readableByteStreamInternalsReadableByteStreamControllerHandleQueueDrainCode; +extern const int s_readableByteStreamInternalsReadableByteStreamControllerHandleQueueDrainCodeLength; +extern const JSC::ConstructAbility s_readableByteStreamInternalsReadableByteStreamControllerHandleQueueDrainCodeConstructAbility; +extern const JSC::ConstructorKind s_readableByteStreamInternalsReadableByteStreamControllerHandleQueueDrainCodeConstructorKind; +extern const JSC::ImplementationVisibility s_readableByteStreamInternalsReadableByteStreamControllerHandleQueueDrainCodeImplementationVisibility; -// setUpWritableStreamDefaultControllerFromUnderlyingSink -#define WEBCORE_BUILTIN_WRITABLESTREAMINTERNALS_SETUPWRITABLESTREAMDEFAULTCONTROLLERFROMUNDERLYINGSINK 1 -extern const char* const s_writableStreamInternalsSetUpWritableStreamDefaultControllerFromUnderlyingSinkCode; -extern const int s_writableStreamInternalsSetUpWritableStreamDefaultControllerFromUnderlyingSinkCodeLength; -extern const JSC::ConstructAbility s_writableStreamInternalsSetUpWritableStreamDefaultControllerFromUnderlyingSinkCodeConstructAbility; -extern const JSC::ConstructorKind s_writableStreamInternalsSetUpWritableStreamDefaultControllerFromUnderlyingSinkCodeConstructorKind; -extern const JSC::ImplementationVisibility s_writableStreamInternalsSetUpWritableStreamDefaultControllerFromUnderlyingSinkCodeImplementationVisibility; +// readableByteStreamControllerPull +#define WEBCORE_BUILTIN_READABLEBYTESTREAMINTERNALS_READABLEBYTESTREAMCONTROLLERPULL 1 +extern const char* const s_readableByteStreamInternalsReadableByteStreamControllerPullCode; +extern const int s_readableByteStreamInternalsReadableByteStreamControllerPullCodeLength; +extern const JSC::ConstructAbility s_readableByteStreamInternalsReadableByteStreamControllerPullCodeConstructAbility; +extern const JSC::ConstructorKind s_readableByteStreamInternalsReadableByteStreamControllerPullCodeConstructorKind; +extern const JSC::ImplementationVisibility s_readableByteStreamInternalsReadableByteStreamControllerPullCodeImplementationVisibility; -// writableStreamDefaultControllerAdvanceQueueIfNeeded -#define WEBCORE_BUILTIN_WRITABLESTREAMINTERNALS_WRITABLESTREAMDEFAULTCONTROLLERADVANCEQUEUEIFNEEDED 1 -extern const char* const s_writableStreamInternalsWritableStreamDefaultControllerAdvanceQueueIfNeededCode; -extern const int s_writableStreamInternalsWritableStreamDefaultControllerAdvanceQueueIfNeededCodeLength; -extern const JSC::ConstructAbility s_writableStreamInternalsWritableStreamDefaultControllerAdvanceQueueIfNeededCodeConstructAbility; -extern const JSC::ConstructorKind s_writableStreamInternalsWritableStreamDefaultControllerAdvanceQueueIfNeededCodeConstructorKind; -extern const JSC::ImplementationVisibility s_writableStreamInternalsWritableStreamDefaultControllerAdvanceQueueIfNeededCodeImplementationVisibility; +// readableByteStreamControllerShouldCallPull +#define WEBCORE_BUILTIN_READABLEBYTESTREAMINTERNALS_READABLEBYTESTREAMCONTROLLERSHOULDCALLPULL 1 +extern const char* const s_readableByteStreamInternalsReadableByteStreamControllerShouldCallPullCode; +extern const int s_readableByteStreamInternalsReadableByteStreamControllerShouldCallPullCodeLength; +extern const JSC::ConstructAbility s_readableByteStreamInternalsReadableByteStreamControllerShouldCallPullCodeConstructAbility; +extern const JSC::ConstructorKind s_readableByteStreamInternalsReadableByteStreamControllerShouldCallPullCodeConstructorKind; +extern const JSC::ImplementationVisibility s_readableByteStreamInternalsReadableByteStreamControllerShouldCallPullCodeImplementationVisibility; -// isCloseSentinel -#define WEBCORE_BUILTIN_WRITABLESTREAMINTERNALS_ISCLOSESENTINEL 1 -extern const char* const s_writableStreamInternalsIsCloseSentinelCode; -extern const int s_writableStreamInternalsIsCloseSentinelCodeLength; -extern const JSC::ConstructAbility s_writableStreamInternalsIsCloseSentinelCodeConstructAbility; -extern const JSC::ConstructorKind s_writableStreamInternalsIsCloseSentinelCodeConstructorKind; -extern const JSC::ImplementationVisibility s_writableStreamInternalsIsCloseSentinelCodeImplementationVisibility; +// readableByteStreamControllerCallPullIfNeeded +#define WEBCORE_BUILTIN_READABLEBYTESTREAMINTERNALS_READABLEBYTESTREAMCONTROLLERCALLPULLIFNEEDED 1 +extern const char* const s_readableByteStreamInternalsReadableByteStreamControllerCallPullIfNeededCode; +extern const int s_readableByteStreamInternalsReadableByteStreamControllerCallPullIfNeededCodeLength; +extern const JSC::ConstructAbility s_readableByteStreamInternalsReadableByteStreamControllerCallPullIfNeededCodeConstructAbility; +extern const JSC::ConstructorKind s_readableByteStreamInternalsReadableByteStreamControllerCallPullIfNeededCodeConstructorKind; +extern const JSC::ImplementationVisibility s_readableByteStreamInternalsReadableByteStreamControllerCallPullIfNeededCodeImplementationVisibility; -// writableStreamDefaultControllerClearAlgorithms -#define WEBCORE_BUILTIN_WRITABLESTREAMINTERNALS_WRITABLESTREAMDEFAULTCONTROLLERCLEARALGORITHMS 1 -extern const char* const s_writableStreamInternalsWritableStreamDefaultControllerClearAlgorithmsCode; -extern const int s_writableStreamInternalsWritableStreamDefaultControllerClearAlgorithmsCodeLength; -extern const JSC::ConstructAbility s_writableStreamInternalsWritableStreamDefaultControllerClearAlgorithmsCodeConstructAbility; -extern const JSC::ConstructorKind s_writableStreamInternalsWritableStreamDefaultControllerClearAlgorithmsCodeConstructorKind; -extern const JSC::ImplementationVisibility s_writableStreamInternalsWritableStreamDefaultControllerClearAlgorithmsCodeImplementationVisibility; +// transferBufferToCurrentRealm +#define WEBCORE_BUILTIN_READABLEBYTESTREAMINTERNALS_TRANSFERBUFFERTOCURRENTREALM 1 +extern const char* const s_readableByteStreamInternalsTransferBufferToCurrentRealmCode; +extern const int s_readableByteStreamInternalsTransferBufferToCurrentRealmCodeLength; +extern const JSC::ConstructAbility s_readableByteStreamInternalsTransferBufferToCurrentRealmCodeConstructAbility; +extern const JSC::ConstructorKind s_readableByteStreamInternalsTransferBufferToCurrentRealmCodeConstructorKind; +extern const JSC::ImplementationVisibility s_readableByteStreamInternalsTransferBufferToCurrentRealmCodeImplementationVisibility; -// writableStreamDefaultControllerClose -#define WEBCORE_BUILTIN_WRITABLESTREAMINTERNALS_WRITABLESTREAMDEFAULTCONTROLLERCLOSE 1 -extern const char* const s_writableStreamInternalsWritableStreamDefaultControllerCloseCode; -extern const int s_writableStreamInternalsWritableStreamDefaultControllerCloseCodeLength; -extern const JSC::ConstructAbility s_writableStreamInternalsWritableStreamDefaultControllerCloseCodeConstructAbility; -extern const JSC::ConstructorKind s_writableStreamInternalsWritableStreamDefaultControllerCloseCodeConstructorKind; -extern const JSC::ImplementationVisibility s_writableStreamInternalsWritableStreamDefaultControllerCloseCodeImplementationVisibility; +// readableStreamReaderKind +#define WEBCORE_BUILTIN_READABLEBYTESTREAMINTERNALS_READABLESTREAMREADERKIND 1 +extern const char* const s_readableByteStreamInternalsReadableStreamReaderKindCode; +extern const int s_readableByteStreamInternalsReadableStreamReaderKindCodeLength; +extern const JSC::ConstructAbility s_readableByteStreamInternalsReadableStreamReaderKindCodeConstructAbility; +extern const JSC::ConstructorKind s_readableByteStreamInternalsReadableStreamReaderKindCodeConstructorKind; +extern const JSC::ImplementationVisibility s_readableByteStreamInternalsReadableStreamReaderKindCodeImplementationVisibility; -// writableStreamDefaultControllerError -#define WEBCORE_BUILTIN_WRITABLESTREAMINTERNALS_WRITABLESTREAMDEFAULTCONTROLLERERROR 1 -extern const char* const s_writableStreamInternalsWritableStreamDefaultControllerErrorCode; -extern const int s_writableStreamInternalsWritableStreamDefaultControllerErrorCodeLength; -extern const JSC::ConstructAbility s_writableStreamInternalsWritableStreamDefaultControllerErrorCodeConstructAbility; -extern const JSC::ConstructorKind s_writableStreamInternalsWritableStreamDefaultControllerErrorCodeConstructorKind; -extern const JSC::ImplementationVisibility s_writableStreamInternalsWritableStreamDefaultControllerErrorCodeImplementationVisibility; +// readableByteStreamControllerEnqueue +#define WEBCORE_BUILTIN_READABLEBYTESTREAMINTERNALS_READABLEBYTESTREAMCONTROLLERENQUEUE 1 +extern const char* const s_readableByteStreamInternalsReadableByteStreamControllerEnqueueCode; +extern const int s_readableByteStreamInternalsReadableByteStreamControllerEnqueueCodeLength; +extern const JSC::ConstructAbility s_readableByteStreamInternalsReadableByteStreamControllerEnqueueCodeConstructAbility; +extern const JSC::ConstructorKind s_readableByteStreamInternalsReadableByteStreamControllerEnqueueCodeConstructorKind; +extern const JSC::ImplementationVisibility s_readableByteStreamInternalsReadableByteStreamControllerEnqueueCodeImplementationVisibility; -// writableStreamDefaultControllerErrorIfNeeded -#define WEBCORE_BUILTIN_WRITABLESTREAMINTERNALS_WRITABLESTREAMDEFAULTCONTROLLERERRORIFNEEDED 1 -extern const char* const s_writableStreamInternalsWritableStreamDefaultControllerErrorIfNeededCode; -extern const int s_writableStreamInternalsWritableStreamDefaultControllerErrorIfNeededCodeLength; -extern const JSC::ConstructAbility s_writableStreamInternalsWritableStreamDefaultControllerErrorIfNeededCodeConstructAbility; -extern const JSC::ConstructorKind s_writableStreamInternalsWritableStreamDefaultControllerErrorIfNeededCodeConstructorKind; -extern const JSC::ImplementationVisibility s_writableStreamInternalsWritableStreamDefaultControllerErrorIfNeededCodeImplementationVisibility; +// readableByteStreamControllerEnqueueChunk +#define WEBCORE_BUILTIN_READABLEBYTESTREAMINTERNALS_READABLEBYTESTREAMCONTROLLERENQUEUECHUNK 1 +extern const char* const s_readableByteStreamInternalsReadableByteStreamControllerEnqueueChunkCode; +extern const int s_readableByteStreamInternalsReadableByteStreamControllerEnqueueChunkCodeLength; +extern const JSC::ConstructAbility s_readableByteStreamInternalsReadableByteStreamControllerEnqueueChunkCodeConstructAbility; +extern const JSC::ConstructorKind s_readableByteStreamInternalsReadableByteStreamControllerEnqueueChunkCodeConstructorKind; +extern const JSC::ImplementationVisibility s_readableByteStreamInternalsReadableByteStreamControllerEnqueueChunkCodeImplementationVisibility; -// writableStreamDefaultControllerGetBackpressure -#define WEBCORE_BUILTIN_WRITABLESTREAMINTERNALS_WRITABLESTREAMDEFAULTCONTROLLERGETBACKPRESSURE 1 -extern const char* const s_writableStreamInternalsWritableStreamDefaultControllerGetBackpressureCode; -extern const int s_writableStreamInternalsWritableStreamDefaultControllerGetBackpressureCodeLength; -extern const JSC::ConstructAbility s_writableStreamInternalsWritableStreamDefaultControllerGetBackpressureCodeConstructAbility; -extern const JSC::ConstructorKind s_writableStreamInternalsWritableStreamDefaultControllerGetBackpressureCodeConstructorKind; -extern const JSC::ImplementationVisibility s_writableStreamInternalsWritableStreamDefaultControllerGetBackpressureCodeImplementationVisibility; +// readableByteStreamControllerRespondWithNewView +#define WEBCORE_BUILTIN_READABLEBYTESTREAMINTERNALS_READABLEBYTESTREAMCONTROLLERRESPONDWITHNEWVIEW 1 +extern const char* const s_readableByteStreamInternalsReadableByteStreamControllerRespondWithNewViewCode; +extern const int s_readableByteStreamInternalsReadableByteStreamControllerRespondWithNewViewCodeLength; +extern const JSC::ConstructAbility s_readableByteStreamInternalsReadableByteStreamControllerRespondWithNewViewCodeConstructAbility; +extern const JSC::ConstructorKind s_readableByteStreamInternalsReadableByteStreamControllerRespondWithNewViewCodeConstructorKind; +extern const JSC::ImplementationVisibility s_readableByteStreamInternalsReadableByteStreamControllerRespondWithNewViewCodeImplementationVisibility; -// writableStreamDefaultControllerGetChunkSize -#define WEBCORE_BUILTIN_WRITABLESTREAMINTERNALS_WRITABLESTREAMDEFAULTCONTROLLERGETCHUNKSIZE 1 -extern const char* const s_writableStreamInternalsWritableStreamDefaultControllerGetChunkSizeCode; -extern const int s_writableStreamInternalsWritableStreamDefaultControllerGetChunkSizeCodeLength; -extern const JSC::ConstructAbility s_writableStreamInternalsWritableStreamDefaultControllerGetChunkSizeCodeConstructAbility; -extern const JSC::ConstructorKind s_writableStreamInternalsWritableStreamDefaultControllerGetChunkSizeCodeConstructorKind; -extern const JSC::ImplementationVisibility s_writableStreamInternalsWritableStreamDefaultControllerGetChunkSizeCodeImplementationVisibility; +// readableByteStreamControllerRespond +#define WEBCORE_BUILTIN_READABLEBYTESTREAMINTERNALS_READABLEBYTESTREAMCONTROLLERRESPOND 1 +extern const char* const s_readableByteStreamInternalsReadableByteStreamControllerRespondCode; +extern const int s_readableByteStreamInternalsReadableByteStreamControllerRespondCodeLength; +extern const JSC::ConstructAbility s_readableByteStreamInternalsReadableByteStreamControllerRespondCodeConstructAbility; +extern const JSC::ConstructorKind s_readableByteStreamInternalsReadableByteStreamControllerRespondCodeConstructorKind; +extern const JSC::ImplementationVisibility s_readableByteStreamInternalsReadableByteStreamControllerRespondCodeImplementationVisibility; -// writableStreamDefaultControllerGetDesiredSize -#define WEBCORE_BUILTIN_WRITABLESTREAMINTERNALS_WRITABLESTREAMDEFAULTCONTROLLERGETDESIREDSIZE 1 -extern const char* const s_writableStreamInternalsWritableStreamDefaultControllerGetDesiredSizeCode; -extern const int s_writableStreamInternalsWritableStreamDefaultControllerGetDesiredSizeCodeLength; -extern const JSC::ConstructAbility s_writableStreamInternalsWritableStreamDefaultControllerGetDesiredSizeCodeConstructAbility; -extern const JSC::ConstructorKind s_writableStreamInternalsWritableStreamDefaultControllerGetDesiredSizeCodeConstructorKind; -extern const JSC::ImplementationVisibility s_writableStreamInternalsWritableStreamDefaultControllerGetDesiredSizeCodeImplementationVisibility; +// readableByteStreamControllerRespondInternal +#define WEBCORE_BUILTIN_READABLEBYTESTREAMINTERNALS_READABLEBYTESTREAMCONTROLLERRESPONDINTERNAL 1 +extern const char* const s_readableByteStreamInternalsReadableByteStreamControllerRespondInternalCode; +extern const int s_readableByteStreamInternalsReadableByteStreamControllerRespondInternalCodeLength; +extern const JSC::ConstructAbility s_readableByteStreamInternalsReadableByteStreamControllerRespondInternalCodeConstructAbility; +extern const JSC::ConstructorKind s_readableByteStreamInternalsReadableByteStreamControllerRespondInternalCodeConstructorKind; +extern const JSC::ImplementationVisibility s_readableByteStreamInternalsReadableByteStreamControllerRespondInternalCodeImplementationVisibility; -// writableStreamDefaultControllerProcessClose -#define WEBCORE_BUILTIN_WRITABLESTREAMINTERNALS_WRITABLESTREAMDEFAULTCONTROLLERPROCESSCLOSE 1 -extern const char* const s_writableStreamInternalsWritableStreamDefaultControllerProcessCloseCode; -extern const int s_writableStreamInternalsWritableStreamDefaultControllerProcessCloseCodeLength; -extern const JSC::ConstructAbility s_writableStreamInternalsWritableStreamDefaultControllerProcessCloseCodeConstructAbility; -extern const JSC::ConstructorKind s_writableStreamInternalsWritableStreamDefaultControllerProcessCloseCodeConstructorKind; -extern const JSC::ImplementationVisibility s_writableStreamInternalsWritableStreamDefaultControllerProcessCloseCodeImplementationVisibility; +// readableByteStreamControllerRespondInReadableState +#define WEBCORE_BUILTIN_READABLEBYTESTREAMINTERNALS_READABLEBYTESTREAMCONTROLLERRESPONDINREADABLESTATE 1 +extern const char* const s_readableByteStreamInternalsReadableByteStreamControllerRespondInReadableStateCode; +extern const int s_readableByteStreamInternalsReadableByteStreamControllerRespondInReadableStateCodeLength; +extern const JSC::ConstructAbility s_readableByteStreamInternalsReadableByteStreamControllerRespondInReadableStateCodeConstructAbility; +extern const JSC::ConstructorKind s_readableByteStreamInternalsReadableByteStreamControllerRespondInReadableStateCodeConstructorKind; +extern const JSC::ImplementationVisibility s_readableByteStreamInternalsReadableByteStreamControllerRespondInReadableStateCodeImplementationVisibility; -// writableStreamDefaultControllerProcessWrite -#define WEBCORE_BUILTIN_WRITABLESTREAMINTERNALS_WRITABLESTREAMDEFAULTCONTROLLERPROCESSWRITE 1 -extern const char* const s_writableStreamInternalsWritableStreamDefaultControllerProcessWriteCode; -extern const int s_writableStreamInternalsWritableStreamDefaultControllerProcessWriteCodeLength; -extern const JSC::ConstructAbility s_writableStreamInternalsWritableStreamDefaultControllerProcessWriteCodeConstructAbility; -extern const JSC::ConstructorKind s_writableStreamInternalsWritableStreamDefaultControllerProcessWriteCodeConstructorKind; -extern const JSC::ImplementationVisibility s_writableStreamInternalsWritableStreamDefaultControllerProcessWriteCodeImplementationVisibility; +// readableByteStreamControllerRespondInClosedState +#define WEBCORE_BUILTIN_READABLEBYTESTREAMINTERNALS_READABLEBYTESTREAMCONTROLLERRESPONDINCLOSEDSTATE 1 +extern const char* const s_readableByteStreamInternalsReadableByteStreamControllerRespondInClosedStateCode; +extern const int s_readableByteStreamInternalsReadableByteStreamControllerRespondInClosedStateCodeLength; +extern const JSC::ConstructAbility s_readableByteStreamInternalsReadableByteStreamControllerRespondInClosedStateCodeConstructAbility; +extern const JSC::ConstructorKind s_readableByteStreamInternalsReadableByteStreamControllerRespondInClosedStateCodeConstructorKind; +extern const JSC::ImplementationVisibility s_readableByteStreamInternalsReadableByteStreamControllerRespondInClosedStateCodeImplementationVisibility; -// writableStreamDefaultControllerWrite -#define WEBCORE_BUILTIN_WRITABLESTREAMINTERNALS_WRITABLESTREAMDEFAULTCONTROLLERWRITE 1 -extern const char* const s_writableStreamInternalsWritableStreamDefaultControllerWriteCode; -extern const int s_writableStreamInternalsWritableStreamDefaultControllerWriteCodeLength; -extern const JSC::ConstructAbility s_writableStreamInternalsWritableStreamDefaultControllerWriteCodeConstructAbility; -extern const JSC::ConstructorKind s_writableStreamInternalsWritableStreamDefaultControllerWriteCodeConstructorKind; -extern const JSC::ImplementationVisibility s_writableStreamInternalsWritableStreamDefaultControllerWriteCodeImplementationVisibility; +// readableByteStreamControllerProcessPullDescriptors +#define WEBCORE_BUILTIN_READABLEBYTESTREAMINTERNALS_READABLEBYTESTREAMCONTROLLERPROCESSPULLDESCRIPTORS 1 +extern const char* const s_readableByteStreamInternalsReadableByteStreamControllerProcessPullDescriptorsCode; +extern const int s_readableByteStreamInternalsReadableByteStreamControllerProcessPullDescriptorsCodeLength; +extern const JSC::ConstructAbility s_readableByteStreamInternalsReadableByteStreamControllerProcessPullDescriptorsCodeConstructAbility; +extern const JSC::ConstructorKind s_readableByteStreamInternalsReadableByteStreamControllerProcessPullDescriptorsCodeConstructorKind; +extern const JSC::ImplementationVisibility s_readableByteStreamInternalsReadableByteStreamControllerProcessPullDescriptorsCodeImplementationVisibility; -#define WEBCORE_FOREACH_WRITABLESTREAMINTERNALS_BUILTIN_DATA(macro) \ - macro(isWritableStream, writableStreamInternalsIsWritableStream, 1) \ - macro(isWritableStreamDefaultWriter, writableStreamInternalsIsWritableStreamDefaultWriter, 1) \ - macro(acquireWritableStreamDefaultWriter, writableStreamInternalsAcquireWritableStreamDefaultWriter, 1) \ - macro(createWritableStream, writableStreamInternalsCreateWritableStream, 7) \ - macro(createInternalWritableStreamFromUnderlyingSink, writableStreamInternalsCreateInternalWritableStreamFromUnderlyingSink, 2) \ - macro(initializeWritableStreamSlots, writableStreamInternalsInitializeWritableStreamSlots, 2) \ - macro(writableStreamCloseForBindings, writableStreamInternalsWritableStreamCloseForBindings, 1) \ - macro(writableStreamAbortForBindings, writableStreamInternalsWritableStreamAbortForBindings, 2) \ - macro(isWritableStreamLocked, writableStreamInternalsIsWritableStreamLocked, 1) \ - macro(setUpWritableStreamDefaultWriter, writableStreamInternalsSetUpWritableStreamDefaultWriter, 2) \ - macro(writableStreamAbort, writableStreamInternalsWritableStreamAbort, 2) \ - macro(writableStreamClose, writableStreamInternalsWritableStreamClose, 1) \ - macro(writableStreamAddWriteRequest, writableStreamInternalsWritableStreamAddWriteRequest, 1) \ - macro(writableStreamCloseQueuedOrInFlight, writableStreamInternalsWritableStreamCloseQueuedOrInFlight, 1) \ - macro(writableStreamDealWithRejection, writableStreamInternalsWritableStreamDealWithRejection, 2) \ - macro(writableStreamFinishErroring, writableStreamInternalsWritableStreamFinishErroring, 1) \ - macro(writableStreamFinishInFlightClose, writableStreamInternalsWritableStreamFinishInFlightClose, 1) \ - macro(writableStreamFinishInFlightCloseWithError, writableStreamInternalsWritableStreamFinishInFlightCloseWithError, 2) \ - macro(writableStreamFinishInFlightWrite, writableStreamInternalsWritableStreamFinishInFlightWrite, 1) \ - macro(writableStreamFinishInFlightWriteWithError, writableStreamInternalsWritableStreamFinishInFlightWriteWithError, 2) \ - macro(writableStreamHasOperationMarkedInFlight, writableStreamInternalsWritableStreamHasOperationMarkedInFlight, 1) \ - macro(writableStreamMarkCloseRequestInFlight, writableStreamInternalsWritableStreamMarkCloseRequestInFlight, 1) \ - macro(writableStreamMarkFirstWriteRequestInFlight, writableStreamInternalsWritableStreamMarkFirstWriteRequestInFlight, 1) \ - macro(writableStreamRejectCloseAndClosedPromiseIfNeeded, writableStreamInternalsWritableStreamRejectCloseAndClosedPromiseIfNeeded, 1) \ - macro(writableStreamStartErroring, writableStreamInternalsWritableStreamStartErroring, 2) \ - macro(writableStreamUpdateBackpressure, writableStreamInternalsWritableStreamUpdateBackpressure, 2) \ - macro(writableStreamDefaultWriterAbort, writableStreamInternalsWritableStreamDefaultWriterAbort, 2) \ - macro(writableStreamDefaultWriterClose, writableStreamInternalsWritableStreamDefaultWriterClose, 1) \ - macro(writableStreamDefaultWriterCloseWithErrorPropagation, writableStreamInternalsWritableStreamDefaultWriterCloseWithErrorPropagation, 1) \ - macro(writableStreamDefaultWriterEnsureClosedPromiseRejected, writableStreamInternalsWritableStreamDefaultWriterEnsureClosedPromiseRejected, 2) \ - macro(writableStreamDefaultWriterEnsureReadyPromiseRejected, writableStreamInternalsWritableStreamDefaultWriterEnsureReadyPromiseRejected, 2) \ - macro(writableStreamDefaultWriterGetDesiredSize, writableStreamInternalsWritableStreamDefaultWriterGetDesiredSize, 1) \ - macro(writableStreamDefaultWriterRelease, writableStreamInternalsWritableStreamDefaultWriterRelease, 1) \ - macro(writableStreamDefaultWriterWrite, writableStreamInternalsWritableStreamDefaultWriterWrite, 2) \ - macro(setUpWritableStreamDefaultController, writableStreamInternalsSetUpWritableStreamDefaultController, 9) \ - macro(writableStreamDefaultControllerStart, writableStreamInternalsWritableStreamDefaultControllerStart, 1) \ - macro(setUpWritableStreamDefaultControllerFromUnderlyingSink, writableStreamInternalsSetUpWritableStreamDefaultControllerFromUnderlyingSink, 6) \ - macro(writableStreamDefaultControllerAdvanceQueueIfNeeded, writableStreamInternalsWritableStreamDefaultControllerAdvanceQueueIfNeeded, 1) \ - macro(isCloseSentinel, writableStreamInternalsIsCloseSentinel, 0) \ - macro(writableStreamDefaultControllerClearAlgorithms, writableStreamInternalsWritableStreamDefaultControllerClearAlgorithms, 1) \ - macro(writableStreamDefaultControllerClose, writableStreamInternalsWritableStreamDefaultControllerClose, 1) \ - macro(writableStreamDefaultControllerError, writableStreamInternalsWritableStreamDefaultControllerError, 2) \ - macro(writableStreamDefaultControllerErrorIfNeeded, writableStreamInternalsWritableStreamDefaultControllerErrorIfNeeded, 2) \ - macro(writableStreamDefaultControllerGetBackpressure, writableStreamInternalsWritableStreamDefaultControllerGetBackpressure, 1) \ - macro(writableStreamDefaultControllerGetChunkSize, writableStreamInternalsWritableStreamDefaultControllerGetChunkSize, 2) \ - macro(writableStreamDefaultControllerGetDesiredSize, writableStreamInternalsWritableStreamDefaultControllerGetDesiredSize, 1) \ - macro(writableStreamDefaultControllerProcessClose, writableStreamInternalsWritableStreamDefaultControllerProcessClose, 1) \ - macro(writableStreamDefaultControllerProcessWrite, writableStreamInternalsWritableStreamDefaultControllerProcessWrite, 2) \ - macro(writableStreamDefaultControllerWrite, writableStreamInternalsWritableStreamDefaultControllerWrite, 3) \ - -#define WEBCORE_FOREACH_WRITABLESTREAMINTERNALS_BUILTIN_CODE(macro) \ - macro(writableStreamInternalsIsWritableStreamCode, isWritableStream, ASCIILiteral(), s_writableStreamInternalsIsWritableStreamCodeLength) \ - macro(writableStreamInternalsIsWritableStreamDefaultWriterCode, isWritableStreamDefaultWriter, ASCIILiteral(), s_writableStreamInternalsIsWritableStreamDefaultWriterCodeLength) \ - macro(writableStreamInternalsAcquireWritableStreamDefaultWriterCode, acquireWritableStreamDefaultWriter, ASCIILiteral(), s_writableStreamInternalsAcquireWritableStreamDefaultWriterCodeLength) \ - macro(writableStreamInternalsCreateWritableStreamCode, createWritableStream, ASCIILiteral(), s_writableStreamInternalsCreateWritableStreamCodeLength) \ - macro(writableStreamInternalsCreateInternalWritableStreamFromUnderlyingSinkCode, createInternalWritableStreamFromUnderlyingSink, ASCIILiteral(), s_writableStreamInternalsCreateInternalWritableStreamFromUnderlyingSinkCodeLength) \ - macro(writableStreamInternalsInitializeWritableStreamSlotsCode, initializeWritableStreamSlots, ASCIILiteral(), s_writableStreamInternalsInitializeWritableStreamSlotsCodeLength) \ - macro(writableStreamInternalsWritableStreamCloseForBindingsCode, writableStreamCloseForBindings, ASCIILiteral(), s_writableStreamInternalsWritableStreamCloseForBindingsCodeLength) \ - macro(writableStreamInternalsWritableStreamAbortForBindingsCode, writableStreamAbortForBindings, ASCIILiteral(), s_writableStreamInternalsWritableStreamAbortForBindingsCodeLength) \ - macro(writableStreamInternalsIsWritableStreamLockedCode, isWritableStreamLocked, ASCIILiteral(), s_writableStreamInternalsIsWritableStreamLockedCodeLength) \ - macro(writableStreamInternalsSetUpWritableStreamDefaultWriterCode, setUpWritableStreamDefaultWriter, ASCIILiteral(), s_writableStreamInternalsSetUpWritableStreamDefaultWriterCodeLength) \ - macro(writableStreamInternalsWritableStreamAbortCode, writableStreamAbort, ASCIILiteral(), s_writableStreamInternalsWritableStreamAbortCodeLength) \ - macro(writableStreamInternalsWritableStreamCloseCode, writableStreamClose, ASCIILiteral(), s_writableStreamInternalsWritableStreamCloseCodeLength) \ - macro(writableStreamInternalsWritableStreamAddWriteRequestCode, writableStreamAddWriteRequest, ASCIILiteral(), s_writableStreamInternalsWritableStreamAddWriteRequestCodeLength) \ - macro(writableStreamInternalsWritableStreamCloseQueuedOrInFlightCode, writableStreamCloseQueuedOrInFlight, ASCIILiteral(), s_writableStreamInternalsWritableStreamCloseQueuedOrInFlightCodeLength) \ - macro(writableStreamInternalsWritableStreamDealWithRejectionCode, writableStreamDealWithRejection, ASCIILiteral(), s_writableStreamInternalsWritableStreamDealWithRejectionCodeLength) \ - macro(writableStreamInternalsWritableStreamFinishErroringCode, writableStreamFinishErroring, ASCIILiteral(), s_writableStreamInternalsWritableStreamFinishErroringCodeLength) \ - macro(writableStreamInternalsWritableStreamFinishInFlightCloseCode, writableStreamFinishInFlightClose, ASCIILiteral(), s_writableStreamInternalsWritableStreamFinishInFlightCloseCodeLength) \ - macro(writableStreamInternalsWritableStreamFinishInFlightCloseWithErrorCode, writableStreamFinishInFlightCloseWithError, ASCIILiteral(), s_writableStreamInternalsWritableStreamFinishInFlightCloseWithErrorCodeLength) \ - macro(writableStreamInternalsWritableStreamFinishInFlightWriteCode, writableStreamFinishInFlightWrite, ASCIILiteral(), s_writableStreamInternalsWritableStreamFinishInFlightWriteCodeLength) \ - macro(writableStreamInternalsWritableStreamFinishInFlightWriteWithErrorCode, writableStreamFinishInFlightWriteWithError, ASCIILiteral(), s_writableStreamInternalsWritableStreamFinishInFlightWriteWithErrorCodeLength) \ - macro(writableStreamInternalsWritableStreamHasOperationMarkedInFlightCode, writableStreamHasOperationMarkedInFlight, ASCIILiteral(), s_writableStreamInternalsWritableStreamHasOperationMarkedInFlightCodeLength) \ - macro(writableStreamInternalsWritableStreamMarkCloseRequestInFlightCode, writableStreamMarkCloseRequestInFlight, ASCIILiteral(), s_writableStreamInternalsWritableStreamMarkCloseRequestInFlightCodeLength) \ - macro(writableStreamInternalsWritableStreamMarkFirstWriteRequestInFlightCode, writableStreamMarkFirstWriteRequestInFlight, ASCIILiteral(), s_writableStreamInternalsWritableStreamMarkFirstWriteRequestInFlightCodeLength) \ - macro(writableStreamInternalsWritableStreamRejectCloseAndClosedPromiseIfNeededCode, writableStreamRejectCloseAndClosedPromiseIfNeeded, ASCIILiteral(), s_writableStreamInternalsWritableStreamRejectCloseAndClosedPromiseIfNeededCodeLength) \ - macro(writableStreamInternalsWritableStreamStartErroringCode, writableStreamStartErroring, ASCIILiteral(), s_writableStreamInternalsWritableStreamStartErroringCodeLength) \ - macro(writableStreamInternalsWritableStreamUpdateBackpressureCode, writableStreamUpdateBackpressure, ASCIILiteral(), s_writableStreamInternalsWritableStreamUpdateBackpressureCodeLength) \ - macro(writableStreamInternalsWritableStreamDefaultWriterAbortCode, writableStreamDefaultWriterAbort, ASCIILiteral(), s_writableStreamInternalsWritableStreamDefaultWriterAbortCodeLength) \ - macro(writableStreamInternalsWritableStreamDefaultWriterCloseCode, writableStreamDefaultWriterClose, ASCIILiteral(), s_writableStreamInternalsWritableStreamDefaultWriterCloseCodeLength) \ - macro(writableStreamInternalsWritableStreamDefaultWriterCloseWithErrorPropagationCode, writableStreamDefaultWriterCloseWithErrorPropagation, ASCIILiteral(), s_writableStreamInternalsWritableStreamDefaultWriterCloseWithErrorPropagationCodeLength) \ - macro(writableStreamInternalsWritableStreamDefaultWriterEnsureClosedPromiseRejectedCode, writableStreamDefaultWriterEnsureClosedPromiseRejected, ASCIILiteral(), s_writableStreamInternalsWritableStreamDefaultWriterEnsureClosedPromiseRejectedCodeLength) \ - macro(writableStreamInternalsWritableStreamDefaultWriterEnsureReadyPromiseRejectedCode, writableStreamDefaultWriterEnsureReadyPromiseRejected, ASCIILiteral(), s_writableStreamInternalsWritableStreamDefaultWriterEnsureReadyPromiseRejectedCodeLength) \ - macro(writableStreamInternalsWritableStreamDefaultWriterGetDesiredSizeCode, writableStreamDefaultWriterGetDesiredSize, ASCIILiteral(), s_writableStreamInternalsWritableStreamDefaultWriterGetDesiredSizeCodeLength) \ - macro(writableStreamInternalsWritableStreamDefaultWriterReleaseCode, writableStreamDefaultWriterRelease, ASCIILiteral(), s_writableStreamInternalsWritableStreamDefaultWriterReleaseCodeLength) \ - macro(writableStreamInternalsWritableStreamDefaultWriterWriteCode, writableStreamDefaultWriterWrite, ASCIILiteral(), s_writableStreamInternalsWritableStreamDefaultWriterWriteCodeLength) \ - macro(writableStreamInternalsSetUpWritableStreamDefaultControllerCode, setUpWritableStreamDefaultController, ASCIILiteral(), s_writableStreamInternalsSetUpWritableStreamDefaultControllerCodeLength) \ - macro(writableStreamInternalsWritableStreamDefaultControllerStartCode, writableStreamDefaultControllerStart, ASCIILiteral(), s_writableStreamInternalsWritableStreamDefaultControllerStartCodeLength) \ - macro(writableStreamInternalsSetUpWritableStreamDefaultControllerFromUnderlyingSinkCode, setUpWritableStreamDefaultControllerFromUnderlyingSink, ASCIILiteral(), s_writableStreamInternalsSetUpWritableStreamDefaultControllerFromUnderlyingSinkCodeLength) \ - macro(writableStreamInternalsWritableStreamDefaultControllerAdvanceQueueIfNeededCode, writableStreamDefaultControllerAdvanceQueueIfNeeded, ASCIILiteral(), s_writableStreamInternalsWritableStreamDefaultControllerAdvanceQueueIfNeededCodeLength) \ - macro(writableStreamInternalsIsCloseSentinelCode, isCloseSentinel, ASCIILiteral(), s_writableStreamInternalsIsCloseSentinelCodeLength) \ - macro(writableStreamInternalsWritableStreamDefaultControllerClearAlgorithmsCode, writableStreamDefaultControllerClearAlgorithms, ASCIILiteral(), s_writableStreamInternalsWritableStreamDefaultControllerClearAlgorithmsCodeLength) \ - macro(writableStreamInternalsWritableStreamDefaultControllerCloseCode, writableStreamDefaultControllerClose, ASCIILiteral(), s_writableStreamInternalsWritableStreamDefaultControllerCloseCodeLength) \ - macro(writableStreamInternalsWritableStreamDefaultControllerErrorCode, writableStreamDefaultControllerError, ASCIILiteral(), s_writableStreamInternalsWritableStreamDefaultControllerErrorCodeLength) \ - macro(writableStreamInternalsWritableStreamDefaultControllerErrorIfNeededCode, writableStreamDefaultControllerErrorIfNeeded, ASCIILiteral(), s_writableStreamInternalsWritableStreamDefaultControllerErrorIfNeededCodeLength) \ - macro(writableStreamInternalsWritableStreamDefaultControllerGetBackpressureCode, writableStreamDefaultControllerGetBackpressure, ASCIILiteral(), s_writableStreamInternalsWritableStreamDefaultControllerGetBackpressureCodeLength) \ - macro(writableStreamInternalsWritableStreamDefaultControllerGetChunkSizeCode, writableStreamDefaultControllerGetChunkSize, ASCIILiteral(), s_writableStreamInternalsWritableStreamDefaultControllerGetChunkSizeCodeLength) \ - macro(writableStreamInternalsWritableStreamDefaultControllerGetDesiredSizeCode, writableStreamDefaultControllerGetDesiredSize, ASCIILiteral(), s_writableStreamInternalsWritableStreamDefaultControllerGetDesiredSizeCodeLength) \ - macro(writableStreamInternalsWritableStreamDefaultControllerProcessCloseCode, writableStreamDefaultControllerProcessClose, ASCIILiteral(), s_writableStreamInternalsWritableStreamDefaultControllerProcessCloseCodeLength) \ - macro(writableStreamInternalsWritableStreamDefaultControllerProcessWriteCode, writableStreamDefaultControllerProcessWrite, ASCIILiteral(), s_writableStreamInternalsWritableStreamDefaultControllerProcessWriteCodeLength) \ - macro(writableStreamInternalsWritableStreamDefaultControllerWriteCode, writableStreamDefaultControllerWrite, ASCIILiteral(), s_writableStreamInternalsWritableStreamDefaultControllerWriteCodeLength) \ - -#define WEBCORE_FOREACH_WRITABLESTREAMINTERNALS_BUILTIN_FUNCTION_NAME(macro) \ - macro(isWritableStream) \ - macro(isWritableStreamDefaultWriter) \ - macro(acquireWritableStreamDefaultWriter) \ - macro(createWritableStream) \ - macro(createInternalWritableStreamFromUnderlyingSink) \ - macro(initializeWritableStreamSlots) \ - macro(writableStreamCloseForBindings) \ - macro(writableStreamAbortForBindings) \ - macro(isWritableStreamLocked) \ - macro(setUpWritableStreamDefaultWriter) \ - macro(writableStreamAbort) \ - macro(writableStreamClose) \ - macro(writableStreamAddWriteRequest) \ - macro(writableStreamCloseQueuedOrInFlight) \ - macro(writableStreamDealWithRejection) \ - macro(writableStreamFinishErroring) \ - macro(writableStreamFinishInFlightClose) \ - macro(writableStreamFinishInFlightCloseWithError) \ - macro(writableStreamFinishInFlightWrite) \ - macro(writableStreamFinishInFlightWriteWithError) \ - macro(writableStreamHasOperationMarkedInFlight) \ - macro(writableStreamMarkCloseRequestInFlight) \ - macro(writableStreamMarkFirstWriteRequestInFlight) \ - macro(writableStreamRejectCloseAndClosedPromiseIfNeeded) \ - macro(writableStreamStartErroring) \ - macro(writableStreamUpdateBackpressure) \ - macro(writableStreamDefaultWriterAbort) \ - macro(writableStreamDefaultWriterClose) \ - macro(writableStreamDefaultWriterCloseWithErrorPropagation) \ - macro(writableStreamDefaultWriterEnsureClosedPromiseRejected) \ - macro(writableStreamDefaultWriterEnsureReadyPromiseRejected) \ - macro(writableStreamDefaultWriterGetDesiredSize) \ - macro(writableStreamDefaultWriterRelease) \ - macro(writableStreamDefaultWriterWrite) \ - macro(setUpWritableStreamDefaultController) \ - macro(writableStreamDefaultControllerStart) \ - macro(setUpWritableStreamDefaultControllerFromUnderlyingSink) \ - macro(writableStreamDefaultControllerAdvanceQueueIfNeeded) \ - macro(isCloseSentinel) \ - macro(writableStreamDefaultControllerClearAlgorithms) \ - macro(writableStreamDefaultControllerClose) \ - macro(writableStreamDefaultControllerError) \ - macro(writableStreamDefaultControllerErrorIfNeeded) \ - macro(writableStreamDefaultControllerGetBackpressure) \ - macro(writableStreamDefaultControllerGetChunkSize) \ - macro(writableStreamDefaultControllerGetDesiredSize) \ - macro(writableStreamDefaultControllerProcessClose) \ - macro(writableStreamDefaultControllerProcessWrite) \ - macro(writableStreamDefaultControllerWrite) \ - -#define DECLARE_BUILTIN_GENERATOR(codeName, functionName, overriddenName, argumentCount) \ - JSC::FunctionExecutable* codeName##Generator(JSC::VM&); - -WEBCORE_FOREACH_WRITABLESTREAMINTERNALS_BUILTIN_CODE(DECLARE_BUILTIN_GENERATOR) -#undef DECLARE_BUILTIN_GENERATOR - -class WritableStreamInternalsBuiltinsWrapper : private JSC::WeakHandleOwner { -public: - explicit WritableStreamInternalsBuiltinsWrapper(JSC::VM& vm) - : m_vm(vm) - WEBCORE_FOREACH_WRITABLESTREAMINTERNALS_BUILTIN_FUNCTION_NAME(INITIALIZE_BUILTIN_NAMES) -#define INITIALIZE_BUILTIN_SOURCE_MEMBERS(name, functionName, overriddenName, length) , m_##name##Source(JSC::makeSource(StringImpl::createWithoutCopying(s_##name, length), { }, JSC::SourceTaintedOrigin::Untainted)) - WEBCORE_FOREACH_WRITABLESTREAMINTERNALS_BUILTIN_CODE(INITIALIZE_BUILTIN_SOURCE_MEMBERS) -#undef INITIALIZE_BUILTIN_SOURCE_MEMBERS - { - } +// readableByteStreamControllerFillDescriptorFromQueue +#define WEBCORE_BUILTIN_READABLEBYTESTREAMINTERNALS_READABLEBYTESTREAMCONTROLLERFILLDESCRIPTORFROMQUEUE 1 +extern const char* const s_readableByteStreamInternalsReadableByteStreamControllerFillDescriptorFromQueueCode; +extern const int s_readableByteStreamInternalsReadableByteStreamControllerFillDescriptorFromQueueCodeLength; +extern const JSC::ConstructAbility s_readableByteStreamInternalsReadableByteStreamControllerFillDescriptorFromQueueCodeConstructAbility; +extern const JSC::ConstructorKind s_readableByteStreamInternalsReadableByteStreamControllerFillDescriptorFromQueueCodeConstructorKind; +extern const JSC::ImplementationVisibility s_readableByteStreamInternalsReadableByteStreamControllerFillDescriptorFromQueueCodeImplementationVisibility; -#define EXPOSE_BUILTIN_EXECUTABLES(name, functionName, overriddenName, length) \ - JSC::UnlinkedFunctionExecutable* name##Executable(); \ - const JSC::SourceCode& name##Source() const { return m_##name##Source; } - WEBCORE_FOREACH_WRITABLESTREAMINTERNALS_BUILTIN_CODE(EXPOSE_BUILTIN_EXECUTABLES) -#undef EXPOSE_BUILTIN_EXECUTABLES +// readableByteStreamControllerShiftPendingDescriptor +#define WEBCORE_BUILTIN_READABLEBYTESTREAMINTERNALS_READABLEBYTESTREAMCONTROLLERSHIFTPENDINGDESCRIPTOR 1 +extern const char* const s_readableByteStreamInternalsReadableByteStreamControllerShiftPendingDescriptorCode; +extern const int s_readableByteStreamInternalsReadableByteStreamControllerShiftPendingDescriptorCodeLength; +extern const JSC::ConstructAbility s_readableByteStreamInternalsReadableByteStreamControllerShiftPendingDescriptorCodeConstructAbility; +extern const JSC::ConstructorKind s_readableByteStreamInternalsReadableByteStreamControllerShiftPendingDescriptorCodeConstructorKind; +extern const JSC::ImplementationVisibility s_readableByteStreamInternalsReadableByteStreamControllerShiftPendingDescriptorCodeImplementationVisibility; - WEBCORE_FOREACH_WRITABLESTREAMINTERNALS_BUILTIN_FUNCTION_NAME(DECLARE_BUILTIN_IDENTIFIER_ACCESSOR) +// readableByteStreamControllerInvalidateBYOBRequest +#define WEBCORE_BUILTIN_READABLEBYTESTREAMINTERNALS_READABLEBYTESTREAMCONTROLLERINVALIDATEBYOBREQUEST 1 +extern const char* const s_readableByteStreamInternalsReadableByteStreamControllerInvalidateBYOBRequestCode; +extern const int s_readableByteStreamInternalsReadableByteStreamControllerInvalidateBYOBRequestCodeLength; +extern const JSC::ConstructAbility s_readableByteStreamInternalsReadableByteStreamControllerInvalidateBYOBRequestCodeConstructAbility; +extern const JSC::ConstructorKind s_readableByteStreamInternalsReadableByteStreamControllerInvalidateBYOBRequestCodeConstructorKind; +extern const JSC::ImplementationVisibility s_readableByteStreamInternalsReadableByteStreamControllerInvalidateBYOBRequestCodeImplementationVisibility; - void exportNames(); +// readableByteStreamControllerCommitDescriptor +#define WEBCORE_BUILTIN_READABLEBYTESTREAMINTERNALS_READABLEBYTESTREAMCONTROLLERCOMMITDESCRIPTOR 1 +extern const char* const s_readableByteStreamInternalsReadableByteStreamControllerCommitDescriptorCode; +extern const int s_readableByteStreamInternalsReadableByteStreamControllerCommitDescriptorCodeLength; +extern const JSC::ConstructAbility s_readableByteStreamInternalsReadableByteStreamControllerCommitDescriptorCodeConstructAbility; +extern const JSC::ConstructorKind s_readableByteStreamInternalsReadableByteStreamControllerCommitDescriptorCodeConstructorKind; +extern const JSC::ImplementationVisibility s_readableByteStreamInternalsReadableByteStreamControllerCommitDescriptorCodeImplementationVisibility; -private: - JSC::VM& m_vm; +// readableByteStreamControllerConvertDescriptor +#define WEBCORE_BUILTIN_READABLEBYTESTREAMINTERNALS_READABLEBYTESTREAMCONTROLLERCONVERTDESCRIPTOR 1 +extern const char* const s_readableByteStreamInternalsReadableByteStreamControllerConvertDescriptorCode; +extern const int s_readableByteStreamInternalsReadableByteStreamControllerConvertDescriptorCodeLength; +extern const JSC::ConstructAbility s_readableByteStreamInternalsReadableByteStreamControllerConvertDescriptorCodeConstructAbility; +extern const JSC::ConstructorKind s_readableByteStreamInternalsReadableByteStreamControllerConvertDescriptorCodeConstructorKind; +extern const JSC::ImplementationVisibility s_readableByteStreamInternalsReadableByteStreamControllerConvertDescriptorCodeImplementationVisibility; - WEBCORE_FOREACH_WRITABLESTREAMINTERNALS_BUILTIN_FUNCTION_NAME(DECLARE_BUILTIN_NAMES) +// readableStreamFulfillReadIntoRequest +#define WEBCORE_BUILTIN_READABLEBYTESTREAMINTERNALS_READABLESTREAMFULFILLREADINTOREQUEST 1 +extern const char* const s_readableByteStreamInternalsReadableStreamFulfillReadIntoRequestCode; +extern const int s_readableByteStreamInternalsReadableStreamFulfillReadIntoRequestCodeLength; +extern const JSC::ConstructAbility s_readableByteStreamInternalsReadableStreamFulfillReadIntoRequestCodeConstructAbility; +extern const JSC::ConstructorKind s_readableByteStreamInternalsReadableStreamFulfillReadIntoRequestCodeConstructorKind; +extern const JSC::ImplementationVisibility s_readableByteStreamInternalsReadableStreamFulfillReadIntoRequestCodeImplementationVisibility; -#define DECLARE_BUILTIN_SOURCE_MEMBERS(name, functionName, overriddenName, length) \ - JSC::SourceCode m_##name##Source;\ - JSC::Weak m_##name##Executable; - WEBCORE_FOREACH_WRITABLESTREAMINTERNALS_BUILTIN_CODE(DECLARE_BUILTIN_SOURCE_MEMBERS) -#undef DECLARE_BUILTIN_SOURCE_MEMBERS +// readableStreamBYOBReaderRead +#define WEBCORE_BUILTIN_READABLEBYTESTREAMINTERNALS_READABLESTREAMBYOBREADERREAD 1 +extern const char* const s_readableByteStreamInternalsReadableStreamBYOBReaderReadCode; +extern const int s_readableByteStreamInternalsReadableStreamBYOBReaderReadCodeLength; +extern const JSC::ConstructAbility s_readableByteStreamInternalsReadableStreamBYOBReaderReadCodeConstructAbility; +extern const JSC::ConstructorKind s_readableByteStreamInternalsReadableStreamBYOBReaderReadCodeConstructorKind; +extern const JSC::ImplementationVisibility s_readableByteStreamInternalsReadableStreamBYOBReaderReadCodeImplementationVisibility; -}; +// readableByteStreamControllerPullInto +#define WEBCORE_BUILTIN_READABLEBYTESTREAMINTERNALS_READABLEBYTESTREAMCONTROLLERPULLINTO 1 +extern const char* const s_readableByteStreamInternalsReadableByteStreamControllerPullIntoCode; +extern const int s_readableByteStreamInternalsReadableByteStreamControllerPullIntoCodeLength; +extern const JSC::ConstructAbility s_readableByteStreamInternalsReadableByteStreamControllerPullIntoCodeConstructAbility; +extern const JSC::ConstructorKind s_readableByteStreamInternalsReadableByteStreamControllerPullIntoCodeConstructorKind; +extern const JSC::ImplementationVisibility s_readableByteStreamInternalsReadableByteStreamControllerPullIntoCodeImplementationVisibility; -#define DEFINE_BUILTIN_EXECUTABLES(name, functionName, overriddenName, length) \ -inline JSC::UnlinkedFunctionExecutable* WritableStreamInternalsBuiltinsWrapper::name##Executable() \ -{\ - if (!m_##name##Executable) {\ - JSC::Identifier executableName = functionName##PublicName();\ - if (overriddenName)\ - executableName = JSC::Identifier::fromString(m_vm, overriddenName);\ - m_##name##Executable = JSC::Weak(JSC::createBuiltinExecutable(m_vm, m_##name##Source, executableName, s_##name##ImplementationVisibility, s_##name##ConstructorKind, s_##name##ConstructAbility), this, &m_##name##Executable);\ - }\ - return m_##name##Executable.get();\ -} -WEBCORE_FOREACH_WRITABLESTREAMINTERNALS_BUILTIN_CODE(DEFINE_BUILTIN_EXECUTABLES) -#undef DEFINE_BUILTIN_EXECUTABLES +// readableStreamAddReadIntoRequest +#define WEBCORE_BUILTIN_READABLEBYTESTREAMINTERNALS_READABLESTREAMADDREADINTOREQUEST 1 +extern const char* const s_readableByteStreamInternalsReadableStreamAddReadIntoRequestCode; +extern const int s_readableByteStreamInternalsReadableStreamAddReadIntoRequestCodeLength; +extern const JSC::ConstructAbility s_readableByteStreamInternalsReadableStreamAddReadIntoRequestCodeConstructAbility; +extern const JSC::ConstructorKind s_readableByteStreamInternalsReadableStreamAddReadIntoRequestCodeConstructorKind; +extern const JSC::ImplementationVisibility s_readableByteStreamInternalsReadableStreamAddReadIntoRequestCodeImplementationVisibility; -inline void WritableStreamInternalsBuiltinsWrapper::exportNames() -{ +#define WEBCORE_FOREACH_READABLEBYTESTREAMINTERNALS_BUILTIN_DATA(macro) \ + macro(privateInitializeReadableByteStreamController, readableByteStreamInternalsPrivateInitializeReadableByteStreamController, 3) \ + macro(readableStreamByteStreamControllerStart, readableByteStreamInternalsReadableStreamByteStreamControllerStart, 1) \ + macro(privateInitializeReadableStreamBYOBRequest, readableByteStreamInternalsPrivateInitializeReadableStreamBYOBRequest, 2) \ + macro(isReadableByteStreamController, readableByteStreamInternalsIsReadableByteStreamController, 1) \ + macro(isReadableStreamBYOBRequest, readableByteStreamInternalsIsReadableStreamBYOBRequest, 1) \ + macro(isReadableStreamBYOBReader, readableByteStreamInternalsIsReadableStreamBYOBReader, 1) \ + macro(readableByteStreamControllerCancel, readableByteStreamInternalsReadableByteStreamControllerCancel, 2) \ + macro(readableByteStreamControllerError, readableByteStreamInternalsReadableByteStreamControllerError, 2) \ + macro(readableByteStreamControllerClose, readableByteStreamInternalsReadableByteStreamControllerClose, 1) \ + macro(readableByteStreamControllerClearPendingPullIntos, readableByteStreamInternalsReadableByteStreamControllerClearPendingPullIntos, 1) \ + macro(readableByteStreamControllerGetDesiredSize, readableByteStreamInternalsReadableByteStreamControllerGetDesiredSize, 1) \ + macro(readableStreamHasBYOBReader, readableByteStreamInternalsReadableStreamHasBYOBReader, 1) \ + macro(readableStreamHasDefaultReader, readableByteStreamInternalsReadableStreamHasDefaultReader, 1) \ + macro(readableByteStreamControllerHandleQueueDrain, readableByteStreamInternalsReadableByteStreamControllerHandleQueueDrain, 1) \ + macro(readableByteStreamControllerPull, readableByteStreamInternalsReadableByteStreamControllerPull, 1) \ + macro(readableByteStreamControllerShouldCallPull, readableByteStreamInternalsReadableByteStreamControllerShouldCallPull, 1) \ + macro(readableByteStreamControllerCallPullIfNeeded, readableByteStreamInternalsReadableByteStreamControllerCallPullIfNeeded, 1) \ + macro(transferBufferToCurrentRealm, readableByteStreamInternalsTransferBufferToCurrentRealm, 1) \ + macro(readableStreamReaderKind, readableByteStreamInternalsReadableStreamReaderKind, 1) \ + macro(readableByteStreamControllerEnqueue, readableByteStreamInternalsReadableByteStreamControllerEnqueue, 2) \ + macro(readableByteStreamControllerEnqueueChunk, readableByteStreamInternalsReadableByteStreamControllerEnqueueChunk, 4) \ + macro(readableByteStreamControllerRespondWithNewView, readableByteStreamInternalsReadableByteStreamControllerRespondWithNewView, 2) \ + macro(readableByteStreamControllerRespond, readableByteStreamInternalsReadableByteStreamControllerRespond, 2) \ + macro(readableByteStreamControllerRespondInternal, readableByteStreamInternalsReadableByteStreamControllerRespondInternal, 2) \ + macro(readableByteStreamControllerRespondInReadableState, readableByteStreamInternalsReadableByteStreamControllerRespondInReadableState, 3) \ + macro(readableByteStreamControllerRespondInClosedState, readableByteStreamInternalsReadableByteStreamControllerRespondInClosedState, 2) \ + macro(readableByteStreamControllerProcessPullDescriptors, readableByteStreamInternalsReadableByteStreamControllerProcessPullDescriptors, 1) \ + macro(readableByteStreamControllerFillDescriptorFromQueue, readableByteStreamInternalsReadableByteStreamControllerFillDescriptorFromQueue, 2) \ + macro(readableByteStreamControllerShiftPendingDescriptor, readableByteStreamInternalsReadableByteStreamControllerShiftPendingDescriptor, 1) \ + macro(readableByteStreamControllerInvalidateBYOBRequest, readableByteStreamInternalsReadableByteStreamControllerInvalidateBYOBRequest, 1) \ + macro(readableByteStreamControllerCommitDescriptor, readableByteStreamInternalsReadableByteStreamControllerCommitDescriptor, 2) \ + macro(readableByteStreamControllerConvertDescriptor, readableByteStreamInternalsReadableByteStreamControllerConvertDescriptor, 1) \ + macro(readableStreamFulfillReadIntoRequest, readableByteStreamInternalsReadableStreamFulfillReadIntoRequest, 3) \ + macro(readableStreamBYOBReaderRead, readableByteStreamInternalsReadableStreamBYOBReaderRead, 2) \ + macro(readableByteStreamControllerPullInto, readableByteStreamInternalsReadableByteStreamControllerPullInto, 2) \ + macro(readableStreamAddReadIntoRequest, readableByteStreamInternalsReadableStreamAddReadIntoRequest, 1) \ + +#define WEBCORE_FOREACH_READABLEBYTESTREAMINTERNALS_BUILTIN_CODE(macro) \ + macro(readableByteStreamInternalsPrivateInitializeReadableByteStreamControllerCode, privateInitializeReadableByteStreamController, ASCIILiteral(), s_readableByteStreamInternalsPrivateInitializeReadableByteStreamControllerCodeLength) \ + macro(readableByteStreamInternalsReadableStreamByteStreamControllerStartCode, readableStreamByteStreamControllerStart, ASCIILiteral(), s_readableByteStreamInternalsReadableStreamByteStreamControllerStartCodeLength) \ + macro(readableByteStreamInternalsPrivateInitializeReadableStreamBYOBRequestCode, privateInitializeReadableStreamBYOBRequest, ASCIILiteral(), s_readableByteStreamInternalsPrivateInitializeReadableStreamBYOBRequestCodeLength) \ + macro(readableByteStreamInternalsIsReadableByteStreamControllerCode, isReadableByteStreamController, ASCIILiteral(), s_readableByteStreamInternalsIsReadableByteStreamControllerCodeLength) \ + macro(readableByteStreamInternalsIsReadableStreamBYOBRequestCode, isReadableStreamBYOBRequest, ASCIILiteral(), s_readableByteStreamInternalsIsReadableStreamBYOBRequestCodeLength) \ + macro(readableByteStreamInternalsIsReadableStreamBYOBReaderCode, isReadableStreamBYOBReader, ASCIILiteral(), s_readableByteStreamInternalsIsReadableStreamBYOBReaderCodeLength) \ + macro(readableByteStreamInternalsReadableByteStreamControllerCancelCode, readableByteStreamControllerCancel, ASCIILiteral(), s_readableByteStreamInternalsReadableByteStreamControllerCancelCodeLength) \ + macro(readableByteStreamInternalsReadableByteStreamControllerErrorCode, readableByteStreamControllerError, ASCIILiteral(), s_readableByteStreamInternalsReadableByteStreamControllerErrorCodeLength) \ + macro(readableByteStreamInternalsReadableByteStreamControllerCloseCode, readableByteStreamControllerClose, ASCIILiteral(), s_readableByteStreamInternalsReadableByteStreamControllerCloseCodeLength) \ + macro(readableByteStreamInternalsReadableByteStreamControllerClearPendingPullIntosCode, readableByteStreamControllerClearPendingPullIntos, ASCIILiteral(), s_readableByteStreamInternalsReadableByteStreamControllerClearPendingPullIntosCodeLength) \ + macro(readableByteStreamInternalsReadableByteStreamControllerGetDesiredSizeCode, readableByteStreamControllerGetDesiredSize, ASCIILiteral(), s_readableByteStreamInternalsReadableByteStreamControllerGetDesiredSizeCodeLength) \ + macro(readableByteStreamInternalsReadableStreamHasBYOBReaderCode, readableStreamHasBYOBReader, ASCIILiteral(), s_readableByteStreamInternalsReadableStreamHasBYOBReaderCodeLength) \ + macro(readableByteStreamInternalsReadableStreamHasDefaultReaderCode, readableStreamHasDefaultReader, ASCIILiteral(), s_readableByteStreamInternalsReadableStreamHasDefaultReaderCodeLength) \ + macro(readableByteStreamInternalsReadableByteStreamControllerHandleQueueDrainCode, readableByteStreamControllerHandleQueueDrain, ASCIILiteral(), s_readableByteStreamInternalsReadableByteStreamControllerHandleQueueDrainCodeLength) \ + macro(readableByteStreamInternalsReadableByteStreamControllerPullCode, readableByteStreamControllerPull, ASCIILiteral(), s_readableByteStreamInternalsReadableByteStreamControllerPullCodeLength) \ + macro(readableByteStreamInternalsReadableByteStreamControllerShouldCallPullCode, readableByteStreamControllerShouldCallPull, ASCIILiteral(), s_readableByteStreamInternalsReadableByteStreamControllerShouldCallPullCodeLength) \ + macro(readableByteStreamInternalsReadableByteStreamControllerCallPullIfNeededCode, readableByteStreamControllerCallPullIfNeeded, ASCIILiteral(), s_readableByteStreamInternalsReadableByteStreamControllerCallPullIfNeededCodeLength) \ + macro(readableByteStreamInternalsTransferBufferToCurrentRealmCode, transferBufferToCurrentRealm, ASCIILiteral(), s_readableByteStreamInternalsTransferBufferToCurrentRealmCodeLength) \ + macro(readableByteStreamInternalsReadableStreamReaderKindCode, readableStreamReaderKind, ASCIILiteral(), s_readableByteStreamInternalsReadableStreamReaderKindCodeLength) \ + macro(readableByteStreamInternalsReadableByteStreamControllerEnqueueCode, readableByteStreamControllerEnqueue, ASCIILiteral(), s_readableByteStreamInternalsReadableByteStreamControllerEnqueueCodeLength) \ + macro(readableByteStreamInternalsReadableByteStreamControllerEnqueueChunkCode, readableByteStreamControllerEnqueueChunk, ASCIILiteral(), s_readableByteStreamInternalsReadableByteStreamControllerEnqueueChunkCodeLength) \ + macro(readableByteStreamInternalsReadableByteStreamControllerRespondWithNewViewCode, readableByteStreamControllerRespondWithNewView, ASCIILiteral(), s_readableByteStreamInternalsReadableByteStreamControllerRespondWithNewViewCodeLength) \ + macro(readableByteStreamInternalsReadableByteStreamControllerRespondCode, readableByteStreamControllerRespond, ASCIILiteral(), s_readableByteStreamInternalsReadableByteStreamControllerRespondCodeLength) \ + macro(readableByteStreamInternalsReadableByteStreamControllerRespondInternalCode, readableByteStreamControllerRespondInternal, ASCIILiteral(), s_readableByteStreamInternalsReadableByteStreamControllerRespondInternalCodeLength) \ + macro(readableByteStreamInternalsReadableByteStreamControllerRespondInReadableStateCode, readableByteStreamControllerRespondInReadableState, ASCIILiteral(), s_readableByteStreamInternalsReadableByteStreamControllerRespondInReadableStateCodeLength) \ + macro(readableByteStreamInternalsReadableByteStreamControllerRespondInClosedStateCode, readableByteStreamControllerRespondInClosedState, ASCIILiteral(), s_readableByteStreamInternalsReadableByteStreamControllerRespondInClosedStateCodeLength) \ + macro(readableByteStreamInternalsReadableByteStreamControllerProcessPullDescriptorsCode, readableByteStreamControllerProcessPullDescriptors, ASCIILiteral(), s_readableByteStreamInternalsReadableByteStreamControllerProcessPullDescriptorsCodeLength) \ + macro(readableByteStreamInternalsReadableByteStreamControllerFillDescriptorFromQueueCode, readableByteStreamControllerFillDescriptorFromQueue, ASCIILiteral(), s_readableByteStreamInternalsReadableByteStreamControllerFillDescriptorFromQueueCodeLength) \ + macro(readableByteStreamInternalsReadableByteStreamControllerShiftPendingDescriptorCode, readableByteStreamControllerShiftPendingDescriptor, ASCIILiteral(), s_readableByteStreamInternalsReadableByteStreamControllerShiftPendingDescriptorCodeLength) \ + macro(readableByteStreamInternalsReadableByteStreamControllerInvalidateBYOBRequestCode, readableByteStreamControllerInvalidateBYOBRequest, ASCIILiteral(), s_readableByteStreamInternalsReadableByteStreamControllerInvalidateBYOBRequestCodeLength) \ + macro(readableByteStreamInternalsReadableByteStreamControllerCommitDescriptorCode, readableByteStreamControllerCommitDescriptor, ASCIILiteral(), s_readableByteStreamInternalsReadableByteStreamControllerCommitDescriptorCodeLength) \ + macro(readableByteStreamInternalsReadableByteStreamControllerConvertDescriptorCode, readableByteStreamControllerConvertDescriptor, ASCIILiteral(), s_readableByteStreamInternalsReadableByteStreamControllerConvertDescriptorCodeLength) \ + macro(readableByteStreamInternalsReadableStreamFulfillReadIntoRequestCode, readableStreamFulfillReadIntoRequest, ASCIILiteral(), s_readableByteStreamInternalsReadableStreamFulfillReadIntoRequestCodeLength) \ + macro(readableByteStreamInternalsReadableStreamBYOBReaderReadCode, readableStreamBYOBReaderRead, ASCIILiteral(), s_readableByteStreamInternalsReadableStreamBYOBReaderReadCodeLength) \ + macro(readableByteStreamInternalsReadableByteStreamControllerPullIntoCode, readableByteStreamControllerPullInto, ASCIILiteral(), s_readableByteStreamInternalsReadableByteStreamControllerPullIntoCodeLength) \ + macro(readableByteStreamInternalsReadableStreamAddReadIntoRequestCode, readableStreamAddReadIntoRequest, ASCIILiteral(), s_readableByteStreamInternalsReadableStreamAddReadIntoRequestCodeLength) \ + +#define WEBCORE_FOREACH_READABLEBYTESTREAMINTERNALS_BUILTIN_FUNCTION_NAME(macro) \ + macro(privateInitializeReadableByteStreamController) \ + macro(readableStreamByteStreamControllerStart) \ + macro(privateInitializeReadableStreamBYOBRequest) \ + macro(isReadableByteStreamController) \ + macro(isReadableStreamBYOBRequest) \ + macro(isReadableStreamBYOBReader) \ + macro(readableByteStreamControllerCancel) \ + macro(readableByteStreamControllerError) \ + macro(readableByteStreamControllerClose) \ + macro(readableByteStreamControllerClearPendingPullIntos) \ + macro(readableByteStreamControllerGetDesiredSize) \ + macro(readableStreamHasBYOBReader) \ + macro(readableStreamHasDefaultReader) \ + macro(readableByteStreamControllerHandleQueueDrain) \ + macro(readableByteStreamControllerPull) \ + macro(readableByteStreamControllerShouldCallPull) \ + macro(readableByteStreamControllerCallPullIfNeeded) \ + macro(transferBufferToCurrentRealm) \ + macro(readableStreamReaderKind) \ + macro(readableByteStreamControllerEnqueue) \ + macro(readableByteStreamControllerEnqueueChunk) \ + macro(readableByteStreamControllerRespondWithNewView) \ + macro(readableByteStreamControllerRespond) \ + macro(readableByteStreamControllerRespondInternal) \ + macro(readableByteStreamControllerRespondInReadableState) \ + macro(readableByteStreamControllerRespondInClosedState) \ + macro(readableByteStreamControllerProcessPullDescriptors) \ + macro(readableByteStreamControllerFillDescriptorFromQueue) \ + macro(readableByteStreamControllerShiftPendingDescriptor) \ + macro(readableByteStreamControllerInvalidateBYOBRequest) \ + macro(readableByteStreamControllerCommitDescriptor) \ + macro(readableByteStreamControllerConvertDescriptor) \ + macro(readableStreamFulfillReadIntoRequest) \ + macro(readableStreamBYOBReaderRead) \ + macro(readableByteStreamControllerPullInto) \ + macro(readableStreamAddReadIntoRequest) \ + +#define DECLARE_BUILTIN_GENERATOR(codeName, functionName, overriddenName, argumentCount) \ + JSC::FunctionExecutable* codeName##Generator(JSC::VM&); + +WEBCORE_FOREACH_READABLEBYTESTREAMINTERNALS_BUILTIN_CODE(DECLARE_BUILTIN_GENERATOR) +#undef DECLARE_BUILTIN_GENERATOR + +class ReadableByteStreamInternalsBuiltinsWrapper : private JSC::WeakHandleOwner { +public: + explicit ReadableByteStreamInternalsBuiltinsWrapper(JSC::VM& vm) + : m_vm(vm) + WEBCORE_FOREACH_READABLEBYTESTREAMINTERNALS_BUILTIN_FUNCTION_NAME(INITIALIZE_BUILTIN_NAMES) +#define INITIALIZE_BUILTIN_SOURCE_MEMBERS(name, functionName, overriddenName, length) , m_##name##Source(JSC::makeSource(StringImpl::createWithoutCopying(s_##name, length), { }, JSC::SourceTaintedOrigin::Untainted)) + WEBCORE_FOREACH_READABLEBYTESTREAMINTERNALS_BUILTIN_CODE(INITIALIZE_BUILTIN_SOURCE_MEMBERS) +#undef INITIALIZE_BUILTIN_SOURCE_MEMBERS + { + } + +#define EXPOSE_BUILTIN_EXECUTABLES(name, functionName, overriddenName, length) \ + JSC::UnlinkedFunctionExecutable* name##Executable(); \ + const JSC::SourceCode& name##Source() const { return m_##name##Source; } + WEBCORE_FOREACH_READABLEBYTESTREAMINTERNALS_BUILTIN_CODE(EXPOSE_BUILTIN_EXECUTABLES) +#undef EXPOSE_BUILTIN_EXECUTABLES + + WEBCORE_FOREACH_READABLEBYTESTREAMINTERNALS_BUILTIN_FUNCTION_NAME(DECLARE_BUILTIN_IDENTIFIER_ACCESSOR) + + void exportNames(); + +private: + JSC::VM& m_vm; + + WEBCORE_FOREACH_READABLEBYTESTREAMINTERNALS_BUILTIN_FUNCTION_NAME(DECLARE_BUILTIN_NAMES) + +#define DECLARE_BUILTIN_SOURCE_MEMBERS(name, functionName, overriddenName, length) \ + JSC::SourceCode m_##name##Source;\ + JSC::Weak m_##name##Executable; + WEBCORE_FOREACH_READABLEBYTESTREAMINTERNALS_BUILTIN_CODE(DECLARE_BUILTIN_SOURCE_MEMBERS) +#undef DECLARE_BUILTIN_SOURCE_MEMBERS + +}; + +#define DEFINE_BUILTIN_EXECUTABLES(name, functionName, overriddenName, length) \ +inline JSC::UnlinkedFunctionExecutable* ReadableByteStreamInternalsBuiltinsWrapper::name##Executable() \ +{\ + if (!m_##name##Executable) {\ + JSC::Identifier executableName = functionName##PublicName();\ + if (overriddenName)\ + executableName = JSC::Identifier::fromString(m_vm, overriddenName);\ + m_##name##Executable = JSC::Weak(JSC::createBuiltinExecutable(m_vm, m_##name##Source, executableName, s_##name##ImplementationVisibility, s_##name##ConstructorKind, s_##name##ConstructAbility), this, &m_##name##Executable);\ + }\ + return m_##name##Executable.get();\ +} +WEBCORE_FOREACH_READABLEBYTESTREAMINTERNALS_BUILTIN_CODE(DEFINE_BUILTIN_EXECUTABLES) +#undef DEFINE_BUILTIN_EXECUTABLES + +inline void ReadableByteStreamInternalsBuiltinsWrapper::exportNames() +{ #define EXPORT_FUNCTION_NAME(name) m_vm.propertyNames->appendExternalName(name##PublicName(), name##PrivateName()); - WEBCORE_FOREACH_WRITABLESTREAMINTERNALS_BUILTIN_FUNCTION_NAME(EXPORT_FUNCTION_NAME) + WEBCORE_FOREACH_READABLEBYTESTREAMINTERNALS_BUILTIN_FUNCTION_NAME(EXPORT_FUNCTION_NAME) #undef EXPORT_FUNCTION_NAME } -class WritableStreamInternalsBuiltinFunctions { +class ReadableByteStreamInternalsBuiltinFunctions { public: - explicit WritableStreamInternalsBuiltinFunctions(JSC::VM& vm) : m_vm(vm) { } + explicit ReadableByteStreamInternalsBuiltinFunctions(JSC::VM& vm) : m_vm(vm) { } void init(JSC::JSGlobalObject&); template void visit(Visitor&); @@ -833,246 +845,103 @@ public: #define DECLARE_BUILTIN_SOURCE_MEMBERS(functionName) \ JSC::WriteBarrier m_##functionName##Function; - WEBCORE_FOREACH_WRITABLESTREAMINTERNALS_BUILTIN_FUNCTION_NAME(DECLARE_BUILTIN_SOURCE_MEMBERS) + WEBCORE_FOREACH_READABLEBYTESTREAMINTERNALS_BUILTIN_FUNCTION_NAME(DECLARE_BUILTIN_SOURCE_MEMBERS) #undef DECLARE_BUILTIN_SOURCE_MEMBERS }; -inline void WritableStreamInternalsBuiltinFunctions::init(JSC::JSGlobalObject& globalObject) +inline void ReadableByteStreamInternalsBuiltinFunctions::init(JSC::JSGlobalObject& globalObject) { #define EXPORT_FUNCTION(codeName, functionName, overriddenName, length) \ m_##functionName##Function.set(m_vm, &globalObject, JSC::JSFunction::create(m_vm, codeName##Generator(m_vm), &globalObject)); - WEBCORE_FOREACH_WRITABLESTREAMINTERNALS_BUILTIN_CODE(EXPORT_FUNCTION) + WEBCORE_FOREACH_READABLEBYTESTREAMINTERNALS_BUILTIN_CODE(EXPORT_FUNCTION) #undef EXPORT_FUNCTION } template -inline void WritableStreamInternalsBuiltinFunctions::visit(Visitor& visitor) +inline void ReadableByteStreamInternalsBuiltinFunctions::visit(Visitor& visitor) { #define VISIT_FUNCTION(name) visitor.append(m_##name##Function); - WEBCORE_FOREACH_WRITABLESTREAMINTERNALS_BUILTIN_FUNCTION_NAME(VISIT_FUNCTION) + WEBCORE_FOREACH_READABLEBYTESTREAMINTERNALS_BUILTIN_FUNCTION_NAME(VISIT_FUNCTION) #undef VISIT_FUNCTION } -template void WritableStreamInternalsBuiltinFunctions::visit(JSC::AbstractSlotVisitor&); -template void WritableStreamInternalsBuiltinFunctions::visit(JSC::SlotVisitor&); - /* TransformStreamInternals.ts */ -// isTransformStream -#define WEBCORE_BUILTIN_TRANSFORMSTREAMINTERNALS_ISTRANSFORMSTREAM 1 -extern const char* const s_transformStreamInternalsIsTransformStreamCode; -extern const int s_transformStreamInternalsIsTransformStreamCodeLength; -extern const JSC::ConstructAbility s_transformStreamInternalsIsTransformStreamCodeConstructAbility; -extern const JSC::ConstructorKind s_transformStreamInternalsIsTransformStreamCodeConstructorKind; -extern const JSC::ImplementationVisibility s_transformStreamInternalsIsTransformStreamCodeImplementationVisibility; - -// isTransformStreamDefaultController -#define WEBCORE_BUILTIN_TRANSFORMSTREAMINTERNALS_ISTRANSFORMSTREAMDEFAULTCONTROLLER 1 -extern const char* const s_transformStreamInternalsIsTransformStreamDefaultControllerCode; -extern const int s_transformStreamInternalsIsTransformStreamDefaultControllerCodeLength; -extern const JSC::ConstructAbility s_transformStreamInternalsIsTransformStreamDefaultControllerCodeConstructAbility; -extern const JSC::ConstructorKind s_transformStreamInternalsIsTransformStreamDefaultControllerCodeConstructorKind; -extern const JSC::ImplementationVisibility s_transformStreamInternalsIsTransformStreamDefaultControllerCodeImplementationVisibility; +template void ReadableByteStreamInternalsBuiltinFunctions::visit(JSC::AbstractSlotVisitor&); +template void ReadableByteStreamInternalsBuiltinFunctions::visit(JSC::SlotVisitor&); + /* ImportMetaObject.ts */ +// loadCJS2ESM +#define WEBCORE_BUILTIN_IMPORTMETAOBJECT_LOADCJS2ESM 1 +extern const char* const s_importMetaObjectLoadCJS2ESMCode; +extern const int s_importMetaObjectLoadCJS2ESMCodeLength; +extern const JSC::ConstructAbility s_importMetaObjectLoadCJS2ESMCodeConstructAbility; +extern const JSC::ConstructorKind s_importMetaObjectLoadCJS2ESMCodeConstructorKind; +extern const JSC::ImplementationVisibility s_importMetaObjectLoadCJS2ESMCodeImplementationVisibility; -// createTransformStream -#define WEBCORE_BUILTIN_TRANSFORMSTREAMINTERNALS_CREATETRANSFORMSTREAM 1 -extern const char* const s_transformStreamInternalsCreateTransformStreamCode; -extern const int s_transformStreamInternalsCreateTransformStreamCodeLength; -extern const JSC::ConstructAbility s_transformStreamInternalsCreateTransformStreamCodeConstructAbility; -extern const JSC::ConstructorKind s_transformStreamInternalsCreateTransformStreamCodeConstructorKind; -extern const JSC::ImplementationVisibility s_transformStreamInternalsCreateTransformStreamCodeImplementationVisibility; +// requireESM +#define WEBCORE_BUILTIN_IMPORTMETAOBJECT_REQUIREESM 1 +extern const char* const s_importMetaObjectRequireESMCode; +extern const int s_importMetaObjectRequireESMCodeLength; +extern const JSC::ConstructAbility s_importMetaObjectRequireESMCodeConstructAbility; +extern const JSC::ConstructorKind s_importMetaObjectRequireESMCodeConstructorKind; +extern const JSC::ImplementationVisibility s_importMetaObjectRequireESMCodeImplementationVisibility; -// initializeTransformStream -#define WEBCORE_BUILTIN_TRANSFORMSTREAMINTERNALS_INITIALIZETRANSFORMSTREAM 1 -extern const char* const s_transformStreamInternalsInitializeTransformStreamCode; -extern const int s_transformStreamInternalsInitializeTransformStreamCodeLength; -extern const JSC::ConstructAbility s_transformStreamInternalsInitializeTransformStreamCodeConstructAbility; -extern const JSC::ConstructorKind s_transformStreamInternalsInitializeTransformStreamCodeConstructorKind; -extern const JSC::ImplementationVisibility s_transformStreamInternalsInitializeTransformStreamCodeImplementationVisibility; +// internalRequire +#define WEBCORE_BUILTIN_IMPORTMETAOBJECT_INTERNALREQUIRE 1 +extern const char* const s_importMetaObjectInternalRequireCode; +extern const int s_importMetaObjectInternalRequireCodeLength; +extern const JSC::ConstructAbility s_importMetaObjectInternalRequireCodeConstructAbility; +extern const JSC::ConstructorKind s_importMetaObjectInternalRequireCodeConstructorKind; +extern const JSC::ImplementationVisibility s_importMetaObjectInternalRequireCodeImplementationVisibility; -// transformStreamError -#define WEBCORE_BUILTIN_TRANSFORMSTREAMINTERNALS_TRANSFORMSTREAMERROR 1 -extern const char* const s_transformStreamInternalsTransformStreamErrorCode; -extern const int s_transformStreamInternalsTransformStreamErrorCodeLength; -extern const JSC::ConstructAbility s_transformStreamInternalsTransformStreamErrorCodeConstructAbility; -extern const JSC::ConstructorKind s_transformStreamInternalsTransformStreamErrorCodeConstructorKind; -extern const JSC::ImplementationVisibility s_transformStreamInternalsTransformStreamErrorCodeImplementationVisibility; +// createRequireCache +#define WEBCORE_BUILTIN_IMPORTMETAOBJECT_CREATEREQUIRECACHE 1 +extern const char* const s_importMetaObjectCreateRequireCacheCode; +extern const int s_importMetaObjectCreateRequireCacheCodeLength; +extern const JSC::ConstructAbility s_importMetaObjectCreateRequireCacheCodeConstructAbility; +extern const JSC::ConstructorKind s_importMetaObjectCreateRequireCacheCodeConstructorKind; +extern const JSC::ImplementationVisibility s_importMetaObjectCreateRequireCacheCodeImplementationVisibility; -// transformStreamErrorWritableAndUnblockWrite -#define WEBCORE_BUILTIN_TRANSFORMSTREAMINTERNALS_TRANSFORMSTREAMERRORWRITABLEANDUNBLOCKWRITE 1 -extern const char* const s_transformStreamInternalsTransformStreamErrorWritableAndUnblockWriteCode; -extern const int s_transformStreamInternalsTransformStreamErrorWritableAndUnblockWriteCodeLength; -extern const JSC::ConstructAbility s_transformStreamInternalsTransformStreamErrorWritableAndUnblockWriteCodeConstructAbility; -extern const JSC::ConstructorKind s_transformStreamInternalsTransformStreamErrorWritableAndUnblockWriteCodeConstructorKind; -extern const JSC::ImplementationVisibility s_transformStreamInternalsTransformStreamErrorWritableAndUnblockWriteCodeImplementationVisibility; - -// transformStreamSetBackpressure -#define WEBCORE_BUILTIN_TRANSFORMSTREAMINTERNALS_TRANSFORMSTREAMSETBACKPRESSURE 1 -extern const char* const s_transformStreamInternalsTransformStreamSetBackpressureCode; -extern const int s_transformStreamInternalsTransformStreamSetBackpressureCodeLength; -extern const JSC::ConstructAbility s_transformStreamInternalsTransformStreamSetBackpressureCodeConstructAbility; -extern const JSC::ConstructorKind s_transformStreamInternalsTransformStreamSetBackpressureCodeConstructorKind; -extern const JSC::ImplementationVisibility s_transformStreamInternalsTransformStreamSetBackpressureCodeImplementationVisibility; - -// setUpTransformStreamDefaultController -#define WEBCORE_BUILTIN_TRANSFORMSTREAMINTERNALS_SETUPTRANSFORMSTREAMDEFAULTCONTROLLER 1 -extern const char* const s_transformStreamInternalsSetUpTransformStreamDefaultControllerCode; -extern const int s_transformStreamInternalsSetUpTransformStreamDefaultControllerCodeLength; -extern const JSC::ConstructAbility s_transformStreamInternalsSetUpTransformStreamDefaultControllerCodeConstructAbility; -extern const JSC::ConstructorKind s_transformStreamInternalsSetUpTransformStreamDefaultControllerCodeConstructorKind; -extern const JSC::ImplementationVisibility s_transformStreamInternalsSetUpTransformStreamDefaultControllerCodeImplementationVisibility; - -// setUpTransformStreamDefaultControllerFromTransformer -#define WEBCORE_BUILTIN_TRANSFORMSTREAMINTERNALS_SETUPTRANSFORMSTREAMDEFAULTCONTROLLERFROMTRANSFORMER 1 -extern const char* const s_transformStreamInternalsSetUpTransformStreamDefaultControllerFromTransformerCode; -extern const int s_transformStreamInternalsSetUpTransformStreamDefaultControllerFromTransformerCodeLength; -extern const JSC::ConstructAbility s_transformStreamInternalsSetUpTransformStreamDefaultControllerFromTransformerCodeConstructAbility; -extern const JSC::ConstructorKind s_transformStreamInternalsSetUpTransformStreamDefaultControllerFromTransformerCodeConstructorKind; -extern const JSC::ImplementationVisibility s_transformStreamInternalsSetUpTransformStreamDefaultControllerFromTransformerCodeImplementationVisibility; - -// transformStreamDefaultControllerClearAlgorithms -#define WEBCORE_BUILTIN_TRANSFORMSTREAMINTERNALS_TRANSFORMSTREAMDEFAULTCONTROLLERCLEARALGORITHMS 1 -extern const char* const s_transformStreamInternalsTransformStreamDefaultControllerClearAlgorithmsCode; -extern const int s_transformStreamInternalsTransformStreamDefaultControllerClearAlgorithmsCodeLength; -extern const JSC::ConstructAbility s_transformStreamInternalsTransformStreamDefaultControllerClearAlgorithmsCodeConstructAbility; -extern const JSC::ConstructorKind s_transformStreamInternalsTransformStreamDefaultControllerClearAlgorithmsCodeConstructorKind; -extern const JSC::ImplementationVisibility s_transformStreamInternalsTransformStreamDefaultControllerClearAlgorithmsCodeImplementationVisibility; - -// transformStreamDefaultControllerEnqueue -#define WEBCORE_BUILTIN_TRANSFORMSTREAMINTERNALS_TRANSFORMSTREAMDEFAULTCONTROLLERENQUEUE 1 -extern const char* const s_transformStreamInternalsTransformStreamDefaultControllerEnqueueCode; -extern const int s_transformStreamInternalsTransformStreamDefaultControllerEnqueueCodeLength; -extern const JSC::ConstructAbility s_transformStreamInternalsTransformStreamDefaultControllerEnqueueCodeConstructAbility; -extern const JSC::ConstructorKind s_transformStreamInternalsTransformStreamDefaultControllerEnqueueCodeConstructorKind; -extern const JSC::ImplementationVisibility s_transformStreamInternalsTransformStreamDefaultControllerEnqueueCodeImplementationVisibility; - -// transformStreamDefaultControllerError -#define WEBCORE_BUILTIN_TRANSFORMSTREAMINTERNALS_TRANSFORMSTREAMDEFAULTCONTROLLERERROR 1 -extern const char* const s_transformStreamInternalsTransformStreamDefaultControllerErrorCode; -extern const int s_transformStreamInternalsTransformStreamDefaultControllerErrorCodeLength; -extern const JSC::ConstructAbility s_transformStreamInternalsTransformStreamDefaultControllerErrorCodeConstructAbility; -extern const JSC::ConstructorKind s_transformStreamInternalsTransformStreamDefaultControllerErrorCodeConstructorKind; -extern const JSC::ImplementationVisibility s_transformStreamInternalsTransformStreamDefaultControllerErrorCodeImplementationVisibility; - -// transformStreamDefaultControllerPerformTransform -#define WEBCORE_BUILTIN_TRANSFORMSTREAMINTERNALS_TRANSFORMSTREAMDEFAULTCONTROLLERPERFORMTRANSFORM 1 -extern const char* const s_transformStreamInternalsTransformStreamDefaultControllerPerformTransformCode; -extern const int s_transformStreamInternalsTransformStreamDefaultControllerPerformTransformCodeLength; -extern const JSC::ConstructAbility s_transformStreamInternalsTransformStreamDefaultControllerPerformTransformCodeConstructAbility; -extern const JSC::ConstructorKind s_transformStreamInternalsTransformStreamDefaultControllerPerformTransformCodeConstructorKind; -extern const JSC::ImplementationVisibility s_transformStreamInternalsTransformStreamDefaultControllerPerformTransformCodeImplementationVisibility; - -// transformStreamDefaultControllerTerminate -#define WEBCORE_BUILTIN_TRANSFORMSTREAMINTERNALS_TRANSFORMSTREAMDEFAULTCONTROLLERTERMINATE 1 -extern const char* const s_transformStreamInternalsTransformStreamDefaultControllerTerminateCode; -extern const int s_transformStreamInternalsTransformStreamDefaultControllerTerminateCodeLength; -extern const JSC::ConstructAbility s_transformStreamInternalsTransformStreamDefaultControllerTerminateCodeConstructAbility; -extern const JSC::ConstructorKind s_transformStreamInternalsTransformStreamDefaultControllerTerminateCodeConstructorKind; -extern const JSC::ImplementationVisibility s_transformStreamInternalsTransformStreamDefaultControllerTerminateCodeImplementationVisibility; - -// transformStreamDefaultSinkWriteAlgorithm -#define WEBCORE_BUILTIN_TRANSFORMSTREAMINTERNALS_TRANSFORMSTREAMDEFAULTSINKWRITEALGORITHM 1 -extern const char* const s_transformStreamInternalsTransformStreamDefaultSinkWriteAlgorithmCode; -extern const int s_transformStreamInternalsTransformStreamDefaultSinkWriteAlgorithmCodeLength; -extern const JSC::ConstructAbility s_transformStreamInternalsTransformStreamDefaultSinkWriteAlgorithmCodeConstructAbility; -extern const JSC::ConstructorKind s_transformStreamInternalsTransformStreamDefaultSinkWriteAlgorithmCodeConstructorKind; -extern const JSC::ImplementationVisibility s_transformStreamInternalsTransformStreamDefaultSinkWriteAlgorithmCodeImplementationVisibility; - -// transformStreamDefaultSinkAbortAlgorithm -#define WEBCORE_BUILTIN_TRANSFORMSTREAMINTERNALS_TRANSFORMSTREAMDEFAULTSINKABORTALGORITHM 1 -extern const char* const s_transformStreamInternalsTransformStreamDefaultSinkAbortAlgorithmCode; -extern const int s_transformStreamInternalsTransformStreamDefaultSinkAbortAlgorithmCodeLength; -extern const JSC::ConstructAbility s_transformStreamInternalsTransformStreamDefaultSinkAbortAlgorithmCodeConstructAbility; -extern const JSC::ConstructorKind s_transformStreamInternalsTransformStreamDefaultSinkAbortAlgorithmCodeConstructorKind; -extern const JSC::ImplementationVisibility s_transformStreamInternalsTransformStreamDefaultSinkAbortAlgorithmCodeImplementationVisibility; - -// transformStreamDefaultSinkCloseAlgorithm -#define WEBCORE_BUILTIN_TRANSFORMSTREAMINTERNALS_TRANSFORMSTREAMDEFAULTSINKCLOSEALGORITHM 1 -extern const char* const s_transformStreamInternalsTransformStreamDefaultSinkCloseAlgorithmCode; -extern const int s_transformStreamInternalsTransformStreamDefaultSinkCloseAlgorithmCodeLength; -extern const JSC::ConstructAbility s_transformStreamInternalsTransformStreamDefaultSinkCloseAlgorithmCodeConstructAbility; -extern const JSC::ConstructorKind s_transformStreamInternalsTransformStreamDefaultSinkCloseAlgorithmCodeConstructorKind; -extern const JSC::ImplementationVisibility s_transformStreamInternalsTransformStreamDefaultSinkCloseAlgorithmCodeImplementationVisibility; - -// transformStreamDefaultSourcePullAlgorithm -#define WEBCORE_BUILTIN_TRANSFORMSTREAMINTERNALS_TRANSFORMSTREAMDEFAULTSOURCEPULLALGORITHM 1 -extern const char* const s_transformStreamInternalsTransformStreamDefaultSourcePullAlgorithmCode; -extern const int s_transformStreamInternalsTransformStreamDefaultSourcePullAlgorithmCodeLength; -extern const JSC::ConstructAbility s_transformStreamInternalsTransformStreamDefaultSourcePullAlgorithmCodeConstructAbility; -extern const JSC::ConstructorKind s_transformStreamInternalsTransformStreamDefaultSourcePullAlgorithmCodeConstructorKind; -extern const JSC::ImplementationVisibility s_transformStreamInternalsTransformStreamDefaultSourcePullAlgorithmCodeImplementationVisibility; +// main +#define WEBCORE_BUILTIN_IMPORTMETAOBJECT_MAIN 1 +extern const char* const s_importMetaObjectMainCode; +extern const int s_importMetaObjectMainCodeLength; +extern const JSC::ConstructAbility s_importMetaObjectMainCodeConstructAbility; +extern const JSC::ConstructorKind s_importMetaObjectMainCodeConstructorKind; +extern const JSC::ImplementationVisibility s_importMetaObjectMainCodeImplementationVisibility; -#define WEBCORE_FOREACH_TRANSFORMSTREAMINTERNALS_BUILTIN_DATA(macro) \ - macro(isTransformStream, transformStreamInternalsIsTransformStream, 1) \ - macro(isTransformStreamDefaultController, transformStreamInternalsIsTransformStreamDefaultController, 1) \ - macro(createTransformStream, transformStreamInternalsCreateTransformStream, 8) \ - macro(initializeTransformStream, transformStreamInternalsInitializeTransformStream, 7) \ - macro(transformStreamError, transformStreamInternalsTransformStreamError, 2) \ - macro(transformStreamErrorWritableAndUnblockWrite, transformStreamInternalsTransformStreamErrorWritableAndUnblockWrite, 2) \ - macro(transformStreamSetBackpressure, transformStreamInternalsTransformStreamSetBackpressure, 2) \ - macro(setUpTransformStreamDefaultController, transformStreamInternalsSetUpTransformStreamDefaultController, 4) \ - macro(setUpTransformStreamDefaultControllerFromTransformer, transformStreamInternalsSetUpTransformStreamDefaultControllerFromTransformer, 3) \ - macro(transformStreamDefaultControllerClearAlgorithms, transformStreamInternalsTransformStreamDefaultControllerClearAlgorithms, 1) \ - macro(transformStreamDefaultControllerEnqueue, transformStreamInternalsTransformStreamDefaultControllerEnqueue, 2) \ - macro(transformStreamDefaultControllerError, transformStreamInternalsTransformStreamDefaultControllerError, 2) \ - macro(transformStreamDefaultControllerPerformTransform, transformStreamInternalsTransformStreamDefaultControllerPerformTransform, 2) \ - macro(transformStreamDefaultControllerTerminate, transformStreamInternalsTransformStreamDefaultControllerTerminate, 1) \ - macro(transformStreamDefaultSinkWriteAlgorithm, transformStreamInternalsTransformStreamDefaultSinkWriteAlgorithm, 2) \ - macro(transformStreamDefaultSinkAbortAlgorithm, transformStreamInternalsTransformStreamDefaultSinkAbortAlgorithm, 2) \ - macro(transformStreamDefaultSinkCloseAlgorithm, transformStreamInternalsTransformStreamDefaultSinkCloseAlgorithm, 1) \ - macro(transformStreamDefaultSourcePullAlgorithm, transformStreamInternalsTransformStreamDefaultSourcePullAlgorithm, 1) \ +#define WEBCORE_FOREACH_IMPORTMETAOBJECT_BUILTIN_DATA(macro) \ + macro(loadCJS2ESM, importMetaObjectLoadCJS2ESM, 1) \ + macro(requireESM, importMetaObjectRequireESM, 1) \ + macro(internalRequire, importMetaObjectInternalRequire, 1) \ + macro(createRequireCache, importMetaObjectCreateRequireCache, 0) \ + macro(main, importMetaObjectMain, 0) \ -#define WEBCORE_FOREACH_TRANSFORMSTREAMINTERNALS_BUILTIN_CODE(macro) \ - macro(transformStreamInternalsIsTransformStreamCode, isTransformStream, ASCIILiteral(), s_transformStreamInternalsIsTransformStreamCodeLength) \ - macro(transformStreamInternalsIsTransformStreamDefaultControllerCode, isTransformStreamDefaultController, ASCIILiteral(), s_transformStreamInternalsIsTransformStreamDefaultControllerCodeLength) \ - macro(transformStreamInternalsCreateTransformStreamCode, createTransformStream, ASCIILiteral(), s_transformStreamInternalsCreateTransformStreamCodeLength) \ - macro(transformStreamInternalsInitializeTransformStreamCode, initializeTransformStream, ASCIILiteral(), s_transformStreamInternalsInitializeTransformStreamCodeLength) \ - macro(transformStreamInternalsTransformStreamErrorCode, transformStreamError, ASCIILiteral(), s_transformStreamInternalsTransformStreamErrorCodeLength) \ - macro(transformStreamInternalsTransformStreamErrorWritableAndUnblockWriteCode, transformStreamErrorWritableAndUnblockWrite, ASCIILiteral(), s_transformStreamInternalsTransformStreamErrorWritableAndUnblockWriteCodeLength) \ - macro(transformStreamInternalsTransformStreamSetBackpressureCode, transformStreamSetBackpressure, ASCIILiteral(), s_transformStreamInternalsTransformStreamSetBackpressureCodeLength) \ - macro(transformStreamInternalsSetUpTransformStreamDefaultControllerCode, setUpTransformStreamDefaultController, ASCIILiteral(), s_transformStreamInternalsSetUpTransformStreamDefaultControllerCodeLength) \ - macro(transformStreamInternalsSetUpTransformStreamDefaultControllerFromTransformerCode, setUpTransformStreamDefaultControllerFromTransformer, ASCIILiteral(), s_transformStreamInternalsSetUpTransformStreamDefaultControllerFromTransformerCodeLength) \ - macro(transformStreamInternalsTransformStreamDefaultControllerClearAlgorithmsCode, transformStreamDefaultControllerClearAlgorithms, ASCIILiteral(), s_transformStreamInternalsTransformStreamDefaultControllerClearAlgorithmsCodeLength) \ - macro(transformStreamInternalsTransformStreamDefaultControllerEnqueueCode, transformStreamDefaultControllerEnqueue, ASCIILiteral(), s_transformStreamInternalsTransformStreamDefaultControllerEnqueueCodeLength) \ - macro(transformStreamInternalsTransformStreamDefaultControllerErrorCode, transformStreamDefaultControllerError, ASCIILiteral(), s_transformStreamInternalsTransformStreamDefaultControllerErrorCodeLength) \ - macro(transformStreamInternalsTransformStreamDefaultControllerPerformTransformCode, transformStreamDefaultControllerPerformTransform, ASCIILiteral(), s_transformStreamInternalsTransformStreamDefaultControllerPerformTransformCodeLength) \ - macro(transformStreamInternalsTransformStreamDefaultControllerTerminateCode, transformStreamDefaultControllerTerminate, ASCIILiteral(), s_transformStreamInternalsTransformStreamDefaultControllerTerminateCodeLength) \ - macro(transformStreamInternalsTransformStreamDefaultSinkWriteAlgorithmCode, transformStreamDefaultSinkWriteAlgorithm, ASCIILiteral(), s_transformStreamInternalsTransformStreamDefaultSinkWriteAlgorithmCodeLength) \ - macro(transformStreamInternalsTransformStreamDefaultSinkAbortAlgorithmCode, transformStreamDefaultSinkAbortAlgorithm, ASCIILiteral(), s_transformStreamInternalsTransformStreamDefaultSinkAbortAlgorithmCodeLength) \ - macro(transformStreamInternalsTransformStreamDefaultSinkCloseAlgorithmCode, transformStreamDefaultSinkCloseAlgorithm, ASCIILiteral(), s_transformStreamInternalsTransformStreamDefaultSinkCloseAlgorithmCodeLength) \ - macro(transformStreamInternalsTransformStreamDefaultSourcePullAlgorithmCode, transformStreamDefaultSourcePullAlgorithm, ASCIILiteral(), s_transformStreamInternalsTransformStreamDefaultSourcePullAlgorithmCodeLength) \ +#define WEBCORE_FOREACH_IMPORTMETAOBJECT_BUILTIN_CODE(macro) \ + macro(importMetaObjectLoadCJS2ESMCode, loadCJS2ESM, ASCIILiteral(), s_importMetaObjectLoadCJS2ESMCodeLength) \ + macro(importMetaObjectRequireESMCode, requireESM, ASCIILiteral(), s_importMetaObjectRequireESMCodeLength) \ + macro(importMetaObjectInternalRequireCode, internalRequire, ASCIILiteral(), s_importMetaObjectInternalRequireCodeLength) \ + macro(importMetaObjectCreateRequireCacheCode, createRequireCache, ASCIILiteral(), s_importMetaObjectCreateRequireCacheCodeLength) \ + macro(importMetaObjectMainCode, main, "get main"_s, s_importMetaObjectMainCodeLength) \ -#define WEBCORE_FOREACH_TRANSFORMSTREAMINTERNALS_BUILTIN_FUNCTION_NAME(macro) \ - macro(isTransformStream) \ - macro(isTransformStreamDefaultController) \ - macro(createTransformStream) \ - macro(initializeTransformStream) \ - macro(transformStreamError) \ - macro(transformStreamErrorWritableAndUnblockWrite) \ - macro(transformStreamSetBackpressure) \ - macro(setUpTransformStreamDefaultController) \ - macro(setUpTransformStreamDefaultControllerFromTransformer) \ - macro(transformStreamDefaultControllerClearAlgorithms) \ - macro(transformStreamDefaultControllerEnqueue) \ - macro(transformStreamDefaultControllerError) \ - macro(transformStreamDefaultControllerPerformTransform) \ - macro(transformStreamDefaultControllerTerminate) \ - macro(transformStreamDefaultSinkWriteAlgorithm) \ - macro(transformStreamDefaultSinkAbortAlgorithm) \ - macro(transformStreamDefaultSinkCloseAlgorithm) \ - macro(transformStreamDefaultSourcePullAlgorithm) \ +#define WEBCORE_FOREACH_IMPORTMETAOBJECT_BUILTIN_FUNCTION_NAME(macro) \ + macro(loadCJS2ESM) \ + macro(requireESM) \ + macro(internalRequire) \ + macro(createRequireCache) \ + macro(main) \ #define DECLARE_BUILTIN_GENERATOR(codeName, functionName, overriddenName, argumentCount) \ JSC::FunctionExecutable* codeName##Generator(JSC::VM&); -WEBCORE_FOREACH_TRANSFORMSTREAMINTERNALS_BUILTIN_CODE(DECLARE_BUILTIN_GENERATOR) +WEBCORE_FOREACH_IMPORTMETAOBJECT_BUILTIN_CODE(DECLARE_BUILTIN_GENERATOR) #undef DECLARE_BUILTIN_GENERATOR -class TransformStreamInternalsBuiltinsWrapper : private JSC::WeakHandleOwner { +class ImportMetaObjectBuiltinsWrapper : private JSC::WeakHandleOwner { public: - explicit TransformStreamInternalsBuiltinsWrapper(JSC::VM& vm) + explicit ImportMetaObjectBuiltinsWrapper(JSC::VM& vm) : m_vm(vm) - WEBCORE_FOREACH_TRANSFORMSTREAMINTERNALS_BUILTIN_FUNCTION_NAME(INITIALIZE_BUILTIN_NAMES) + WEBCORE_FOREACH_IMPORTMETAOBJECT_BUILTIN_FUNCTION_NAME(INITIALIZE_BUILTIN_NAMES) #define INITIALIZE_BUILTIN_SOURCE_MEMBERS(name, functionName, overriddenName, length) , m_##name##Source(JSC::makeSource(StringImpl::createWithoutCopying(s_##name, length), { }, JSC::SourceTaintedOrigin::Untainted)) - WEBCORE_FOREACH_TRANSFORMSTREAMINTERNALS_BUILTIN_CODE(INITIALIZE_BUILTIN_SOURCE_MEMBERS) + WEBCORE_FOREACH_IMPORTMETAOBJECT_BUILTIN_CODE(INITIALIZE_BUILTIN_SOURCE_MEMBERS) #undef INITIALIZE_BUILTIN_SOURCE_MEMBERS { } @@ -1080,28 +949,28 @@ public: #define EXPOSE_BUILTIN_EXECUTABLES(name, functionName, overriddenName, length) \ JSC::UnlinkedFunctionExecutable* name##Executable(); \ const JSC::SourceCode& name##Source() const { return m_##name##Source; } - WEBCORE_FOREACH_TRANSFORMSTREAMINTERNALS_BUILTIN_CODE(EXPOSE_BUILTIN_EXECUTABLES) + WEBCORE_FOREACH_IMPORTMETAOBJECT_BUILTIN_CODE(EXPOSE_BUILTIN_EXECUTABLES) #undef EXPOSE_BUILTIN_EXECUTABLES - WEBCORE_FOREACH_TRANSFORMSTREAMINTERNALS_BUILTIN_FUNCTION_NAME(DECLARE_BUILTIN_IDENTIFIER_ACCESSOR) + WEBCORE_FOREACH_IMPORTMETAOBJECT_BUILTIN_FUNCTION_NAME(DECLARE_BUILTIN_IDENTIFIER_ACCESSOR) void exportNames(); private: JSC::VM& m_vm; - WEBCORE_FOREACH_TRANSFORMSTREAMINTERNALS_BUILTIN_FUNCTION_NAME(DECLARE_BUILTIN_NAMES) + WEBCORE_FOREACH_IMPORTMETAOBJECT_BUILTIN_FUNCTION_NAME(DECLARE_BUILTIN_NAMES) #define DECLARE_BUILTIN_SOURCE_MEMBERS(name, functionName, overriddenName, length) \ JSC::SourceCode m_##name##Source;\ JSC::Weak m_##name##Executable; - WEBCORE_FOREACH_TRANSFORMSTREAMINTERNALS_BUILTIN_CODE(DECLARE_BUILTIN_SOURCE_MEMBERS) + WEBCORE_FOREACH_IMPORTMETAOBJECT_BUILTIN_CODE(DECLARE_BUILTIN_SOURCE_MEMBERS) #undef DECLARE_BUILTIN_SOURCE_MEMBERS }; #define DEFINE_BUILTIN_EXECUTABLES(name, functionName, overriddenName, length) \ -inline JSC::UnlinkedFunctionExecutable* TransformStreamInternalsBuiltinsWrapper::name##Executable() \ +inline JSC::UnlinkedFunctionExecutable* ImportMetaObjectBuiltinsWrapper::name##Executable() \ {\ if (!m_##name##Executable) {\ JSC::Identifier executableName = functionName##PublicName();\ @@ -1111,102 +980,101 @@ inline JSC::UnlinkedFunctionExecutable* TransformStreamInternalsBuiltinsWrapper: }\ return m_##name##Executable.get();\ } -WEBCORE_FOREACH_TRANSFORMSTREAMINTERNALS_BUILTIN_CODE(DEFINE_BUILTIN_EXECUTABLES) +WEBCORE_FOREACH_IMPORTMETAOBJECT_BUILTIN_CODE(DEFINE_BUILTIN_EXECUTABLES) #undef DEFINE_BUILTIN_EXECUTABLES -inline void TransformStreamInternalsBuiltinsWrapper::exportNames() +inline void ImportMetaObjectBuiltinsWrapper::exportNames() { #define EXPORT_FUNCTION_NAME(name) m_vm.propertyNames->appendExternalName(name##PublicName(), name##PrivateName()); - WEBCORE_FOREACH_TRANSFORMSTREAMINTERNALS_BUILTIN_FUNCTION_NAME(EXPORT_FUNCTION_NAME) + WEBCORE_FOREACH_IMPORTMETAOBJECT_BUILTIN_FUNCTION_NAME(EXPORT_FUNCTION_NAME) #undef EXPORT_FUNCTION_NAME } -class TransformStreamInternalsBuiltinFunctions { -public: - explicit TransformStreamInternalsBuiltinFunctions(JSC::VM& vm) : m_vm(vm) { } +/* ReadableStreamDefaultReader.ts */ +// initializeReadableStreamDefaultReader +#define WEBCORE_BUILTIN_READABLESTREAMDEFAULTREADER_INITIALIZEREADABLESTREAMDEFAULTREADER 1 +extern const char* const s_readableStreamDefaultReaderInitializeReadableStreamDefaultReaderCode; +extern const int s_readableStreamDefaultReaderInitializeReadableStreamDefaultReaderCodeLength; +extern const JSC::ConstructAbility s_readableStreamDefaultReaderInitializeReadableStreamDefaultReaderCodeConstructAbility; +extern const JSC::ConstructorKind s_readableStreamDefaultReaderInitializeReadableStreamDefaultReaderCodeConstructorKind; +extern const JSC::ImplementationVisibility s_readableStreamDefaultReaderInitializeReadableStreamDefaultReaderCodeImplementationVisibility; - void init(JSC::JSGlobalObject&); - template void visit(Visitor&); +// cancel +#define WEBCORE_BUILTIN_READABLESTREAMDEFAULTREADER_CANCEL 1 +extern const char* const s_readableStreamDefaultReaderCancelCode; +extern const int s_readableStreamDefaultReaderCancelCodeLength; +extern const JSC::ConstructAbility s_readableStreamDefaultReaderCancelCodeConstructAbility; +extern const JSC::ConstructorKind s_readableStreamDefaultReaderCancelCodeConstructorKind; +extern const JSC::ImplementationVisibility s_readableStreamDefaultReaderCancelCodeImplementationVisibility; -public: - JSC::VM& m_vm; +// readMany +#define WEBCORE_BUILTIN_READABLESTREAMDEFAULTREADER_READMANY 1 +extern const char* const s_readableStreamDefaultReaderReadManyCode; +extern const int s_readableStreamDefaultReaderReadManyCodeLength; +extern const JSC::ConstructAbility s_readableStreamDefaultReaderReadManyCodeConstructAbility; +extern const JSC::ConstructorKind s_readableStreamDefaultReaderReadManyCodeConstructorKind; +extern const JSC::ImplementationVisibility s_readableStreamDefaultReaderReadManyCodeImplementationVisibility; -#define DECLARE_BUILTIN_SOURCE_MEMBERS(functionName) \ - JSC::WriteBarrier m_##functionName##Function; - WEBCORE_FOREACH_TRANSFORMSTREAMINTERNALS_BUILTIN_FUNCTION_NAME(DECLARE_BUILTIN_SOURCE_MEMBERS) -#undef DECLARE_BUILTIN_SOURCE_MEMBERS -}; +// read +#define WEBCORE_BUILTIN_READABLESTREAMDEFAULTREADER_READ 1 +extern const char* const s_readableStreamDefaultReaderReadCode; +extern const int s_readableStreamDefaultReaderReadCodeLength; +extern const JSC::ConstructAbility s_readableStreamDefaultReaderReadCodeConstructAbility; +extern const JSC::ConstructorKind s_readableStreamDefaultReaderReadCodeConstructorKind; +extern const JSC::ImplementationVisibility s_readableStreamDefaultReaderReadCodeImplementationVisibility; -inline void TransformStreamInternalsBuiltinFunctions::init(JSC::JSGlobalObject& globalObject) -{ -#define EXPORT_FUNCTION(codeName, functionName, overriddenName, length) \ - m_##functionName##Function.set(m_vm, &globalObject, JSC::JSFunction::create(m_vm, codeName##Generator(m_vm), &globalObject)); - WEBCORE_FOREACH_TRANSFORMSTREAMINTERNALS_BUILTIN_CODE(EXPORT_FUNCTION) -#undef EXPORT_FUNCTION -} - -template -inline void TransformStreamInternalsBuiltinFunctions::visit(Visitor& visitor) -{ -#define VISIT_FUNCTION(name) visitor.append(m_##name##Function); - WEBCORE_FOREACH_TRANSFORMSTREAMINTERNALS_BUILTIN_FUNCTION_NAME(VISIT_FUNCTION) -#undef VISIT_FUNCTION -} - -template void TransformStreamInternalsBuiltinFunctions::visit(JSC::AbstractSlotVisitor&); -template void TransformStreamInternalsBuiltinFunctions::visit(JSC::SlotVisitor&); - /* ProcessObjectInternals.ts */ -// getStdioWriteStream -#define WEBCORE_BUILTIN_PROCESSOBJECTINTERNALS_GETSTDIOWRITESTREAM 1 -extern const char* const s_processObjectInternalsGetStdioWriteStreamCode; -extern const int s_processObjectInternalsGetStdioWriteStreamCodeLength; -extern const JSC::ConstructAbility s_processObjectInternalsGetStdioWriteStreamCodeConstructAbility; -extern const JSC::ConstructorKind s_processObjectInternalsGetStdioWriteStreamCodeConstructorKind; -extern const JSC::ImplementationVisibility s_processObjectInternalsGetStdioWriteStreamCodeImplementationVisibility; - -// getStdinStream -#define WEBCORE_BUILTIN_PROCESSOBJECTINTERNALS_GETSTDINSTREAM 1 -extern const char* const s_processObjectInternalsGetStdinStreamCode; -extern const int s_processObjectInternalsGetStdinStreamCodeLength; -extern const JSC::ConstructAbility s_processObjectInternalsGetStdinStreamCodeConstructAbility; -extern const JSC::ConstructorKind s_processObjectInternalsGetStdinStreamCodeConstructorKind; -extern const JSC::ImplementationVisibility s_processObjectInternalsGetStdinStreamCodeImplementationVisibility; +// releaseLock +#define WEBCORE_BUILTIN_READABLESTREAMDEFAULTREADER_RELEASELOCK 1 +extern const char* const s_readableStreamDefaultReaderReleaseLockCode; +extern const int s_readableStreamDefaultReaderReleaseLockCodeLength; +extern const JSC::ConstructAbility s_readableStreamDefaultReaderReleaseLockCodeConstructAbility; +extern const JSC::ConstructorKind s_readableStreamDefaultReaderReleaseLockCodeConstructorKind; +extern const JSC::ImplementationVisibility s_readableStreamDefaultReaderReleaseLockCodeImplementationVisibility; -// initializeNextTickQueue -#define WEBCORE_BUILTIN_PROCESSOBJECTINTERNALS_INITIALIZENEXTTICKQUEUE 1 -extern const char* const s_processObjectInternalsInitializeNextTickQueueCode; -extern const int s_processObjectInternalsInitializeNextTickQueueCodeLength; -extern const JSC::ConstructAbility s_processObjectInternalsInitializeNextTickQueueCodeConstructAbility; -extern const JSC::ConstructorKind s_processObjectInternalsInitializeNextTickQueueCodeConstructorKind; -extern const JSC::ImplementationVisibility s_processObjectInternalsInitializeNextTickQueueCodeImplementationVisibility; +// closed +#define WEBCORE_BUILTIN_READABLESTREAMDEFAULTREADER_CLOSED 1 +extern const char* const s_readableStreamDefaultReaderClosedCode; +extern const int s_readableStreamDefaultReaderClosedCodeLength; +extern const JSC::ConstructAbility s_readableStreamDefaultReaderClosedCodeConstructAbility; +extern const JSC::ConstructorKind s_readableStreamDefaultReaderClosedCodeConstructorKind; +extern const JSC::ImplementationVisibility s_readableStreamDefaultReaderClosedCodeImplementationVisibility; -#define WEBCORE_FOREACH_PROCESSOBJECTINTERNALS_BUILTIN_DATA(macro) \ - macro(getStdioWriteStream, processObjectInternalsGetStdioWriteStream, 1) \ - macro(getStdinStream, processObjectInternalsGetStdinStream, 1) \ - macro(initializeNextTickQueue, processObjectInternalsInitializeNextTickQueue, 4) \ +#define WEBCORE_FOREACH_READABLESTREAMDEFAULTREADER_BUILTIN_DATA(macro) \ + macro(initializeReadableStreamDefaultReader, readableStreamDefaultReaderInitializeReadableStreamDefaultReader, 1) \ + macro(cancel, readableStreamDefaultReaderCancel, 1) \ + macro(readMany, readableStreamDefaultReaderReadMany, 0) \ + macro(read, readableStreamDefaultReaderRead, 0) \ + macro(releaseLock, readableStreamDefaultReaderReleaseLock, 0) \ + macro(closed, readableStreamDefaultReaderClosed, 0) \ -#define WEBCORE_FOREACH_PROCESSOBJECTINTERNALS_BUILTIN_CODE(macro) \ - macro(processObjectInternalsGetStdioWriteStreamCode, getStdioWriteStream, ASCIILiteral(), s_processObjectInternalsGetStdioWriteStreamCodeLength) \ - macro(processObjectInternalsGetStdinStreamCode, getStdinStream, ASCIILiteral(), s_processObjectInternalsGetStdinStreamCodeLength) \ - macro(processObjectInternalsInitializeNextTickQueueCode, initializeNextTickQueue, ASCIILiteral(), s_processObjectInternalsInitializeNextTickQueueCodeLength) \ +#define WEBCORE_FOREACH_READABLESTREAMDEFAULTREADER_BUILTIN_CODE(macro) \ + macro(readableStreamDefaultReaderInitializeReadableStreamDefaultReaderCode, initializeReadableStreamDefaultReader, ASCIILiteral(), s_readableStreamDefaultReaderInitializeReadableStreamDefaultReaderCodeLength) \ + macro(readableStreamDefaultReaderCancelCode, cancel, ASCIILiteral(), s_readableStreamDefaultReaderCancelCodeLength) \ + macro(readableStreamDefaultReaderReadManyCode, readMany, ASCIILiteral(), s_readableStreamDefaultReaderReadManyCodeLength) \ + macro(readableStreamDefaultReaderReadCode, read, ASCIILiteral(), s_readableStreamDefaultReaderReadCodeLength) \ + macro(readableStreamDefaultReaderReleaseLockCode, releaseLock, ASCIILiteral(), s_readableStreamDefaultReaderReleaseLockCodeLength) \ + macro(readableStreamDefaultReaderClosedCode, closed, "get closed"_s, s_readableStreamDefaultReaderClosedCodeLength) \ -#define WEBCORE_FOREACH_PROCESSOBJECTINTERNALS_BUILTIN_FUNCTION_NAME(macro) \ - macro(getStdioWriteStream) \ - macro(getStdinStream) \ - macro(initializeNextTickQueue) \ +#define WEBCORE_FOREACH_READABLESTREAMDEFAULTREADER_BUILTIN_FUNCTION_NAME(macro) \ + macro(initializeReadableStreamDefaultReader) \ + macro(cancel) \ + macro(readMany) \ + macro(read) \ + macro(releaseLock) \ + macro(closed) \ #define DECLARE_BUILTIN_GENERATOR(codeName, functionName, overriddenName, argumentCount) \ JSC::FunctionExecutable* codeName##Generator(JSC::VM&); -WEBCORE_FOREACH_PROCESSOBJECTINTERNALS_BUILTIN_CODE(DECLARE_BUILTIN_GENERATOR) +WEBCORE_FOREACH_READABLESTREAMDEFAULTREADER_BUILTIN_CODE(DECLARE_BUILTIN_GENERATOR) #undef DECLARE_BUILTIN_GENERATOR -class ProcessObjectInternalsBuiltinsWrapper : private JSC::WeakHandleOwner { +class ReadableStreamDefaultReaderBuiltinsWrapper : private JSC::WeakHandleOwner { public: - explicit ProcessObjectInternalsBuiltinsWrapper(JSC::VM& vm) + explicit ReadableStreamDefaultReaderBuiltinsWrapper(JSC::VM& vm) : m_vm(vm) - WEBCORE_FOREACH_PROCESSOBJECTINTERNALS_BUILTIN_FUNCTION_NAME(INITIALIZE_BUILTIN_NAMES) + WEBCORE_FOREACH_READABLESTREAMDEFAULTREADER_BUILTIN_FUNCTION_NAME(INITIALIZE_BUILTIN_NAMES) #define INITIALIZE_BUILTIN_SOURCE_MEMBERS(name, functionName, overriddenName, length) , m_##name##Source(JSC::makeSource(StringImpl::createWithoutCopying(s_##name, length), { }, JSC::SourceTaintedOrigin::Untainted)) - WEBCORE_FOREACH_PROCESSOBJECTINTERNALS_BUILTIN_CODE(INITIALIZE_BUILTIN_SOURCE_MEMBERS) + WEBCORE_FOREACH_READABLESTREAMDEFAULTREADER_BUILTIN_CODE(INITIALIZE_BUILTIN_SOURCE_MEMBERS) #undef INITIALIZE_BUILTIN_SOURCE_MEMBERS { } @@ -1214,28 +1082,28 @@ public: #define EXPOSE_BUILTIN_EXECUTABLES(name, functionName, overriddenName, length) \ JSC::UnlinkedFunctionExecutable* name##Executable(); \ const JSC::SourceCode& name##Source() const { return m_##name##Source; } - WEBCORE_FOREACH_PROCESSOBJECTINTERNALS_BUILTIN_CODE(EXPOSE_BUILTIN_EXECUTABLES) + WEBCORE_FOREACH_READABLESTREAMDEFAULTREADER_BUILTIN_CODE(EXPOSE_BUILTIN_EXECUTABLES) #undef EXPOSE_BUILTIN_EXECUTABLES - WEBCORE_FOREACH_PROCESSOBJECTINTERNALS_BUILTIN_FUNCTION_NAME(DECLARE_BUILTIN_IDENTIFIER_ACCESSOR) + WEBCORE_FOREACH_READABLESTREAMDEFAULTREADER_BUILTIN_FUNCTION_NAME(DECLARE_BUILTIN_IDENTIFIER_ACCESSOR) void exportNames(); private: JSC::VM& m_vm; - WEBCORE_FOREACH_PROCESSOBJECTINTERNALS_BUILTIN_FUNCTION_NAME(DECLARE_BUILTIN_NAMES) + WEBCORE_FOREACH_READABLESTREAMDEFAULTREADER_BUILTIN_FUNCTION_NAME(DECLARE_BUILTIN_NAMES) #define DECLARE_BUILTIN_SOURCE_MEMBERS(name, functionName, overriddenName, length) \ JSC::SourceCode m_##name##Source;\ JSC::Weak m_##name##Executable; - WEBCORE_FOREACH_PROCESSOBJECTINTERNALS_BUILTIN_CODE(DECLARE_BUILTIN_SOURCE_MEMBERS) + WEBCORE_FOREACH_READABLESTREAMDEFAULTREADER_BUILTIN_CODE(DECLARE_BUILTIN_SOURCE_MEMBERS) #undef DECLARE_BUILTIN_SOURCE_MEMBERS }; #define DEFINE_BUILTIN_EXECUTABLES(name, functionName, overriddenName, length) \ -inline JSC::UnlinkedFunctionExecutable* ProcessObjectInternalsBuiltinsWrapper::name##Executable() \ +inline JSC::UnlinkedFunctionExecutable* ReadableStreamDefaultReaderBuiltinsWrapper::name##Executable() \ {\ if (!m_##name##Executable) {\ JSC::Identifier executableName = functionName##PublicName();\ @@ -1245,68 +1113,79 @@ inline JSC::UnlinkedFunctionExecutable* ProcessObjectInternalsBuiltinsWrapper::n }\ return m_##name##Executable.get();\ } -WEBCORE_FOREACH_PROCESSOBJECTINTERNALS_BUILTIN_CODE(DEFINE_BUILTIN_EXECUTABLES) +WEBCORE_FOREACH_READABLESTREAMDEFAULTREADER_BUILTIN_CODE(DEFINE_BUILTIN_EXECUTABLES) #undef DEFINE_BUILTIN_EXECUTABLES -inline void ProcessObjectInternalsBuiltinsWrapper::exportNames() +inline void ReadableStreamDefaultReaderBuiltinsWrapper::exportNames() { #define EXPORT_FUNCTION_NAME(name) m_vm.propertyNames->appendExternalName(name##PublicName(), name##PrivateName()); - WEBCORE_FOREACH_PROCESSOBJECTINTERNALS_BUILTIN_FUNCTION_NAME(EXPORT_FUNCTION_NAME) + WEBCORE_FOREACH_READABLESTREAMDEFAULTREADER_BUILTIN_FUNCTION_NAME(EXPORT_FUNCTION_NAME) #undef EXPORT_FUNCTION_NAME } -/* TransformStream.ts */ -// initializeTransformStream -#define WEBCORE_BUILTIN_TRANSFORMSTREAM_INITIALIZETRANSFORMSTREAM 1 -extern const char* const s_transformStreamInitializeTransformStreamCode; -extern const int s_transformStreamInitializeTransformStreamCodeLength; -extern const JSC::ConstructAbility s_transformStreamInitializeTransformStreamCodeConstructAbility; -extern const JSC::ConstructorKind s_transformStreamInitializeTransformStreamCodeConstructorKind; -extern const JSC::ImplementationVisibility s_transformStreamInitializeTransformStreamCodeImplementationVisibility; +/* ReadableStreamBYOBRequest.ts */ +// initializeReadableStreamBYOBRequest +#define WEBCORE_BUILTIN_READABLESTREAMBYOBREQUEST_INITIALIZEREADABLESTREAMBYOBREQUEST 1 +extern const char* const s_readableStreamBYOBRequestInitializeReadableStreamBYOBRequestCode; +extern const int s_readableStreamBYOBRequestInitializeReadableStreamBYOBRequestCodeLength; +extern const JSC::ConstructAbility s_readableStreamBYOBRequestInitializeReadableStreamBYOBRequestCodeConstructAbility; +extern const JSC::ConstructorKind s_readableStreamBYOBRequestInitializeReadableStreamBYOBRequestCodeConstructorKind; +extern const JSC::ImplementationVisibility s_readableStreamBYOBRequestInitializeReadableStreamBYOBRequestCodeImplementationVisibility; -// readable -#define WEBCORE_BUILTIN_TRANSFORMSTREAM_READABLE 1 -extern const char* const s_transformStreamReadableCode; -extern const int s_transformStreamReadableCodeLength; -extern const JSC::ConstructAbility s_transformStreamReadableCodeConstructAbility; -extern const JSC::ConstructorKind s_transformStreamReadableCodeConstructorKind; -extern const JSC::ImplementationVisibility s_transformStreamReadableCodeImplementationVisibility; +// respond +#define WEBCORE_BUILTIN_READABLESTREAMBYOBREQUEST_RESPOND 1 +extern const char* const s_readableStreamBYOBRequestRespondCode; +extern const int s_readableStreamBYOBRequestRespondCodeLength; +extern const JSC::ConstructAbility s_readableStreamBYOBRequestRespondCodeConstructAbility; +extern const JSC::ConstructorKind s_readableStreamBYOBRequestRespondCodeConstructorKind; +extern const JSC::ImplementationVisibility s_readableStreamBYOBRequestRespondCodeImplementationVisibility; -// writable -#define WEBCORE_BUILTIN_TRANSFORMSTREAM_WRITABLE 1 -extern const char* const s_transformStreamWritableCode; -extern const int s_transformStreamWritableCodeLength; -extern const JSC::ConstructAbility s_transformStreamWritableCodeConstructAbility; -extern const JSC::ConstructorKind s_transformStreamWritableCodeConstructorKind; -extern const JSC::ImplementationVisibility s_transformStreamWritableCodeImplementationVisibility; +// respondWithNewView +#define WEBCORE_BUILTIN_READABLESTREAMBYOBREQUEST_RESPONDWITHNEWVIEW 1 +extern const char* const s_readableStreamBYOBRequestRespondWithNewViewCode; +extern const int s_readableStreamBYOBRequestRespondWithNewViewCodeLength; +extern const JSC::ConstructAbility s_readableStreamBYOBRequestRespondWithNewViewCodeConstructAbility; +extern const JSC::ConstructorKind s_readableStreamBYOBRequestRespondWithNewViewCodeConstructorKind; +extern const JSC::ImplementationVisibility s_readableStreamBYOBRequestRespondWithNewViewCodeImplementationVisibility; -#define WEBCORE_FOREACH_TRANSFORMSTREAM_BUILTIN_DATA(macro) \ - macro(initializeTransformStream, transformStreamInitializeTransformStream, 0) \ - macro(readable, transformStreamReadable, 0) \ - macro(writable, transformStreamWritable, 0) \ +// view +#define WEBCORE_BUILTIN_READABLESTREAMBYOBREQUEST_VIEW 1 +extern const char* const s_readableStreamBYOBRequestViewCode; +extern const int s_readableStreamBYOBRequestViewCodeLength; +extern const JSC::ConstructAbility s_readableStreamBYOBRequestViewCodeConstructAbility; +extern const JSC::ConstructorKind s_readableStreamBYOBRequestViewCodeConstructorKind; +extern const JSC::ImplementationVisibility s_readableStreamBYOBRequestViewCodeImplementationVisibility; -#define WEBCORE_FOREACH_TRANSFORMSTREAM_BUILTIN_CODE(macro) \ - macro(transformStreamInitializeTransformStreamCode, initializeTransformStream, ASCIILiteral(), s_transformStreamInitializeTransformStreamCodeLength) \ - macro(transformStreamReadableCode, readable, "get readable"_s, s_transformStreamReadableCodeLength) \ - macro(transformStreamWritableCode, writable, ASCIILiteral(), s_transformStreamWritableCodeLength) \ +#define WEBCORE_FOREACH_READABLESTREAMBYOBREQUEST_BUILTIN_DATA(macro) \ + macro(initializeReadableStreamBYOBRequest, readableStreamBYOBRequestInitializeReadableStreamBYOBRequest, 2) \ + macro(respond, readableStreamBYOBRequestRespond, 1) \ + macro(respondWithNewView, readableStreamBYOBRequestRespondWithNewView, 1) \ + macro(view, readableStreamBYOBRequestView, 0) \ -#define WEBCORE_FOREACH_TRANSFORMSTREAM_BUILTIN_FUNCTION_NAME(macro) \ - macro(initializeTransformStream) \ - macro(readable) \ - macro(writable) \ +#define WEBCORE_FOREACH_READABLESTREAMBYOBREQUEST_BUILTIN_CODE(macro) \ + macro(readableStreamBYOBRequestInitializeReadableStreamBYOBRequestCode, initializeReadableStreamBYOBRequest, ASCIILiteral(), s_readableStreamBYOBRequestInitializeReadableStreamBYOBRequestCodeLength) \ + macro(readableStreamBYOBRequestRespondCode, respond, ASCIILiteral(), s_readableStreamBYOBRequestRespondCodeLength) \ + macro(readableStreamBYOBRequestRespondWithNewViewCode, respondWithNewView, ASCIILiteral(), s_readableStreamBYOBRequestRespondWithNewViewCodeLength) \ + macro(readableStreamBYOBRequestViewCode, view, "get view"_s, s_readableStreamBYOBRequestViewCodeLength) \ + +#define WEBCORE_FOREACH_READABLESTREAMBYOBREQUEST_BUILTIN_FUNCTION_NAME(macro) \ + macro(initializeReadableStreamBYOBRequest) \ + macro(respond) \ + macro(respondWithNewView) \ + macro(view) \ #define DECLARE_BUILTIN_GENERATOR(codeName, functionName, overriddenName, argumentCount) \ JSC::FunctionExecutable* codeName##Generator(JSC::VM&); -WEBCORE_FOREACH_TRANSFORMSTREAM_BUILTIN_CODE(DECLARE_BUILTIN_GENERATOR) +WEBCORE_FOREACH_READABLESTREAMBYOBREQUEST_BUILTIN_CODE(DECLARE_BUILTIN_GENERATOR) #undef DECLARE_BUILTIN_GENERATOR -class TransformStreamBuiltinsWrapper : private JSC::WeakHandleOwner { +class ReadableStreamBYOBRequestBuiltinsWrapper : private JSC::WeakHandleOwner { public: - explicit TransformStreamBuiltinsWrapper(JSC::VM& vm) + explicit ReadableStreamBYOBRequestBuiltinsWrapper(JSC::VM& vm) : m_vm(vm) - WEBCORE_FOREACH_TRANSFORMSTREAM_BUILTIN_FUNCTION_NAME(INITIALIZE_BUILTIN_NAMES) + WEBCORE_FOREACH_READABLESTREAMBYOBREQUEST_BUILTIN_FUNCTION_NAME(INITIALIZE_BUILTIN_NAMES) #define INITIALIZE_BUILTIN_SOURCE_MEMBERS(name, functionName, overriddenName, length) , m_##name##Source(JSC::makeSource(StringImpl::createWithoutCopying(s_##name, length), { }, JSC::SourceTaintedOrigin::Untainted)) - WEBCORE_FOREACH_TRANSFORMSTREAM_BUILTIN_CODE(INITIALIZE_BUILTIN_SOURCE_MEMBERS) + WEBCORE_FOREACH_READABLESTREAMBYOBREQUEST_BUILTIN_CODE(INITIALIZE_BUILTIN_SOURCE_MEMBERS) #undef INITIALIZE_BUILTIN_SOURCE_MEMBERS { } @@ -1314,28 +1193,28 @@ public: #define EXPOSE_BUILTIN_EXECUTABLES(name, functionName, overriddenName, length) \ JSC::UnlinkedFunctionExecutable* name##Executable(); \ const JSC::SourceCode& name##Source() const { return m_##name##Source; } - WEBCORE_FOREACH_TRANSFORMSTREAM_BUILTIN_CODE(EXPOSE_BUILTIN_EXECUTABLES) + WEBCORE_FOREACH_READABLESTREAMBYOBREQUEST_BUILTIN_CODE(EXPOSE_BUILTIN_EXECUTABLES) #undef EXPOSE_BUILTIN_EXECUTABLES - WEBCORE_FOREACH_TRANSFORMSTREAM_BUILTIN_FUNCTION_NAME(DECLARE_BUILTIN_IDENTIFIER_ACCESSOR) + WEBCORE_FOREACH_READABLESTREAMBYOBREQUEST_BUILTIN_FUNCTION_NAME(DECLARE_BUILTIN_IDENTIFIER_ACCESSOR) void exportNames(); private: JSC::VM& m_vm; - WEBCORE_FOREACH_TRANSFORMSTREAM_BUILTIN_FUNCTION_NAME(DECLARE_BUILTIN_NAMES) + WEBCORE_FOREACH_READABLESTREAMBYOBREQUEST_BUILTIN_FUNCTION_NAME(DECLARE_BUILTIN_NAMES) #define DECLARE_BUILTIN_SOURCE_MEMBERS(name, functionName, overriddenName, length) \ JSC::SourceCode m_##name##Source;\ JSC::Weak m_##name##Executable; - WEBCORE_FOREACH_TRANSFORMSTREAM_BUILTIN_CODE(DECLARE_BUILTIN_SOURCE_MEMBERS) + WEBCORE_FOREACH_READABLESTREAMBYOBREQUEST_BUILTIN_CODE(DECLARE_BUILTIN_SOURCE_MEMBERS) #undef DECLARE_BUILTIN_SOURCE_MEMBERS }; #define DEFINE_BUILTIN_EXECUTABLES(name, functionName, overriddenName, length) \ -inline JSC::UnlinkedFunctionExecutable* TransformStreamBuiltinsWrapper::name##Executable() \ +inline JSC::UnlinkedFunctionExecutable* ReadableStreamBYOBRequestBuiltinsWrapper::name##Executable() \ {\ if (!m_##name##Executable) {\ JSC::Identifier executableName = functionName##PublicName();\ @@ -1345,79 +1224,68 @@ inline JSC::UnlinkedFunctionExecutable* TransformStreamBuiltinsWrapper::name##Ex }\ return m_##name##Executable.get();\ } -WEBCORE_FOREACH_TRANSFORMSTREAM_BUILTIN_CODE(DEFINE_BUILTIN_EXECUTABLES) +WEBCORE_FOREACH_READABLESTREAMBYOBREQUEST_BUILTIN_CODE(DEFINE_BUILTIN_EXECUTABLES) #undef DEFINE_BUILTIN_EXECUTABLES -inline void TransformStreamBuiltinsWrapper::exportNames() +inline void ReadableStreamBYOBRequestBuiltinsWrapper::exportNames() { #define EXPORT_FUNCTION_NAME(name) m_vm.propertyNames->appendExternalName(name##PublicName(), name##PrivateName()); - WEBCORE_FOREACH_TRANSFORMSTREAM_BUILTIN_FUNCTION_NAME(EXPORT_FUNCTION_NAME) + WEBCORE_FOREACH_READABLESTREAMBYOBREQUEST_BUILTIN_FUNCTION_NAME(EXPORT_FUNCTION_NAME) #undef EXPORT_FUNCTION_NAME } -/* Module.ts */ -// main -#define WEBCORE_BUILTIN_MODULE_MAIN 1 -extern const char* const s_moduleMainCode; -extern const int s_moduleMainCodeLength; -extern const JSC::ConstructAbility s_moduleMainCodeConstructAbility; -extern const JSC::ConstructorKind s_moduleMainCodeConstructorKind; -extern const JSC::ImplementationVisibility s_moduleMainCodeImplementationVisibility; +/* ProcessObjectInternals.ts */ +// getStdioWriteStream +#define WEBCORE_BUILTIN_PROCESSOBJECTINTERNALS_GETSTDIOWRITESTREAM 1 +extern const char* const s_processObjectInternalsGetStdioWriteStreamCode; +extern const int s_processObjectInternalsGetStdioWriteStreamCodeLength; +extern const JSC::ConstructAbility s_processObjectInternalsGetStdioWriteStreamCodeConstructAbility; +extern const JSC::ConstructorKind s_processObjectInternalsGetStdioWriteStreamCodeConstructorKind; +extern const JSC::ImplementationVisibility s_processObjectInternalsGetStdioWriteStreamCodeImplementationVisibility; -// require -#define WEBCORE_BUILTIN_MODULE_REQUIRE 1 -extern const char* const s_moduleRequireCode; -extern const int s_moduleRequireCodeLength; -extern const JSC::ConstructAbility s_moduleRequireCodeConstructAbility; -extern const JSC::ConstructorKind s_moduleRequireCodeConstructorKind; -extern const JSC::ImplementationVisibility s_moduleRequireCodeImplementationVisibility; +// getStdinStream +#define WEBCORE_BUILTIN_PROCESSOBJECTINTERNALS_GETSTDINSTREAM 1 +extern const char* const s_processObjectInternalsGetStdinStreamCode; +extern const int s_processObjectInternalsGetStdinStreamCodeLength; +extern const JSC::ConstructAbility s_processObjectInternalsGetStdinStreamCodeConstructAbility; +extern const JSC::ConstructorKind s_processObjectInternalsGetStdinStreamCodeConstructorKind; +extern const JSC::ImplementationVisibility s_processObjectInternalsGetStdinStreamCodeImplementationVisibility; -// requireResolve -#define WEBCORE_BUILTIN_MODULE_REQUIRERESOLVE 1 -extern const char* const s_moduleRequireResolveCode; -extern const int s_moduleRequireResolveCodeLength; -extern const JSC::ConstructAbility s_moduleRequireResolveCodeConstructAbility; -extern const JSC::ConstructorKind s_moduleRequireResolveCodeConstructorKind; -extern const JSC::ImplementationVisibility s_moduleRequireResolveCodeImplementationVisibility; +// initializeNextTickQueue +#define WEBCORE_BUILTIN_PROCESSOBJECTINTERNALS_INITIALIZENEXTTICKQUEUE 1 +extern const char* const s_processObjectInternalsInitializeNextTickQueueCode; +extern const int s_processObjectInternalsInitializeNextTickQueueCodeLength; +extern const JSC::ConstructAbility s_processObjectInternalsInitializeNextTickQueueCodeConstructAbility; +extern const JSC::ConstructorKind s_processObjectInternalsInitializeNextTickQueueCodeConstructorKind; +extern const JSC::ImplementationVisibility s_processObjectInternalsInitializeNextTickQueueCodeImplementationVisibility; -// requireNativeModule -#define WEBCORE_BUILTIN_MODULE_REQUIRENATIVEMODULE 1 -extern const char* const s_moduleRequireNativeModuleCode; -extern const int s_moduleRequireNativeModuleCodeLength; -extern const JSC::ConstructAbility s_moduleRequireNativeModuleCodeConstructAbility; -extern const JSC::ConstructorKind s_moduleRequireNativeModuleCodeConstructorKind; -extern const JSC::ImplementationVisibility s_moduleRequireNativeModuleCodeImplementationVisibility; - -#define WEBCORE_FOREACH_MODULE_BUILTIN_DATA(macro) \ - macro(main, moduleMain, 0) \ - macro(require, moduleRequire, 1) \ - macro(requireResolve, moduleRequireResolve, 1) \ - macro(requireNativeModule, moduleRequireNativeModule, 1) \ +#define WEBCORE_FOREACH_PROCESSOBJECTINTERNALS_BUILTIN_DATA(macro) \ + macro(getStdioWriteStream, processObjectInternalsGetStdioWriteStream, 1) \ + macro(getStdinStream, processObjectInternalsGetStdinStream, 1) \ + macro(initializeNextTickQueue, processObjectInternalsInitializeNextTickQueue, 4) \ -#define WEBCORE_FOREACH_MODULE_BUILTIN_CODE(macro) \ - macro(moduleMainCode, main, "get main"_s, s_moduleMainCodeLength) \ - macro(moduleRequireCode, require, ASCIILiteral(), s_moduleRequireCodeLength) \ - macro(moduleRequireResolveCode, requireResolve, ASCIILiteral(), s_moduleRequireResolveCodeLength) \ - macro(moduleRequireNativeModuleCode, requireNativeModule, ASCIILiteral(), s_moduleRequireNativeModuleCodeLength) \ +#define WEBCORE_FOREACH_PROCESSOBJECTINTERNALS_BUILTIN_CODE(macro) \ + macro(processObjectInternalsGetStdioWriteStreamCode, getStdioWriteStream, ASCIILiteral(), s_processObjectInternalsGetStdioWriteStreamCodeLength) \ + macro(processObjectInternalsGetStdinStreamCode, getStdinStream, ASCIILiteral(), s_processObjectInternalsGetStdinStreamCodeLength) \ + macro(processObjectInternalsInitializeNextTickQueueCode, initializeNextTickQueue, ASCIILiteral(), s_processObjectInternalsInitializeNextTickQueueCodeLength) \ -#define WEBCORE_FOREACH_MODULE_BUILTIN_FUNCTION_NAME(macro) \ - macro(main) \ - macro(require) \ - macro(requireResolve) \ - macro(requireNativeModule) \ +#define WEBCORE_FOREACH_PROCESSOBJECTINTERNALS_BUILTIN_FUNCTION_NAME(macro) \ + macro(getStdioWriteStream) \ + macro(getStdinStream) \ + macro(initializeNextTickQueue) \ #define DECLARE_BUILTIN_GENERATOR(codeName, functionName, overriddenName, argumentCount) \ JSC::FunctionExecutable* codeName##Generator(JSC::VM&); -WEBCORE_FOREACH_MODULE_BUILTIN_CODE(DECLARE_BUILTIN_GENERATOR) +WEBCORE_FOREACH_PROCESSOBJECTINTERNALS_BUILTIN_CODE(DECLARE_BUILTIN_GENERATOR) #undef DECLARE_BUILTIN_GENERATOR -class ModuleBuiltinsWrapper : private JSC::WeakHandleOwner { +class ProcessObjectInternalsBuiltinsWrapper : private JSC::WeakHandleOwner { public: - explicit ModuleBuiltinsWrapper(JSC::VM& vm) + explicit ProcessObjectInternalsBuiltinsWrapper(JSC::VM& vm) : m_vm(vm) - WEBCORE_FOREACH_MODULE_BUILTIN_FUNCTION_NAME(INITIALIZE_BUILTIN_NAMES) + WEBCORE_FOREACH_PROCESSOBJECTINTERNALS_BUILTIN_FUNCTION_NAME(INITIALIZE_BUILTIN_NAMES) #define INITIALIZE_BUILTIN_SOURCE_MEMBERS(name, functionName, overriddenName, length) , m_##name##Source(JSC::makeSource(StringImpl::createWithoutCopying(s_##name, length), { }, JSC::SourceTaintedOrigin::Untainted)) - WEBCORE_FOREACH_MODULE_BUILTIN_CODE(INITIALIZE_BUILTIN_SOURCE_MEMBERS) + WEBCORE_FOREACH_PROCESSOBJECTINTERNALS_BUILTIN_CODE(INITIALIZE_BUILTIN_SOURCE_MEMBERS) #undef INITIALIZE_BUILTIN_SOURCE_MEMBERS { } @@ -1425,28 +1293,28 @@ public: #define EXPOSE_BUILTIN_EXECUTABLES(name, functionName, overriddenName, length) \ JSC::UnlinkedFunctionExecutable* name##Executable(); \ const JSC::SourceCode& name##Source() const { return m_##name##Source; } - WEBCORE_FOREACH_MODULE_BUILTIN_CODE(EXPOSE_BUILTIN_EXECUTABLES) + WEBCORE_FOREACH_PROCESSOBJECTINTERNALS_BUILTIN_CODE(EXPOSE_BUILTIN_EXECUTABLES) #undef EXPOSE_BUILTIN_EXECUTABLES - WEBCORE_FOREACH_MODULE_BUILTIN_FUNCTION_NAME(DECLARE_BUILTIN_IDENTIFIER_ACCESSOR) + WEBCORE_FOREACH_PROCESSOBJECTINTERNALS_BUILTIN_FUNCTION_NAME(DECLARE_BUILTIN_IDENTIFIER_ACCESSOR) void exportNames(); private: JSC::VM& m_vm; - WEBCORE_FOREACH_MODULE_BUILTIN_FUNCTION_NAME(DECLARE_BUILTIN_NAMES) + WEBCORE_FOREACH_PROCESSOBJECTINTERNALS_BUILTIN_FUNCTION_NAME(DECLARE_BUILTIN_NAMES) #define DECLARE_BUILTIN_SOURCE_MEMBERS(name, functionName, overriddenName, length) \ JSC::SourceCode m_##name##Source;\ JSC::Weak m_##name##Executable; - WEBCORE_FOREACH_MODULE_BUILTIN_CODE(DECLARE_BUILTIN_SOURCE_MEMBERS) + WEBCORE_FOREACH_PROCESSOBJECTINTERNALS_BUILTIN_CODE(DECLARE_BUILTIN_SOURCE_MEMBERS) #undef DECLARE_BUILTIN_SOURCE_MEMBERS }; #define DEFINE_BUILTIN_EXECUTABLES(name, functionName, overriddenName, length) \ -inline JSC::UnlinkedFunctionExecutable* ModuleBuiltinsWrapper::name##Executable() \ +inline JSC::UnlinkedFunctionExecutable* ProcessObjectInternalsBuiltinsWrapper::name##Executable() \ {\ if (!m_##name##Executable) {\ JSC::Identifier executableName = functionName##PublicName();\ @@ -1456,761 +1324,1260 @@ inline JSC::UnlinkedFunctionExecutable* ModuleBuiltinsWrapper::name##Executable( }\ return m_##name##Executable.get();\ } -WEBCORE_FOREACH_MODULE_BUILTIN_CODE(DEFINE_BUILTIN_EXECUTABLES) +WEBCORE_FOREACH_PROCESSOBJECTINTERNALS_BUILTIN_CODE(DEFINE_BUILTIN_EXECUTABLES) #undef DEFINE_BUILTIN_EXECUTABLES -inline void ModuleBuiltinsWrapper::exportNames() +inline void ProcessObjectInternalsBuiltinsWrapper::exportNames() { #define EXPORT_FUNCTION_NAME(name) m_vm.propertyNames->appendExternalName(name##PublicName(), name##PrivateName()); - WEBCORE_FOREACH_MODULE_BUILTIN_FUNCTION_NAME(EXPORT_FUNCTION_NAME) + WEBCORE_FOREACH_PROCESSOBJECTINTERNALS_BUILTIN_FUNCTION_NAME(EXPORT_FUNCTION_NAME) #undef EXPORT_FUNCTION_NAME } -/* JSBufferPrototype.ts */ -// setBigUint64 -#define WEBCORE_BUILTIN_JSBUFFERPROTOTYPE_SETBIGUINT64 1 -extern const char* const s_jsBufferPrototypeSetBigUint64Code; -extern const int s_jsBufferPrototypeSetBigUint64CodeLength; -extern const JSC::ConstructAbility s_jsBufferPrototypeSetBigUint64CodeConstructAbility; -extern const JSC::ConstructorKind s_jsBufferPrototypeSetBigUint64CodeConstructorKind; -extern const JSC::ImplementationVisibility s_jsBufferPrototypeSetBigUint64CodeImplementationVisibility; - -// readInt8 -#define WEBCORE_BUILTIN_JSBUFFERPROTOTYPE_READINT8 1 -extern const char* const s_jsBufferPrototypeReadInt8Code; -extern const int s_jsBufferPrototypeReadInt8CodeLength; -extern const JSC::ConstructAbility s_jsBufferPrototypeReadInt8CodeConstructAbility; -extern const JSC::ConstructorKind s_jsBufferPrototypeReadInt8CodeConstructorKind; -extern const JSC::ImplementationVisibility s_jsBufferPrototypeReadInt8CodeImplementationVisibility; +/* WritableStreamInternals.ts */ +// isWritableStream +#define WEBCORE_BUILTIN_WRITABLESTREAMINTERNALS_ISWRITABLESTREAM 1 +extern const char* const s_writableStreamInternalsIsWritableStreamCode; +extern const int s_writableStreamInternalsIsWritableStreamCodeLength; +extern const JSC::ConstructAbility s_writableStreamInternalsIsWritableStreamCodeConstructAbility; +extern const JSC::ConstructorKind s_writableStreamInternalsIsWritableStreamCodeConstructorKind; +extern const JSC::ImplementationVisibility s_writableStreamInternalsIsWritableStreamCodeImplementationVisibility; -// readUInt8 -#define WEBCORE_BUILTIN_JSBUFFERPROTOTYPE_READUINT8 1 -extern const char* const s_jsBufferPrototypeReadUInt8Code; -extern const int s_jsBufferPrototypeReadUInt8CodeLength; -extern const JSC::ConstructAbility s_jsBufferPrototypeReadUInt8CodeConstructAbility; -extern const JSC::ConstructorKind s_jsBufferPrototypeReadUInt8CodeConstructorKind; -extern const JSC::ImplementationVisibility s_jsBufferPrototypeReadUInt8CodeImplementationVisibility; +// isWritableStreamDefaultWriter +#define WEBCORE_BUILTIN_WRITABLESTREAMINTERNALS_ISWRITABLESTREAMDEFAULTWRITER 1 +extern const char* const s_writableStreamInternalsIsWritableStreamDefaultWriterCode; +extern const int s_writableStreamInternalsIsWritableStreamDefaultWriterCodeLength; +extern const JSC::ConstructAbility s_writableStreamInternalsIsWritableStreamDefaultWriterCodeConstructAbility; +extern const JSC::ConstructorKind s_writableStreamInternalsIsWritableStreamDefaultWriterCodeConstructorKind; +extern const JSC::ImplementationVisibility s_writableStreamInternalsIsWritableStreamDefaultWriterCodeImplementationVisibility; -// readInt16LE -#define WEBCORE_BUILTIN_JSBUFFERPROTOTYPE_READINT16LE 1 -extern const char* const s_jsBufferPrototypeReadInt16LECode; -extern const int s_jsBufferPrototypeReadInt16LECodeLength; -extern const JSC::ConstructAbility s_jsBufferPrototypeReadInt16LECodeConstructAbility; -extern const JSC::ConstructorKind s_jsBufferPrototypeReadInt16LECodeConstructorKind; -extern const JSC::ImplementationVisibility s_jsBufferPrototypeReadInt16LECodeImplementationVisibility; +// acquireWritableStreamDefaultWriter +#define WEBCORE_BUILTIN_WRITABLESTREAMINTERNALS_ACQUIREWRITABLESTREAMDEFAULTWRITER 1 +extern const char* const s_writableStreamInternalsAcquireWritableStreamDefaultWriterCode; +extern const int s_writableStreamInternalsAcquireWritableStreamDefaultWriterCodeLength; +extern const JSC::ConstructAbility s_writableStreamInternalsAcquireWritableStreamDefaultWriterCodeConstructAbility; +extern const JSC::ConstructorKind s_writableStreamInternalsAcquireWritableStreamDefaultWriterCodeConstructorKind; +extern const JSC::ImplementationVisibility s_writableStreamInternalsAcquireWritableStreamDefaultWriterCodeImplementationVisibility; -// readInt16BE -#define WEBCORE_BUILTIN_JSBUFFERPROTOTYPE_READINT16BE 1 -extern const char* const s_jsBufferPrototypeReadInt16BECode; -extern const int s_jsBufferPrototypeReadInt16BECodeLength; -extern const JSC::ConstructAbility s_jsBufferPrototypeReadInt16BECodeConstructAbility; -extern const JSC::ConstructorKind s_jsBufferPrototypeReadInt16BECodeConstructorKind; -extern const JSC::ImplementationVisibility s_jsBufferPrototypeReadInt16BECodeImplementationVisibility; +// createWritableStream +#define WEBCORE_BUILTIN_WRITABLESTREAMINTERNALS_CREATEWRITABLESTREAM 1 +extern const char* const s_writableStreamInternalsCreateWritableStreamCode; +extern const int s_writableStreamInternalsCreateWritableStreamCodeLength; +extern const JSC::ConstructAbility s_writableStreamInternalsCreateWritableStreamCodeConstructAbility; +extern const JSC::ConstructorKind s_writableStreamInternalsCreateWritableStreamCodeConstructorKind; +extern const JSC::ImplementationVisibility s_writableStreamInternalsCreateWritableStreamCodeImplementationVisibility; -// readUInt16LE -#define WEBCORE_BUILTIN_JSBUFFERPROTOTYPE_READUINT16LE 1 -extern const char* const s_jsBufferPrototypeReadUInt16LECode; -extern const int s_jsBufferPrototypeReadUInt16LECodeLength; -extern const JSC::ConstructAbility s_jsBufferPrototypeReadUInt16LECodeConstructAbility; -extern const JSC::ConstructorKind s_jsBufferPrototypeReadUInt16LECodeConstructorKind; -extern const JSC::ImplementationVisibility s_jsBufferPrototypeReadUInt16LECodeImplementationVisibility; +// createInternalWritableStreamFromUnderlyingSink +#define WEBCORE_BUILTIN_WRITABLESTREAMINTERNALS_CREATEINTERNALWRITABLESTREAMFROMUNDERLYINGSINK 1 +extern const char* const s_writableStreamInternalsCreateInternalWritableStreamFromUnderlyingSinkCode; +extern const int s_writableStreamInternalsCreateInternalWritableStreamFromUnderlyingSinkCodeLength; +extern const JSC::ConstructAbility s_writableStreamInternalsCreateInternalWritableStreamFromUnderlyingSinkCodeConstructAbility; +extern const JSC::ConstructorKind s_writableStreamInternalsCreateInternalWritableStreamFromUnderlyingSinkCodeConstructorKind; +extern const JSC::ImplementationVisibility s_writableStreamInternalsCreateInternalWritableStreamFromUnderlyingSinkCodeImplementationVisibility; -// readUInt16BE -#define WEBCORE_BUILTIN_JSBUFFERPROTOTYPE_READUINT16BE 1 -extern const char* const s_jsBufferPrototypeReadUInt16BECode; -extern const int s_jsBufferPrototypeReadUInt16BECodeLength; -extern const JSC::ConstructAbility s_jsBufferPrototypeReadUInt16BECodeConstructAbility; -extern const JSC::ConstructorKind s_jsBufferPrototypeReadUInt16BECodeConstructorKind; -extern const JSC::ImplementationVisibility s_jsBufferPrototypeReadUInt16BECodeImplementationVisibility; +// initializeWritableStreamSlots +#define WEBCORE_BUILTIN_WRITABLESTREAMINTERNALS_INITIALIZEWRITABLESTREAMSLOTS 1 +extern const char* const s_writableStreamInternalsInitializeWritableStreamSlotsCode; +extern const int s_writableStreamInternalsInitializeWritableStreamSlotsCodeLength; +extern const JSC::ConstructAbility s_writableStreamInternalsInitializeWritableStreamSlotsCodeConstructAbility; +extern const JSC::ConstructorKind s_writableStreamInternalsInitializeWritableStreamSlotsCodeConstructorKind; +extern const JSC::ImplementationVisibility s_writableStreamInternalsInitializeWritableStreamSlotsCodeImplementationVisibility; -// readInt32LE -#define WEBCORE_BUILTIN_JSBUFFERPROTOTYPE_READINT32LE 1 -extern const char* const s_jsBufferPrototypeReadInt32LECode; -extern const int s_jsBufferPrototypeReadInt32LECodeLength; -extern const JSC::ConstructAbility s_jsBufferPrototypeReadInt32LECodeConstructAbility; -extern const JSC::ConstructorKind s_jsBufferPrototypeReadInt32LECodeConstructorKind; -extern const JSC::ImplementationVisibility s_jsBufferPrototypeReadInt32LECodeImplementationVisibility; +// writableStreamCloseForBindings +#define WEBCORE_BUILTIN_WRITABLESTREAMINTERNALS_WRITABLESTREAMCLOSEFORBINDINGS 1 +extern const char* const s_writableStreamInternalsWritableStreamCloseForBindingsCode; +extern const int s_writableStreamInternalsWritableStreamCloseForBindingsCodeLength; +extern const JSC::ConstructAbility s_writableStreamInternalsWritableStreamCloseForBindingsCodeConstructAbility; +extern const JSC::ConstructorKind s_writableStreamInternalsWritableStreamCloseForBindingsCodeConstructorKind; +extern const JSC::ImplementationVisibility s_writableStreamInternalsWritableStreamCloseForBindingsCodeImplementationVisibility; -// readInt32BE -#define WEBCORE_BUILTIN_JSBUFFERPROTOTYPE_READINT32BE 1 -extern const char* const s_jsBufferPrototypeReadInt32BECode; -extern const int s_jsBufferPrototypeReadInt32BECodeLength; -extern const JSC::ConstructAbility s_jsBufferPrototypeReadInt32BECodeConstructAbility; -extern const JSC::ConstructorKind s_jsBufferPrototypeReadInt32BECodeConstructorKind; -extern const JSC::ImplementationVisibility s_jsBufferPrototypeReadInt32BECodeImplementationVisibility; +// writableStreamAbortForBindings +#define WEBCORE_BUILTIN_WRITABLESTREAMINTERNALS_WRITABLESTREAMABORTFORBINDINGS 1 +extern const char* const s_writableStreamInternalsWritableStreamAbortForBindingsCode; +extern const int s_writableStreamInternalsWritableStreamAbortForBindingsCodeLength; +extern const JSC::ConstructAbility s_writableStreamInternalsWritableStreamAbortForBindingsCodeConstructAbility; +extern const JSC::ConstructorKind s_writableStreamInternalsWritableStreamAbortForBindingsCodeConstructorKind; +extern const JSC::ImplementationVisibility s_writableStreamInternalsWritableStreamAbortForBindingsCodeImplementationVisibility; -// readUInt32LE -#define WEBCORE_BUILTIN_JSBUFFERPROTOTYPE_READUINT32LE 1 -extern const char* const s_jsBufferPrototypeReadUInt32LECode; -extern const int s_jsBufferPrototypeReadUInt32LECodeLength; -extern const JSC::ConstructAbility s_jsBufferPrototypeReadUInt32LECodeConstructAbility; -extern const JSC::ConstructorKind s_jsBufferPrototypeReadUInt32LECodeConstructorKind; -extern const JSC::ImplementationVisibility s_jsBufferPrototypeReadUInt32LECodeImplementationVisibility; +// isWritableStreamLocked +#define WEBCORE_BUILTIN_WRITABLESTREAMINTERNALS_ISWRITABLESTREAMLOCKED 1 +extern const char* const s_writableStreamInternalsIsWritableStreamLockedCode; +extern const int s_writableStreamInternalsIsWritableStreamLockedCodeLength; +extern const JSC::ConstructAbility s_writableStreamInternalsIsWritableStreamLockedCodeConstructAbility; +extern const JSC::ConstructorKind s_writableStreamInternalsIsWritableStreamLockedCodeConstructorKind; +extern const JSC::ImplementationVisibility s_writableStreamInternalsIsWritableStreamLockedCodeImplementationVisibility; -// readUInt32BE -#define WEBCORE_BUILTIN_JSBUFFERPROTOTYPE_READUINT32BE 1 -extern const char* const s_jsBufferPrototypeReadUInt32BECode; -extern const int s_jsBufferPrototypeReadUInt32BECodeLength; -extern const JSC::ConstructAbility s_jsBufferPrototypeReadUInt32BECodeConstructAbility; -extern const JSC::ConstructorKind s_jsBufferPrototypeReadUInt32BECodeConstructorKind; -extern const JSC::ImplementationVisibility s_jsBufferPrototypeReadUInt32BECodeImplementationVisibility; +// setUpWritableStreamDefaultWriter +#define WEBCORE_BUILTIN_WRITABLESTREAMINTERNALS_SETUPWRITABLESTREAMDEFAULTWRITER 1 +extern const char* const s_writableStreamInternalsSetUpWritableStreamDefaultWriterCode; +extern const int s_writableStreamInternalsSetUpWritableStreamDefaultWriterCodeLength; +extern const JSC::ConstructAbility s_writableStreamInternalsSetUpWritableStreamDefaultWriterCodeConstructAbility; +extern const JSC::ConstructorKind s_writableStreamInternalsSetUpWritableStreamDefaultWriterCodeConstructorKind; +extern const JSC::ImplementationVisibility s_writableStreamInternalsSetUpWritableStreamDefaultWriterCodeImplementationVisibility; -// readIntLE -#define WEBCORE_BUILTIN_JSBUFFERPROTOTYPE_READINTLE 1 -extern const char* const s_jsBufferPrototypeReadIntLECode; -extern const int s_jsBufferPrototypeReadIntLECodeLength; -extern const JSC::ConstructAbility s_jsBufferPrototypeReadIntLECodeConstructAbility; -extern const JSC::ConstructorKind s_jsBufferPrototypeReadIntLECodeConstructorKind; -extern const JSC::ImplementationVisibility s_jsBufferPrototypeReadIntLECodeImplementationVisibility; +// writableStreamAbort +#define WEBCORE_BUILTIN_WRITABLESTREAMINTERNALS_WRITABLESTREAMABORT 1 +extern const char* const s_writableStreamInternalsWritableStreamAbortCode; +extern const int s_writableStreamInternalsWritableStreamAbortCodeLength; +extern const JSC::ConstructAbility s_writableStreamInternalsWritableStreamAbortCodeConstructAbility; +extern const JSC::ConstructorKind s_writableStreamInternalsWritableStreamAbortCodeConstructorKind; +extern const JSC::ImplementationVisibility s_writableStreamInternalsWritableStreamAbortCodeImplementationVisibility; -// readIntBE -#define WEBCORE_BUILTIN_JSBUFFERPROTOTYPE_READINTBE 1 -extern const char* const s_jsBufferPrototypeReadIntBECode; -extern const int s_jsBufferPrototypeReadIntBECodeLength; -extern const JSC::ConstructAbility s_jsBufferPrototypeReadIntBECodeConstructAbility; -extern const JSC::ConstructorKind s_jsBufferPrototypeReadIntBECodeConstructorKind; -extern const JSC::ImplementationVisibility s_jsBufferPrototypeReadIntBECodeImplementationVisibility; +// writableStreamClose +#define WEBCORE_BUILTIN_WRITABLESTREAMINTERNALS_WRITABLESTREAMCLOSE 1 +extern const char* const s_writableStreamInternalsWritableStreamCloseCode; +extern const int s_writableStreamInternalsWritableStreamCloseCodeLength; +extern const JSC::ConstructAbility s_writableStreamInternalsWritableStreamCloseCodeConstructAbility; +extern const JSC::ConstructorKind s_writableStreamInternalsWritableStreamCloseCodeConstructorKind; +extern const JSC::ImplementationVisibility s_writableStreamInternalsWritableStreamCloseCodeImplementationVisibility; -// readUIntLE -#define WEBCORE_BUILTIN_JSBUFFERPROTOTYPE_READUINTLE 1 -extern const char* const s_jsBufferPrototypeReadUIntLECode; -extern const int s_jsBufferPrototypeReadUIntLECodeLength; -extern const JSC::ConstructAbility s_jsBufferPrototypeReadUIntLECodeConstructAbility; -extern const JSC::ConstructorKind s_jsBufferPrototypeReadUIntLECodeConstructorKind; -extern const JSC::ImplementationVisibility s_jsBufferPrototypeReadUIntLECodeImplementationVisibility; +// writableStreamAddWriteRequest +#define WEBCORE_BUILTIN_WRITABLESTREAMINTERNALS_WRITABLESTREAMADDWRITEREQUEST 1 +extern const char* const s_writableStreamInternalsWritableStreamAddWriteRequestCode; +extern const int s_writableStreamInternalsWritableStreamAddWriteRequestCodeLength; +extern const JSC::ConstructAbility s_writableStreamInternalsWritableStreamAddWriteRequestCodeConstructAbility; +extern const JSC::ConstructorKind s_writableStreamInternalsWritableStreamAddWriteRequestCodeConstructorKind; +extern const JSC::ImplementationVisibility s_writableStreamInternalsWritableStreamAddWriteRequestCodeImplementationVisibility; -// readUIntBE -#define WEBCORE_BUILTIN_JSBUFFERPROTOTYPE_READUINTBE 1 -extern const char* const s_jsBufferPrototypeReadUIntBECode; -extern const int s_jsBufferPrototypeReadUIntBECodeLength; -extern const JSC::ConstructAbility s_jsBufferPrototypeReadUIntBECodeConstructAbility; -extern const JSC::ConstructorKind s_jsBufferPrototypeReadUIntBECodeConstructorKind; -extern const JSC::ImplementationVisibility s_jsBufferPrototypeReadUIntBECodeImplementationVisibility; +// writableStreamCloseQueuedOrInFlight +#define WEBCORE_BUILTIN_WRITABLESTREAMINTERNALS_WRITABLESTREAMCLOSEQUEUEDORINFLIGHT 1 +extern const char* const s_writableStreamInternalsWritableStreamCloseQueuedOrInFlightCode; +extern const int s_writableStreamInternalsWritableStreamCloseQueuedOrInFlightCodeLength; +extern const JSC::ConstructAbility s_writableStreamInternalsWritableStreamCloseQueuedOrInFlightCodeConstructAbility; +extern const JSC::ConstructorKind s_writableStreamInternalsWritableStreamCloseQueuedOrInFlightCodeConstructorKind; +extern const JSC::ImplementationVisibility s_writableStreamInternalsWritableStreamCloseQueuedOrInFlightCodeImplementationVisibility; -// readFloatLE -#define WEBCORE_BUILTIN_JSBUFFERPROTOTYPE_READFLOATLE 1 -extern const char* const s_jsBufferPrototypeReadFloatLECode; -extern const int s_jsBufferPrototypeReadFloatLECodeLength; -extern const JSC::ConstructAbility s_jsBufferPrototypeReadFloatLECodeConstructAbility; -extern const JSC::ConstructorKind s_jsBufferPrototypeReadFloatLECodeConstructorKind; -extern const JSC::ImplementationVisibility s_jsBufferPrototypeReadFloatLECodeImplementationVisibility; +// writableStreamDealWithRejection +#define WEBCORE_BUILTIN_WRITABLESTREAMINTERNALS_WRITABLESTREAMDEALWITHREJECTION 1 +extern const char* const s_writableStreamInternalsWritableStreamDealWithRejectionCode; +extern const int s_writableStreamInternalsWritableStreamDealWithRejectionCodeLength; +extern const JSC::ConstructAbility s_writableStreamInternalsWritableStreamDealWithRejectionCodeConstructAbility; +extern const JSC::ConstructorKind s_writableStreamInternalsWritableStreamDealWithRejectionCodeConstructorKind; +extern const JSC::ImplementationVisibility s_writableStreamInternalsWritableStreamDealWithRejectionCodeImplementationVisibility; -// readFloatBE -#define WEBCORE_BUILTIN_JSBUFFERPROTOTYPE_READFLOATBE 1 -extern const char* const s_jsBufferPrototypeReadFloatBECode; -extern const int s_jsBufferPrototypeReadFloatBECodeLength; -extern const JSC::ConstructAbility s_jsBufferPrototypeReadFloatBECodeConstructAbility; -extern const JSC::ConstructorKind s_jsBufferPrototypeReadFloatBECodeConstructorKind; -extern const JSC::ImplementationVisibility s_jsBufferPrototypeReadFloatBECodeImplementationVisibility; +// writableStreamFinishErroring +#define WEBCORE_BUILTIN_WRITABLESTREAMINTERNALS_WRITABLESTREAMFINISHERRORING 1 +extern const char* const s_writableStreamInternalsWritableStreamFinishErroringCode; +extern const int s_writableStreamInternalsWritableStreamFinishErroringCodeLength; +extern const JSC::ConstructAbility s_writableStreamInternalsWritableStreamFinishErroringCodeConstructAbility; +extern const JSC::ConstructorKind s_writableStreamInternalsWritableStreamFinishErroringCodeConstructorKind; +extern const JSC::ImplementationVisibility s_writableStreamInternalsWritableStreamFinishErroringCodeImplementationVisibility; -// readDoubleLE -#define WEBCORE_BUILTIN_JSBUFFERPROTOTYPE_READDOUBLELE 1 -extern const char* const s_jsBufferPrototypeReadDoubleLECode; -extern const int s_jsBufferPrototypeReadDoubleLECodeLength; -extern const JSC::ConstructAbility s_jsBufferPrototypeReadDoubleLECodeConstructAbility; -extern const JSC::ConstructorKind s_jsBufferPrototypeReadDoubleLECodeConstructorKind; -extern const JSC::ImplementationVisibility s_jsBufferPrototypeReadDoubleLECodeImplementationVisibility; +// writableStreamFinishInFlightClose +#define WEBCORE_BUILTIN_WRITABLESTREAMINTERNALS_WRITABLESTREAMFINISHINFLIGHTCLOSE 1 +extern const char* const s_writableStreamInternalsWritableStreamFinishInFlightCloseCode; +extern const int s_writableStreamInternalsWritableStreamFinishInFlightCloseCodeLength; +extern const JSC::ConstructAbility s_writableStreamInternalsWritableStreamFinishInFlightCloseCodeConstructAbility; +extern const JSC::ConstructorKind s_writableStreamInternalsWritableStreamFinishInFlightCloseCodeConstructorKind; +extern const JSC::ImplementationVisibility s_writableStreamInternalsWritableStreamFinishInFlightCloseCodeImplementationVisibility; -// readDoubleBE -#define WEBCORE_BUILTIN_JSBUFFERPROTOTYPE_READDOUBLEBE 1 -extern const char* const s_jsBufferPrototypeReadDoubleBECode; -extern const int s_jsBufferPrototypeReadDoubleBECodeLength; -extern const JSC::ConstructAbility s_jsBufferPrototypeReadDoubleBECodeConstructAbility; -extern const JSC::ConstructorKind s_jsBufferPrototypeReadDoubleBECodeConstructorKind; -extern const JSC::ImplementationVisibility s_jsBufferPrototypeReadDoubleBECodeImplementationVisibility; +// writableStreamFinishInFlightCloseWithError +#define WEBCORE_BUILTIN_WRITABLESTREAMINTERNALS_WRITABLESTREAMFINISHINFLIGHTCLOSEWITHERROR 1 +extern const char* const s_writableStreamInternalsWritableStreamFinishInFlightCloseWithErrorCode; +extern const int s_writableStreamInternalsWritableStreamFinishInFlightCloseWithErrorCodeLength; +extern const JSC::ConstructAbility s_writableStreamInternalsWritableStreamFinishInFlightCloseWithErrorCodeConstructAbility; +extern const JSC::ConstructorKind s_writableStreamInternalsWritableStreamFinishInFlightCloseWithErrorCodeConstructorKind; +extern const JSC::ImplementationVisibility s_writableStreamInternalsWritableStreamFinishInFlightCloseWithErrorCodeImplementationVisibility; -// readBigInt64LE -#define WEBCORE_BUILTIN_JSBUFFERPROTOTYPE_READBIGINT64LE 1 -extern const char* const s_jsBufferPrototypeReadBigInt64LECode; -extern const int s_jsBufferPrototypeReadBigInt64LECodeLength; -extern const JSC::ConstructAbility s_jsBufferPrototypeReadBigInt64LECodeConstructAbility; -extern const JSC::ConstructorKind s_jsBufferPrototypeReadBigInt64LECodeConstructorKind; -extern const JSC::ImplementationVisibility s_jsBufferPrototypeReadBigInt64LECodeImplementationVisibility; +// writableStreamFinishInFlightWrite +#define WEBCORE_BUILTIN_WRITABLESTREAMINTERNALS_WRITABLESTREAMFINISHINFLIGHTWRITE 1 +extern const char* const s_writableStreamInternalsWritableStreamFinishInFlightWriteCode; +extern const int s_writableStreamInternalsWritableStreamFinishInFlightWriteCodeLength; +extern const JSC::ConstructAbility s_writableStreamInternalsWritableStreamFinishInFlightWriteCodeConstructAbility; +extern const JSC::ConstructorKind s_writableStreamInternalsWritableStreamFinishInFlightWriteCodeConstructorKind; +extern const JSC::ImplementationVisibility s_writableStreamInternalsWritableStreamFinishInFlightWriteCodeImplementationVisibility; -// readBigInt64BE -#define WEBCORE_BUILTIN_JSBUFFERPROTOTYPE_READBIGINT64BE 1 -extern const char* const s_jsBufferPrototypeReadBigInt64BECode; -extern const int s_jsBufferPrototypeReadBigInt64BECodeLength; -extern const JSC::ConstructAbility s_jsBufferPrototypeReadBigInt64BECodeConstructAbility; -extern const JSC::ConstructorKind s_jsBufferPrototypeReadBigInt64BECodeConstructorKind; -extern const JSC::ImplementationVisibility s_jsBufferPrototypeReadBigInt64BECodeImplementationVisibility; +// writableStreamFinishInFlightWriteWithError +#define WEBCORE_BUILTIN_WRITABLESTREAMINTERNALS_WRITABLESTREAMFINISHINFLIGHTWRITEWITHERROR 1 +extern const char* const s_writableStreamInternalsWritableStreamFinishInFlightWriteWithErrorCode; +extern const int s_writableStreamInternalsWritableStreamFinishInFlightWriteWithErrorCodeLength; +extern const JSC::ConstructAbility s_writableStreamInternalsWritableStreamFinishInFlightWriteWithErrorCodeConstructAbility; +extern const JSC::ConstructorKind s_writableStreamInternalsWritableStreamFinishInFlightWriteWithErrorCodeConstructorKind; +extern const JSC::ImplementationVisibility s_writableStreamInternalsWritableStreamFinishInFlightWriteWithErrorCodeImplementationVisibility; -// readBigUInt64LE -#define WEBCORE_BUILTIN_JSBUFFERPROTOTYPE_READBIGUINT64LE 1 -extern const char* const s_jsBufferPrototypeReadBigUInt64LECode; -extern const int s_jsBufferPrototypeReadBigUInt64LECodeLength; -extern const JSC::ConstructAbility s_jsBufferPrototypeReadBigUInt64LECodeConstructAbility; -extern const JSC::ConstructorKind s_jsBufferPrototypeReadBigUInt64LECodeConstructorKind; -extern const JSC::ImplementationVisibility s_jsBufferPrototypeReadBigUInt64LECodeImplementationVisibility; +// writableStreamHasOperationMarkedInFlight +#define WEBCORE_BUILTIN_WRITABLESTREAMINTERNALS_WRITABLESTREAMHASOPERATIONMARKEDINFLIGHT 1 +extern const char* const s_writableStreamInternalsWritableStreamHasOperationMarkedInFlightCode; +extern const int s_writableStreamInternalsWritableStreamHasOperationMarkedInFlightCodeLength; +extern const JSC::ConstructAbility s_writableStreamInternalsWritableStreamHasOperationMarkedInFlightCodeConstructAbility; +extern const JSC::ConstructorKind s_writableStreamInternalsWritableStreamHasOperationMarkedInFlightCodeConstructorKind; +extern const JSC::ImplementationVisibility s_writableStreamInternalsWritableStreamHasOperationMarkedInFlightCodeImplementationVisibility; -// readBigUInt64BE -#define WEBCORE_BUILTIN_JSBUFFERPROTOTYPE_READBIGUINT64BE 1 -extern const char* const s_jsBufferPrototypeReadBigUInt64BECode; -extern const int s_jsBufferPrototypeReadBigUInt64BECodeLength; -extern const JSC::ConstructAbility s_jsBufferPrototypeReadBigUInt64BECodeConstructAbility; -extern const JSC::ConstructorKind s_jsBufferPrototypeReadBigUInt64BECodeConstructorKind; -extern const JSC::ImplementationVisibility s_jsBufferPrototypeReadBigUInt64BECodeImplementationVisibility; +// writableStreamMarkCloseRequestInFlight +#define WEBCORE_BUILTIN_WRITABLESTREAMINTERNALS_WRITABLESTREAMMARKCLOSEREQUESTINFLIGHT 1 +extern const char* const s_writableStreamInternalsWritableStreamMarkCloseRequestInFlightCode; +extern const int s_writableStreamInternalsWritableStreamMarkCloseRequestInFlightCodeLength; +extern const JSC::ConstructAbility s_writableStreamInternalsWritableStreamMarkCloseRequestInFlightCodeConstructAbility; +extern const JSC::ConstructorKind s_writableStreamInternalsWritableStreamMarkCloseRequestInFlightCodeConstructorKind; +extern const JSC::ImplementationVisibility s_writableStreamInternalsWritableStreamMarkCloseRequestInFlightCodeImplementationVisibility; -// writeInt8 -#define WEBCORE_BUILTIN_JSBUFFERPROTOTYPE_WRITEINT8 1 -extern const char* const s_jsBufferPrototypeWriteInt8Code; -extern const int s_jsBufferPrototypeWriteInt8CodeLength; -extern const JSC::ConstructAbility s_jsBufferPrototypeWriteInt8CodeConstructAbility; -extern const JSC::ConstructorKind s_jsBufferPrototypeWriteInt8CodeConstructorKind; -extern const JSC::ImplementationVisibility s_jsBufferPrototypeWriteInt8CodeImplementationVisibility; +// writableStreamMarkFirstWriteRequestInFlight +#define WEBCORE_BUILTIN_WRITABLESTREAMINTERNALS_WRITABLESTREAMMARKFIRSTWRITEREQUESTINFLIGHT 1 +extern const char* const s_writableStreamInternalsWritableStreamMarkFirstWriteRequestInFlightCode; +extern const int s_writableStreamInternalsWritableStreamMarkFirstWriteRequestInFlightCodeLength; +extern const JSC::ConstructAbility s_writableStreamInternalsWritableStreamMarkFirstWriteRequestInFlightCodeConstructAbility; +extern const JSC::ConstructorKind s_writableStreamInternalsWritableStreamMarkFirstWriteRequestInFlightCodeConstructorKind; +extern const JSC::ImplementationVisibility s_writableStreamInternalsWritableStreamMarkFirstWriteRequestInFlightCodeImplementationVisibility; -// writeUInt8 -#define WEBCORE_BUILTIN_JSBUFFERPROTOTYPE_WRITEUINT8 1 -extern const char* const s_jsBufferPrototypeWriteUInt8Code; -extern const int s_jsBufferPrototypeWriteUInt8CodeLength; -extern const JSC::ConstructAbility s_jsBufferPrototypeWriteUInt8CodeConstructAbility; -extern const JSC::ConstructorKind s_jsBufferPrototypeWriteUInt8CodeConstructorKind; -extern const JSC::ImplementationVisibility s_jsBufferPrototypeWriteUInt8CodeImplementationVisibility; +// writableStreamRejectCloseAndClosedPromiseIfNeeded +#define WEBCORE_BUILTIN_WRITABLESTREAMINTERNALS_WRITABLESTREAMREJECTCLOSEANDCLOSEDPROMISEIFNEEDED 1 +extern const char* const s_writableStreamInternalsWritableStreamRejectCloseAndClosedPromiseIfNeededCode; +extern const int s_writableStreamInternalsWritableStreamRejectCloseAndClosedPromiseIfNeededCodeLength; +extern const JSC::ConstructAbility s_writableStreamInternalsWritableStreamRejectCloseAndClosedPromiseIfNeededCodeConstructAbility; +extern const JSC::ConstructorKind s_writableStreamInternalsWritableStreamRejectCloseAndClosedPromiseIfNeededCodeConstructorKind; +extern const JSC::ImplementationVisibility s_writableStreamInternalsWritableStreamRejectCloseAndClosedPromiseIfNeededCodeImplementationVisibility; -// writeInt16LE -#define WEBCORE_BUILTIN_JSBUFFERPROTOTYPE_WRITEINT16LE 1 -extern const char* const s_jsBufferPrototypeWriteInt16LECode; -extern const int s_jsBufferPrototypeWriteInt16LECodeLength; -extern const JSC::ConstructAbility s_jsBufferPrototypeWriteInt16LECodeConstructAbility; -extern const JSC::ConstructorKind s_jsBufferPrototypeWriteInt16LECodeConstructorKind; -extern const JSC::ImplementationVisibility s_jsBufferPrototypeWriteInt16LECodeImplementationVisibility; +// writableStreamStartErroring +#define WEBCORE_BUILTIN_WRITABLESTREAMINTERNALS_WRITABLESTREAMSTARTERRORING 1 +extern const char* const s_writableStreamInternalsWritableStreamStartErroringCode; +extern const int s_writableStreamInternalsWritableStreamStartErroringCodeLength; +extern const JSC::ConstructAbility s_writableStreamInternalsWritableStreamStartErroringCodeConstructAbility; +extern const JSC::ConstructorKind s_writableStreamInternalsWritableStreamStartErroringCodeConstructorKind; +extern const JSC::ImplementationVisibility s_writableStreamInternalsWritableStreamStartErroringCodeImplementationVisibility; -// writeInt16BE -#define WEBCORE_BUILTIN_JSBUFFERPROTOTYPE_WRITEINT16BE 1 -extern const char* const s_jsBufferPrototypeWriteInt16BECode; -extern const int s_jsBufferPrototypeWriteInt16BECodeLength; -extern const JSC::ConstructAbility s_jsBufferPrototypeWriteInt16BECodeConstructAbility; -extern const JSC::ConstructorKind s_jsBufferPrototypeWriteInt16BECodeConstructorKind; -extern const JSC::ImplementationVisibility s_jsBufferPrototypeWriteInt16BECodeImplementationVisibility; +// writableStreamUpdateBackpressure +#define WEBCORE_BUILTIN_WRITABLESTREAMINTERNALS_WRITABLESTREAMUPDATEBACKPRESSURE 1 +extern const char* const s_writableStreamInternalsWritableStreamUpdateBackpressureCode; +extern const int s_writableStreamInternalsWritableStreamUpdateBackpressureCodeLength; +extern const JSC::ConstructAbility s_writableStreamInternalsWritableStreamUpdateBackpressureCodeConstructAbility; +extern const JSC::ConstructorKind s_writableStreamInternalsWritableStreamUpdateBackpressureCodeConstructorKind; +extern const JSC::ImplementationVisibility s_writableStreamInternalsWritableStreamUpdateBackpressureCodeImplementationVisibility; -// writeUInt16LE -#define WEBCORE_BUILTIN_JSBUFFERPROTOTYPE_WRITEUINT16LE 1 -extern const char* const s_jsBufferPrototypeWriteUInt16LECode; -extern const int s_jsBufferPrototypeWriteUInt16LECodeLength; -extern const JSC::ConstructAbility s_jsBufferPrototypeWriteUInt16LECodeConstructAbility; -extern const JSC::ConstructorKind s_jsBufferPrototypeWriteUInt16LECodeConstructorKind; -extern const JSC::ImplementationVisibility s_jsBufferPrototypeWriteUInt16LECodeImplementationVisibility; +// writableStreamDefaultWriterAbort +#define WEBCORE_BUILTIN_WRITABLESTREAMINTERNALS_WRITABLESTREAMDEFAULTWRITERABORT 1 +extern const char* const s_writableStreamInternalsWritableStreamDefaultWriterAbortCode; +extern const int s_writableStreamInternalsWritableStreamDefaultWriterAbortCodeLength; +extern const JSC::ConstructAbility s_writableStreamInternalsWritableStreamDefaultWriterAbortCodeConstructAbility; +extern const JSC::ConstructorKind s_writableStreamInternalsWritableStreamDefaultWriterAbortCodeConstructorKind; +extern const JSC::ImplementationVisibility s_writableStreamInternalsWritableStreamDefaultWriterAbortCodeImplementationVisibility; -// writeUInt16BE -#define WEBCORE_BUILTIN_JSBUFFERPROTOTYPE_WRITEUINT16BE 1 -extern const char* const s_jsBufferPrototypeWriteUInt16BECode; -extern const int s_jsBufferPrototypeWriteUInt16BECodeLength; -extern const JSC::ConstructAbility s_jsBufferPrototypeWriteUInt16BECodeConstructAbility; -extern const JSC::ConstructorKind s_jsBufferPrototypeWriteUInt16BECodeConstructorKind; -extern const JSC::ImplementationVisibility s_jsBufferPrototypeWriteUInt16BECodeImplementationVisibility; +// writableStreamDefaultWriterClose +#define WEBCORE_BUILTIN_WRITABLESTREAMINTERNALS_WRITABLESTREAMDEFAULTWRITERCLOSE 1 +extern const char* const s_writableStreamInternalsWritableStreamDefaultWriterCloseCode; +extern const int s_writableStreamInternalsWritableStreamDefaultWriterCloseCodeLength; +extern const JSC::ConstructAbility s_writableStreamInternalsWritableStreamDefaultWriterCloseCodeConstructAbility; +extern const JSC::ConstructorKind s_writableStreamInternalsWritableStreamDefaultWriterCloseCodeConstructorKind; +extern const JSC::ImplementationVisibility s_writableStreamInternalsWritableStreamDefaultWriterCloseCodeImplementationVisibility; -// writeInt32LE -#define WEBCORE_BUILTIN_JSBUFFERPROTOTYPE_WRITEINT32LE 1 -extern const char* const s_jsBufferPrototypeWriteInt32LECode; -extern const int s_jsBufferPrototypeWriteInt32LECodeLength; -extern const JSC::ConstructAbility s_jsBufferPrototypeWriteInt32LECodeConstructAbility; -extern const JSC::ConstructorKind s_jsBufferPrototypeWriteInt32LECodeConstructorKind; -extern const JSC::ImplementationVisibility s_jsBufferPrototypeWriteInt32LECodeImplementationVisibility; +// writableStreamDefaultWriterCloseWithErrorPropagation +#define WEBCORE_BUILTIN_WRITABLESTREAMINTERNALS_WRITABLESTREAMDEFAULTWRITERCLOSEWITHERRORPROPAGATION 1 +extern const char* const s_writableStreamInternalsWritableStreamDefaultWriterCloseWithErrorPropagationCode; +extern const int s_writableStreamInternalsWritableStreamDefaultWriterCloseWithErrorPropagationCodeLength; +extern const JSC::ConstructAbility s_writableStreamInternalsWritableStreamDefaultWriterCloseWithErrorPropagationCodeConstructAbility; +extern const JSC::ConstructorKind s_writableStreamInternalsWritableStreamDefaultWriterCloseWithErrorPropagationCodeConstructorKind; +extern const JSC::ImplementationVisibility s_writableStreamInternalsWritableStreamDefaultWriterCloseWithErrorPropagationCodeImplementationVisibility; -// writeInt32BE -#define WEBCORE_BUILTIN_JSBUFFERPROTOTYPE_WRITEINT32BE 1 -extern const char* const s_jsBufferPrototypeWriteInt32BECode; -extern const int s_jsBufferPrototypeWriteInt32BECodeLength; -extern const JSC::ConstructAbility s_jsBufferPrototypeWriteInt32BECodeConstructAbility; -extern const JSC::ConstructorKind s_jsBufferPrototypeWriteInt32BECodeConstructorKind; -extern const JSC::ImplementationVisibility s_jsBufferPrototypeWriteInt32BECodeImplementationVisibility; +// writableStreamDefaultWriterEnsureClosedPromiseRejected +#define WEBCORE_BUILTIN_WRITABLESTREAMINTERNALS_WRITABLESTREAMDEFAULTWRITERENSURECLOSEDPROMISEREJECTED 1 +extern const char* const s_writableStreamInternalsWritableStreamDefaultWriterEnsureClosedPromiseRejectedCode; +extern const int s_writableStreamInternalsWritableStreamDefaultWriterEnsureClosedPromiseRejectedCodeLength; +extern const JSC::ConstructAbility s_writableStreamInternalsWritableStreamDefaultWriterEnsureClosedPromiseRejectedCodeConstructAbility; +extern const JSC::ConstructorKind s_writableStreamInternalsWritableStreamDefaultWriterEnsureClosedPromiseRejectedCodeConstructorKind; +extern const JSC::ImplementationVisibility s_writableStreamInternalsWritableStreamDefaultWriterEnsureClosedPromiseRejectedCodeImplementationVisibility; -// writeUInt32LE -#define WEBCORE_BUILTIN_JSBUFFERPROTOTYPE_WRITEUINT32LE 1 -extern const char* const s_jsBufferPrototypeWriteUInt32LECode; -extern const int s_jsBufferPrototypeWriteUInt32LECodeLength; -extern const JSC::ConstructAbility s_jsBufferPrototypeWriteUInt32LECodeConstructAbility; -extern const JSC::ConstructorKind s_jsBufferPrototypeWriteUInt32LECodeConstructorKind; -extern const JSC::ImplementationVisibility s_jsBufferPrototypeWriteUInt32LECodeImplementationVisibility; +// writableStreamDefaultWriterEnsureReadyPromiseRejected +#define WEBCORE_BUILTIN_WRITABLESTREAMINTERNALS_WRITABLESTREAMDEFAULTWRITERENSUREREADYPROMISEREJECTED 1 +extern const char* const s_writableStreamInternalsWritableStreamDefaultWriterEnsureReadyPromiseRejectedCode; +extern const int s_writableStreamInternalsWritableStreamDefaultWriterEnsureReadyPromiseRejectedCodeLength; +extern const JSC::ConstructAbility s_writableStreamInternalsWritableStreamDefaultWriterEnsureReadyPromiseRejectedCodeConstructAbility; +extern const JSC::ConstructorKind s_writableStreamInternalsWritableStreamDefaultWriterEnsureReadyPromiseRejectedCodeConstructorKind; +extern const JSC::ImplementationVisibility s_writableStreamInternalsWritableStreamDefaultWriterEnsureReadyPromiseRejectedCodeImplementationVisibility; -// writeUInt32BE -#define WEBCORE_BUILTIN_JSBUFFERPROTOTYPE_WRITEUINT32BE 1 -extern const char* const s_jsBufferPrototypeWriteUInt32BECode; -extern const int s_jsBufferPrototypeWriteUInt32BECodeLength; -extern const JSC::ConstructAbility s_jsBufferPrototypeWriteUInt32BECodeConstructAbility; -extern const JSC::ConstructorKind s_jsBufferPrototypeWriteUInt32BECodeConstructorKind; -extern const JSC::ImplementationVisibility s_jsBufferPrototypeWriteUInt32BECodeImplementationVisibility; - -// writeIntLE -#define WEBCORE_BUILTIN_JSBUFFERPROTOTYPE_WRITEINTLE 1 -extern const char* const s_jsBufferPrototypeWriteIntLECode; -extern const int s_jsBufferPrototypeWriteIntLECodeLength; -extern const JSC::ConstructAbility s_jsBufferPrototypeWriteIntLECodeConstructAbility; -extern const JSC::ConstructorKind s_jsBufferPrototypeWriteIntLECodeConstructorKind; -extern const JSC::ImplementationVisibility s_jsBufferPrototypeWriteIntLECodeImplementationVisibility; +// writableStreamDefaultWriterGetDesiredSize +#define WEBCORE_BUILTIN_WRITABLESTREAMINTERNALS_WRITABLESTREAMDEFAULTWRITERGETDESIREDSIZE 1 +extern const char* const s_writableStreamInternalsWritableStreamDefaultWriterGetDesiredSizeCode; +extern const int s_writableStreamInternalsWritableStreamDefaultWriterGetDesiredSizeCodeLength; +extern const JSC::ConstructAbility s_writableStreamInternalsWritableStreamDefaultWriterGetDesiredSizeCodeConstructAbility; +extern const JSC::ConstructorKind s_writableStreamInternalsWritableStreamDefaultWriterGetDesiredSizeCodeConstructorKind; +extern const JSC::ImplementationVisibility s_writableStreamInternalsWritableStreamDefaultWriterGetDesiredSizeCodeImplementationVisibility; -// writeIntBE -#define WEBCORE_BUILTIN_JSBUFFERPROTOTYPE_WRITEINTBE 1 -extern const char* const s_jsBufferPrototypeWriteIntBECode; -extern const int s_jsBufferPrototypeWriteIntBECodeLength; -extern const JSC::ConstructAbility s_jsBufferPrototypeWriteIntBECodeConstructAbility; -extern const JSC::ConstructorKind s_jsBufferPrototypeWriteIntBECodeConstructorKind; -extern const JSC::ImplementationVisibility s_jsBufferPrototypeWriteIntBECodeImplementationVisibility; +// writableStreamDefaultWriterRelease +#define WEBCORE_BUILTIN_WRITABLESTREAMINTERNALS_WRITABLESTREAMDEFAULTWRITERRELEASE 1 +extern const char* const s_writableStreamInternalsWritableStreamDefaultWriterReleaseCode; +extern const int s_writableStreamInternalsWritableStreamDefaultWriterReleaseCodeLength; +extern const JSC::ConstructAbility s_writableStreamInternalsWritableStreamDefaultWriterReleaseCodeConstructAbility; +extern const JSC::ConstructorKind s_writableStreamInternalsWritableStreamDefaultWriterReleaseCodeConstructorKind; +extern const JSC::ImplementationVisibility s_writableStreamInternalsWritableStreamDefaultWriterReleaseCodeImplementationVisibility; -// writeUIntLE -#define WEBCORE_BUILTIN_JSBUFFERPROTOTYPE_WRITEUINTLE 1 -extern const char* const s_jsBufferPrototypeWriteUIntLECode; -extern const int s_jsBufferPrototypeWriteUIntLECodeLength; -extern const JSC::ConstructAbility s_jsBufferPrototypeWriteUIntLECodeConstructAbility; -extern const JSC::ConstructorKind s_jsBufferPrototypeWriteUIntLECodeConstructorKind; -extern const JSC::ImplementationVisibility s_jsBufferPrototypeWriteUIntLECodeImplementationVisibility; +// writableStreamDefaultWriterWrite +#define WEBCORE_BUILTIN_WRITABLESTREAMINTERNALS_WRITABLESTREAMDEFAULTWRITERWRITE 1 +extern const char* const s_writableStreamInternalsWritableStreamDefaultWriterWriteCode; +extern const int s_writableStreamInternalsWritableStreamDefaultWriterWriteCodeLength; +extern const JSC::ConstructAbility s_writableStreamInternalsWritableStreamDefaultWriterWriteCodeConstructAbility; +extern const JSC::ConstructorKind s_writableStreamInternalsWritableStreamDefaultWriterWriteCodeConstructorKind; +extern const JSC::ImplementationVisibility s_writableStreamInternalsWritableStreamDefaultWriterWriteCodeImplementationVisibility; -// writeUIntBE -#define WEBCORE_BUILTIN_JSBUFFERPROTOTYPE_WRITEUINTBE 1 -extern const char* const s_jsBufferPrototypeWriteUIntBECode; -extern const int s_jsBufferPrototypeWriteUIntBECodeLength; -extern const JSC::ConstructAbility s_jsBufferPrototypeWriteUIntBECodeConstructAbility; -extern const JSC::ConstructorKind s_jsBufferPrototypeWriteUIntBECodeConstructorKind; -extern const JSC::ImplementationVisibility s_jsBufferPrototypeWriteUIntBECodeImplementationVisibility; +// setUpWritableStreamDefaultController +#define WEBCORE_BUILTIN_WRITABLESTREAMINTERNALS_SETUPWRITABLESTREAMDEFAULTCONTROLLER 1 +extern const char* const s_writableStreamInternalsSetUpWritableStreamDefaultControllerCode; +extern const int s_writableStreamInternalsSetUpWritableStreamDefaultControllerCodeLength; +extern const JSC::ConstructAbility s_writableStreamInternalsSetUpWritableStreamDefaultControllerCodeConstructAbility; +extern const JSC::ConstructorKind s_writableStreamInternalsSetUpWritableStreamDefaultControllerCodeConstructorKind; +extern const JSC::ImplementationVisibility s_writableStreamInternalsSetUpWritableStreamDefaultControllerCodeImplementationVisibility; -// writeFloatLE -#define WEBCORE_BUILTIN_JSBUFFERPROTOTYPE_WRITEFLOATLE 1 -extern const char* const s_jsBufferPrototypeWriteFloatLECode; -extern const int s_jsBufferPrototypeWriteFloatLECodeLength; -extern const JSC::ConstructAbility s_jsBufferPrototypeWriteFloatLECodeConstructAbility; -extern const JSC::ConstructorKind s_jsBufferPrototypeWriteFloatLECodeConstructorKind; -extern const JSC::ImplementationVisibility s_jsBufferPrototypeWriteFloatLECodeImplementationVisibility; +// writableStreamDefaultControllerStart +#define WEBCORE_BUILTIN_WRITABLESTREAMINTERNALS_WRITABLESTREAMDEFAULTCONTROLLERSTART 1 +extern const char* const s_writableStreamInternalsWritableStreamDefaultControllerStartCode; +extern const int s_writableStreamInternalsWritableStreamDefaultControllerStartCodeLength; +extern const JSC::ConstructAbility s_writableStreamInternalsWritableStreamDefaultControllerStartCodeConstructAbility; +extern const JSC::ConstructorKind s_writableStreamInternalsWritableStreamDefaultControllerStartCodeConstructorKind; +extern const JSC::ImplementationVisibility s_writableStreamInternalsWritableStreamDefaultControllerStartCodeImplementationVisibility; -// writeFloatBE -#define WEBCORE_BUILTIN_JSBUFFERPROTOTYPE_WRITEFLOATBE 1 -extern const char* const s_jsBufferPrototypeWriteFloatBECode; -extern const int s_jsBufferPrototypeWriteFloatBECodeLength; -extern const JSC::ConstructAbility s_jsBufferPrototypeWriteFloatBECodeConstructAbility; -extern const JSC::ConstructorKind s_jsBufferPrototypeWriteFloatBECodeConstructorKind; -extern const JSC::ImplementationVisibility s_jsBufferPrototypeWriteFloatBECodeImplementationVisibility; +// setUpWritableStreamDefaultControllerFromUnderlyingSink +#define WEBCORE_BUILTIN_WRITABLESTREAMINTERNALS_SETUPWRITABLESTREAMDEFAULTCONTROLLERFROMUNDERLYINGSINK 1 +extern const char* const s_writableStreamInternalsSetUpWritableStreamDefaultControllerFromUnderlyingSinkCode; +extern const int s_writableStreamInternalsSetUpWritableStreamDefaultControllerFromUnderlyingSinkCodeLength; +extern const JSC::ConstructAbility s_writableStreamInternalsSetUpWritableStreamDefaultControllerFromUnderlyingSinkCodeConstructAbility; +extern const JSC::ConstructorKind s_writableStreamInternalsSetUpWritableStreamDefaultControllerFromUnderlyingSinkCodeConstructorKind; +extern const JSC::ImplementationVisibility s_writableStreamInternalsSetUpWritableStreamDefaultControllerFromUnderlyingSinkCodeImplementationVisibility; -// writeDoubleLE -#define WEBCORE_BUILTIN_JSBUFFERPROTOTYPE_WRITEDOUBLELE 1 -extern const char* const s_jsBufferPrototypeWriteDoubleLECode; -extern const int s_jsBufferPrototypeWriteDoubleLECodeLength; -extern const JSC::ConstructAbility s_jsBufferPrototypeWriteDoubleLECodeConstructAbility; -extern const JSC::ConstructorKind s_jsBufferPrototypeWriteDoubleLECodeConstructorKind; -extern const JSC::ImplementationVisibility s_jsBufferPrototypeWriteDoubleLECodeImplementationVisibility; +// writableStreamDefaultControllerAdvanceQueueIfNeeded +#define WEBCORE_BUILTIN_WRITABLESTREAMINTERNALS_WRITABLESTREAMDEFAULTCONTROLLERADVANCEQUEUEIFNEEDED 1 +extern const char* const s_writableStreamInternalsWritableStreamDefaultControllerAdvanceQueueIfNeededCode; +extern const int s_writableStreamInternalsWritableStreamDefaultControllerAdvanceQueueIfNeededCodeLength; +extern const JSC::ConstructAbility s_writableStreamInternalsWritableStreamDefaultControllerAdvanceQueueIfNeededCodeConstructAbility; +extern const JSC::ConstructorKind s_writableStreamInternalsWritableStreamDefaultControllerAdvanceQueueIfNeededCodeConstructorKind; +extern const JSC::ImplementationVisibility s_writableStreamInternalsWritableStreamDefaultControllerAdvanceQueueIfNeededCodeImplementationVisibility; -// writeDoubleBE -#define WEBCORE_BUILTIN_JSBUFFERPROTOTYPE_WRITEDOUBLEBE 1 -extern const char* const s_jsBufferPrototypeWriteDoubleBECode; -extern const int s_jsBufferPrototypeWriteDoubleBECodeLength; -extern const JSC::ConstructAbility s_jsBufferPrototypeWriteDoubleBECodeConstructAbility; -extern const JSC::ConstructorKind s_jsBufferPrototypeWriteDoubleBECodeConstructorKind; -extern const JSC::ImplementationVisibility s_jsBufferPrototypeWriteDoubleBECodeImplementationVisibility; +// isCloseSentinel +#define WEBCORE_BUILTIN_WRITABLESTREAMINTERNALS_ISCLOSESENTINEL 1 +extern const char* const s_writableStreamInternalsIsCloseSentinelCode; +extern const int s_writableStreamInternalsIsCloseSentinelCodeLength; +extern const JSC::ConstructAbility s_writableStreamInternalsIsCloseSentinelCodeConstructAbility; +extern const JSC::ConstructorKind s_writableStreamInternalsIsCloseSentinelCodeConstructorKind; +extern const JSC::ImplementationVisibility s_writableStreamInternalsIsCloseSentinelCodeImplementationVisibility; -// writeBigInt64LE -#define WEBCORE_BUILTIN_JSBUFFERPROTOTYPE_WRITEBIGINT64LE 1 -extern const char* const s_jsBufferPrototypeWriteBigInt64LECode; -extern const int s_jsBufferPrototypeWriteBigInt64LECodeLength; -extern const JSC::ConstructAbility s_jsBufferPrototypeWriteBigInt64LECodeConstructAbility; -extern const JSC::ConstructorKind s_jsBufferPrototypeWriteBigInt64LECodeConstructorKind; -extern const JSC::ImplementationVisibility s_jsBufferPrototypeWriteBigInt64LECodeImplementationVisibility; +// writableStreamDefaultControllerClearAlgorithms +#define WEBCORE_BUILTIN_WRITABLESTREAMINTERNALS_WRITABLESTREAMDEFAULTCONTROLLERCLEARALGORITHMS 1 +extern const char* const s_writableStreamInternalsWritableStreamDefaultControllerClearAlgorithmsCode; +extern const int s_writableStreamInternalsWritableStreamDefaultControllerClearAlgorithmsCodeLength; +extern const JSC::ConstructAbility s_writableStreamInternalsWritableStreamDefaultControllerClearAlgorithmsCodeConstructAbility; +extern const JSC::ConstructorKind s_writableStreamInternalsWritableStreamDefaultControllerClearAlgorithmsCodeConstructorKind; +extern const JSC::ImplementationVisibility s_writableStreamInternalsWritableStreamDefaultControllerClearAlgorithmsCodeImplementationVisibility; -// writeBigInt64BE -#define WEBCORE_BUILTIN_JSBUFFERPROTOTYPE_WRITEBIGINT64BE 1 -extern const char* const s_jsBufferPrototypeWriteBigInt64BECode; -extern const int s_jsBufferPrototypeWriteBigInt64BECodeLength; -extern const JSC::ConstructAbility s_jsBufferPrototypeWriteBigInt64BECodeConstructAbility; -extern const JSC::ConstructorKind s_jsBufferPrototypeWriteBigInt64BECodeConstructorKind; -extern const JSC::ImplementationVisibility s_jsBufferPrototypeWriteBigInt64BECodeImplementationVisibility; +// writableStreamDefaultControllerClose +#define WEBCORE_BUILTIN_WRITABLESTREAMINTERNALS_WRITABLESTREAMDEFAULTCONTROLLERCLOSE 1 +extern const char* const s_writableStreamInternalsWritableStreamDefaultControllerCloseCode; +extern const int s_writableStreamInternalsWritableStreamDefaultControllerCloseCodeLength; +extern const JSC::ConstructAbility s_writableStreamInternalsWritableStreamDefaultControllerCloseCodeConstructAbility; +extern const JSC::ConstructorKind s_writableStreamInternalsWritableStreamDefaultControllerCloseCodeConstructorKind; +extern const JSC::ImplementationVisibility s_writableStreamInternalsWritableStreamDefaultControllerCloseCodeImplementationVisibility; -// writeBigUInt64LE -#define WEBCORE_BUILTIN_JSBUFFERPROTOTYPE_WRITEBIGUINT64LE 1 -extern const char* const s_jsBufferPrototypeWriteBigUInt64LECode; -extern const int s_jsBufferPrototypeWriteBigUInt64LECodeLength; -extern const JSC::ConstructAbility s_jsBufferPrototypeWriteBigUInt64LECodeConstructAbility; -extern const JSC::ConstructorKind s_jsBufferPrototypeWriteBigUInt64LECodeConstructorKind; -extern const JSC::ImplementationVisibility s_jsBufferPrototypeWriteBigUInt64LECodeImplementationVisibility; +// writableStreamDefaultControllerError +#define WEBCORE_BUILTIN_WRITABLESTREAMINTERNALS_WRITABLESTREAMDEFAULTCONTROLLERERROR 1 +extern const char* const s_writableStreamInternalsWritableStreamDefaultControllerErrorCode; +extern const int s_writableStreamInternalsWritableStreamDefaultControllerErrorCodeLength; +extern const JSC::ConstructAbility s_writableStreamInternalsWritableStreamDefaultControllerErrorCodeConstructAbility; +extern const JSC::ConstructorKind s_writableStreamInternalsWritableStreamDefaultControllerErrorCodeConstructorKind; +extern const JSC::ImplementationVisibility s_writableStreamInternalsWritableStreamDefaultControllerErrorCodeImplementationVisibility; -// writeBigUInt64BE -#define WEBCORE_BUILTIN_JSBUFFERPROTOTYPE_WRITEBIGUINT64BE 1 -extern const char* const s_jsBufferPrototypeWriteBigUInt64BECode; -extern const int s_jsBufferPrototypeWriteBigUInt64BECodeLength; -extern const JSC::ConstructAbility s_jsBufferPrototypeWriteBigUInt64BECodeConstructAbility; -extern const JSC::ConstructorKind s_jsBufferPrototypeWriteBigUInt64BECodeConstructorKind; -extern const JSC::ImplementationVisibility s_jsBufferPrototypeWriteBigUInt64BECodeImplementationVisibility; +// writableStreamDefaultControllerErrorIfNeeded +#define WEBCORE_BUILTIN_WRITABLESTREAMINTERNALS_WRITABLESTREAMDEFAULTCONTROLLERERRORIFNEEDED 1 +extern const char* const s_writableStreamInternalsWritableStreamDefaultControllerErrorIfNeededCode; +extern const int s_writableStreamInternalsWritableStreamDefaultControllerErrorIfNeededCodeLength; +extern const JSC::ConstructAbility s_writableStreamInternalsWritableStreamDefaultControllerErrorIfNeededCodeConstructAbility; +extern const JSC::ConstructorKind s_writableStreamInternalsWritableStreamDefaultControllerErrorIfNeededCodeConstructorKind; +extern const JSC::ImplementationVisibility s_writableStreamInternalsWritableStreamDefaultControllerErrorIfNeededCodeImplementationVisibility; -// utf8Write -#define WEBCORE_BUILTIN_JSBUFFERPROTOTYPE_UTF8WRITE 1 -extern const char* const s_jsBufferPrototypeUtf8WriteCode; -extern const int s_jsBufferPrototypeUtf8WriteCodeLength; -extern const JSC::ConstructAbility s_jsBufferPrototypeUtf8WriteCodeConstructAbility; -extern const JSC::ConstructorKind s_jsBufferPrototypeUtf8WriteCodeConstructorKind; -extern const JSC::ImplementationVisibility s_jsBufferPrototypeUtf8WriteCodeImplementationVisibility; +// writableStreamDefaultControllerGetBackpressure +#define WEBCORE_BUILTIN_WRITABLESTREAMINTERNALS_WRITABLESTREAMDEFAULTCONTROLLERGETBACKPRESSURE 1 +extern const char* const s_writableStreamInternalsWritableStreamDefaultControllerGetBackpressureCode; +extern const int s_writableStreamInternalsWritableStreamDefaultControllerGetBackpressureCodeLength; +extern const JSC::ConstructAbility s_writableStreamInternalsWritableStreamDefaultControllerGetBackpressureCodeConstructAbility; +extern const JSC::ConstructorKind s_writableStreamInternalsWritableStreamDefaultControllerGetBackpressureCodeConstructorKind; +extern const JSC::ImplementationVisibility s_writableStreamInternalsWritableStreamDefaultControllerGetBackpressureCodeImplementationVisibility; -// ucs2Write -#define WEBCORE_BUILTIN_JSBUFFERPROTOTYPE_UCS2WRITE 1 -extern const char* const s_jsBufferPrototypeUcs2WriteCode; -extern const int s_jsBufferPrototypeUcs2WriteCodeLength; -extern const JSC::ConstructAbility s_jsBufferPrototypeUcs2WriteCodeConstructAbility; -extern const JSC::ConstructorKind s_jsBufferPrototypeUcs2WriteCodeConstructorKind; -extern const JSC::ImplementationVisibility s_jsBufferPrototypeUcs2WriteCodeImplementationVisibility; +// writableStreamDefaultControllerGetChunkSize +#define WEBCORE_BUILTIN_WRITABLESTREAMINTERNALS_WRITABLESTREAMDEFAULTCONTROLLERGETCHUNKSIZE 1 +extern const char* const s_writableStreamInternalsWritableStreamDefaultControllerGetChunkSizeCode; +extern const int s_writableStreamInternalsWritableStreamDefaultControllerGetChunkSizeCodeLength; +extern const JSC::ConstructAbility s_writableStreamInternalsWritableStreamDefaultControllerGetChunkSizeCodeConstructAbility; +extern const JSC::ConstructorKind s_writableStreamInternalsWritableStreamDefaultControllerGetChunkSizeCodeConstructorKind; +extern const JSC::ImplementationVisibility s_writableStreamInternalsWritableStreamDefaultControllerGetChunkSizeCodeImplementationVisibility; -// utf16leWrite -#define WEBCORE_BUILTIN_JSBUFFERPROTOTYPE_UTF16LEWRITE 1 -extern const char* const s_jsBufferPrototypeUtf16leWriteCode; -extern const int s_jsBufferPrototypeUtf16leWriteCodeLength; -extern const JSC::ConstructAbility s_jsBufferPrototypeUtf16leWriteCodeConstructAbility; -extern const JSC::ConstructorKind s_jsBufferPrototypeUtf16leWriteCodeConstructorKind; -extern const JSC::ImplementationVisibility s_jsBufferPrototypeUtf16leWriteCodeImplementationVisibility; +// writableStreamDefaultControllerGetDesiredSize +#define WEBCORE_BUILTIN_WRITABLESTREAMINTERNALS_WRITABLESTREAMDEFAULTCONTROLLERGETDESIREDSIZE 1 +extern const char* const s_writableStreamInternalsWritableStreamDefaultControllerGetDesiredSizeCode; +extern const int s_writableStreamInternalsWritableStreamDefaultControllerGetDesiredSizeCodeLength; +extern const JSC::ConstructAbility s_writableStreamInternalsWritableStreamDefaultControllerGetDesiredSizeCodeConstructAbility; +extern const JSC::ConstructorKind s_writableStreamInternalsWritableStreamDefaultControllerGetDesiredSizeCodeConstructorKind; +extern const JSC::ImplementationVisibility s_writableStreamInternalsWritableStreamDefaultControllerGetDesiredSizeCodeImplementationVisibility; -// latin1Write -#define WEBCORE_BUILTIN_JSBUFFERPROTOTYPE_LATIN1WRITE 1 -extern const char* const s_jsBufferPrototypeLatin1WriteCode; -extern const int s_jsBufferPrototypeLatin1WriteCodeLength; -extern const JSC::ConstructAbility s_jsBufferPrototypeLatin1WriteCodeConstructAbility; -extern const JSC::ConstructorKind s_jsBufferPrototypeLatin1WriteCodeConstructorKind; -extern const JSC::ImplementationVisibility s_jsBufferPrototypeLatin1WriteCodeImplementationVisibility; +// writableStreamDefaultControllerProcessClose +#define WEBCORE_BUILTIN_WRITABLESTREAMINTERNALS_WRITABLESTREAMDEFAULTCONTROLLERPROCESSCLOSE 1 +extern const char* const s_writableStreamInternalsWritableStreamDefaultControllerProcessCloseCode; +extern const int s_writableStreamInternalsWritableStreamDefaultControllerProcessCloseCodeLength; +extern const JSC::ConstructAbility s_writableStreamInternalsWritableStreamDefaultControllerProcessCloseCodeConstructAbility; +extern const JSC::ConstructorKind s_writableStreamInternalsWritableStreamDefaultControllerProcessCloseCodeConstructorKind; +extern const JSC::ImplementationVisibility s_writableStreamInternalsWritableStreamDefaultControllerProcessCloseCodeImplementationVisibility; -// asciiWrite -#define WEBCORE_BUILTIN_JSBUFFERPROTOTYPE_ASCIIWRITE 1 -extern const char* const s_jsBufferPrototypeAsciiWriteCode; -extern const int s_jsBufferPrototypeAsciiWriteCodeLength; -extern const JSC::ConstructAbility s_jsBufferPrototypeAsciiWriteCodeConstructAbility; -extern const JSC::ConstructorKind s_jsBufferPrototypeAsciiWriteCodeConstructorKind; -extern const JSC::ImplementationVisibility s_jsBufferPrototypeAsciiWriteCodeImplementationVisibility; +// writableStreamDefaultControllerProcessWrite +#define WEBCORE_BUILTIN_WRITABLESTREAMINTERNALS_WRITABLESTREAMDEFAULTCONTROLLERPROCESSWRITE 1 +extern const char* const s_writableStreamInternalsWritableStreamDefaultControllerProcessWriteCode; +extern const int s_writableStreamInternalsWritableStreamDefaultControllerProcessWriteCodeLength; +extern const JSC::ConstructAbility s_writableStreamInternalsWritableStreamDefaultControllerProcessWriteCodeConstructAbility; +extern const JSC::ConstructorKind s_writableStreamInternalsWritableStreamDefaultControllerProcessWriteCodeConstructorKind; +extern const JSC::ImplementationVisibility s_writableStreamInternalsWritableStreamDefaultControllerProcessWriteCodeImplementationVisibility; -// base64Write -#define WEBCORE_BUILTIN_JSBUFFERPROTOTYPE_BASE64WRITE 1 -extern const char* const s_jsBufferPrototypeBase64WriteCode; -extern const int s_jsBufferPrototypeBase64WriteCodeLength; -extern const JSC::ConstructAbility s_jsBufferPrototypeBase64WriteCodeConstructAbility; -extern const JSC::ConstructorKind s_jsBufferPrototypeBase64WriteCodeConstructorKind; -extern const JSC::ImplementationVisibility s_jsBufferPrototypeBase64WriteCodeImplementationVisibility; +// writableStreamDefaultControllerWrite +#define WEBCORE_BUILTIN_WRITABLESTREAMINTERNALS_WRITABLESTREAMDEFAULTCONTROLLERWRITE 1 +extern const char* const s_writableStreamInternalsWritableStreamDefaultControllerWriteCode; +extern const int s_writableStreamInternalsWritableStreamDefaultControllerWriteCodeLength; +extern const JSC::ConstructAbility s_writableStreamInternalsWritableStreamDefaultControllerWriteCodeConstructAbility; +extern const JSC::ConstructorKind s_writableStreamInternalsWritableStreamDefaultControllerWriteCodeConstructorKind; +extern const JSC::ImplementationVisibility s_writableStreamInternalsWritableStreamDefaultControllerWriteCodeImplementationVisibility; -// base64urlWrite -#define WEBCORE_BUILTIN_JSBUFFERPROTOTYPE_BASE64URLWRITE 1 -extern const char* const s_jsBufferPrototypeBase64urlWriteCode; -extern const int s_jsBufferPrototypeBase64urlWriteCodeLength; -extern const JSC::ConstructAbility s_jsBufferPrototypeBase64urlWriteCodeConstructAbility; -extern const JSC::ConstructorKind s_jsBufferPrototypeBase64urlWriteCodeConstructorKind; -extern const JSC::ImplementationVisibility s_jsBufferPrototypeBase64urlWriteCodeImplementationVisibility; - -// hexWrite -#define WEBCORE_BUILTIN_JSBUFFERPROTOTYPE_HEXWRITE 1 -extern const char* const s_jsBufferPrototypeHexWriteCode; -extern const int s_jsBufferPrototypeHexWriteCodeLength; -extern const JSC::ConstructAbility s_jsBufferPrototypeHexWriteCodeConstructAbility; -extern const JSC::ConstructorKind s_jsBufferPrototypeHexWriteCodeConstructorKind; -extern const JSC::ImplementationVisibility s_jsBufferPrototypeHexWriteCodeImplementationVisibility; +#define WEBCORE_FOREACH_WRITABLESTREAMINTERNALS_BUILTIN_DATA(macro) \ + macro(isWritableStream, writableStreamInternalsIsWritableStream, 1) \ + macro(isWritableStreamDefaultWriter, writableStreamInternalsIsWritableStreamDefaultWriter, 1) \ + macro(acquireWritableStreamDefaultWriter, writableStreamInternalsAcquireWritableStreamDefaultWriter, 1) \ + macro(createWritableStream, writableStreamInternalsCreateWritableStream, 7) \ + macro(createInternalWritableStreamFromUnderlyingSink, writableStreamInternalsCreateInternalWritableStreamFromUnderlyingSink, 2) \ + macro(initializeWritableStreamSlots, writableStreamInternalsInitializeWritableStreamSlots, 2) \ + macro(writableStreamCloseForBindings, writableStreamInternalsWritableStreamCloseForBindings, 1) \ + macro(writableStreamAbortForBindings, writableStreamInternalsWritableStreamAbortForBindings, 2) \ + macro(isWritableStreamLocked, writableStreamInternalsIsWritableStreamLocked, 1) \ + macro(setUpWritableStreamDefaultWriter, writableStreamInternalsSetUpWritableStreamDefaultWriter, 2) \ + macro(writableStreamAbort, writableStreamInternalsWritableStreamAbort, 2) \ + macro(writableStreamClose, writableStreamInternalsWritableStreamClose, 1) \ + macro(writableStreamAddWriteRequest, writableStreamInternalsWritableStreamAddWriteRequest, 1) \ + macro(writableStreamCloseQueuedOrInFlight, writableStreamInternalsWritableStreamCloseQueuedOrInFlight, 1) \ + macro(writableStreamDealWithRejection, writableStreamInternalsWritableStreamDealWithRejection, 2) \ + macro(writableStreamFinishErroring, writableStreamInternalsWritableStreamFinishErroring, 1) \ + macro(writableStreamFinishInFlightClose, writableStreamInternalsWritableStreamFinishInFlightClose, 1) \ + macro(writableStreamFinishInFlightCloseWithError, writableStreamInternalsWritableStreamFinishInFlightCloseWithError, 2) \ + macro(writableStreamFinishInFlightWrite, writableStreamInternalsWritableStreamFinishInFlightWrite, 1) \ + macro(writableStreamFinishInFlightWriteWithError, writableStreamInternalsWritableStreamFinishInFlightWriteWithError, 2) \ + macro(writableStreamHasOperationMarkedInFlight, writableStreamInternalsWritableStreamHasOperationMarkedInFlight, 1) \ + macro(writableStreamMarkCloseRequestInFlight, writableStreamInternalsWritableStreamMarkCloseRequestInFlight, 1) \ + macro(writableStreamMarkFirstWriteRequestInFlight, writableStreamInternalsWritableStreamMarkFirstWriteRequestInFlight, 1) \ + macro(writableStreamRejectCloseAndClosedPromiseIfNeeded, writableStreamInternalsWritableStreamRejectCloseAndClosedPromiseIfNeeded, 1) \ + macro(writableStreamStartErroring, writableStreamInternalsWritableStreamStartErroring, 2) \ + macro(writableStreamUpdateBackpressure, writableStreamInternalsWritableStreamUpdateBackpressure, 2) \ + macro(writableStreamDefaultWriterAbort, writableStreamInternalsWritableStreamDefaultWriterAbort, 2) \ + macro(writableStreamDefaultWriterClose, writableStreamInternalsWritableStreamDefaultWriterClose, 1) \ + macro(writableStreamDefaultWriterCloseWithErrorPropagation, writableStreamInternalsWritableStreamDefaultWriterCloseWithErrorPropagation, 1) \ + macro(writableStreamDefaultWriterEnsureClosedPromiseRejected, writableStreamInternalsWritableStreamDefaultWriterEnsureClosedPromiseRejected, 2) \ + macro(writableStreamDefaultWriterEnsureReadyPromiseRejected, writableStreamInternalsWritableStreamDefaultWriterEnsureReadyPromiseRejected, 2) \ + macro(writableStreamDefaultWriterGetDesiredSize, writableStreamInternalsWritableStreamDefaultWriterGetDesiredSize, 1) \ + macro(writableStreamDefaultWriterRelease, writableStreamInternalsWritableStreamDefaultWriterRelease, 1) \ + macro(writableStreamDefaultWriterWrite, writableStreamInternalsWritableStreamDefaultWriterWrite, 2) \ + macro(setUpWritableStreamDefaultController, writableStreamInternalsSetUpWritableStreamDefaultController, 9) \ + macro(writableStreamDefaultControllerStart, writableStreamInternalsWritableStreamDefaultControllerStart, 1) \ + macro(setUpWritableStreamDefaultControllerFromUnderlyingSink, writableStreamInternalsSetUpWritableStreamDefaultControllerFromUnderlyingSink, 6) \ + macro(writableStreamDefaultControllerAdvanceQueueIfNeeded, writableStreamInternalsWritableStreamDefaultControllerAdvanceQueueIfNeeded, 1) \ + macro(isCloseSentinel, writableStreamInternalsIsCloseSentinel, 0) \ + macro(writableStreamDefaultControllerClearAlgorithms, writableStreamInternalsWritableStreamDefaultControllerClearAlgorithms, 1) \ + macro(writableStreamDefaultControllerClose, writableStreamInternalsWritableStreamDefaultControllerClose, 1) \ + macro(writableStreamDefaultControllerError, writableStreamInternalsWritableStreamDefaultControllerError, 2) \ + macro(writableStreamDefaultControllerErrorIfNeeded, writableStreamInternalsWritableStreamDefaultControllerErrorIfNeeded, 2) \ + macro(writableStreamDefaultControllerGetBackpressure, writableStreamInternalsWritableStreamDefaultControllerGetBackpressure, 1) \ + macro(writableStreamDefaultControllerGetChunkSize, writableStreamInternalsWritableStreamDefaultControllerGetChunkSize, 2) \ + macro(writableStreamDefaultControllerGetDesiredSize, writableStreamInternalsWritableStreamDefaultControllerGetDesiredSize, 1) \ + macro(writableStreamDefaultControllerProcessClose, writableStreamInternalsWritableStreamDefaultControllerProcessClose, 1) \ + macro(writableStreamDefaultControllerProcessWrite, writableStreamInternalsWritableStreamDefaultControllerProcessWrite, 2) \ + macro(writableStreamDefaultControllerWrite, writableStreamInternalsWritableStreamDefaultControllerWrite, 3) \ -// utf8Slice -#define WEBCORE_BUILTIN_JSBUFFERPROTOTYPE_UTF8SLICE 1 -extern const char* const s_jsBufferPrototypeUtf8SliceCode; -extern const int s_jsBufferPrototypeUtf8SliceCodeLength; -extern const JSC::ConstructAbility s_jsBufferPrototypeUtf8SliceCodeConstructAbility; -extern const JSC::ConstructorKind s_jsBufferPrototypeUtf8SliceCodeConstructorKind; -extern const JSC::ImplementationVisibility s_jsBufferPrototypeUtf8SliceCodeImplementationVisibility; +#define WEBCORE_FOREACH_WRITABLESTREAMINTERNALS_BUILTIN_CODE(macro) \ + macro(writableStreamInternalsIsWritableStreamCode, isWritableStream, ASCIILiteral(), s_writableStreamInternalsIsWritableStreamCodeLength) \ + macro(writableStreamInternalsIsWritableStreamDefaultWriterCode, isWritableStreamDefaultWriter, ASCIILiteral(), s_writableStreamInternalsIsWritableStreamDefaultWriterCodeLength) \ + macro(writableStreamInternalsAcquireWritableStreamDefaultWriterCode, acquireWritableStreamDefaultWriter, ASCIILiteral(), s_writableStreamInternalsAcquireWritableStreamDefaultWriterCodeLength) \ + macro(writableStreamInternalsCreateWritableStreamCode, createWritableStream, ASCIILiteral(), s_writableStreamInternalsCreateWritableStreamCodeLength) \ + macro(writableStreamInternalsCreateInternalWritableStreamFromUnderlyingSinkCode, createInternalWritableStreamFromUnderlyingSink, ASCIILiteral(), s_writableStreamInternalsCreateInternalWritableStreamFromUnderlyingSinkCodeLength) \ + macro(writableStreamInternalsInitializeWritableStreamSlotsCode, initializeWritableStreamSlots, ASCIILiteral(), s_writableStreamInternalsInitializeWritableStreamSlotsCodeLength) \ + macro(writableStreamInternalsWritableStreamCloseForBindingsCode, writableStreamCloseForBindings, ASCIILiteral(), s_writableStreamInternalsWritableStreamCloseForBindingsCodeLength) \ + macro(writableStreamInternalsWritableStreamAbortForBindingsCode, writableStreamAbortForBindings, ASCIILiteral(), s_writableStreamInternalsWritableStreamAbortForBindingsCodeLength) \ + macro(writableStreamInternalsIsWritableStreamLockedCode, isWritableStreamLocked, ASCIILiteral(), s_writableStreamInternalsIsWritableStreamLockedCodeLength) \ + macro(writableStreamInternalsSetUpWritableStreamDefaultWriterCode, setUpWritableStreamDefaultWriter, ASCIILiteral(), s_writableStreamInternalsSetUpWritableStreamDefaultWriterCodeLength) \ + macro(writableStreamInternalsWritableStreamAbortCode, writableStreamAbort, ASCIILiteral(), s_writableStreamInternalsWritableStreamAbortCodeLength) \ + macro(writableStreamInternalsWritableStreamCloseCode, writableStreamClose, ASCIILiteral(), s_writableStreamInternalsWritableStreamCloseCodeLength) \ + macro(writableStreamInternalsWritableStreamAddWriteRequestCode, writableStreamAddWriteRequest, ASCIILiteral(), s_writableStreamInternalsWritableStreamAddWriteRequestCodeLength) \ + macro(writableStreamInternalsWritableStreamCloseQueuedOrInFlightCode, writableStreamCloseQueuedOrInFlight, ASCIILiteral(), s_writableStreamInternalsWritableStreamCloseQueuedOrInFlightCodeLength) \ + macro(writableStreamInternalsWritableStreamDealWithRejectionCode, writableStreamDealWithRejection, ASCIILiteral(), s_writableStreamInternalsWritableStreamDealWithRejectionCodeLength) \ + macro(writableStreamInternalsWritableStreamFinishErroringCode, writableStreamFinishErroring, ASCIILiteral(), s_writableStreamInternalsWritableStreamFinishErroringCodeLength) \ + macro(writableStreamInternalsWritableStreamFinishInFlightCloseCode, writableStreamFinishInFlightClose, ASCIILiteral(), s_writableStreamInternalsWritableStreamFinishInFlightCloseCodeLength) \ + macro(writableStreamInternalsWritableStreamFinishInFlightCloseWithErrorCode, writableStreamFinishInFlightCloseWithError, ASCIILiteral(), s_writableStreamInternalsWritableStreamFinishInFlightCloseWithErrorCodeLength) \ + macro(writableStreamInternalsWritableStreamFinishInFlightWriteCode, writableStreamFinishInFlightWrite, ASCIILiteral(), s_writableStreamInternalsWritableStreamFinishInFlightWriteCodeLength) \ + macro(writableStreamInternalsWritableStreamFinishInFlightWriteWithErrorCode, writableStreamFinishInFlightWriteWithError, ASCIILiteral(), s_writableStreamInternalsWritableStreamFinishInFlightWriteWithErrorCodeLength) \ + macro(writableStreamInternalsWritableStreamHasOperationMarkedInFlightCode, writableStreamHasOperationMarkedInFlight, ASCIILiteral(), s_writableStreamInternalsWritableStreamHasOperationMarkedInFlightCodeLength) \ + macro(writableStreamInternalsWritableStreamMarkCloseRequestInFlightCode, writableStreamMarkCloseRequestInFlight, ASCIILiteral(), s_writableStreamInternalsWritableStreamMarkCloseRequestInFlightCodeLength) \ + macro(writableStreamInternalsWritableStreamMarkFirstWriteRequestInFlightCode, writableStreamMarkFirstWriteRequestInFlight, ASCIILiteral(), s_writableStreamInternalsWritableStreamMarkFirstWriteRequestInFlightCodeLength) \ + macro(writableStreamInternalsWritableStreamRejectCloseAndClosedPromiseIfNeededCode, writableStreamRejectCloseAndClosedPromiseIfNeeded, ASCIILiteral(), s_writableStreamInternalsWritableStreamRejectCloseAndClosedPromiseIfNeededCodeLength) \ + macro(writableStreamInternalsWritableStreamStartErroringCode, writableStreamStartErroring, ASCIILiteral(), s_writableStreamInternalsWritableStreamStartErroringCodeLength) \ + macro(writableStreamInternalsWritableStreamUpdateBackpressureCode, writableStreamUpdateBackpressure, ASCIILiteral(), s_writableStreamInternalsWritableStreamUpdateBackpressureCodeLength) \ + macro(writableStreamInternalsWritableStreamDefaultWriterAbortCode, writableStreamDefaultWriterAbort, ASCIILiteral(), s_writableStreamInternalsWritableStreamDefaultWriterAbortCodeLength) \ + macro(writableStreamInternalsWritableStreamDefaultWriterCloseCode, writableStreamDefaultWriterClose, ASCIILiteral(), s_writableStreamInternalsWritableStreamDefaultWriterCloseCodeLength) \ + macro(writableStreamInternalsWritableStreamDefaultWriterCloseWithErrorPropagationCode, writableStreamDefaultWriterCloseWithErrorPropagation, ASCIILiteral(), s_writableStreamInternalsWritableStreamDefaultWriterCloseWithErrorPropagationCodeLength) \ + macro(writableStreamInternalsWritableStreamDefaultWriterEnsureClosedPromiseRejectedCode, writableStreamDefaultWriterEnsureClosedPromiseRejected, ASCIILiteral(), s_writableStreamInternalsWritableStreamDefaultWriterEnsureClosedPromiseRejectedCodeLength) \ + macro(writableStreamInternalsWritableStreamDefaultWriterEnsureReadyPromiseRejectedCode, writableStreamDefaultWriterEnsureReadyPromiseRejected, ASCIILiteral(), s_writableStreamInternalsWritableStreamDefaultWriterEnsureReadyPromiseRejectedCodeLength) \ + macro(writableStreamInternalsWritableStreamDefaultWriterGetDesiredSizeCode, writableStreamDefaultWriterGetDesiredSize, ASCIILiteral(), s_writableStreamInternalsWritableStreamDefaultWriterGetDesiredSizeCodeLength) \ + macro(writableStreamInternalsWritableStreamDefaultWriterReleaseCode, writableStreamDefaultWriterRelease, ASCIILiteral(), s_writableStreamInternalsWritableStreamDefaultWriterReleaseCodeLength) \ + macro(writableStreamInternalsWritableStreamDefaultWriterWriteCode, writableStreamDefaultWriterWrite, ASCIILiteral(), s_writableStreamInternalsWritableStreamDefaultWriterWriteCodeLength) \ + macro(writableStreamInternalsSetUpWritableStreamDefaultControllerCode, setUpWritableStreamDefaultController, ASCIILiteral(), s_writableStreamInternalsSetUpWritableStreamDefaultControllerCodeLength) \ + macro(writableStreamInternalsWritableStreamDefaultControllerStartCode, writableStreamDefaultControllerStart, ASCIILiteral(), s_writableStreamInternalsWritableStreamDefaultControllerStartCodeLength) \ + macro(writableStreamInternalsSetUpWritableStreamDefaultControllerFromUnderlyingSinkCode, setUpWritableStreamDefaultControllerFromUnderlyingSink, ASCIILiteral(), s_writableStreamInternalsSetUpWritableStreamDefaultControllerFromUnderlyingSinkCodeLength) \ + macro(writableStreamInternalsWritableStreamDefaultControllerAdvanceQueueIfNeededCode, writableStreamDefaultControllerAdvanceQueueIfNeeded, ASCIILiteral(), s_writableStreamInternalsWritableStreamDefaultControllerAdvanceQueueIfNeededCodeLength) \ + macro(writableStreamInternalsIsCloseSentinelCode, isCloseSentinel, ASCIILiteral(), s_writableStreamInternalsIsCloseSentinelCodeLength) \ + macro(writableStreamInternalsWritableStreamDefaultControllerClearAlgorithmsCode, writableStreamDefaultControllerClearAlgorithms, ASCIILiteral(), s_writableStreamInternalsWritableStreamDefaultControllerClearAlgorithmsCodeLength) \ + macro(writableStreamInternalsWritableStreamDefaultControllerCloseCode, writableStreamDefaultControllerClose, ASCIILiteral(), s_writableStreamInternalsWritableStreamDefaultControllerCloseCodeLength) \ + macro(writableStreamInternalsWritableStreamDefaultControllerErrorCode, writableStreamDefaultControllerError, ASCIILiteral(), s_writableStreamInternalsWritableStreamDefaultControllerErrorCodeLength) \ + macro(writableStreamInternalsWritableStreamDefaultControllerErrorIfNeededCode, writableStreamDefaultControllerErrorIfNeeded, ASCIILiteral(), s_writableStreamInternalsWritableStreamDefaultControllerErrorIfNeededCodeLength) \ + macro(writableStreamInternalsWritableStreamDefaultControllerGetBackpressureCode, writableStreamDefaultControllerGetBackpressure, ASCIILiteral(), s_writableStreamInternalsWritableStreamDefaultControllerGetBackpressureCodeLength) \ + macro(writableStreamInternalsWritableStreamDefaultControllerGetChunkSizeCode, writableStreamDefaultControllerGetChunkSize, ASCIILiteral(), s_writableStreamInternalsWritableStreamDefaultControllerGetChunkSizeCodeLength) \ + macro(writableStreamInternalsWritableStreamDefaultControllerGetDesiredSizeCode, writableStreamDefaultControllerGetDesiredSize, ASCIILiteral(), s_writableStreamInternalsWritableStreamDefaultControllerGetDesiredSizeCodeLength) \ + macro(writableStreamInternalsWritableStreamDefaultControllerProcessCloseCode, writableStreamDefaultControllerProcessClose, ASCIILiteral(), s_writableStreamInternalsWritableStreamDefaultControllerProcessCloseCodeLength) \ + macro(writableStreamInternalsWritableStreamDefaultControllerProcessWriteCode, writableStreamDefaultControllerProcessWrite, ASCIILiteral(), s_writableStreamInternalsWritableStreamDefaultControllerProcessWriteCodeLength) \ + macro(writableStreamInternalsWritableStreamDefaultControllerWriteCode, writableStreamDefaultControllerWrite, ASCIILiteral(), s_writableStreamInternalsWritableStreamDefaultControllerWriteCodeLength) \ -// ucs2Slice -#define WEBCORE_BUILTIN_JSBUFFERPROTOTYPE_UCS2SLICE 1 -extern const char* const s_jsBufferPrototypeUcs2SliceCode; -extern const int s_jsBufferPrototypeUcs2SliceCodeLength; -extern const JSC::ConstructAbility s_jsBufferPrototypeUcs2SliceCodeConstructAbility; -extern const JSC::ConstructorKind s_jsBufferPrototypeUcs2SliceCodeConstructorKind; -extern const JSC::ImplementationVisibility s_jsBufferPrototypeUcs2SliceCodeImplementationVisibility; +#define WEBCORE_FOREACH_WRITABLESTREAMINTERNALS_BUILTIN_FUNCTION_NAME(macro) \ + macro(isWritableStream) \ + macro(isWritableStreamDefaultWriter) \ + macro(acquireWritableStreamDefaultWriter) \ + macro(createWritableStream) \ + macro(createInternalWritableStreamFromUnderlyingSink) \ + macro(initializeWritableStreamSlots) \ + macro(writableStreamCloseForBindings) \ + macro(writableStreamAbortForBindings) \ + macro(isWritableStreamLocked) \ + macro(setUpWritableStreamDefaultWriter) \ + macro(writableStreamAbort) \ + macro(writableStreamClose) \ + macro(writableStreamAddWriteRequest) \ + macro(writableStreamCloseQueuedOrInFlight) \ + macro(writableStreamDealWithRejection) \ + macro(writableStreamFinishErroring) \ + macro(writableStreamFinishInFlightClose) \ + macro(writableStreamFinishInFlightCloseWithError) \ + macro(writableStreamFinishInFlightWrite) \ + macro(writableStreamFinishInFlightWriteWithError) \ + macro(writableStreamHasOperationMarkedInFlight) \ + macro(writableStreamMarkCloseRequestInFlight) \ + macro(writableStreamMarkFirstWriteRequestInFlight) \ + macro(writableStreamRejectCloseAndClosedPromiseIfNeeded) \ + macro(writableStreamStartErroring) \ + macro(writableStreamUpdateBackpressure) \ + macro(writableStreamDefaultWriterAbort) \ + macro(writableStreamDefaultWriterClose) \ + macro(writableStreamDefaultWriterCloseWithErrorPropagation) \ + macro(writableStreamDefaultWriterEnsureClosedPromiseRejected) \ + macro(writableStreamDefaultWriterEnsureReadyPromiseRejected) \ + macro(writableStreamDefaultWriterGetDesiredSize) \ + macro(writableStreamDefaultWriterRelease) \ + macro(writableStreamDefaultWriterWrite) \ + macro(setUpWritableStreamDefaultController) \ + macro(writableStreamDefaultControllerStart) \ + macro(setUpWritableStreamDefaultControllerFromUnderlyingSink) \ + macro(writableStreamDefaultControllerAdvanceQueueIfNeeded) \ + macro(isCloseSentinel) \ + macro(writableStreamDefaultControllerClearAlgorithms) \ + macro(writableStreamDefaultControllerClose) \ + macro(writableStreamDefaultControllerError) \ + macro(writableStreamDefaultControllerErrorIfNeeded) \ + macro(writableStreamDefaultControllerGetBackpressure) \ + macro(writableStreamDefaultControllerGetChunkSize) \ + macro(writableStreamDefaultControllerGetDesiredSize) \ + macro(writableStreamDefaultControllerProcessClose) \ + macro(writableStreamDefaultControllerProcessWrite) \ + macro(writableStreamDefaultControllerWrite) \ -// utf16leSlice -#define WEBCORE_BUILTIN_JSBUFFERPROTOTYPE_UTF16LESLICE 1 -extern const char* const s_jsBufferPrototypeUtf16leSliceCode; -extern const int s_jsBufferPrototypeUtf16leSliceCodeLength; -extern const JSC::ConstructAbility s_jsBufferPrototypeUtf16leSliceCodeConstructAbility; -extern const JSC::ConstructorKind s_jsBufferPrototypeUtf16leSliceCodeConstructorKind; -extern const JSC::ImplementationVisibility s_jsBufferPrototypeUtf16leSliceCodeImplementationVisibility; +#define DECLARE_BUILTIN_GENERATOR(codeName, functionName, overriddenName, argumentCount) \ + JSC::FunctionExecutable* codeName##Generator(JSC::VM&); -// latin1Slice -#define WEBCORE_BUILTIN_JSBUFFERPROTOTYPE_LATIN1SLICE 1 -extern const char* const s_jsBufferPrototypeLatin1SliceCode; -extern const int s_jsBufferPrototypeLatin1SliceCodeLength; -extern const JSC::ConstructAbility s_jsBufferPrototypeLatin1SliceCodeConstructAbility; -extern const JSC::ConstructorKind s_jsBufferPrototypeLatin1SliceCodeConstructorKind; -extern const JSC::ImplementationVisibility s_jsBufferPrototypeLatin1SliceCodeImplementationVisibility; +WEBCORE_FOREACH_WRITABLESTREAMINTERNALS_BUILTIN_CODE(DECLARE_BUILTIN_GENERATOR) +#undef DECLARE_BUILTIN_GENERATOR -// asciiSlice -#define WEBCORE_BUILTIN_JSBUFFERPROTOTYPE_ASCIISLICE 1 -extern const char* const s_jsBufferPrototypeAsciiSliceCode; -extern const int s_jsBufferPrototypeAsciiSliceCodeLength; -extern const JSC::ConstructAbility s_jsBufferPrototypeAsciiSliceCodeConstructAbility; -extern const JSC::ConstructorKind s_jsBufferPrototypeAsciiSliceCodeConstructorKind; -extern const JSC::ImplementationVisibility s_jsBufferPrototypeAsciiSliceCodeImplementationVisibility; +class WritableStreamInternalsBuiltinsWrapper : private JSC::WeakHandleOwner { +public: + explicit WritableStreamInternalsBuiltinsWrapper(JSC::VM& vm) + : m_vm(vm) + WEBCORE_FOREACH_WRITABLESTREAMINTERNALS_BUILTIN_FUNCTION_NAME(INITIALIZE_BUILTIN_NAMES) +#define INITIALIZE_BUILTIN_SOURCE_MEMBERS(name, functionName, overriddenName, length) , m_##name##Source(JSC::makeSource(StringImpl::createWithoutCopying(s_##name, length), { }, JSC::SourceTaintedOrigin::Untainted)) + WEBCORE_FOREACH_WRITABLESTREAMINTERNALS_BUILTIN_CODE(INITIALIZE_BUILTIN_SOURCE_MEMBERS) +#undef INITIALIZE_BUILTIN_SOURCE_MEMBERS + { + } -// base64Slice -#define WEBCORE_BUILTIN_JSBUFFERPROTOTYPE_BASE64SLICE 1 -extern const char* const s_jsBufferPrototypeBase64SliceCode; -extern const int s_jsBufferPrototypeBase64SliceCodeLength; -extern const JSC::ConstructAbility s_jsBufferPrototypeBase64SliceCodeConstructAbility; -extern const JSC::ConstructorKind s_jsBufferPrototypeBase64SliceCodeConstructorKind; -extern const JSC::ImplementationVisibility s_jsBufferPrototypeBase64SliceCodeImplementationVisibility; +#define EXPOSE_BUILTIN_EXECUTABLES(name, functionName, overriddenName, length) \ + JSC::UnlinkedFunctionExecutable* name##Executable(); \ + const JSC::SourceCode& name##Source() const { return m_##name##Source; } + WEBCORE_FOREACH_WRITABLESTREAMINTERNALS_BUILTIN_CODE(EXPOSE_BUILTIN_EXECUTABLES) +#undef EXPOSE_BUILTIN_EXECUTABLES -// base64urlSlice -#define WEBCORE_BUILTIN_JSBUFFERPROTOTYPE_BASE64URLSLICE 1 -extern const char* const s_jsBufferPrototypeBase64urlSliceCode; -extern const int s_jsBufferPrototypeBase64urlSliceCodeLength; -extern const JSC::ConstructAbility s_jsBufferPrototypeBase64urlSliceCodeConstructAbility; -extern const JSC::ConstructorKind s_jsBufferPrototypeBase64urlSliceCodeConstructorKind; -extern const JSC::ImplementationVisibility s_jsBufferPrototypeBase64urlSliceCodeImplementationVisibility; + WEBCORE_FOREACH_WRITABLESTREAMINTERNALS_BUILTIN_FUNCTION_NAME(DECLARE_BUILTIN_IDENTIFIER_ACCESSOR) -// hexSlice -#define WEBCORE_BUILTIN_JSBUFFERPROTOTYPE_HEXSLICE 1 -extern const char* const s_jsBufferPrototypeHexSliceCode; -extern const int s_jsBufferPrototypeHexSliceCodeLength; -extern const JSC::ConstructAbility s_jsBufferPrototypeHexSliceCodeConstructAbility; -extern const JSC::ConstructorKind s_jsBufferPrototypeHexSliceCodeConstructorKind; -extern const JSC::ImplementationVisibility s_jsBufferPrototypeHexSliceCodeImplementationVisibility; + void exportNames(); -// toJSON -#define WEBCORE_BUILTIN_JSBUFFERPROTOTYPE_TOJSON 1 -extern const char* const s_jsBufferPrototypeToJSONCode; -extern const int s_jsBufferPrototypeToJSONCodeLength; -extern const JSC::ConstructAbility s_jsBufferPrototypeToJSONCodeConstructAbility; -extern const JSC::ConstructorKind s_jsBufferPrototypeToJSONCodeConstructorKind; -extern const JSC::ImplementationVisibility s_jsBufferPrototypeToJSONCodeImplementationVisibility; +private: + JSC::VM& m_vm; -// slice -#define WEBCORE_BUILTIN_JSBUFFERPROTOTYPE_SLICE 1 -extern const char* const s_jsBufferPrototypeSliceCode; -extern const int s_jsBufferPrototypeSliceCodeLength; -extern const JSC::ConstructAbility s_jsBufferPrototypeSliceCodeConstructAbility; -extern const JSC::ConstructorKind s_jsBufferPrototypeSliceCodeConstructorKind; -extern const JSC::ImplementationVisibility s_jsBufferPrototypeSliceCodeImplementationVisibility; + WEBCORE_FOREACH_WRITABLESTREAMINTERNALS_BUILTIN_FUNCTION_NAME(DECLARE_BUILTIN_NAMES) -// parent -#define WEBCORE_BUILTIN_JSBUFFERPROTOTYPE_PARENT 1 -extern const char* const s_jsBufferPrototypeParentCode; -extern const int s_jsBufferPrototypeParentCodeLength; -extern const JSC::ConstructAbility s_jsBufferPrototypeParentCodeConstructAbility; -extern const JSC::ConstructorKind s_jsBufferPrototypeParentCodeConstructorKind; -extern const JSC::ImplementationVisibility s_jsBufferPrototypeParentCodeImplementationVisibility; +#define DECLARE_BUILTIN_SOURCE_MEMBERS(name, functionName, overriddenName, length) \ + JSC::SourceCode m_##name##Source;\ + JSC::Weak m_##name##Executable; + WEBCORE_FOREACH_WRITABLESTREAMINTERNALS_BUILTIN_CODE(DECLARE_BUILTIN_SOURCE_MEMBERS) +#undef DECLARE_BUILTIN_SOURCE_MEMBERS + +}; + +#define DEFINE_BUILTIN_EXECUTABLES(name, functionName, overriddenName, length) \ +inline JSC::UnlinkedFunctionExecutable* WritableStreamInternalsBuiltinsWrapper::name##Executable() \ +{\ + if (!m_##name##Executable) {\ + JSC::Identifier executableName = functionName##PublicName();\ + if (overriddenName)\ + executableName = JSC::Identifier::fromString(m_vm, overriddenName);\ + m_##name##Executable = JSC::Weak(JSC::createBuiltinExecutable(m_vm, m_##name##Source, executableName, s_##name##ImplementationVisibility, s_##name##ConstructorKind, s_##name##ConstructAbility), this, &m_##name##Executable);\ + }\ + return m_##name##Executable.get();\ +} +WEBCORE_FOREACH_WRITABLESTREAMINTERNALS_BUILTIN_CODE(DEFINE_BUILTIN_EXECUTABLES) +#undef DEFINE_BUILTIN_EXECUTABLES + +inline void WritableStreamInternalsBuiltinsWrapper::exportNames() +{ +#define EXPORT_FUNCTION_NAME(name) m_vm.propertyNames->appendExternalName(name##PublicName(), name##PrivateName()); + WEBCORE_FOREACH_WRITABLESTREAMINTERNALS_BUILTIN_FUNCTION_NAME(EXPORT_FUNCTION_NAME) +#undef EXPORT_FUNCTION_NAME +} +class WritableStreamInternalsBuiltinFunctions { +public: + explicit WritableStreamInternalsBuiltinFunctions(JSC::VM& vm) : m_vm(vm) { } + + void init(JSC::JSGlobalObject&); + template void visit(Visitor&); + +public: + JSC::VM& m_vm; + +#define DECLARE_BUILTIN_SOURCE_MEMBERS(functionName) \ + JSC::WriteBarrier m_##functionName##Function; + WEBCORE_FOREACH_WRITABLESTREAMINTERNALS_BUILTIN_FUNCTION_NAME(DECLARE_BUILTIN_SOURCE_MEMBERS) +#undef DECLARE_BUILTIN_SOURCE_MEMBERS +}; + +inline void WritableStreamInternalsBuiltinFunctions::init(JSC::JSGlobalObject& globalObject) +{ +#define EXPORT_FUNCTION(codeName, functionName, overriddenName, length) \ + m_##functionName##Function.set(m_vm, &globalObject, JSC::JSFunction::create(m_vm, codeName##Generator(m_vm), &globalObject)); + WEBCORE_FOREACH_WRITABLESTREAMINTERNALS_BUILTIN_CODE(EXPORT_FUNCTION) +#undef EXPORT_FUNCTION +} + +template +inline void WritableStreamInternalsBuiltinFunctions::visit(Visitor& visitor) +{ +#define VISIT_FUNCTION(name) visitor.append(m_##name##Function); + WEBCORE_FOREACH_WRITABLESTREAMINTERNALS_BUILTIN_FUNCTION_NAME(VISIT_FUNCTION) +#undef VISIT_FUNCTION +} + +template void WritableStreamInternalsBuiltinFunctions::visit(JSC::AbstractSlotVisitor&); +template void WritableStreamInternalsBuiltinFunctions::visit(JSC::SlotVisitor&); + /* ReadableStream.ts */ +// initializeReadableStream +#define WEBCORE_BUILTIN_READABLESTREAM_INITIALIZEREADABLESTREAM 1 +extern const char* const s_readableStreamInitializeReadableStreamCode; +extern const int s_readableStreamInitializeReadableStreamCodeLength; +extern const JSC::ConstructAbility s_readableStreamInitializeReadableStreamCodeConstructAbility; +extern const JSC::ConstructorKind s_readableStreamInitializeReadableStreamCodeConstructorKind; +extern const JSC::ImplementationVisibility s_readableStreamInitializeReadableStreamCodeImplementationVisibility; + +// readableStreamToArray +#define WEBCORE_BUILTIN_READABLESTREAM_READABLESTREAMTOARRAY 1 +extern const char* const s_readableStreamReadableStreamToArrayCode; +extern const int s_readableStreamReadableStreamToArrayCodeLength; +extern const JSC::ConstructAbility s_readableStreamReadableStreamToArrayCodeConstructAbility; +extern const JSC::ConstructorKind s_readableStreamReadableStreamToArrayCodeConstructorKind; +extern const JSC::ImplementationVisibility s_readableStreamReadableStreamToArrayCodeImplementationVisibility; + +// readableStreamToText +#define WEBCORE_BUILTIN_READABLESTREAM_READABLESTREAMTOTEXT 1 +extern const char* const s_readableStreamReadableStreamToTextCode; +extern const int s_readableStreamReadableStreamToTextCodeLength; +extern const JSC::ConstructAbility s_readableStreamReadableStreamToTextCodeConstructAbility; +extern const JSC::ConstructorKind s_readableStreamReadableStreamToTextCodeConstructorKind; +extern const JSC::ImplementationVisibility s_readableStreamReadableStreamToTextCodeImplementationVisibility; + +// readableStreamToArrayBuffer +#define WEBCORE_BUILTIN_READABLESTREAM_READABLESTREAMTOARRAYBUFFER 1 +extern const char* const s_readableStreamReadableStreamToArrayBufferCode; +extern const int s_readableStreamReadableStreamToArrayBufferCodeLength; +extern const JSC::ConstructAbility s_readableStreamReadableStreamToArrayBufferCodeConstructAbility; +extern const JSC::ConstructorKind s_readableStreamReadableStreamToArrayBufferCodeConstructorKind; +extern const JSC::ImplementationVisibility s_readableStreamReadableStreamToArrayBufferCodeImplementationVisibility; + +// readableStreamToFormData +#define WEBCORE_BUILTIN_READABLESTREAM_READABLESTREAMTOFORMDATA 1 +extern const char* const s_readableStreamReadableStreamToFormDataCode; +extern const int s_readableStreamReadableStreamToFormDataCodeLength; +extern const JSC::ConstructAbility s_readableStreamReadableStreamToFormDataCodeConstructAbility; +extern const JSC::ConstructorKind s_readableStreamReadableStreamToFormDataCodeConstructorKind; +extern const JSC::ImplementationVisibility s_readableStreamReadableStreamToFormDataCodeImplementationVisibility; + +// readableStreamToJSON +#define WEBCORE_BUILTIN_READABLESTREAM_READABLESTREAMTOJSON 1 +extern const char* const s_readableStreamReadableStreamToJSONCode; +extern const int s_readableStreamReadableStreamToJSONCodeLength; +extern const JSC::ConstructAbility s_readableStreamReadableStreamToJSONCodeConstructAbility; +extern const JSC::ConstructorKind s_readableStreamReadableStreamToJSONCodeConstructorKind; +extern const JSC::ImplementationVisibility s_readableStreamReadableStreamToJSONCodeImplementationVisibility; + +// readableStreamToBlob +#define WEBCORE_BUILTIN_READABLESTREAM_READABLESTREAMTOBLOB 1 +extern const char* const s_readableStreamReadableStreamToBlobCode; +extern const int s_readableStreamReadableStreamToBlobCodeLength; +extern const JSC::ConstructAbility s_readableStreamReadableStreamToBlobCodeConstructAbility; +extern const JSC::ConstructorKind s_readableStreamReadableStreamToBlobCodeConstructorKind; +extern const JSC::ImplementationVisibility s_readableStreamReadableStreamToBlobCodeImplementationVisibility; + +// consumeReadableStream +#define WEBCORE_BUILTIN_READABLESTREAM_CONSUMEREADABLESTREAM 1 +extern const char* const s_readableStreamConsumeReadableStreamCode; +extern const int s_readableStreamConsumeReadableStreamCodeLength; +extern const JSC::ConstructAbility s_readableStreamConsumeReadableStreamCodeConstructAbility; +extern const JSC::ConstructorKind s_readableStreamConsumeReadableStreamCodeConstructorKind; +extern const JSC::ImplementationVisibility s_readableStreamConsumeReadableStreamCodeImplementationVisibility; + +// createEmptyReadableStream +#define WEBCORE_BUILTIN_READABLESTREAM_CREATEEMPTYREADABLESTREAM 1 +extern const char* const s_readableStreamCreateEmptyReadableStreamCode; +extern const int s_readableStreamCreateEmptyReadableStreamCodeLength; +extern const JSC::ConstructAbility s_readableStreamCreateEmptyReadableStreamCodeConstructAbility; +extern const JSC::ConstructorKind s_readableStreamCreateEmptyReadableStreamCodeConstructorKind; +extern const JSC::ImplementationVisibility s_readableStreamCreateEmptyReadableStreamCodeImplementationVisibility; + +// createNativeReadableStream +#define WEBCORE_BUILTIN_READABLESTREAM_CREATENATIVEREADABLESTREAM 1 +extern const char* const s_readableStreamCreateNativeReadableStreamCode; +extern const int s_readableStreamCreateNativeReadableStreamCodeLength; +extern const JSC::ConstructAbility s_readableStreamCreateNativeReadableStreamCodeConstructAbility; +extern const JSC::ConstructorKind s_readableStreamCreateNativeReadableStreamCodeConstructorKind; +extern const JSC::ImplementationVisibility s_readableStreamCreateNativeReadableStreamCodeImplementationVisibility; + +// cancel +#define WEBCORE_BUILTIN_READABLESTREAM_CANCEL 1 +extern const char* const s_readableStreamCancelCode; +extern const int s_readableStreamCancelCodeLength; +extern const JSC::ConstructAbility s_readableStreamCancelCodeConstructAbility; +extern const JSC::ConstructorKind s_readableStreamCancelCodeConstructorKind; +extern const JSC::ImplementationVisibility s_readableStreamCancelCodeImplementationVisibility; + +// getReader +#define WEBCORE_BUILTIN_READABLESTREAM_GETREADER 1 +extern const char* const s_readableStreamGetReaderCode; +extern const int s_readableStreamGetReaderCodeLength; +extern const JSC::ConstructAbility s_readableStreamGetReaderCodeConstructAbility; +extern const JSC::ConstructorKind s_readableStreamGetReaderCodeConstructorKind; +extern const JSC::ImplementationVisibility s_readableStreamGetReaderCodeImplementationVisibility; + +// pipeThrough +#define WEBCORE_BUILTIN_READABLESTREAM_PIPETHROUGH 1 +extern const char* const s_readableStreamPipeThroughCode; +extern const int s_readableStreamPipeThroughCodeLength; +extern const JSC::ConstructAbility s_readableStreamPipeThroughCodeConstructAbility; +extern const JSC::ConstructorKind s_readableStreamPipeThroughCodeConstructorKind; +extern const JSC::ImplementationVisibility s_readableStreamPipeThroughCodeImplementationVisibility; + +// pipeTo +#define WEBCORE_BUILTIN_READABLESTREAM_PIPETO 1 +extern const char* const s_readableStreamPipeToCode; +extern const int s_readableStreamPipeToCodeLength; +extern const JSC::ConstructAbility s_readableStreamPipeToCodeConstructAbility; +extern const JSC::ConstructorKind s_readableStreamPipeToCodeConstructorKind; +extern const JSC::ImplementationVisibility s_readableStreamPipeToCodeImplementationVisibility; + +// tee +#define WEBCORE_BUILTIN_READABLESTREAM_TEE 1 +extern const char* const s_readableStreamTeeCode; +extern const int s_readableStreamTeeCodeLength; +extern const JSC::ConstructAbility s_readableStreamTeeCodeConstructAbility; +extern const JSC::ConstructorKind s_readableStreamTeeCodeConstructorKind; +extern const JSC::ImplementationVisibility s_readableStreamTeeCodeImplementationVisibility; + +// locked +#define WEBCORE_BUILTIN_READABLESTREAM_LOCKED 1 +extern const char* const s_readableStreamLockedCode; +extern const int s_readableStreamLockedCodeLength; +extern const JSC::ConstructAbility s_readableStreamLockedCodeConstructAbility; +extern const JSC::ConstructorKind s_readableStreamLockedCodeConstructorKind; +extern const JSC::ImplementationVisibility s_readableStreamLockedCodeImplementationVisibility; + +// values +#define WEBCORE_BUILTIN_READABLESTREAM_VALUES 1 +extern const char* const s_readableStreamValuesCode; +extern const int s_readableStreamValuesCodeLength; +extern const JSC::ConstructAbility s_readableStreamValuesCodeConstructAbility; +extern const JSC::ConstructorKind s_readableStreamValuesCodeConstructorKind; +extern const JSC::ImplementationVisibility s_readableStreamValuesCodeImplementationVisibility; + +// lazyAsyncIterator +#define WEBCORE_BUILTIN_READABLESTREAM_LAZYASYNCITERATOR 1 +extern const char* const s_readableStreamLazyAsyncIteratorCode; +extern const int s_readableStreamLazyAsyncIteratorCodeLength; +extern const JSC::ConstructAbility s_readableStreamLazyAsyncIteratorCodeConstructAbility; +extern const JSC::ConstructorKind s_readableStreamLazyAsyncIteratorCodeConstructorKind; +extern const JSC::ImplementationVisibility s_readableStreamLazyAsyncIteratorCodeImplementationVisibility; + +#define WEBCORE_FOREACH_READABLESTREAM_BUILTIN_DATA(macro) \ + macro(initializeReadableStream, readableStreamInitializeReadableStream, 3) \ + macro(readableStreamToArray, readableStreamReadableStreamToArray, 1) \ + macro(readableStreamToText, readableStreamReadableStreamToText, 1) \ + macro(readableStreamToArrayBuffer, readableStreamReadableStreamToArrayBuffer, 1) \ + macro(readableStreamToFormData, readableStreamReadableStreamToFormData, 3) \ + macro(readableStreamToJSON, readableStreamReadableStreamToJSON, 1) \ + macro(readableStreamToBlob, readableStreamReadableStreamToBlob, 1) \ + macro(consumeReadableStream, readableStreamConsumeReadableStream, 3) \ + macro(createEmptyReadableStream, readableStreamCreateEmptyReadableStream, 0) \ + macro(createNativeReadableStream, readableStreamCreateNativeReadableStream, 3) \ + macro(cancel, readableStreamCancel, 1) \ + macro(getReader, readableStreamGetReader, 1) \ + macro(pipeThrough, readableStreamPipeThrough, 2) \ + macro(pipeTo, readableStreamPipeTo, 1) \ + macro(tee, readableStreamTee, 0) \ + macro(locked, readableStreamLocked, 0) \ + macro(values, readableStreamValues, 1) \ + macro(lazyAsyncIterator, readableStreamLazyAsyncIterator, 0) \ + +#define WEBCORE_FOREACH_READABLESTREAM_BUILTIN_CODE(macro) \ + macro(readableStreamInitializeReadableStreamCode, initializeReadableStream, ASCIILiteral(), s_readableStreamInitializeReadableStreamCodeLength) \ + macro(readableStreamReadableStreamToArrayCode, readableStreamToArray, ASCIILiteral(), s_readableStreamReadableStreamToArrayCodeLength) \ + macro(readableStreamReadableStreamToTextCode, readableStreamToText, ASCIILiteral(), s_readableStreamReadableStreamToTextCodeLength) \ + macro(readableStreamReadableStreamToArrayBufferCode, readableStreamToArrayBuffer, ASCIILiteral(), s_readableStreamReadableStreamToArrayBufferCodeLength) \ + macro(readableStreamReadableStreamToFormDataCode, readableStreamToFormData, ASCIILiteral(), s_readableStreamReadableStreamToFormDataCodeLength) \ + macro(readableStreamReadableStreamToJSONCode, readableStreamToJSON, ASCIILiteral(), s_readableStreamReadableStreamToJSONCodeLength) \ + macro(readableStreamReadableStreamToBlobCode, readableStreamToBlob, ASCIILiteral(), s_readableStreamReadableStreamToBlobCodeLength) \ + macro(readableStreamConsumeReadableStreamCode, consumeReadableStream, ASCIILiteral(), s_readableStreamConsumeReadableStreamCodeLength) \ + macro(readableStreamCreateEmptyReadableStreamCode, createEmptyReadableStream, ASCIILiteral(), s_readableStreamCreateEmptyReadableStreamCodeLength) \ + macro(readableStreamCreateNativeReadableStreamCode, createNativeReadableStream, ASCIILiteral(), s_readableStreamCreateNativeReadableStreamCodeLength) \ + macro(readableStreamCancelCode, cancel, ASCIILiteral(), s_readableStreamCancelCodeLength) \ + macro(readableStreamGetReaderCode, getReader, ASCIILiteral(), s_readableStreamGetReaderCodeLength) \ + macro(readableStreamPipeThroughCode, pipeThrough, ASCIILiteral(), s_readableStreamPipeThroughCodeLength) \ + macro(readableStreamPipeToCode, pipeTo, ASCIILiteral(), s_readableStreamPipeToCodeLength) \ + macro(readableStreamTeeCode, tee, ASCIILiteral(), s_readableStreamTeeCodeLength) \ + macro(readableStreamLockedCode, locked, "get locked"_s, s_readableStreamLockedCodeLength) \ + macro(readableStreamValuesCode, values, ASCIILiteral(), s_readableStreamValuesCodeLength) \ + macro(readableStreamLazyAsyncIteratorCode, lazyAsyncIterator, ASCIILiteral(), s_readableStreamLazyAsyncIteratorCodeLength) \ + +#define WEBCORE_FOREACH_READABLESTREAM_BUILTIN_FUNCTION_NAME(macro) \ + macro(initializeReadableStream) \ + macro(readableStreamToArray) \ + macro(readableStreamToText) \ + macro(readableStreamToArrayBuffer) \ + macro(readableStreamToFormData) \ + macro(readableStreamToJSON) \ + macro(readableStreamToBlob) \ + macro(consumeReadableStream) \ + macro(createEmptyReadableStream) \ + macro(createNativeReadableStream) \ + macro(cancel) \ + macro(getReader) \ + macro(pipeThrough) \ + macro(pipeTo) \ + macro(tee) \ + macro(locked) \ + macro(values) \ + macro(lazyAsyncIterator) \ + +#define DECLARE_BUILTIN_GENERATOR(codeName, functionName, overriddenName, argumentCount) \ + JSC::FunctionExecutable* codeName##Generator(JSC::VM&); + +WEBCORE_FOREACH_READABLESTREAM_BUILTIN_CODE(DECLARE_BUILTIN_GENERATOR) +#undef DECLARE_BUILTIN_GENERATOR + +class ReadableStreamBuiltinsWrapper : private JSC::WeakHandleOwner { +public: + explicit ReadableStreamBuiltinsWrapper(JSC::VM& vm) + : m_vm(vm) + WEBCORE_FOREACH_READABLESTREAM_BUILTIN_FUNCTION_NAME(INITIALIZE_BUILTIN_NAMES) +#define INITIALIZE_BUILTIN_SOURCE_MEMBERS(name, functionName, overriddenName, length) , m_##name##Source(JSC::makeSource(StringImpl::createWithoutCopying(s_##name, length), { }, JSC::SourceTaintedOrigin::Untainted)) + WEBCORE_FOREACH_READABLESTREAM_BUILTIN_CODE(INITIALIZE_BUILTIN_SOURCE_MEMBERS) +#undef INITIALIZE_BUILTIN_SOURCE_MEMBERS + { + } + +#define EXPOSE_BUILTIN_EXECUTABLES(name, functionName, overriddenName, length) \ + JSC::UnlinkedFunctionExecutable* name##Executable(); \ + const JSC::SourceCode& name##Source() const { return m_##name##Source; } + WEBCORE_FOREACH_READABLESTREAM_BUILTIN_CODE(EXPOSE_BUILTIN_EXECUTABLES) +#undef EXPOSE_BUILTIN_EXECUTABLES + + WEBCORE_FOREACH_READABLESTREAM_BUILTIN_FUNCTION_NAME(DECLARE_BUILTIN_IDENTIFIER_ACCESSOR) + + void exportNames(); + +private: + JSC::VM& m_vm; + + WEBCORE_FOREACH_READABLESTREAM_BUILTIN_FUNCTION_NAME(DECLARE_BUILTIN_NAMES) + +#define DECLARE_BUILTIN_SOURCE_MEMBERS(name, functionName, overriddenName, length) \ + JSC::SourceCode m_##name##Source;\ + JSC::Weak m_##name##Executable; + WEBCORE_FOREACH_READABLESTREAM_BUILTIN_CODE(DECLARE_BUILTIN_SOURCE_MEMBERS) +#undef DECLARE_BUILTIN_SOURCE_MEMBERS + +}; + +#define DEFINE_BUILTIN_EXECUTABLES(name, functionName, overriddenName, length) \ +inline JSC::UnlinkedFunctionExecutable* ReadableStreamBuiltinsWrapper::name##Executable() \ +{\ + if (!m_##name##Executable) {\ + JSC::Identifier executableName = functionName##PublicName();\ + if (overriddenName)\ + executableName = JSC::Identifier::fromString(m_vm, overriddenName);\ + m_##name##Executable = JSC::Weak(JSC::createBuiltinExecutable(m_vm, m_##name##Source, executableName, s_##name##ImplementationVisibility, s_##name##ConstructorKind, s_##name##ConstructAbility), this, &m_##name##Executable);\ + }\ + return m_##name##Executable.get();\ +} +WEBCORE_FOREACH_READABLESTREAM_BUILTIN_CODE(DEFINE_BUILTIN_EXECUTABLES) +#undef DEFINE_BUILTIN_EXECUTABLES + +inline void ReadableStreamBuiltinsWrapper::exportNames() +{ +#define EXPORT_FUNCTION_NAME(name) m_vm.propertyNames->appendExternalName(name##PublicName(), name##PrivateName()); + WEBCORE_FOREACH_READABLESTREAM_BUILTIN_FUNCTION_NAME(EXPORT_FUNCTION_NAME) +#undef EXPORT_FUNCTION_NAME +} +/* TransformStreamDefaultController.ts */ +// initializeTransformStreamDefaultController +#define WEBCORE_BUILTIN_TRANSFORMSTREAMDEFAULTCONTROLLER_INITIALIZETRANSFORMSTREAMDEFAULTCONTROLLER 1 +extern const char* const s_transformStreamDefaultControllerInitializeTransformStreamDefaultControllerCode; +extern const int s_transformStreamDefaultControllerInitializeTransformStreamDefaultControllerCodeLength; +extern const JSC::ConstructAbility s_transformStreamDefaultControllerInitializeTransformStreamDefaultControllerCodeConstructAbility; +extern const JSC::ConstructorKind s_transformStreamDefaultControllerInitializeTransformStreamDefaultControllerCodeConstructorKind; +extern const JSC::ImplementationVisibility s_transformStreamDefaultControllerInitializeTransformStreamDefaultControllerCodeImplementationVisibility; + +// desiredSize +#define WEBCORE_BUILTIN_TRANSFORMSTREAMDEFAULTCONTROLLER_DESIREDSIZE 1 +extern const char* const s_transformStreamDefaultControllerDesiredSizeCode; +extern const int s_transformStreamDefaultControllerDesiredSizeCodeLength; +extern const JSC::ConstructAbility s_transformStreamDefaultControllerDesiredSizeCodeConstructAbility; +extern const JSC::ConstructorKind s_transformStreamDefaultControllerDesiredSizeCodeConstructorKind; +extern const JSC::ImplementationVisibility s_transformStreamDefaultControllerDesiredSizeCodeImplementationVisibility; + +// enqueue +#define WEBCORE_BUILTIN_TRANSFORMSTREAMDEFAULTCONTROLLER_ENQUEUE 1 +extern const char* const s_transformStreamDefaultControllerEnqueueCode; +extern const int s_transformStreamDefaultControllerEnqueueCodeLength; +extern const JSC::ConstructAbility s_transformStreamDefaultControllerEnqueueCodeConstructAbility; +extern const JSC::ConstructorKind s_transformStreamDefaultControllerEnqueueCodeConstructorKind; +extern const JSC::ImplementationVisibility s_transformStreamDefaultControllerEnqueueCodeImplementationVisibility; + +// error +#define WEBCORE_BUILTIN_TRANSFORMSTREAMDEFAULTCONTROLLER_ERROR 1 +extern const char* const s_transformStreamDefaultControllerErrorCode; +extern const int s_transformStreamDefaultControllerErrorCodeLength; +extern const JSC::ConstructAbility s_transformStreamDefaultControllerErrorCodeConstructAbility; +extern const JSC::ConstructorKind s_transformStreamDefaultControllerErrorCodeConstructorKind; +extern const JSC::ImplementationVisibility s_transformStreamDefaultControllerErrorCodeImplementationVisibility; + +// terminate +#define WEBCORE_BUILTIN_TRANSFORMSTREAMDEFAULTCONTROLLER_TERMINATE 1 +extern const char* const s_transformStreamDefaultControllerTerminateCode; +extern const int s_transformStreamDefaultControllerTerminateCodeLength; +extern const JSC::ConstructAbility s_transformStreamDefaultControllerTerminateCodeConstructAbility; +extern const JSC::ConstructorKind s_transformStreamDefaultControllerTerminateCodeConstructorKind; +extern const JSC::ImplementationVisibility s_transformStreamDefaultControllerTerminateCodeImplementationVisibility; + +#define WEBCORE_FOREACH_TRANSFORMSTREAMDEFAULTCONTROLLER_BUILTIN_DATA(macro) \ + macro(initializeTransformStreamDefaultController, transformStreamDefaultControllerInitializeTransformStreamDefaultController, 0) \ + macro(desiredSize, transformStreamDefaultControllerDesiredSize, 0) \ + macro(enqueue, transformStreamDefaultControllerEnqueue, 1) \ + macro(error, transformStreamDefaultControllerError, 1) \ + macro(terminate, transformStreamDefaultControllerTerminate, 0) \ + +#define WEBCORE_FOREACH_TRANSFORMSTREAMDEFAULTCONTROLLER_BUILTIN_CODE(macro) \ + macro(transformStreamDefaultControllerInitializeTransformStreamDefaultControllerCode, initializeTransformStreamDefaultController, ASCIILiteral(), s_transformStreamDefaultControllerInitializeTransformStreamDefaultControllerCodeLength) \ + macro(transformStreamDefaultControllerDesiredSizeCode, desiredSize, "get desiredSize"_s, s_transformStreamDefaultControllerDesiredSizeCodeLength) \ + macro(transformStreamDefaultControllerEnqueueCode, enqueue, ASCIILiteral(), s_transformStreamDefaultControllerEnqueueCodeLength) \ + macro(transformStreamDefaultControllerErrorCode, error, ASCIILiteral(), s_transformStreamDefaultControllerErrorCodeLength) \ + macro(transformStreamDefaultControllerTerminateCode, terminate, ASCIILiteral(), s_transformStreamDefaultControllerTerminateCodeLength) \ + +#define WEBCORE_FOREACH_TRANSFORMSTREAMDEFAULTCONTROLLER_BUILTIN_FUNCTION_NAME(macro) \ + macro(initializeTransformStreamDefaultController) \ + macro(desiredSize) \ + macro(enqueue) \ + macro(error) \ + macro(terminate) \ + +#define DECLARE_BUILTIN_GENERATOR(codeName, functionName, overriddenName, argumentCount) \ + JSC::FunctionExecutable* codeName##Generator(JSC::VM&); + +WEBCORE_FOREACH_TRANSFORMSTREAMDEFAULTCONTROLLER_BUILTIN_CODE(DECLARE_BUILTIN_GENERATOR) +#undef DECLARE_BUILTIN_GENERATOR + +class TransformStreamDefaultControllerBuiltinsWrapper : private JSC::WeakHandleOwner { +public: + explicit TransformStreamDefaultControllerBuiltinsWrapper(JSC::VM& vm) + : m_vm(vm) + WEBCORE_FOREACH_TRANSFORMSTREAMDEFAULTCONTROLLER_BUILTIN_FUNCTION_NAME(INITIALIZE_BUILTIN_NAMES) +#define INITIALIZE_BUILTIN_SOURCE_MEMBERS(name, functionName, overriddenName, length) , m_##name##Source(JSC::makeSource(StringImpl::createWithoutCopying(s_##name, length), { }, JSC::SourceTaintedOrigin::Untainted)) + WEBCORE_FOREACH_TRANSFORMSTREAMDEFAULTCONTROLLER_BUILTIN_CODE(INITIALIZE_BUILTIN_SOURCE_MEMBERS) +#undef INITIALIZE_BUILTIN_SOURCE_MEMBERS + { + } + +#define EXPOSE_BUILTIN_EXECUTABLES(name, functionName, overriddenName, length) \ + JSC::UnlinkedFunctionExecutable* name##Executable(); \ + const JSC::SourceCode& name##Source() const { return m_##name##Source; } + WEBCORE_FOREACH_TRANSFORMSTREAMDEFAULTCONTROLLER_BUILTIN_CODE(EXPOSE_BUILTIN_EXECUTABLES) +#undef EXPOSE_BUILTIN_EXECUTABLES + + WEBCORE_FOREACH_TRANSFORMSTREAMDEFAULTCONTROLLER_BUILTIN_FUNCTION_NAME(DECLARE_BUILTIN_IDENTIFIER_ACCESSOR) + + void exportNames(); + +private: + JSC::VM& m_vm; + + WEBCORE_FOREACH_TRANSFORMSTREAMDEFAULTCONTROLLER_BUILTIN_FUNCTION_NAME(DECLARE_BUILTIN_NAMES) + +#define DECLARE_BUILTIN_SOURCE_MEMBERS(name, functionName, overriddenName, length) \ + JSC::SourceCode m_##name##Source;\ + JSC::Weak m_##name##Executable; + WEBCORE_FOREACH_TRANSFORMSTREAMDEFAULTCONTROLLER_BUILTIN_CODE(DECLARE_BUILTIN_SOURCE_MEMBERS) +#undef DECLARE_BUILTIN_SOURCE_MEMBERS + +}; + +#define DEFINE_BUILTIN_EXECUTABLES(name, functionName, overriddenName, length) \ +inline JSC::UnlinkedFunctionExecutable* TransformStreamDefaultControllerBuiltinsWrapper::name##Executable() \ +{\ + if (!m_##name##Executable) {\ + JSC::Identifier executableName = functionName##PublicName();\ + if (overriddenName)\ + executableName = JSC::Identifier::fromString(m_vm, overriddenName);\ + m_##name##Executable = JSC::Weak(JSC::createBuiltinExecutable(m_vm, m_##name##Source, executableName, s_##name##ImplementationVisibility, s_##name##ConstructorKind, s_##name##ConstructAbility), this, &m_##name##Executable);\ + }\ + return m_##name##Executable.get();\ +} +WEBCORE_FOREACH_TRANSFORMSTREAMDEFAULTCONTROLLER_BUILTIN_CODE(DEFINE_BUILTIN_EXECUTABLES) +#undef DEFINE_BUILTIN_EXECUTABLES + +inline void TransformStreamDefaultControllerBuiltinsWrapper::exportNames() +{ +#define EXPORT_FUNCTION_NAME(name) m_vm.propertyNames->appendExternalName(name##PublicName(), name##PrivateName()); + WEBCORE_FOREACH_TRANSFORMSTREAMDEFAULTCONTROLLER_BUILTIN_FUNCTION_NAME(EXPORT_FUNCTION_NAME) +#undef EXPORT_FUNCTION_NAME +} +/* TransformStreamInternals.ts */ +// isTransformStream +#define WEBCORE_BUILTIN_TRANSFORMSTREAMINTERNALS_ISTRANSFORMSTREAM 1 +extern const char* const s_transformStreamInternalsIsTransformStreamCode; +extern const int s_transformStreamInternalsIsTransformStreamCodeLength; +extern const JSC::ConstructAbility s_transformStreamInternalsIsTransformStreamCodeConstructAbility; +extern const JSC::ConstructorKind s_transformStreamInternalsIsTransformStreamCodeConstructorKind; +extern const JSC::ImplementationVisibility s_transformStreamInternalsIsTransformStreamCodeImplementationVisibility; + +// isTransformStreamDefaultController +#define WEBCORE_BUILTIN_TRANSFORMSTREAMINTERNALS_ISTRANSFORMSTREAMDEFAULTCONTROLLER 1 +extern const char* const s_transformStreamInternalsIsTransformStreamDefaultControllerCode; +extern const int s_transformStreamInternalsIsTransformStreamDefaultControllerCodeLength; +extern const JSC::ConstructAbility s_transformStreamInternalsIsTransformStreamDefaultControllerCodeConstructAbility; +extern const JSC::ConstructorKind s_transformStreamInternalsIsTransformStreamDefaultControllerCodeConstructorKind; +extern const JSC::ImplementationVisibility s_transformStreamInternalsIsTransformStreamDefaultControllerCodeImplementationVisibility; + +// createTransformStream +#define WEBCORE_BUILTIN_TRANSFORMSTREAMINTERNALS_CREATETRANSFORMSTREAM 1 +extern const char* const s_transformStreamInternalsCreateTransformStreamCode; +extern const int s_transformStreamInternalsCreateTransformStreamCodeLength; +extern const JSC::ConstructAbility s_transformStreamInternalsCreateTransformStreamCodeConstructAbility; +extern const JSC::ConstructorKind s_transformStreamInternalsCreateTransformStreamCodeConstructorKind; +extern const JSC::ImplementationVisibility s_transformStreamInternalsCreateTransformStreamCodeImplementationVisibility; + +// initializeTransformStream +#define WEBCORE_BUILTIN_TRANSFORMSTREAMINTERNALS_INITIALIZETRANSFORMSTREAM 1 +extern const char* const s_transformStreamInternalsInitializeTransformStreamCode; +extern const int s_transformStreamInternalsInitializeTransformStreamCodeLength; +extern const JSC::ConstructAbility s_transformStreamInternalsInitializeTransformStreamCodeConstructAbility; +extern const JSC::ConstructorKind s_transformStreamInternalsInitializeTransformStreamCodeConstructorKind; +extern const JSC::ImplementationVisibility s_transformStreamInternalsInitializeTransformStreamCodeImplementationVisibility; + +// transformStreamError +#define WEBCORE_BUILTIN_TRANSFORMSTREAMINTERNALS_TRANSFORMSTREAMERROR 1 +extern const char* const s_transformStreamInternalsTransformStreamErrorCode; +extern const int s_transformStreamInternalsTransformStreamErrorCodeLength; +extern const JSC::ConstructAbility s_transformStreamInternalsTransformStreamErrorCodeConstructAbility; +extern const JSC::ConstructorKind s_transformStreamInternalsTransformStreamErrorCodeConstructorKind; +extern const JSC::ImplementationVisibility s_transformStreamInternalsTransformStreamErrorCodeImplementationVisibility; + +// transformStreamErrorWritableAndUnblockWrite +#define WEBCORE_BUILTIN_TRANSFORMSTREAMINTERNALS_TRANSFORMSTREAMERRORWRITABLEANDUNBLOCKWRITE 1 +extern const char* const s_transformStreamInternalsTransformStreamErrorWritableAndUnblockWriteCode; +extern const int s_transformStreamInternalsTransformStreamErrorWritableAndUnblockWriteCodeLength; +extern const JSC::ConstructAbility s_transformStreamInternalsTransformStreamErrorWritableAndUnblockWriteCodeConstructAbility; +extern const JSC::ConstructorKind s_transformStreamInternalsTransformStreamErrorWritableAndUnblockWriteCodeConstructorKind; +extern const JSC::ImplementationVisibility s_transformStreamInternalsTransformStreamErrorWritableAndUnblockWriteCodeImplementationVisibility; + +// transformStreamSetBackpressure +#define WEBCORE_BUILTIN_TRANSFORMSTREAMINTERNALS_TRANSFORMSTREAMSETBACKPRESSURE 1 +extern const char* const s_transformStreamInternalsTransformStreamSetBackpressureCode; +extern const int s_transformStreamInternalsTransformStreamSetBackpressureCodeLength; +extern const JSC::ConstructAbility s_transformStreamInternalsTransformStreamSetBackpressureCodeConstructAbility; +extern const JSC::ConstructorKind s_transformStreamInternalsTransformStreamSetBackpressureCodeConstructorKind; +extern const JSC::ImplementationVisibility s_transformStreamInternalsTransformStreamSetBackpressureCodeImplementationVisibility; + +// setUpTransformStreamDefaultController +#define WEBCORE_BUILTIN_TRANSFORMSTREAMINTERNALS_SETUPTRANSFORMSTREAMDEFAULTCONTROLLER 1 +extern const char* const s_transformStreamInternalsSetUpTransformStreamDefaultControllerCode; +extern const int s_transformStreamInternalsSetUpTransformStreamDefaultControllerCodeLength; +extern const JSC::ConstructAbility s_transformStreamInternalsSetUpTransformStreamDefaultControllerCodeConstructAbility; +extern const JSC::ConstructorKind s_transformStreamInternalsSetUpTransformStreamDefaultControllerCodeConstructorKind; +extern const JSC::ImplementationVisibility s_transformStreamInternalsSetUpTransformStreamDefaultControllerCodeImplementationVisibility; + +// setUpTransformStreamDefaultControllerFromTransformer +#define WEBCORE_BUILTIN_TRANSFORMSTREAMINTERNALS_SETUPTRANSFORMSTREAMDEFAULTCONTROLLERFROMTRANSFORMER 1 +extern const char* const s_transformStreamInternalsSetUpTransformStreamDefaultControllerFromTransformerCode; +extern const int s_transformStreamInternalsSetUpTransformStreamDefaultControllerFromTransformerCodeLength; +extern const JSC::ConstructAbility s_transformStreamInternalsSetUpTransformStreamDefaultControllerFromTransformerCodeConstructAbility; +extern const JSC::ConstructorKind s_transformStreamInternalsSetUpTransformStreamDefaultControllerFromTransformerCodeConstructorKind; +extern const JSC::ImplementationVisibility s_transformStreamInternalsSetUpTransformStreamDefaultControllerFromTransformerCodeImplementationVisibility; + +// transformStreamDefaultControllerClearAlgorithms +#define WEBCORE_BUILTIN_TRANSFORMSTREAMINTERNALS_TRANSFORMSTREAMDEFAULTCONTROLLERCLEARALGORITHMS 1 +extern const char* const s_transformStreamInternalsTransformStreamDefaultControllerClearAlgorithmsCode; +extern const int s_transformStreamInternalsTransformStreamDefaultControllerClearAlgorithmsCodeLength; +extern const JSC::ConstructAbility s_transformStreamInternalsTransformStreamDefaultControllerClearAlgorithmsCodeConstructAbility; +extern const JSC::ConstructorKind s_transformStreamInternalsTransformStreamDefaultControllerClearAlgorithmsCodeConstructorKind; +extern const JSC::ImplementationVisibility s_transformStreamInternalsTransformStreamDefaultControllerClearAlgorithmsCodeImplementationVisibility; + +// transformStreamDefaultControllerEnqueue +#define WEBCORE_BUILTIN_TRANSFORMSTREAMINTERNALS_TRANSFORMSTREAMDEFAULTCONTROLLERENQUEUE 1 +extern const char* const s_transformStreamInternalsTransformStreamDefaultControllerEnqueueCode; +extern const int s_transformStreamInternalsTransformStreamDefaultControllerEnqueueCodeLength; +extern const JSC::ConstructAbility s_transformStreamInternalsTransformStreamDefaultControllerEnqueueCodeConstructAbility; +extern const JSC::ConstructorKind s_transformStreamInternalsTransformStreamDefaultControllerEnqueueCodeConstructorKind; +extern const JSC::ImplementationVisibility s_transformStreamInternalsTransformStreamDefaultControllerEnqueueCodeImplementationVisibility; + +// transformStreamDefaultControllerError +#define WEBCORE_BUILTIN_TRANSFORMSTREAMINTERNALS_TRANSFORMSTREAMDEFAULTCONTROLLERERROR 1 +extern const char* const s_transformStreamInternalsTransformStreamDefaultControllerErrorCode; +extern const int s_transformStreamInternalsTransformStreamDefaultControllerErrorCodeLength; +extern const JSC::ConstructAbility s_transformStreamInternalsTransformStreamDefaultControllerErrorCodeConstructAbility; +extern const JSC::ConstructorKind s_transformStreamInternalsTransformStreamDefaultControllerErrorCodeConstructorKind; +extern const JSC::ImplementationVisibility s_transformStreamInternalsTransformStreamDefaultControllerErrorCodeImplementationVisibility; -// offset -#define WEBCORE_BUILTIN_JSBUFFERPROTOTYPE_OFFSET 1 -extern const char* const s_jsBufferPrototypeOffsetCode; -extern const int s_jsBufferPrototypeOffsetCodeLength; -extern const JSC::ConstructAbility s_jsBufferPrototypeOffsetCodeConstructAbility; -extern const JSC::ConstructorKind s_jsBufferPrototypeOffsetCodeConstructorKind; -extern const JSC::ImplementationVisibility s_jsBufferPrototypeOffsetCodeImplementationVisibility; +// transformStreamDefaultControllerPerformTransform +#define WEBCORE_BUILTIN_TRANSFORMSTREAMINTERNALS_TRANSFORMSTREAMDEFAULTCONTROLLERPERFORMTRANSFORM 1 +extern const char* const s_transformStreamInternalsTransformStreamDefaultControllerPerformTransformCode; +extern const int s_transformStreamInternalsTransformStreamDefaultControllerPerformTransformCodeLength; +extern const JSC::ConstructAbility s_transformStreamInternalsTransformStreamDefaultControllerPerformTransformCodeConstructAbility; +extern const JSC::ConstructorKind s_transformStreamInternalsTransformStreamDefaultControllerPerformTransformCodeConstructorKind; +extern const JSC::ImplementationVisibility s_transformStreamInternalsTransformStreamDefaultControllerPerformTransformCodeImplementationVisibility; -// inspect -#define WEBCORE_BUILTIN_JSBUFFERPROTOTYPE_INSPECT 1 -extern const char* const s_jsBufferPrototypeInspectCode; -extern const int s_jsBufferPrototypeInspectCodeLength; -extern const JSC::ConstructAbility s_jsBufferPrototypeInspectCodeConstructAbility; -extern const JSC::ConstructorKind s_jsBufferPrototypeInspectCodeConstructorKind; -extern const JSC::ImplementationVisibility s_jsBufferPrototypeInspectCodeImplementationVisibility; +// transformStreamDefaultControllerTerminate +#define WEBCORE_BUILTIN_TRANSFORMSTREAMINTERNALS_TRANSFORMSTREAMDEFAULTCONTROLLERTERMINATE 1 +extern const char* const s_transformStreamInternalsTransformStreamDefaultControllerTerminateCode; +extern const int s_transformStreamInternalsTransformStreamDefaultControllerTerminateCodeLength; +extern const JSC::ConstructAbility s_transformStreamInternalsTransformStreamDefaultControllerTerminateCodeConstructAbility; +extern const JSC::ConstructorKind s_transformStreamInternalsTransformStreamDefaultControllerTerminateCodeConstructorKind; +extern const JSC::ImplementationVisibility s_transformStreamInternalsTransformStreamDefaultControllerTerminateCodeImplementationVisibility; -#define WEBCORE_FOREACH_JSBUFFERPROTOTYPE_BUILTIN_DATA(macro) \ - macro(setBigUint64, jsBufferPrototypeSetBigUint64, 3) \ - macro(readInt8, jsBufferPrototypeReadInt8, 1) \ - macro(readUInt8, jsBufferPrototypeReadUInt8, 1) \ - macro(readInt16LE, jsBufferPrototypeReadInt16LE, 1) \ - macro(readInt16BE, jsBufferPrototypeReadInt16BE, 1) \ - macro(readUInt16LE, jsBufferPrototypeReadUInt16LE, 1) \ - macro(readUInt16BE, jsBufferPrototypeReadUInt16BE, 1) \ - macro(readInt32LE, jsBufferPrototypeReadInt32LE, 1) \ - macro(readInt32BE, jsBufferPrototypeReadInt32BE, 1) \ - macro(readUInt32LE, jsBufferPrototypeReadUInt32LE, 1) \ - macro(readUInt32BE, jsBufferPrototypeReadUInt32BE, 1) \ - macro(readIntLE, jsBufferPrototypeReadIntLE, 2) \ - macro(readIntBE, jsBufferPrototypeReadIntBE, 2) \ - macro(readUIntLE, jsBufferPrototypeReadUIntLE, 2) \ - macro(readUIntBE, jsBufferPrototypeReadUIntBE, 2) \ - macro(readFloatLE, jsBufferPrototypeReadFloatLE, 1) \ - macro(readFloatBE, jsBufferPrototypeReadFloatBE, 1) \ - macro(readDoubleLE, jsBufferPrototypeReadDoubleLE, 1) \ - macro(readDoubleBE, jsBufferPrototypeReadDoubleBE, 1) \ - macro(readBigInt64LE, jsBufferPrototypeReadBigInt64LE, 1) \ - macro(readBigInt64BE, jsBufferPrototypeReadBigInt64BE, 1) \ - macro(readBigUInt64LE, jsBufferPrototypeReadBigUInt64LE, 1) \ - macro(readBigUInt64BE, jsBufferPrototypeReadBigUInt64BE, 1) \ - macro(writeInt8, jsBufferPrototypeWriteInt8, 2) \ - macro(writeUInt8, jsBufferPrototypeWriteUInt8, 2) \ - macro(writeInt16LE, jsBufferPrototypeWriteInt16LE, 2) \ - macro(writeInt16BE, jsBufferPrototypeWriteInt16BE, 2) \ - macro(writeUInt16LE, jsBufferPrototypeWriteUInt16LE, 2) \ - macro(writeUInt16BE, jsBufferPrototypeWriteUInt16BE, 2) \ - macro(writeInt32LE, jsBufferPrototypeWriteInt32LE, 2) \ - macro(writeInt32BE, jsBufferPrototypeWriteInt32BE, 2) \ - macro(writeUInt32LE, jsBufferPrototypeWriteUInt32LE, 2) \ - macro(writeUInt32BE, jsBufferPrototypeWriteUInt32BE, 2) \ - macro(writeIntLE, jsBufferPrototypeWriteIntLE, 3) \ - macro(writeIntBE, jsBufferPrototypeWriteIntBE, 3) \ - macro(writeUIntLE, jsBufferPrototypeWriteUIntLE, 3) \ - macro(writeUIntBE, jsBufferPrototypeWriteUIntBE, 3) \ - macro(writeFloatLE, jsBufferPrototypeWriteFloatLE, 2) \ - macro(writeFloatBE, jsBufferPrototypeWriteFloatBE, 2) \ - macro(writeDoubleLE, jsBufferPrototypeWriteDoubleLE, 2) \ - macro(writeDoubleBE, jsBufferPrototypeWriteDoubleBE, 2) \ - macro(writeBigInt64LE, jsBufferPrototypeWriteBigInt64LE, 2) \ - macro(writeBigInt64BE, jsBufferPrototypeWriteBigInt64BE, 2) \ - macro(writeBigUInt64LE, jsBufferPrototypeWriteBigUInt64LE, 2) \ - macro(writeBigUInt64BE, jsBufferPrototypeWriteBigUInt64BE, 2) \ - macro(utf8Write, jsBufferPrototypeUtf8Write, 3) \ - macro(ucs2Write, jsBufferPrototypeUcs2Write, 3) \ - macro(utf16leWrite, jsBufferPrototypeUtf16leWrite, 3) \ - macro(latin1Write, jsBufferPrototypeLatin1Write, 3) \ - macro(asciiWrite, jsBufferPrototypeAsciiWrite, 3) \ - macro(base64Write, jsBufferPrototypeBase64Write, 3) \ - macro(base64urlWrite, jsBufferPrototypeBase64urlWrite, 3) \ - macro(hexWrite, jsBufferPrototypeHexWrite, 3) \ - macro(utf8Slice, jsBufferPrototypeUtf8Slice, 2) \ - macro(ucs2Slice, jsBufferPrototypeUcs2Slice, 2) \ - macro(utf16leSlice, jsBufferPrototypeUtf16leSlice, 2) \ - macro(latin1Slice, jsBufferPrototypeLatin1Slice, 2) \ - macro(asciiSlice, jsBufferPrototypeAsciiSlice, 2) \ - macro(base64Slice, jsBufferPrototypeBase64Slice, 2) \ - macro(base64urlSlice, jsBufferPrototypeBase64urlSlice, 2) \ - macro(hexSlice, jsBufferPrototypeHexSlice, 2) \ - macro(toJSON, jsBufferPrototypeToJSON, 0) \ - macro(slice, jsBufferPrototypeSlice, 2) \ - macro(parent, jsBufferPrototypeParent, 0) \ - macro(offset, jsBufferPrototypeOffset, 0) \ - macro(inspect, jsBufferPrototypeInspect, 2) \ +// transformStreamDefaultSinkWriteAlgorithm +#define WEBCORE_BUILTIN_TRANSFORMSTREAMINTERNALS_TRANSFORMSTREAMDEFAULTSINKWRITEALGORITHM 1 +extern const char* const s_transformStreamInternalsTransformStreamDefaultSinkWriteAlgorithmCode; +extern const int s_transformStreamInternalsTransformStreamDefaultSinkWriteAlgorithmCodeLength; +extern const JSC::ConstructAbility s_transformStreamInternalsTransformStreamDefaultSinkWriteAlgorithmCodeConstructAbility; +extern const JSC::ConstructorKind s_transformStreamInternalsTransformStreamDefaultSinkWriteAlgorithmCodeConstructorKind; +extern const JSC::ImplementationVisibility s_transformStreamInternalsTransformStreamDefaultSinkWriteAlgorithmCodeImplementationVisibility; -#define WEBCORE_FOREACH_JSBUFFERPROTOTYPE_BUILTIN_CODE(macro) \ - macro(jsBufferPrototypeSetBigUint64Code, setBigUint64, ASCIILiteral(), s_jsBufferPrototypeSetBigUint64CodeLength) \ - macro(jsBufferPrototypeReadInt8Code, readInt8, ASCIILiteral(), s_jsBufferPrototypeReadInt8CodeLength) \ - macro(jsBufferPrototypeReadUInt8Code, readUInt8, ASCIILiteral(), s_jsBufferPrototypeReadUInt8CodeLength) \ - macro(jsBufferPrototypeReadInt16LECode, readInt16LE, ASCIILiteral(), s_jsBufferPrototypeReadInt16LECodeLength) \ - macro(jsBufferPrototypeReadInt16BECode, readInt16BE, ASCIILiteral(), s_jsBufferPrototypeReadInt16BECodeLength) \ - macro(jsBufferPrototypeReadUInt16LECode, readUInt16LE, ASCIILiteral(), s_jsBufferPrototypeReadUInt16LECodeLength) \ - macro(jsBufferPrototypeReadUInt16BECode, readUInt16BE, ASCIILiteral(), s_jsBufferPrototypeReadUInt16BECodeLength) \ - macro(jsBufferPrototypeReadInt32LECode, readInt32LE, ASCIILiteral(), s_jsBufferPrototypeReadInt32LECodeLength) \ - macro(jsBufferPrototypeReadInt32BECode, readInt32BE, ASCIILiteral(), s_jsBufferPrototypeReadInt32BECodeLength) \ - macro(jsBufferPrototypeReadUInt32LECode, readUInt32LE, ASCIILiteral(), s_jsBufferPrototypeReadUInt32LECodeLength) \ - macro(jsBufferPrototypeReadUInt32BECode, readUInt32BE, ASCIILiteral(), s_jsBufferPrototypeReadUInt32BECodeLength) \ - macro(jsBufferPrototypeReadIntLECode, readIntLE, ASCIILiteral(), s_jsBufferPrototypeReadIntLECodeLength) \ - macro(jsBufferPrototypeReadIntBECode, readIntBE, ASCIILiteral(), s_jsBufferPrototypeReadIntBECodeLength) \ - macro(jsBufferPrototypeReadUIntLECode, readUIntLE, ASCIILiteral(), s_jsBufferPrototypeReadUIntLECodeLength) \ - macro(jsBufferPrototypeReadUIntBECode, readUIntBE, ASCIILiteral(), s_jsBufferPrototypeReadUIntBECodeLength) \ - macro(jsBufferPrototypeReadFloatLECode, readFloatLE, ASCIILiteral(), s_jsBufferPrototypeReadFloatLECodeLength) \ - macro(jsBufferPrototypeReadFloatBECode, readFloatBE, ASCIILiteral(), s_jsBufferPrototypeReadFloatBECodeLength) \ - macro(jsBufferPrototypeReadDoubleLECode, readDoubleLE, ASCIILiteral(), s_jsBufferPrototypeReadDoubleLECodeLength) \ - macro(jsBufferPrototypeReadDoubleBECode, readDoubleBE, ASCIILiteral(), s_jsBufferPrototypeReadDoubleBECodeLength) \ - macro(jsBufferPrototypeReadBigInt64LECode, readBigInt64LE, ASCIILiteral(), s_jsBufferPrototypeReadBigInt64LECodeLength) \ - macro(jsBufferPrototypeReadBigInt64BECode, readBigInt64BE, ASCIILiteral(), s_jsBufferPrototypeReadBigInt64BECodeLength) \ - macro(jsBufferPrototypeReadBigUInt64LECode, readBigUInt64LE, ASCIILiteral(), s_jsBufferPrototypeReadBigUInt64LECodeLength) \ - macro(jsBufferPrototypeReadBigUInt64BECode, readBigUInt64BE, ASCIILiteral(), s_jsBufferPrototypeReadBigUInt64BECodeLength) \ - macro(jsBufferPrototypeWriteInt8Code, writeInt8, ASCIILiteral(), s_jsBufferPrototypeWriteInt8CodeLength) \ - macro(jsBufferPrototypeWriteUInt8Code, writeUInt8, ASCIILiteral(), s_jsBufferPrototypeWriteUInt8CodeLength) \ - macro(jsBufferPrototypeWriteInt16LECode, writeInt16LE, ASCIILiteral(), s_jsBufferPrototypeWriteInt16LECodeLength) \ - macro(jsBufferPrototypeWriteInt16BECode, writeInt16BE, ASCIILiteral(), s_jsBufferPrototypeWriteInt16BECodeLength) \ - macro(jsBufferPrototypeWriteUInt16LECode, writeUInt16LE, ASCIILiteral(), s_jsBufferPrototypeWriteUInt16LECodeLength) \ - macro(jsBufferPrototypeWriteUInt16BECode, writeUInt16BE, ASCIILiteral(), s_jsBufferPrototypeWriteUInt16BECodeLength) \ - macro(jsBufferPrototypeWriteInt32LECode, writeInt32LE, ASCIILiteral(), s_jsBufferPrototypeWriteInt32LECodeLength) \ - macro(jsBufferPrototypeWriteInt32BECode, writeInt32BE, ASCIILiteral(), s_jsBufferPrototypeWriteInt32BECodeLength) \ - macro(jsBufferPrototypeWriteUInt32LECode, writeUInt32LE, ASCIILiteral(), s_jsBufferPrototypeWriteUInt32LECodeLength) \ - macro(jsBufferPrototypeWriteUInt32BECode, writeUInt32BE, ASCIILiteral(), s_jsBufferPrototypeWriteUInt32BECodeLength) \ - macro(jsBufferPrototypeWriteIntLECode, writeIntLE, ASCIILiteral(), s_jsBufferPrototypeWriteIntLECodeLength) \ - macro(jsBufferPrototypeWriteIntBECode, writeIntBE, ASCIILiteral(), s_jsBufferPrototypeWriteIntBECodeLength) \ - macro(jsBufferPrototypeWriteUIntLECode, writeUIntLE, ASCIILiteral(), s_jsBufferPrototypeWriteUIntLECodeLength) \ - macro(jsBufferPrototypeWriteUIntBECode, writeUIntBE, ASCIILiteral(), s_jsBufferPrototypeWriteUIntBECodeLength) \ - macro(jsBufferPrototypeWriteFloatLECode, writeFloatLE, ASCIILiteral(), s_jsBufferPrototypeWriteFloatLECodeLength) \ - macro(jsBufferPrototypeWriteFloatBECode, writeFloatBE, ASCIILiteral(), s_jsBufferPrototypeWriteFloatBECodeLength) \ - macro(jsBufferPrototypeWriteDoubleLECode, writeDoubleLE, ASCIILiteral(), s_jsBufferPrototypeWriteDoubleLECodeLength) \ - macro(jsBufferPrototypeWriteDoubleBECode, writeDoubleBE, ASCIILiteral(), s_jsBufferPrototypeWriteDoubleBECodeLength) \ - macro(jsBufferPrototypeWriteBigInt64LECode, writeBigInt64LE, ASCIILiteral(), s_jsBufferPrototypeWriteBigInt64LECodeLength) \ - macro(jsBufferPrototypeWriteBigInt64BECode, writeBigInt64BE, ASCIILiteral(), s_jsBufferPrototypeWriteBigInt64BECodeLength) \ - macro(jsBufferPrototypeWriteBigUInt64LECode, writeBigUInt64LE, ASCIILiteral(), s_jsBufferPrototypeWriteBigUInt64LECodeLength) \ - macro(jsBufferPrototypeWriteBigUInt64BECode, writeBigUInt64BE, ASCIILiteral(), s_jsBufferPrototypeWriteBigUInt64BECodeLength) \ - macro(jsBufferPrototypeUtf8WriteCode, utf8Write, ASCIILiteral(), s_jsBufferPrototypeUtf8WriteCodeLength) \ - macro(jsBufferPrototypeUcs2WriteCode, ucs2Write, ASCIILiteral(), s_jsBufferPrototypeUcs2WriteCodeLength) \ - macro(jsBufferPrototypeUtf16leWriteCode, utf16leWrite, ASCIILiteral(), s_jsBufferPrototypeUtf16leWriteCodeLength) \ - macro(jsBufferPrototypeLatin1WriteCode, latin1Write, ASCIILiteral(), s_jsBufferPrototypeLatin1WriteCodeLength) \ - macro(jsBufferPrototypeAsciiWriteCode, asciiWrite, ASCIILiteral(), s_jsBufferPrototypeAsciiWriteCodeLength) \ - macro(jsBufferPrototypeBase64WriteCode, base64Write, ASCIILiteral(), s_jsBufferPrototypeBase64WriteCodeLength) \ - macro(jsBufferPrototypeBase64urlWriteCode, base64urlWrite, ASCIILiteral(), s_jsBufferPrototypeBase64urlWriteCodeLength) \ - macro(jsBufferPrototypeHexWriteCode, hexWrite, ASCIILiteral(), s_jsBufferPrototypeHexWriteCodeLength) \ - macro(jsBufferPrototypeUtf8SliceCode, utf8Slice, ASCIILiteral(), s_jsBufferPrototypeUtf8SliceCodeLength) \ - macro(jsBufferPrototypeUcs2SliceCode, ucs2Slice, ASCIILiteral(), s_jsBufferPrototypeUcs2SliceCodeLength) \ - macro(jsBufferPrototypeUtf16leSliceCode, utf16leSlice, ASCIILiteral(), s_jsBufferPrototypeUtf16leSliceCodeLength) \ - macro(jsBufferPrototypeLatin1SliceCode, latin1Slice, ASCIILiteral(), s_jsBufferPrototypeLatin1SliceCodeLength) \ - macro(jsBufferPrototypeAsciiSliceCode, asciiSlice, ASCIILiteral(), s_jsBufferPrototypeAsciiSliceCodeLength) \ - macro(jsBufferPrototypeBase64SliceCode, base64Slice, ASCIILiteral(), s_jsBufferPrototypeBase64SliceCodeLength) \ - macro(jsBufferPrototypeBase64urlSliceCode, base64urlSlice, ASCIILiteral(), s_jsBufferPrototypeBase64urlSliceCodeLength) \ - macro(jsBufferPrototypeHexSliceCode, hexSlice, ASCIILiteral(), s_jsBufferPrototypeHexSliceCodeLength) \ - macro(jsBufferPrototypeToJSONCode, toJSON, ASCIILiteral(), s_jsBufferPrototypeToJSONCodeLength) \ - macro(jsBufferPrototypeSliceCode, slice, ASCIILiteral(), s_jsBufferPrototypeSliceCodeLength) \ - macro(jsBufferPrototypeParentCode, parent, "get parent"_s, s_jsBufferPrototypeParentCodeLength) \ - macro(jsBufferPrototypeOffsetCode, offset, "get offset"_s, s_jsBufferPrototypeOffsetCodeLength) \ - macro(jsBufferPrototypeInspectCode, inspect, ASCIILiteral(), s_jsBufferPrototypeInspectCodeLength) \ +// transformStreamDefaultSinkAbortAlgorithm +#define WEBCORE_BUILTIN_TRANSFORMSTREAMINTERNALS_TRANSFORMSTREAMDEFAULTSINKABORTALGORITHM 1 +extern const char* const s_transformStreamInternalsTransformStreamDefaultSinkAbortAlgorithmCode; +extern const int s_transformStreamInternalsTransformStreamDefaultSinkAbortAlgorithmCodeLength; +extern const JSC::ConstructAbility s_transformStreamInternalsTransformStreamDefaultSinkAbortAlgorithmCodeConstructAbility; +extern const JSC::ConstructorKind s_transformStreamInternalsTransformStreamDefaultSinkAbortAlgorithmCodeConstructorKind; +extern const JSC::ImplementationVisibility s_transformStreamInternalsTransformStreamDefaultSinkAbortAlgorithmCodeImplementationVisibility; -#define WEBCORE_FOREACH_JSBUFFERPROTOTYPE_BUILTIN_FUNCTION_NAME(macro) \ - macro(setBigUint64) \ - macro(readInt8) \ - macro(readUInt8) \ - macro(readInt16LE) \ - macro(readInt16BE) \ - macro(readUInt16LE) \ - macro(readUInt16BE) \ - macro(readInt32LE) \ - macro(readInt32BE) \ - macro(readUInt32LE) \ - macro(readUInt32BE) \ - macro(readIntLE) \ - macro(readIntBE) \ - macro(readUIntLE) \ - macro(readUIntBE) \ - macro(readFloatLE) \ - macro(readFloatBE) \ - macro(readDoubleLE) \ - macro(readDoubleBE) \ - macro(readBigInt64LE) \ - macro(readBigInt64BE) \ - macro(readBigUInt64LE) \ - macro(readBigUInt64BE) \ - macro(writeInt8) \ - macro(writeUInt8) \ - macro(writeInt16LE) \ - macro(writeInt16BE) \ - macro(writeUInt16LE) \ - macro(writeUInt16BE) \ - macro(writeInt32LE) \ - macro(writeInt32BE) \ - macro(writeUInt32LE) \ - macro(writeUInt32BE) \ - macro(writeIntLE) \ - macro(writeIntBE) \ - macro(writeUIntLE) \ - macro(writeUIntBE) \ - macro(writeFloatLE) \ - macro(writeFloatBE) \ - macro(writeDoubleLE) \ - macro(writeDoubleBE) \ - macro(writeBigInt64LE) \ - macro(writeBigInt64BE) \ - macro(writeBigUInt64LE) \ - macro(writeBigUInt64BE) \ - macro(utf8Write) \ - macro(ucs2Write) \ - macro(utf16leWrite) \ - macro(latin1Write) \ - macro(asciiWrite) \ - macro(base64Write) \ - macro(base64urlWrite) \ - macro(hexWrite) \ - macro(utf8Slice) \ - macro(ucs2Slice) \ - macro(utf16leSlice) \ - macro(latin1Slice) \ - macro(asciiSlice) \ - macro(base64Slice) \ - macro(base64urlSlice) \ - macro(hexSlice) \ - macro(toJSON) \ - macro(slice) \ - macro(parent) \ - macro(offset) \ - macro(inspect) \ +// transformStreamDefaultSinkCloseAlgorithm +#define WEBCORE_BUILTIN_TRANSFORMSTREAMINTERNALS_TRANSFORMSTREAMDEFAULTSINKCLOSEALGORITHM 1 +extern const char* const s_transformStreamInternalsTransformStreamDefaultSinkCloseAlgorithmCode; +extern const int s_transformStreamInternalsTransformStreamDefaultSinkCloseAlgorithmCodeLength; +extern const JSC::ConstructAbility s_transformStreamInternalsTransformStreamDefaultSinkCloseAlgorithmCodeConstructAbility; +extern const JSC::ConstructorKind s_transformStreamInternalsTransformStreamDefaultSinkCloseAlgorithmCodeConstructorKind; +extern const JSC::ImplementationVisibility s_transformStreamInternalsTransformStreamDefaultSinkCloseAlgorithmCodeImplementationVisibility; + +// transformStreamDefaultSourcePullAlgorithm +#define WEBCORE_BUILTIN_TRANSFORMSTREAMINTERNALS_TRANSFORMSTREAMDEFAULTSOURCEPULLALGORITHM 1 +extern const char* const s_transformStreamInternalsTransformStreamDefaultSourcePullAlgorithmCode; +extern const int s_transformStreamInternalsTransformStreamDefaultSourcePullAlgorithmCodeLength; +extern const JSC::ConstructAbility s_transformStreamInternalsTransformStreamDefaultSourcePullAlgorithmCodeConstructAbility; +extern const JSC::ConstructorKind s_transformStreamInternalsTransformStreamDefaultSourcePullAlgorithmCodeConstructorKind; +extern const JSC::ImplementationVisibility s_transformStreamInternalsTransformStreamDefaultSourcePullAlgorithmCodeImplementationVisibility; + +#define WEBCORE_FOREACH_TRANSFORMSTREAMINTERNALS_BUILTIN_DATA(macro) \ + macro(isTransformStream, transformStreamInternalsIsTransformStream, 1) \ + macro(isTransformStreamDefaultController, transformStreamInternalsIsTransformStreamDefaultController, 1) \ + macro(createTransformStream, transformStreamInternalsCreateTransformStream, 8) \ + macro(initializeTransformStream, transformStreamInternalsInitializeTransformStream, 7) \ + macro(transformStreamError, transformStreamInternalsTransformStreamError, 2) \ + macro(transformStreamErrorWritableAndUnblockWrite, transformStreamInternalsTransformStreamErrorWritableAndUnblockWrite, 2) \ + macro(transformStreamSetBackpressure, transformStreamInternalsTransformStreamSetBackpressure, 2) \ + macro(setUpTransformStreamDefaultController, transformStreamInternalsSetUpTransformStreamDefaultController, 4) \ + macro(setUpTransformStreamDefaultControllerFromTransformer, transformStreamInternalsSetUpTransformStreamDefaultControllerFromTransformer, 3) \ + macro(transformStreamDefaultControllerClearAlgorithms, transformStreamInternalsTransformStreamDefaultControllerClearAlgorithms, 1) \ + macro(transformStreamDefaultControllerEnqueue, transformStreamInternalsTransformStreamDefaultControllerEnqueue, 2) \ + macro(transformStreamDefaultControllerError, transformStreamInternalsTransformStreamDefaultControllerError, 2) \ + macro(transformStreamDefaultControllerPerformTransform, transformStreamInternalsTransformStreamDefaultControllerPerformTransform, 2) \ + macro(transformStreamDefaultControllerTerminate, transformStreamInternalsTransformStreamDefaultControllerTerminate, 1) \ + macro(transformStreamDefaultSinkWriteAlgorithm, transformStreamInternalsTransformStreamDefaultSinkWriteAlgorithm, 2) \ + macro(transformStreamDefaultSinkAbortAlgorithm, transformStreamInternalsTransformStreamDefaultSinkAbortAlgorithm, 2) \ + macro(transformStreamDefaultSinkCloseAlgorithm, transformStreamInternalsTransformStreamDefaultSinkCloseAlgorithm, 1) \ + macro(transformStreamDefaultSourcePullAlgorithm, transformStreamInternalsTransformStreamDefaultSourcePullAlgorithm, 1) \ + +#define WEBCORE_FOREACH_TRANSFORMSTREAMINTERNALS_BUILTIN_CODE(macro) \ + macro(transformStreamInternalsIsTransformStreamCode, isTransformStream, ASCIILiteral(), s_transformStreamInternalsIsTransformStreamCodeLength) \ + macro(transformStreamInternalsIsTransformStreamDefaultControllerCode, isTransformStreamDefaultController, ASCIILiteral(), s_transformStreamInternalsIsTransformStreamDefaultControllerCodeLength) \ + macro(transformStreamInternalsCreateTransformStreamCode, createTransformStream, ASCIILiteral(), s_transformStreamInternalsCreateTransformStreamCodeLength) \ + macro(transformStreamInternalsInitializeTransformStreamCode, initializeTransformStream, ASCIILiteral(), s_transformStreamInternalsInitializeTransformStreamCodeLength) \ + macro(transformStreamInternalsTransformStreamErrorCode, transformStreamError, ASCIILiteral(), s_transformStreamInternalsTransformStreamErrorCodeLength) \ + macro(transformStreamInternalsTransformStreamErrorWritableAndUnblockWriteCode, transformStreamErrorWritableAndUnblockWrite, ASCIILiteral(), s_transformStreamInternalsTransformStreamErrorWritableAndUnblockWriteCodeLength) \ + macro(transformStreamInternalsTransformStreamSetBackpressureCode, transformStreamSetBackpressure, ASCIILiteral(), s_transformStreamInternalsTransformStreamSetBackpressureCodeLength) \ + macro(transformStreamInternalsSetUpTransformStreamDefaultControllerCode, setUpTransformStreamDefaultController, ASCIILiteral(), s_transformStreamInternalsSetUpTransformStreamDefaultControllerCodeLength) \ + macro(transformStreamInternalsSetUpTransformStreamDefaultControllerFromTransformerCode, setUpTransformStreamDefaultControllerFromTransformer, ASCIILiteral(), s_transformStreamInternalsSetUpTransformStreamDefaultControllerFromTransformerCodeLength) \ + macro(transformStreamInternalsTransformStreamDefaultControllerClearAlgorithmsCode, transformStreamDefaultControllerClearAlgorithms, ASCIILiteral(), s_transformStreamInternalsTransformStreamDefaultControllerClearAlgorithmsCodeLength) \ + macro(transformStreamInternalsTransformStreamDefaultControllerEnqueueCode, transformStreamDefaultControllerEnqueue, ASCIILiteral(), s_transformStreamInternalsTransformStreamDefaultControllerEnqueueCodeLength) \ + macro(transformStreamInternalsTransformStreamDefaultControllerErrorCode, transformStreamDefaultControllerError, ASCIILiteral(), s_transformStreamInternalsTransformStreamDefaultControllerErrorCodeLength) \ + macro(transformStreamInternalsTransformStreamDefaultControllerPerformTransformCode, transformStreamDefaultControllerPerformTransform, ASCIILiteral(), s_transformStreamInternalsTransformStreamDefaultControllerPerformTransformCodeLength) \ + macro(transformStreamInternalsTransformStreamDefaultControllerTerminateCode, transformStreamDefaultControllerTerminate, ASCIILiteral(), s_transformStreamInternalsTransformStreamDefaultControllerTerminateCodeLength) \ + macro(transformStreamInternalsTransformStreamDefaultSinkWriteAlgorithmCode, transformStreamDefaultSinkWriteAlgorithm, ASCIILiteral(), s_transformStreamInternalsTransformStreamDefaultSinkWriteAlgorithmCodeLength) \ + macro(transformStreamInternalsTransformStreamDefaultSinkAbortAlgorithmCode, transformStreamDefaultSinkAbortAlgorithm, ASCIILiteral(), s_transformStreamInternalsTransformStreamDefaultSinkAbortAlgorithmCodeLength) \ + macro(transformStreamInternalsTransformStreamDefaultSinkCloseAlgorithmCode, transformStreamDefaultSinkCloseAlgorithm, ASCIILiteral(), s_transformStreamInternalsTransformStreamDefaultSinkCloseAlgorithmCodeLength) \ + macro(transformStreamInternalsTransformStreamDefaultSourcePullAlgorithmCode, transformStreamDefaultSourcePullAlgorithm, ASCIILiteral(), s_transformStreamInternalsTransformStreamDefaultSourcePullAlgorithmCodeLength) \ + +#define WEBCORE_FOREACH_TRANSFORMSTREAMINTERNALS_BUILTIN_FUNCTION_NAME(macro) \ + macro(isTransformStream) \ + macro(isTransformStreamDefaultController) \ + macro(createTransformStream) \ + macro(initializeTransformStream) \ + macro(transformStreamError) \ + macro(transformStreamErrorWritableAndUnblockWrite) \ + macro(transformStreamSetBackpressure) \ + macro(setUpTransformStreamDefaultController) \ + macro(setUpTransformStreamDefaultControllerFromTransformer) \ + macro(transformStreamDefaultControllerClearAlgorithms) \ + macro(transformStreamDefaultControllerEnqueue) \ + macro(transformStreamDefaultControllerError) \ + macro(transformStreamDefaultControllerPerformTransform) \ + macro(transformStreamDefaultControllerTerminate) \ + macro(transformStreamDefaultSinkWriteAlgorithm) \ + macro(transformStreamDefaultSinkAbortAlgorithm) \ + macro(transformStreamDefaultSinkCloseAlgorithm) \ + macro(transformStreamDefaultSourcePullAlgorithm) \ #define DECLARE_BUILTIN_GENERATOR(codeName, functionName, overriddenName, argumentCount) \ JSC::FunctionExecutable* codeName##Generator(JSC::VM&); -WEBCORE_FOREACH_JSBUFFERPROTOTYPE_BUILTIN_CODE(DECLARE_BUILTIN_GENERATOR) +WEBCORE_FOREACH_TRANSFORMSTREAMINTERNALS_BUILTIN_CODE(DECLARE_BUILTIN_GENERATOR) #undef DECLARE_BUILTIN_GENERATOR -class JSBufferPrototypeBuiltinsWrapper : private JSC::WeakHandleOwner { +class TransformStreamInternalsBuiltinsWrapper : private JSC::WeakHandleOwner { public: - explicit JSBufferPrototypeBuiltinsWrapper(JSC::VM& vm) + explicit TransformStreamInternalsBuiltinsWrapper(JSC::VM& vm) : m_vm(vm) - WEBCORE_FOREACH_JSBUFFERPROTOTYPE_BUILTIN_FUNCTION_NAME(INITIALIZE_BUILTIN_NAMES) + WEBCORE_FOREACH_TRANSFORMSTREAMINTERNALS_BUILTIN_FUNCTION_NAME(INITIALIZE_BUILTIN_NAMES) #define INITIALIZE_BUILTIN_SOURCE_MEMBERS(name, functionName, overriddenName, length) , m_##name##Source(JSC::makeSource(StringImpl::createWithoutCopying(s_##name, length), { }, JSC::SourceTaintedOrigin::Untainted)) - WEBCORE_FOREACH_JSBUFFERPROTOTYPE_BUILTIN_CODE(INITIALIZE_BUILTIN_SOURCE_MEMBERS) + WEBCORE_FOREACH_TRANSFORMSTREAMINTERNALS_BUILTIN_CODE(INITIALIZE_BUILTIN_SOURCE_MEMBERS) #undef INITIALIZE_BUILTIN_SOURCE_MEMBERS { } @@ -2218,28 +2585,28 @@ public: #define EXPOSE_BUILTIN_EXECUTABLES(name, functionName, overriddenName, length) \ JSC::UnlinkedFunctionExecutable* name##Executable(); \ const JSC::SourceCode& name##Source() const { return m_##name##Source; } - WEBCORE_FOREACH_JSBUFFERPROTOTYPE_BUILTIN_CODE(EXPOSE_BUILTIN_EXECUTABLES) + WEBCORE_FOREACH_TRANSFORMSTREAMINTERNALS_BUILTIN_CODE(EXPOSE_BUILTIN_EXECUTABLES) #undef EXPOSE_BUILTIN_EXECUTABLES - WEBCORE_FOREACH_JSBUFFERPROTOTYPE_BUILTIN_FUNCTION_NAME(DECLARE_BUILTIN_IDENTIFIER_ACCESSOR) + WEBCORE_FOREACH_TRANSFORMSTREAMINTERNALS_BUILTIN_FUNCTION_NAME(DECLARE_BUILTIN_IDENTIFIER_ACCESSOR) void exportNames(); private: JSC::VM& m_vm; - WEBCORE_FOREACH_JSBUFFERPROTOTYPE_BUILTIN_FUNCTION_NAME(DECLARE_BUILTIN_NAMES) + WEBCORE_FOREACH_TRANSFORMSTREAMINTERNALS_BUILTIN_FUNCTION_NAME(DECLARE_BUILTIN_NAMES) #define DECLARE_BUILTIN_SOURCE_MEMBERS(name, functionName, overriddenName, length) \ JSC::SourceCode m_##name##Source;\ JSC::Weak m_##name##Executable; - WEBCORE_FOREACH_JSBUFFERPROTOTYPE_BUILTIN_CODE(DECLARE_BUILTIN_SOURCE_MEMBERS) + WEBCORE_FOREACH_TRANSFORMSTREAMINTERNALS_BUILTIN_CODE(DECLARE_BUILTIN_SOURCE_MEMBERS) #undef DECLARE_BUILTIN_SOURCE_MEMBERS }; #define DEFINE_BUILTIN_EXECUTABLES(name, functionName, overriddenName, length) \ -inline JSC::UnlinkedFunctionExecutable* JSBufferPrototypeBuiltinsWrapper::name##Executable() \ +inline JSC::UnlinkedFunctionExecutable* TransformStreamInternalsBuiltinsWrapper::name##Executable() \ {\ if (!m_##name##Executable) {\ JSC::Identifier executableName = functionName##PublicName();\ @@ -2249,190 +2616,80 @@ inline JSC::UnlinkedFunctionExecutable* JSBufferPrototypeBuiltinsWrapper::name## }\ return m_##name##Executable.get();\ } -WEBCORE_FOREACH_JSBUFFERPROTOTYPE_BUILTIN_CODE(DEFINE_BUILTIN_EXECUTABLES) +WEBCORE_FOREACH_TRANSFORMSTREAMINTERNALS_BUILTIN_CODE(DEFINE_BUILTIN_EXECUTABLES) #undef DEFINE_BUILTIN_EXECUTABLES -inline void JSBufferPrototypeBuiltinsWrapper::exportNames() +inline void TransformStreamInternalsBuiltinsWrapper::exportNames() { #define EXPORT_FUNCTION_NAME(name) m_vm.propertyNames->appendExternalName(name##PublicName(), name##PrivateName()); - WEBCORE_FOREACH_JSBUFFERPROTOTYPE_BUILTIN_FUNCTION_NAME(EXPORT_FUNCTION_NAME) + WEBCORE_FOREACH_TRANSFORMSTREAMINTERNALS_BUILTIN_FUNCTION_NAME(EXPORT_FUNCTION_NAME) #undef EXPORT_FUNCTION_NAME } -/* ReadableByteStreamController.ts */ -// initializeReadableByteStreamController -#define WEBCORE_BUILTIN_READABLEBYTESTREAMCONTROLLER_INITIALIZEREADABLEBYTESTREAMCONTROLLER 1 -extern const char* const s_readableByteStreamControllerInitializeReadableByteStreamControllerCode; -extern const int s_readableByteStreamControllerInitializeReadableByteStreamControllerCodeLength; -extern const JSC::ConstructAbility s_readableByteStreamControllerInitializeReadableByteStreamControllerCodeConstructAbility; -extern const JSC::ConstructorKind s_readableByteStreamControllerInitializeReadableByteStreamControllerCodeConstructorKind; -extern const JSC::ImplementationVisibility s_readableByteStreamControllerInitializeReadableByteStreamControllerCodeImplementationVisibility; - -// enqueue -#define WEBCORE_BUILTIN_READABLEBYTESTREAMCONTROLLER_ENQUEUE 1 -extern const char* const s_readableByteStreamControllerEnqueueCode; -extern const int s_readableByteStreamControllerEnqueueCodeLength; -extern const JSC::ConstructAbility s_readableByteStreamControllerEnqueueCodeConstructAbility; -extern const JSC::ConstructorKind s_readableByteStreamControllerEnqueueCodeConstructorKind; -extern const JSC::ImplementationVisibility s_readableByteStreamControllerEnqueueCodeImplementationVisibility; - -// error -#define WEBCORE_BUILTIN_READABLEBYTESTREAMCONTROLLER_ERROR 1 -extern const char* const s_readableByteStreamControllerErrorCode; -extern const int s_readableByteStreamControllerErrorCodeLength; -extern const JSC::ConstructAbility s_readableByteStreamControllerErrorCodeConstructAbility; -extern const JSC::ConstructorKind s_readableByteStreamControllerErrorCodeConstructorKind; -extern const JSC::ImplementationVisibility s_readableByteStreamControllerErrorCodeImplementationVisibility; - -// close -#define WEBCORE_BUILTIN_READABLEBYTESTREAMCONTROLLER_CLOSE 1 -extern const char* const s_readableByteStreamControllerCloseCode; -extern const int s_readableByteStreamControllerCloseCodeLength; -extern const JSC::ConstructAbility s_readableByteStreamControllerCloseCodeConstructAbility; -extern const JSC::ConstructorKind s_readableByteStreamControllerCloseCodeConstructorKind; -extern const JSC::ImplementationVisibility s_readableByteStreamControllerCloseCodeImplementationVisibility; - -// byobRequest -#define WEBCORE_BUILTIN_READABLEBYTESTREAMCONTROLLER_BYOBREQUEST 1 -extern const char* const s_readableByteStreamControllerByobRequestCode; -extern const int s_readableByteStreamControllerByobRequestCodeLength; -extern const JSC::ConstructAbility s_readableByteStreamControllerByobRequestCodeConstructAbility; -extern const JSC::ConstructorKind s_readableByteStreamControllerByobRequestCodeConstructorKind; -extern const JSC::ImplementationVisibility s_readableByteStreamControllerByobRequestCodeImplementationVisibility; - -// desiredSize -#define WEBCORE_BUILTIN_READABLEBYTESTREAMCONTROLLER_DESIREDSIZE 1 -extern const char* const s_readableByteStreamControllerDesiredSizeCode; -extern const int s_readableByteStreamControllerDesiredSizeCodeLength; -extern const JSC::ConstructAbility s_readableByteStreamControllerDesiredSizeCodeConstructAbility; -extern const JSC::ConstructorKind s_readableByteStreamControllerDesiredSizeCodeConstructorKind; -extern const JSC::ImplementationVisibility s_readableByteStreamControllerDesiredSizeCodeImplementationVisibility; - -#define WEBCORE_FOREACH_READABLEBYTESTREAMCONTROLLER_BUILTIN_DATA(macro) \ - macro(initializeReadableByteStreamController, readableByteStreamControllerInitializeReadableByteStreamController, 3) \ - macro(enqueue, readableByteStreamControllerEnqueue, 1) \ - macro(error, readableByteStreamControllerError, 1) \ - macro(close, readableByteStreamControllerClose, 0) \ - macro(byobRequest, readableByteStreamControllerByobRequest, 0) \ - macro(desiredSize, readableByteStreamControllerDesiredSize, 0) \ - -#define WEBCORE_FOREACH_READABLEBYTESTREAMCONTROLLER_BUILTIN_CODE(macro) \ - macro(readableByteStreamControllerInitializeReadableByteStreamControllerCode, initializeReadableByteStreamController, ASCIILiteral(), s_readableByteStreamControllerInitializeReadableByteStreamControllerCodeLength) \ - macro(readableByteStreamControllerEnqueueCode, enqueue, ASCIILiteral(), s_readableByteStreamControllerEnqueueCodeLength) \ - macro(readableByteStreamControllerErrorCode, error, ASCIILiteral(), s_readableByteStreamControllerErrorCodeLength) \ - macro(readableByteStreamControllerCloseCode, close, ASCIILiteral(), s_readableByteStreamControllerCloseCodeLength) \ - macro(readableByteStreamControllerByobRequestCode, byobRequest, "get byobRequest"_s, s_readableByteStreamControllerByobRequestCodeLength) \ - macro(readableByteStreamControllerDesiredSizeCode, desiredSize, "get desiredSize"_s, s_readableByteStreamControllerDesiredSizeCodeLength) \ - -#define WEBCORE_FOREACH_READABLEBYTESTREAMCONTROLLER_BUILTIN_FUNCTION_NAME(macro) \ - macro(initializeReadableByteStreamController) \ - macro(enqueue) \ - macro(error) \ - macro(close) \ - macro(byobRequest) \ - macro(desiredSize) \ - -#define DECLARE_BUILTIN_GENERATOR(codeName, functionName, overriddenName, argumentCount) \ - JSC::FunctionExecutable* codeName##Generator(JSC::VM&); - -WEBCORE_FOREACH_READABLEBYTESTREAMCONTROLLER_BUILTIN_CODE(DECLARE_BUILTIN_GENERATOR) -#undef DECLARE_BUILTIN_GENERATOR - -class ReadableByteStreamControllerBuiltinsWrapper : private JSC::WeakHandleOwner { +class TransformStreamInternalsBuiltinFunctions { public: - explicit ReadableByteStreamControllerBuiltinsWrapper(JSC::VM& vm) - : m_vm(vm) - WEBCORE_FOREACH_READABLEBYTESTREAMCONTROLLER_BUILTIN_FUNCTION_NAME(INITIALIZE_BUILTIN_NAMES) -#define INITIALIZE_BUILTIN_SOURCE_MEMBERS(name, functionName, overriddenName, length) , m_##name##Source(JSC::makeSource(StringImpl::createWithoutCopying(s_##name, length), { }, JSC::SourceTaintedOrigin::Untainted)) - WEBCORE_FOREACH_READABLEBYTESTREAMCONTROLLER_BUILTIN_CODE(INITIALIZE_BUILTIN_SOURCE_MEMBERS) -#undef INITIALIZE_BUILTIN_SOURCE_MEMBERS - { - } - -#define EXPOSE_BUILTIN_EXECUTABLES(name, functionName, overriddenName, length) \ - JSC::UnlinkedFunctionExecutable* name##Executable(); \ - const JSC::SourceCode& name##Source() const { return m_##name##Source; } - WEBCORE_FOREACH_READABLEBYTESTREAMCONTROLLER_BUILTIN_CODE(EXPOSE_BUILTIN_EXECUTABLES) -#undef EXPOSE_BUILTIN_EXECUTABLES - - WEBCORE_FOREACH_READABLEBYTESTREAMCONTROLLER_BUILTIN_FUNCTION_NAME(DECLARE_BUILTIN_IDENTIFIER_ACCESSOR) + explicit TransformStreamInternalsBuiltinFunctions(JSC::VM& vm) : m_vm(vm) { } - void exportNames(); + void init(JSC::JSGlobalObject&); + template void visit(Visitor&); -private: +public: JSC::VM& m_vm; - WEBCORE_FOREACH_READABLEBYTESTREAMCONTROLLER_BUILTIN_FUNCTION_NAME(DECLARE_BUILTIN_NAMES) - -#define DECLARE_BUILTIN_SOURCE_MEMBERS(name, functionName, overriddenName, length) \ - JSC::SourceCode m_##name##Source;\ - JSC::Weak m_##name##Executable; - WEBCORE_FOREACH_READABLEBYTESTREAMCONTROLLER_BUILTIN_CODE(DECLARE_BUILTIN_SOURCE_MEMBERS) +#define DECLARE_BUILTIN_SOURCE_MEMBERS(functionName) \ + JSC::WriteBarrier m_##functionName##Function; + WEBCORE_FOREACH_TRANSFORMSTREAMINTERNALS_BUILTIN_FUNCTION_NAME(DECLARE_BUILTIN_SOURCE_MEMBERS) #undef DECLARE_BUILTIN_SOURCE_MEMBERS - }; -#define DEFINE_BUILTIN_EXECUTABLES(name, functionName, overriddenName, length) \ -inline JSC::UnlinkedFunctionExecutable* ReadableByteStreamControllerBuiltinsWrapper::name##Executable() \ -{\ - if (!m_##name##Executable) {\ - JSC::Identifier executableName = functionName##PublicName();\ - if (overriddenName)\ - executableName = JSC::Identifier::fromString(m_vm, overriddenName);\ - m_##name##Executable = JSC::Weak(JSC::createBuiltinExecutable(m_vm, m_##name##Source, executableName, s_##name##ImplementationVisibility, s_##name##ConstructorKind, s_##name##ConstructAbility), this, &m_##name##Executable);\ - }\ - return m_##name##Executable.get();\ +inline void TransformStreamInternalsBuiltinFunctions::init(JSC::JSGlobalObject& globalObject) +{ +#define EXPORT_FUNCTION(codeName, functionName, overriddenName, length) \ + m_##functionName##Function.set(m_vm, &globalObject, JSC::JSFunction::create(m_vm, codeName##Generator(m_vm), &globalObject)); + WEBCORE_FOREACH_TRANSFORMSTREAMINTERNALS_BUILTIN_CODE(EXPORT_FUNCTION) +#undef EXPORT_FUNCTION } -WEBCORE_FOREACH_READABLEBYTESTREAMCONTROLLER_BUILTIN_CODE(DEFINE_BUILTIN_EXECUTABLES) -#undef DEFINE_BUILTIN_EXECUTABLES -inline void ReadableByteStreamControllerBuiltinsWrapper::exportNames() +template +inline void TransformStreamInternalsBuiltinFunctions::visit(Visitor& visitor) { -#define EXPORT_FUNCTION_NAME(name) m_vm.propertyNames->appendExternalName(name##PublicName(), name##PrivateName()); - WEBCORE_FOREACH_READABLEBYTESTREAMCONTROLLER_BUILTIN_FUNCTION_NAME(EXPORT_FUNCTION_NAME) -#undef EXPORT_FUNCTION_NAME +#define VISIT_FUNCTION(name) visitor.append(m_##name##Function); + WEBCORE_FOREACH_TRANSFORMSTREAMINTERNALS_BUILTIN_FUNCTION_NAME(VISIT_FUNCTION) +#undef VISIT_FUNCTION } -/* UtilInspect.ts */ -// getStylizeWithColor -#define WEBCORE_BUILTIN_UTILINSPECT_GETSTYLIZEWITHCOLOR 1 -extern const char* const s_utilInspectGetStylizeWithColorCode; -extern const int s_utilInspectGetStylizeWithColorCodeLength; -extern const JSC::ConstructAbility s_utilInspectGetStylizeWithColorCodeConstructAbility; -extern const JSC::ConstructorKind s_utilInspectGetStylizeWithColorCodeConstructorKind; -extern const JSC::ImplementationVisibility s_utilInspectGetStylizeWithColorCodeImplementationVisibility; -// stylizeWithNoColor -#define WEBCORE_BUILTIN_UTILINSPECT_STYLIZEWITHNOCOLOR 1 -extern const char* const s_utilInspectStylizeWithNoColorCode; -extern const int s_utilInspectStylizeWithNoColorCodeLength; -extern const JSC::ConstructAbility s_utilInspectStylizeWithNoColorCodeConstructAbility; -extern const JSC::ConstructorKind s_utilInspectStylizeWithNoColorCodeConstructorKind; -extern const JSC::ImplementationVisibility s_utilInspectStylizeWithNoColorCodeImplementationVisibility; +template void TransformStreamInternalsBuiltinFunctions::visit(JSC::AbstractSlotVisitor&); +template void TransformStreamInternalsBuiltinFunctions::visit(JSC::SlotVisitor&); + /* EventSource.ts */ +// getEventSource +#define WEBCORE_BUILTIN_EVENTSOURCE_GETEVENTSOURCE 1 +extern const char* const s_eventSourceGetEventSourceCode; +extern const int s_eventSourceGetEventSourceCodeLength; +extern const JSC::ConstructAbility s_eventSourceGetEventSourceCodeConstructAbility; +extern const JSC::ConstructorKind s_eventSourceGetEventSourceCodeConstructorKind; +extern const JSC::ImplementationVisibility s_eventSourceGetEventSourceCodeImplementationVisibility; -#define WEBCORE_FOREACH_UTILINSPECT_BUILTIN_DATA(macro) \ - macro(getStylizeWithColor, utilInspectGetStylizeWithColor, 1) \ - macro(stylizeWithNoColor, utilInspectStylizeWithNoColor, 1) \ +#define WEBCORE_FOREACH_EVENTSOURCE_BUILTIN_DATA(macro) \ + macro(getEventSource, eventSourceGetEventSource, 0) \ -#define WEBCORE_FOREACH_UTILINSPECT_BUILTIN_CODE(macro) \ - macro(utilInspectGetStylizeWithColorCode, getStylizeWithColor, ASCIILiteral(), s_utilInspectGetStylizeWithColorCodeLength) \ - macro(utilInspectStylizeWithNoColorCode, stylizeWithNoColor, ASCIILiteral(), s_utilInspectStylizeWithNoColorCodeLength) \ +#define WEBCORE_FOREACH_EVENTSOURCE_BUILTIN_CODE(macro) \ + macro(eventSourceGetEventSourceCode, getEventSource, ASCIILiteral(), s_eventSourceGetEventSourceCodeLength) \ -#define WEBCORE_FOREACH_UTILINSPECT_BUILTIN_FUNCTION_NAME(macro) \ - macro(getStylizeWithColor) \ - macro(stylizeWithNoColor) \ +#define WEBCORE_FOREACH_EVENTSOURCE_BUILTIN_FUNCTION_NAME(macro) \ + macro(getEventSource) \ #define DECLARE_BUILTIN_GENERATOR(codeName, functionName, overriddenName, argumentCount) \ JSC::FunctionExecutable* codeName##Generator(JSC::VM&); -WEBCORE_FOREACH_UTILINSPECT_BUILTIN_CODE(DECLARE_BUILTIN_GENERATOR) +WEBCORE_FOREACH_EVENTSOURCE_BUILTIN_CODE(DECLARE_BUILTIN_GENERATOR) #undef DECLARE_BUILTIN_GENERATOR -class UtilInspectBuiltinsWrapper : private JSC::WeakHandleOwner { +class EventSourceBuiltinsWrapper : private JSC::WeakHandleOwner { public: - explicit UtilInspectBuiltinsWrapper(JSC::VM& vm) + explicit EventSourceBuiltinsWrapper(JSC::VM& vm) : m_vm(vm) - WEBCORE_FOREACH_UTILINSPECT_BUILTIN_FUNCTION_NAME(INITIALIZE_BUILTIN_NAMES) + WEBCORE_FOREACH_EVENTSOURCE_BUILTIN_FUNCTION_NAME(INITIALIZE_BUILTIN_NAMES) #define INITIALIZE_BUILTIN_SOURCE_MEMBERS(name, functionName, overriddenName, length) , m_##name##Source(JSC::makeSource(StringImpl::createWithoutCopying(s_##name, length), { }, JSC::SourceTaintedOrigin::Untainted)) - WEBCORE_FOREACH_UTILINSPECT_BUILTIN_CODE(INITIALIZE_BUILTIN_SOURCE_MEMBERS) + WEBCORE_FOREACH_EVENTSOURCE_BUILTIN_CODE(INITIALIZE_BUILTIN_SOURCE_MEMBERS) #undef INITIALIZE_BUILTIN_SOURCE_MEMBERS { } @@ -2440,28 +2697,28 @@ public: #define EXPOSE_BUILTIN_EXECUTABLES(name, functionName, overriddenName, length) \ JSC::UnlinkedFunctionExecutable* name##Executable(); \ const JSC::SourceCode& name##Source() const { return m_##name##Source; } - WEBCORE_FOREACH_UTILINSPECT_BUILTIN_CODE(EXPOSE_BUILTIN_EXECUTABLES) + WEBCORE_FOREACH_EVENTSOURCE_BUILTIN_CODE(EXPOSE_BUILTIN_EXECUTABLES) #undef EXPOSE_BUILTIN_EXECUTABLES - WEBCORE_FOREACH_UTILINSPECT_BUILTIN_FUNCTION_NAME(DECLARE_BUILTIN_IDENTIFIER_ACCESSOR) + WEBCORE_FOREACH_EVENTSOURCE_BUILTIN_FUNCTION_NAME(DECLARE_BUILTIN_IDENTIFIER_ACCESSOR) void exportNames(); private: JSC::VM& m_vm; - WEBCORE_FOREACH_UTILINSPECT_BUILTIN_FUNCTION_NAME(DECLARE_BUILTIN_NAMES) + WEBCORE_FOREACH_EVENTSOURCE_BUILTIN_FUNCTION_NAME(DECLARE_BUILTIN_NAMES) #define DECLARE_BUILTIN_SOURCE_MEMBERS(name, functionName, overriddenName, length) \ JSC::SourceCode m_##name##Source;\ JSC::Weak m_##name##Executable; - WEBCORE_FOREACH_UTILINSPECT_BUILTIN_CODE(DECLARE_BUILTIN_SOURCE_MEMBERS) + WEBCORE_FOREACH_EVENTSOURCE_BUILTIN_CODE(DECLARE_BUILTIN_SOURCE_MEMBERS) #undef DECLARE_BUILTIN_SOURCE_MEMBERS }; #define DEFINE_BUILTIN_EXECUTABLES(name, functionName, overriddenName, length) \ -inline JSC::UnlinkedFunctionExecutable* UtilInspectBuiltinsWrapper::name##Executable() \ +inline JSC::UnlinkedFunctionExecutable* EventSourceBuiltinsWrapper::name##Executable() \ {\ if (!m_##name##Executable) {\ JSC::Identifier executableName = functionName##PublicName();\ @@ -2471,13 +2728,13 @@ inline JSC::UnlinkedFunctionExecutable* UtilInspectBuiltinsWrapper::name##Execut }\ return m_##name##Executable.get();\ } -WEBCORE_FOREACH_UTILINSPECT_BUILTIN_CODE(DEFINE_BUILTIN_EXECUTABLES) +WEBCORE_FOREACH_EVENTSOURCE_BUILTIN_CODE(DEFINE_BUILTIN_EXECUTABLES) #undef DEFINE_BUILTIN_EXECUTABLES -inline void UtilInspectBuiltinsWrapper::exportNames() +inline void EventSourceBuiltinsWrapper::exportNames() { #define EXPORT_FUNCTION_NAME(name) m_vm.propertyNames->appendExternalName(name##PublicName(), name##PrivateName()); - WEBCORE_FOREACH_UTILINSPECT_BUILTIN_FUNCTION_NAME(EXPORT_FUNCTION_NAME) + WEBCORE_FOREACH_EVENTSOURCE_BUILTIN_FUNCTION_NAME(EXPORT_FUNCTION_NAME) #undef EXPORT_FUNCTION_NAME } /* ConsoleObject.ts */ @@ -2527,1150 +2784,1005 @@ WEBCORE_FOREACH_CONSOLEOBJECT_BUILTIN_CODE(DECLARE_BUILTIN_GENERATOR) #undef DECLARE_BUILTIN_GENERATOR class ConsoleObjectBuiltinsWrapper : private JSC::WeakHandleOwner { -public: - explicit ConsoleObjectBuiltinsWrapper(JSC::VM& vm) - : m_vm(vm) - WEBCORE_FOREACH_CONSOLEOBJECT_BUILTIN_FUNCTION_NAME(INITIALIZE_BUILTIN_NAMES) -#define INITIALIZE_BUILTIN_SOURCE_MEMBERS(name, functionName, overriddenName, length) , m_##name##Source(JSC::makeSource(StringImpl::createWithoutCopying(s_##name, length), { }, JSC::SourceTaintedOrigin::Untainted)) - WEBCORE_FOREACH_CONSOLEOBJECT_BUILTIN_CODE(INITIALIZE_BUILTIN_SOURCE_MEMBERS) -#undef INITIALIZE_BUILTIN_SOURCE_MEMBERS - { - } - -#define EXPOSE_BUILTIN_EXECUTABLES(name, functionName, overriddenName, length) \ - JSC::UnlinkedFunctionExecutable* name##Executable(); \ - const JSC::SourceCode& name##Source() const { return m_##name##Source; } - WEBCORE_FOREACH_CONSOLEOBJECT_BUILTIN_CODE(EXPOSE_BUILTIN_EXECUTABLES) -#undef EXPOSE_BUILTIN_EXECUTABLES - - WEBCORE_FOREACH_CONSOLEOBJECT_BUILTIN_FUNCTION_NAME(DECLARE_BUILTIN_IDENTIFIER_ACCESSOR) - - void exportNames(); - -private: - JSC::VM& m_vm; - - WEBCORE_FOREACH_CONSOLEOBJECT_BUILTIN_FUNCTION_NAME(DECLARE_BUILTIN_NAMES) - -#define DECLARE_BUILTIN_SOURCE_MEMBERS(name, functionName, overriddenName, length) \ - JSC::SourceCode m_##name##Source;\ - JSC::Weak m_##name##Executable; - WEBCORE_FOREACH_CONSOLEOBJECT_BUILTIN_CODE(DECLARE_BUILTIN_SOURCE_MEMBERS) -#undef DECLARE_BUILTIN_SOURCE_MEMBERS - -}; - -#define DEFINE_BUILTIN_EXECUTABLES(name, functionName, overriddenName, length) \ -inline JSC::UnlinkedFunctionExecutable* ConsoleObjectBuiltinsWrapper::name##Executable() \ -{\ - if (!m_##name##Executable) {\ - JSC::Identifier executableName = functionName##PublicName();\ - if (overriddenName)\ - executableName = JSC::Identifier::fromString(m_vm, overriddenName);\ - m_##name##Executable = JSC::Weak(JSC::createBuiltinExecutable(m_vm, m_##name##Source, executableName, s_##name##ImplementationVisibility, s_##name##ConstructorKind, s_##name##ConstructAbility), this, &m_##name##Executable);\ - }\ - return m_##name##Executable.get();\ -} -WEBCORE_FOREACH_CONSOLEOBJECT_BUILTIN_CODE(DEFINE_BUILTIN_EXECUTABLES) -#undef DEFINE_BUILTIN_EXECUTABLES - -inline void ConsoleObjectBuiltinsWrapper::exportNames() -{ -#define EXPORT_FUNCTION_NAME(name) m_vm.propertyNames->appendExternalName(name##PublicName(), name##PrivateName()); - WEBCORE_FOREACH_CONSOLEOBJECT_BUILTIN_FUNCTION_NAME(EXPORT_FUNCTION_NAME) -#undef EXPORT_FUNCTION_NAME -} -/* ReadableStreamInternals.ts */ -// readableStreamReaderGenericInitialize -#define WEBCORE_BUILTIN_READABLESTREAMINTERNALS_READABLESTREAMREADERGENERICINITIALIZE 1 -extern const char* const s_readableStreamInternalsReadableStreamReaderGenericInitializeCode; -extern const int s_readableStreamInternalsReadableStreamReaderGenericInitializeCodeLength; -extern const JSC::ConstructAbility s_readableStreamInternalsReadableStreamReaderGenericInitializeCodeConstructAbility; -extern const JSC::ConstructorKind s_readableStreamInternalsReadableStreamReaderGenericInitializeCodeConstructorKind; -extern const JSC::ImplementationVisibility s_readableStreamInternalsReadableStreamReaderGenericInitializeCodeImplementationVisibility; - -// privateInitializeReadableStreamDefaultController -#define WEBCORE_BUILTIN_READABLESTREAMINTERNALS_PRIVATEINITIALIZEREADABLESTREAMDEFAULTCONTROLLER 1 -extern const char* const s_readableStreamInternalsPrivateInitializeReadableStreamDefaultControllerCode; -extern const int s_readableStreamInternalsPrivateInitializeReadableStreamDefaultControllerCodeLength; -extern const JSC::ConstructAbility s_readableStreamInternalsPrivateInitializeReadableStreamDefaultControllerCodeConstructAbility; -extern const JSC::ConstructorKind s_readableStreamInternalsPrivateInitializeReadableStreamDefaultControllerCodeConstructorKind; -extern const JSC::ImplementationVisibility s_readableStreamInternalsPrivateInitializeReadableStreamDefaultControllerCodeImplementationVisibility; - -// readableStreamDefaultControllerError -#define WEBCORE_BUILTIN_READABLESTREAMINTERNALS_READABLESTREAMDEFAULTCONTROLLERERROR 1 -extern const char* const s_readableStreamInternalsReadableStreamDefaultControllerErrorCode; -extern const int s_readableStreamInternalsReadableStreamDefaultControllerErrorCodeLength; -extern const JSC::ConstructAbility s_readableStreamInternalsReadableStreamDefaultControllerErrorCodeConstructAbility; -extern const JSC::ConstructorKind s_readableStreamInternalsReadableStreamDefaultControllerErrorCodeConstructorKind; -extern const JSC::ImplementationVisibility s_readableStreamInternalsReadableStreamDefaultControllerErrorCodeImplementationVisibility; - -// readableStreamPipeTo -#define WEBCORE_BUILTIN_READABLESTREAMINTERNALS_READABLESTREAMPIPETO 1 -extern const char* const s_readableStreamInternalsReadableStreamPipeToCode; -extern const int s_readableStreamInternalsReadableStreamPipeToCodeLength; -extern const JSC::ConstructAbility s_readableStreamInternalsReadableStreamPipeToCodeConstructAbility; -extern const JSC::ConstructorKind s_readableStreamInternalsReadableStreamPipeToCodeConstructorKind; -extern const JSC::ImplementationVisibility s_readableStreamInternalsReadableStreamPipeToCodeImplementationVisibility; - -// acquireReadableStreamDefaultReader -#define WEBCORE_BUILTIN_READABLESTREAMINTERNALS_ACQUIREREADABLESTREAMDEFAULTREADER 1 -extern const char* const s_readableStreamInternalsAcquireReadableStreamDefaultReaderCode; -extern const int s_readableStreamInternalsAcquireReadableStreamDefaultReaderCodeLength; -extern const JSC::ConstructAbility s_readableStreamInternalsAcquireReadableStreamDefaultReaderCodeConstructAbility; -extern const JSC::ConstructorKind s_readableStreamInternalsAcquireReadableStreamDefaultReaderCodeConstructorKind; -extern const JSC::ImplementationVisibility s_readableStreamInternalsAcquireReadableStreamDefaultReaderCodeImplementationVisibility; - -// setupReadableStreamDefaultController -#define WEBCORE_BUILTIN_READABLESTREAMINTERNALS_SETUPREADABLESTREAMDEFAULTCONTROLLER 1 -extern const char* const s_readableStreamInternalsSetupReadableStreamDefaultControllerCode; -extern const int s_readableStreamInternalsSetupReadableStreamDefaultControllerCodeLength; -extern const JSC::ConstructAbility s_readableStreamInternalsSetupReadableStreamDefaultControllerCodeConstructAbility; -extern const JSC::ConstructorKind s_readableStreamInternalsSetupReadableStreamDefaultControllerCodeConstructorKind; -extern const JSC::ImplementationVisibility s_readableStreamInternalsSetupReadableStreamDefaultControllerCodeImplementationVisibility; - -// createReadableStreamController -#define WEBCORE_BUILTIN_READABLESTREAMINTERNALS_CREATEREADABLESTREAMCONTROLLER 1 -extern const char* const s_readableStreamInternalsCreateReadableStreamControllerCode; -extern const int s_readableStreamInternalsCreateReadableStreamControllerCodeLength; -extern const JSC::ConstructAbility s_readableStreamInternalsCreateReadableStreamControllerCodeConstructAbility; -extern const JSC::ConstructorKind s_readableStreamInternalsCreateReadableStreamControllerCodeConstructorKind; -extern const JSC::ImplementationVisibility s_readableStreamInternalsCreateReadableStreamControllerCodeImplementationVisibility; - -// readableStreamDefaultControllerStart -#define WEBCORE_BUILTIN_READABLESTREAMINTERNALS_READABLESTREAMDEFAULTCONTROLLERSTART 1 -extern const char* const s_readableStreamInternalsReadableStreamDefaultControllerStartCode; -extern const int s_readableStreamInternalsReadableStreamDefaultControllerStartCodeLength; -extern const JSC::ConstructAbility s_readableStreamInternalsReadableStreamDefaultControllerStartCodeConstructAbility; -extern const JSC::ConstructorKind s_readableStreamInternalsReadableStreamDefaultControllerStartCodeConstructorKind; -extern const JSC::ImplementationVisibility s_readableStreamInternalsReadableStreamDefaultControllerStartCodeImplementationVisibility; - -// readableStreamPipeToWritableStream -#define WEBCORE_BUILTIN_READABLESTREAMINTERNALS_READABLESTREAMPIPETOWRITABLESTREAM 1 -extern const char* const s_readableStreamInternalsReadableStreamPipeToWritableStreamCode; -extern const int s_readableStreamInternalsReadableStreamPipeToWritableStreamCodeLength; -extern const JSC::ConstructAbility s_readableStreamInternalsReadableStreamPipeToWritableStreamCodeConstructAbility; -extern const JSC::ConstructorKind s_readableStreamInternalsReadableStreamPipeToWritableStreamCodeConstructorKind; -extern const JSC::ImplementationVisibility s_readableStreamInternalsReadableStreamPipeToWritableStreamCodeImplementationVisibility; - -// pipeToLoop -#define WEBCORE_BUILTIN_READABLESTREAMINTERNALS_PIPETOLOOP 1 -extern const char* const s_readableStreamInternalsPipeToLoopCode; -extern const int s_readableStreamInternalsPipeToLoopCodeLength; -extern const JSC::ConstructAbility s_readableStreamInternalsPipeToLoopCodeConstructAbility; -extern const JSC::ConstructorKind s_readableStreamInternalsPipeToLoopCodeConstructorKind; -extern const JSC::ImplementationVisibility s_readableStreamInternalsPipeToLoopCodeImplementationVisibility; - -// pipeToDoReadWrite -#define WEBCORE_BUILTIN_READABLESTREAMINTERNALS_PIPETODOREADWRITE 1 -extern const char* const s_readableStreamInternalsPipeToDoReadWriteCode; -extern const int s_readableStreamInternalsPipeToDoReadWriteCodeLength; -extern const JSC::ConstructAbility s_readableStreamInternalsPipeToDoReadWriteCodeConstructAbility; -extern const JSC::ConstructorKind s_readableStreamInternalsPipeToDoReadWriteCodeConstructorKind; -extern const JSC::ImplementationVisibility s_readableStreamInternalsPipeToDoReadWriteCodeImplementationVisibility; - -// pipeToErrorsMustBePropagatedForward -#define WEBCORE_BUILTIN_READABLESTREAMINTERNALS_PIPETOERRORSMUSTBEPROPAGATEDFORWARD 1 -extern const char* const s_readableStreamInternalsPipeToErrorsMustBePropagatedForwardCode; -extern const int s_readableStreamInternalsPipeToErrorsMustBePropagatedForwardCodeLength; -extern const JSC::ConstructAbility s_readableStreamInternalsPipeToErrorsMustBePropagatedForwardCodeConstructAbility; -extern const JSC::ConstructorKind s_readableStreamInternalsPipeToErrorsMustBePropagatedForwardCodeConstructorKind; -extern const JSC::ImplementationVisibility s_readableStreamInternalsPipeToErrorsMustBePropagatedForwardCodeImplementationVisibility; - -// pipeToErrorsMustBePropagatedBackward -#define WEBCORE_BUILTIN_READABLESTREAMINTERNALS_PIPETOERRORSMUSTBEPROPAGATEDBACKWARD 1 -extern const char* const s_readableStreamInternalsPipeToErrorsMustBePropagatedBackwardCode; -extern const int s_readableStreamInternalsPipeToErrorsMustBePropagatedBackwardCodeLength; -extern const JSC::ConstructAbility s_readableStreamInternalsPipeToErrorsMustBePropagatedBackwardCodeConstructAbility; -extern const JSC::ConstructorKind s_readableStreamInternalsPipeToErrorsMustBePropagatedBackwardCodeConstructorKind; -extern const JSC::ImplementationVisibility s_readableStreamInternalsPipeToErrorsMustBePropagatedBackwardCodeImplementationVisibility; - -// pipeToClosingMustBePropagatedForward -#define WEBCORE_BUILTIN_READABLESTREAMINTERNALS_PIPETOCLOSINGMUSTBEPROPAGATEDFORWARD 1 -extern const char* const s_readableStreamInternalsPipeToClosingMustBePropagatedForwardCode; -extern const int s_readableStreamInternalsPipeToClosingMustBePropagatedForwardCodeLength; -extern const JSC::ConstructAbility s_readableStreamInternalsPipeToClosingMustBePropagatedForwardCodeConstructAbility; -extern const JSC::ConstructorKind s_readableStreamInternalsPipeToClosingMustBePropagatedForwardCodeConstructorKind; -extern const JSC::ImplementationVisibility s_readableStreamInternalsPipeToClosingMustBePropagatedForwardCodeImplementationVisibility; - -// pipeToClosingMustBePropagatedBackward -#define WEBCORE_BUILTIN_READABLESTREAMINTERNALS_PIPETOCLOSINGMUSTBEPROPAGATEDBACKWARD 1 -extern const char* const s_readableStreamInternalsPipeToClosingMustBePropagatedBackwardCode; -extern const int s_readableStreamInternalsPipeToClosingMustBePropagatedBackwardCodeLength; -extern const JSC::ConstructAbility s_readableStreamInternalsPipeToClosingMustBePropagatedBackwardCodeConstructAbility; -extern const JSC::ConstructorKind s_readableStreamInternalsPipeToClosingMustBePropagatedBackwardCodeConstructorKind; -extern const JSC::ImplementationVisibility s_readableStreamInternalsPipeToClosingMustBePropagatedBackwardCodeImplementationVisibility; - -// pipeToShutdownWithAction -#define WEBCORE_BUILTIN_READABLESTREAMINTERNALS_PIPETOSHUTDOWNWITHACTION 1 -extern const char* const s_readableStreamInternalsPipeToShutdownWithActionCode; -extern const int s_readableStreamInternalsPipeToShutdownWithActionCodeLength; -extern const JSC::ConstructAbility s_readableStreamInternalsPipeToShutdownWithActionCodeConstructAbility; -extern const JSC::ConstructorKind s_readableStreamInternalsPipeToShutdownWithActionCodeConstructorKind; -extern const JSC::ImplementationVisibility s_readableStreamInternalsPipeToShutdownWithActionCodeImplementationVisibility; - -// pipeToShutdown -#define WEBCORE_BUILTIN_READABLESTREAMINTERNALS_PIPETOSHUTDOWN 1 -extern const char* const s_readableStreamInternalsPipeToShutdownCode; -extern const int s_readableStreamInternalsPipeToShutdownCodeLength; -extern const JSC::ConstructAbility s_readableStreamInternalsPipeToShutdownCodeConstructAbility; -extern const JSC::ConstructorKind s_readableStreamInternalsPipeToShutdownCodeConstructorKind; -extern const JSC::ImplementationVisibility s_readableStreamInternalsPipeToShutdownCodeImplementationVisibility; - -// pipeToFinalize -#define WEBCORE_BUILTIN_READABLESTREAMINTERNALS_PIPETOFINALIZE 1 -extern const char* const s_readableStreamInternalsPipeToFinalizeCode; -extern const int s_readableStreamInternalsPipeToFinalizeCodeLength; -extern const JSC::ConstructAbility s_readableStreamInternalsPipeToFinalizeCodeConstructAbility; -extern const JSC::ConstructorKind s_readableStreamInternalsPipeToFinalizeCodeConstructorKind; -extern const JSC::ImplementationVisibility s_readableStreamInternalsPipeToFinalizeCodeImplementationVisibility; - -// readableStreamTee -#define WEBCORE_BUILTIN_READABLESTREAMINTERNALS_READABLESTREAMTEE 1 -extern const char* const s_readableStreamInternalsReadableStreamTeeCode; -extern const int s_readableStreamInternalsReadableStreamTeeCodeLength; -extern const JSC::ConstructAbility s_readableStreamInternalsReadableStreamTeeCodeConstructAbility; -extern const JSC::ConstructorKind s_readableStreamInternalsReadableStreamTeeCodeConstructorKind; -extern const JSC::ImplementationVisibility s_readableStreamInternalsReadableStreamTeeCodeImplementationVisibility; - -// readableStreamTeePullFunction -#define WEBCORE_BUILTIN_READABLESTREAMINTERNALS_READABLESTREAMTEEPULLFUNCTION 1 -extern const char* const s_readableStreamInternalsReadableStreamTeePullFunctionCode; -extern const int s_readableStreamInternalsReadableStreamTeePullFunctionCodeLength; -extern const JSC::ConstructAbility s_readableStreamInternalsReadableStreamTeePullFunctionCodeConstructAbility; -extern const JSC::ConstructorKind s_readableStreamInternalsReadableStreamTeePullFunctionCodeConstructorKind; -extern const JSC::ImplementationVisibility s_readableStreamInternalsReadableStreamTeePullFunctionCodeImplementationVisibility; +public: + explicit ConsoleObjectBuiltinsWrapper(JSC::VM& vm) + : m_vm(vm) + WEBCORE_FOREACH_CONSOLEOBJECT_BUILTIN_FUNCTION_NAME(INITIALIZE_BUILTIN_NAMES) +#define INITIALIZE_BUILTIN_SOURCE_MEMBERS(name, functionName, overriddenName, length) , m_##name##Source(JSC::makeSource(StringImpl::createWithoutCopying(s_##name, length), { }, JSC::SourceTaintedOrigin::Untainted)) + WEBCORE_FOREACH_CONSOLEOBJECT_BUILTIN_CODE(INITIALIZE_BUILTIN_SOURCE_MEMBERS) +#undef INITIALIZE_BUILTIN_SOURCE_MEMBERS + { + } -// readableStreamTeeBranch1CancelFunction -#define WEBCORE_BUILTIN_READABLESTREAMINTERNALS_READABLESTREAMTEEBRANCH1CANCELFUNCTION 1 -extern const char* const s_readableStreamInternalsReadableStreamTeeBranch1CancelFunctionCode; -extern const int s_readableStreamInternalsReadableStreamTeeBranch1CancelFunctionCodeLength; -extern const JSC::ConstructAbility s_readableStreamInternalsReadableStreamTeeBranch1CancelFunctionCodeConstructAbility; -extern const JSC::ConstructorKind s_readableStreamInternalsReadableStreamTeeBranch1CancelFunctionCodeConstructorKind; -extern const JSC::ImplementationVisibility s_readableStreamInternalsReadableStreamTeeBranch1CancelFunctionCodeImplementationVisibility; +#define EXPOSE_BUILTIN_EXECUTABLES(name, functionName, overriddenName, length) \ + JSC::UnlinkedFunctionExecutable* name##Executable(); \ + const JSC::SourceCode& name##Source() const { return m_##name##Source; } + WEBCORE_FOREACH_CONSOLEOBJECT_BUILTIN_CODE(EXPOSE_BUILTIN_EXECUTABLES) +#undef EXPOSE_BUILTIN_EXECUTABLES -// readableStreamTeeBranch2CancelFunction -#define WEBCORE_BUILTIN_READABLESTREAMINTERNALS_READABLESTREAMTEEBRANCH2CANCELFUNCTION 1 -extern const char* const s_readableStreamInternalsReadableStreamTeeBranch2CancelFunctionCode; -extern const int s_readableStreamInternalsReadableStreamTeeBranch2CancelFunctionCodeLength; -extern const JSC::ConstructAbility s_readableStreamInternalsReadableStreamTeeBranch2CancelFunctionCodeConstructAbility; -extern const JSC::ConstructorKind s_readableStreamInternalsReadableStreamTeeBranch2CancelFunctionCodeConstructorKind; -extern const JSC::ImplementationVisibility s_readableStreamInternalsReadableStreamTeeBranch2CancelFunctionCodeImplementationVisibility; + WEBCORE_FOREACH_CONSOLEOBJECT_BUILTIN_FUNCTION_NAME(DECLARE_BUILTIN_IDENTIFIER_ACCESSOR) -// isReadableStream -#define WEBCORE_BUILTIN_READABLESTREAMINTERNALS_ISREADABLESTREAM 1 -extern const char* const s_readableStreamInternalsIsReadableStreamCode; -extern const int s_readableStreamInternalsIsReadableStreamCodeLength; -extern const JSC::ConstructAbility s_readableStreamInternalsIsReadableStreamCodeConstructAbility; -extern const JSC::ConstructorKind s_readableStreamInternalsIsReadableStreamCodeConstructorKind; -extern const JSC::ImplementationVisibility s_readableStreamInternalsIsReadableStreamCodeImplementationVisibility; + void exportNames(); -// isReadableStreamDefaultReader -#define WEBCORE_BUILTIN_READABLESTREAMINTERNALS_ISREADABLESTREAMDEFAULTREADER 1 -extern const char* const s_readableStreamInternalsIsReadableStreamDefaultReaderCode; -extern const int s_readableStreamInternalsIsReadableStreamDefaultReaderCodeLength; -extern const JSC::ConstructAbility s_readableStreamInternalsIsReadableStreamDefaultReaderCodeConstructAbility; -extern const JSC::ConstructorKind s_readableStreamInternalsIsReadableStreamDefaultReaderCodeConstructorKind; -extern const JSC::ImplementationVisibility s_readableStreamInternalsIsReadableStreamDefaultReaderCodeImplementationVisibility; +private: + JSC::VM& m_vm; -// isReadableStreamDefaultController -#define WEBCORE_BUILTIN_READABLESTREAMINTERNALS_ISREADABLESTREAMDEFAULTCONTROLLER 1 -extern const char* const s_readableStreamInternalsIsReadableStreamDefaultControllerCode; -extern const int s_readableStreamInternalsIsReadableStreamDefaultControllerCodeLength; -extern const JSC::ConstructAbility s_readableStreamInternalsIsReadableStreamDefaultControllerCodeConstructAbility; -extern const JSC::ConstructorKind s_readableStreamInternalsIsReadableStreamDefaultControllerCodeConstructorKind; -extern const JSC::ImplementationVisibility s_readableStreamInternalsIsReadableStreamDefaultControllerCodeImplementationVisibility; + WEBCORE_FOREACH_CONSOLEOBJECT_BUILTIN_FUNCTION_NAME(DECLARE_BUILTIN_NAMES) -// readDirectStream -#define WEBCORE_BUILTIN_READABLESTREAMINTERNALS_READDIRECTSTREAM 1 -extern const char* const s_readableStreamInternalsReadDirectStreamCode; -extern const int s_readableStreamInternalsReadDirectStreamCodeLength; -extern const JSC::ConstructAbility s_readableStreamInternalsReadDirectStreamCodeConstructAbility; -extern const JSC::ConstructorKind s_readableStreamInternalsReadDirectStreamCodeConstructorKind; -extern const JSC::ImplementationVisibility s_readableStreamInternalsReadDirectStreamCodeImplementationVisibility; +#define DECLARE_BUILTIN_SOURCE_MEMBERS(name, functionName, overriddenName, length) \ + JSC::SourceCode m_##name##Source;\ + JSC::Weak m_##name##Executable; + WEBCORE_FOREACH_CONSOLEOBJECT_BUILTIN_CODE(DECLARE_BUILTIN_SOURCE_MEMBERS) +#undef DECLARE_BUILTIN_SOURCE_MEMBERS -// assignToStream -#define WEBCORE_BUILTIN_READABLESTREAMINTERNALS_ASSIGNTOSTREAM 1 -extern const char* const s_readableStreamInternalsAssignToStreamCode; -extern const int s_readableStreamInternalsAssignToStreamCodeLength; -extern const JSC::ConstructAbility s_readableStreamInternalsAssignToStreamCodeConstructAbility; -extern const JSC::ConstructorKind s_readableStreamInternalsAssignToStreamCodeConstructorKind; -extern const JSC::ImplementationVisibility s_readableStreamInternalsAssignToStreamCodeImplementationVisibility; +}; -// readStreamIntoSink -#define WEBCORE_BUILTIN_READABLESTREAMINTERNALS_READSTREAMINTOSINK 1 -extern const char* const s_readableStreamInternalsReadStreamIntoSinkCode; -extern const int s_readableStreamInternalsReadStreamIntoSinkCodeLength; -extern const JSC::ConstructAbility s_readableStreamInternalsReadStreamIntoSinkCodeConstructAbility; -extern const JSC::ConstructorKind s_readableStreamInternalsReadStreamIntoSinkCodeConstructorKind; -extern const JSC::ImplementationVisibility s_readableStreamInternalsReadStreamIntoSinkCodeImplementationVisibility; +#define DEFINE_BUILTIN_EXECUTABLES(name, functionName, overriddenName, length) \ +inline JSC::UnlinkedFunctionExecutable* ConsoleObjectBuiltinsWrapper::name##Executable() \ +{\ + if (!m_##name##Executable) {\ + JSC::Identifier executableName = functionName##PublicName();\ + if (overriddenName)\ + executableName = JSC::Identifier::fromString(m_vm, overriddenName);\ + m_##name##Executable = JSC::Weak(JSC::createBuiltinExecutable(m_vm, m_##name##Source, executableName, s_##name##ImplementationVisibility, s_##name##ConstructorKind, s_##name##ConstructAbility), this, &m_##name##Executable);\ + }\ + return m_##name##Executable.get();\ +} +WEBCORE_FOREACH_CONSOLEOBJECT_BUILTIN_CODE(DEFINE_BUILTIN_EXECUTABLES) +#undef DEFINE_BUILTIN_EXECUTABLES -// handleDirectStreamError -#define WEBCORE_BUILTIN_READABLESTREAMINTERNALS_HANDLEDIRECTSTREAMERROR 1 -extern const char* const s_readableStreamInternalsHandleDirectStreamErrorCode; -extern const int s_readableStreamInternalsHandleDirectStreamErrorCodeLength; -extern const JSC::ConstructAbility s_readableStreamInternalsHandleDirectStreamErrorCodeConstructAbility; -extern const JSC::ConstructorKind s_readableStreamInternalsHandleDirectStreamErrorCodeConstructorKind; -extern const JSC::ImplementationVisibility s_readableStreamInternalsHandleDirectStreamErrorCodeImplementationVisibility; +inline void ConsoleObjectBuiltinsWrapper::exportNames() +{ +#define EXPORT_FUNCTION_NAME(name) m_vm.propertyNames->appendExternalName(name##PublicName(), name##PrivateName()); + WEBCORE_FOREACH_CONSOLEOBJECT_BUILTIN_FUNCTION_NAME(EXPORT_FUNCTION_NAME) +#undef EXPORT_FUNCTION_NAME +} +/* Module.ts */ +// main +#define WEBCORE_BUILTIN_MODULE_MAIN 1 +extern const char* const s_moduleMainCode; +extern const int s_moduleMainCodeLength; +extern const JSC::ConstructAbility s_moduleMainCodeConstructAbility; +extern const JSC::ConstructorKind s_moduleMainCodeConstructorKind; +extern const JSC::ImplementationVisibility s_moduleMainCodeImplementationVisibility; -// handleDirectStreamErrorReject -#define WEBCORE_BUILTIN_READABLESTREAMINTERNALS_HANDLEDIRECTSTREAMERRORREJECT 1 -extern const char* const s_readableStreamInternalsHandleDirectStreamErrorRejectCode; -extern const int s_readableStreamInternalsHandleDirectStreamErrorRejectCodeLength; -extern const JSC::ConstructAbility s_readableStreamInternalsHandleDirectStreamErrorRejectCodeConstructAbility; -extern const JSC::ConstructorKind s_readableStreamInternalsHandleDirectStreamErrorRejectCodeConstructorKind; -extern const JSC::ImplementationVisibility s_readableStreamInternalsHandleDirectStreamErrorRejectCodeImplementationVisibility; +// require +#define WEBCORE_BUILTIN_MODULE_REQUIRE 1 +extern const char* const s_moduleRequireCode; +extern const int s_moduleRequireCodeLength; +extern const JSC::ConstructAbility s_moduleRequireCodeConstructAbility; +extern const JSC::ConstructorKind s_moduleRequireCodeConstructorKind; +extern const JSC::ImplementationVisibility s_moduleRequireCodeImplementationVisibility; -// onPullDirectStream -#define WEBCORE_BUILTIN_READABLESTREAMINTERNALS_ONPULLDIRECTSTREAM 1 -extern const char* const s_readableStreamInternalsOnPullDirectStreamCode; -extern const int s_readableStreamInternalsOnPullDirectStreamCodeLength; -extern const JSC::ConstructAbility s_readableStreamInternalsOnPullDirectStreamCodeConstructAbility; -extern const JSC::ConstructorKind s_readableStreamInternalsOnPullDirectStreamCodeConstructorKind; -extern const JSC::ImplementationVisibility s_readableStreamInternalsOnPullDirectStreamCodeImplementationVisibility; +// requireResolve +#define WEBCORE_BUILTIN_MODULE_REQUIRERESOLVE 1 +extern const char* const s_moduleRequireResolveCode; +extern const int s_moduleRequireResolveCodeLength; +extern const JSC::ConstructAbility s_moduleRequireResolveCodeConstructAbility; +extern const JSC::ConstructorKind s_moduleRequireResolveCodeConstructorKind; +extern const JSC::ImplementationVisibility s_moduleRequireResolveCodeImplementationVisibility; -// noopDoneFunction -#define WEBCORE_BUILTIN_READABLESTREAMINTERNALS_NOOPDONEFUNCTION 1 -extern const char* const s_readableStreamInternalsNoopDoneFunctionCode; -extern const int s_readableStreamInternalsNoopDoneFunctionCodeLength; -extern const JSC::ConstructAbility s_readableStreamInternalsNoopDoneFunctionCodeConstructAbility; -extern const JSC::ConstructorKind s_readableStreamInternalsNoopDoneFunctionCodeConstructorKind; -extern const JSC::ImplementationVisibility s_readableStreamInternalsNoopDoneFunctionCodeImplementationVisibility; +// requireNativeModule +#define WEBCORE_BUILTIN_MODULE_REQUIRENATIVEMODULE 1 +extern const char* const s_moduleRequireNativeModuleCode; +extern const int s_moduleRequireNativeModuleCodeLength; +extern const JSC::ConstructAbility s_moduleRequireNativeModuleCodeConstructAbility; +extern const JSC::ConstructorKind s_moduleRequireNativeModuleCodeConstructorKind; +extern const JSC::ImplementationVisibility s_moduleRequireNativeModuleCodeImplementationVisibility; -// onReadableStreamDirectControllerClosed -#define WEBCORE_BUILTIN_READABLESTREAMINTERNALS_ONREADABLESTREAMDIRECTCONTROLLERCLOSED 1 -extern const char* const s_readableStreamInternalsOnReadableStreamDirectControllerClosedCode; -extern const int s_readableStreamInternalsOnReadableStreamDirectControllerClosedCodeLength; -extern const JSC::ConstructAbility s_readableStreamInternalsOnReadableStreamDirectControllerClosedCodeConstructAbility; -extern const JSC::ConstructorKind s_readableStreamInternalsOnReadableStreamDirectControllerClosedCodeConstructorKind; -extern const JSC::ImplementationVisibility s_readableStreamInternalsOnReadableStreamDirectControllerClosedCodeImplementationVisibility; +#define WEBCORE_FOREACH_MODULE_BUILTIN_DATA(macro) \ + macro(main, moduleMain, 0) \ + macro(require, moduleRequire, 1) \ + macro(requireResolve, moduleRequireResolve, 1) \ + macro(requireNativeModule, moduleRequireNativeModule, 1) \ -// onCloseDirectStream -#define WEBCORE_BUILTIN_READABLESTREAMINTERNALS_ONCLOSEDIRECTSTREAM 1 -extern const char* const s_readableStreamInternalsOnCloseDirectStreamCode; -extern const int s_readableStreamInternalsOnCloseDirectStreamCodeLength; -extern const JSC::ConstructAbility s_readableStreamInternalsOnCloseDirectStreamCodeConstructAbility; -extern const JSC::ConstructorKind s_readableStreamInternalsOnCloseDirectStreamCodeConstructorKind; -extern const JSC::ImplementationVisibility s_readableStreamInternalsOnCloseDirectStreamCodeImplementationVisibility; +#define WEBCORE_FOREACH_MODULE_BUILTIN_CODE(macro) \ + macro(moduleMainCode, main, "get main"_s, s_moduleMainCodeLength) \ + macro(moduleRequireCode, require, ASCIILiteral(), s_moduleRequireCodeLength) \ + macro(moduleRequireResolveCode, requireResolve, ASCIILiteral(), s_moduleRequireResolveCodeLength) \ + macro(moduleRequireNativeModuleCode, requireNativeModule, ASCIILiteral(), s_moduleRequireNativeModuleCodeLength) \ -// onFlushDirectStream -#define WEBCORE_BUILTIN_READABLESTREAMINTERNALS_ONFLUSHDIRECTSTREAM 1 -extern const char* const s_readableStreamInternalsOnFlushDirectStreamCode; -extern const int s_readableStreamInternalsOnFlushDirectStreamCodeLength; -extern const JSC::ConstructAbility s_readableStreamInternalsOnFlushDirectStreamCodeConstructAbility; -extern const JSC::ConstructorKind s_readableStreamInternalsOnFlushDirectStreamCodeConstructorKind; -extern const JSC::ImplementationVisibility s_readableStreamInternalsOnFlushDirectStreamCodeImplementationVisibility; +#define WEBCORE_FOREACH_MODULE_BUILTIN_FUNCTION_NAME(macro) \ + macro(main) \ + macro(require) \ + macro(requireResolve) \ + macro(requireNativeModule) \ -// createTextStream -#define WEBCORE_BUILTIN_READABLESTREAMINTERNALS_CREATETEXTSTREAM 1 -extern const char* const s_readableStreamInternalsCreateTextStreamCode; -extern const int s_readableStreamInternalsCreateTextStreamCodeLength; -extern const JSC::ConstructAbility s_readableStreamInternalsCreateTextStreamCodeConstructAbility; -extern const JSC::ConstructorKind s_readableStreamInternalsCreateTextStreamCodeConstructorKind; -extern const JSC::ImplementationVisibility s_readableStreamInternalsCreateTextStreamCodeImplementationVisibility; +#define DECLARE_BUILTIN_GENERATOR(codeName, functionName, overriddenName, argumentCount) \ + JSC::FunctionExecutable* codeName##Generator(JSC::VM&); -// initializeTextStream -#define WEBCORE_BUILTIN_READABLESTREAMINTERNALS_INITIALIZETEXTSTREAM 1 -extern const char* const s_readableStreamInternalsInitializeTextStreamCode; -extern const int s_readableStreamInternalsInitializeTextStreamCodeLength; -extern const JSC::ConstructAbility s_readableStreamInternalsInitializeTextStreamCodeConstructAbility; -extern const JSC::ConstructorKind s_readableStreamInternalsInitializeTextStreamCodeConstructorKind; -extern const JSC::ImplementationVisibility s_readableStreamInternalsInitializeTextStreamCodeImplementationVisibility; +WEBCORE_FOREACH_MODULE_BUILTIN_CODE(DECLARE_BUILTIN_GENERATOR) +#undef DECLARE_BUILTIN_GENERATOR -// initializeArrayStream -#define WEBCORE_BUILTIN_READABLESTREAMINTERNALS_INITIALIZEARRAYSTREAM 1 -extern const char* const s_readableStreamInternalsInitializeArrayStreamCode; -extern const int s_readableStreamInternalsInitializeArrayStreamCodeLength; -extern const JSC::ConstructAbility s_readableStreamInternalsInitializeArrayStreamCodeConstructAbility; -extern const JSC::ConstructorKind s_readableStreamInternalsInitializeArrayStreamCodeConstructorKind; -extern const JSC::ImplementationVisibility s_readableStreamInternalsInitializeArrayStreamCodeImplementationVisibility; +class ModuleBuiltinsWrapper : private JSC::WeakHandleOwner { +public: + explicit ModuleBuiltinsWrapper(JSC::VM& vm) + : m_vm(vm) + WEBCORE_FOREACH_MODULE_BUILTIN_FUNCTION_NAME(INITIALIZE_BUILTIN_NAMES) +#define INITIALIZE_BUILTIN_SOURCE_MEMBERS(name, functionName, overriddenName, length) , m_##name##Source(JSC::makeSource(StringImpl::createWithoutCopying(s_##name, length), { }, JSC::SourceTaintedOrigin::Untainted)) + WEBCORE_FOREACH_MODULE_BUILTIN_CODE(INITIALIZE_BUILTIN_SOURCE_MEMBERS) +#undef INITIALIZE_BUILTIN_SOURCE_MEMBERS + { + } -// initializeArrayBufferStream -#define WEBCORE_BUILTIN_READABLESTREAMINTERNALS_INITIALIZEARRAYBUFFERSTREAM 1 -extern const char* const s_readableStreamInternalsInitializeArrayBufferStreamCode; -extern const int s_readableStreamInternalsInitializeArrayBufferStreamCodeLength; -extern const JSC::ConstructAbility s_readableStreamInternalsInitializeArrayBufferStreamCodeConstructAbility; -extern const JSC::ConstructorKind s_readableStreamInternalsInitializeArrayBufferStreamCodeConstructorKind; -extern const JSC::ImplementationVisibility s_readableStreamInternalsInitializeArrayBufferStreamCodeImplementationVisibility; +#define EXPOSE_BUILTIN_EXECUTABLES(name, functionName, overriddenName, length) \ + JSC::UnlinkedFunctionExecutable* name##Executable(); \ + const JSC::SourceCode& name##Source() const { return m_##name##Source; } + WEBCORE_FOREACH_MODULE_BUILTIN_CODE(EXPOSE_BUILTIN_EXECUTABLES) +#undef EXPOSE_BUILTIN_EXECUTABLES -// readableStreamError -#define WEBCORE_BUILTIN_READABLESTREAMINTERNALS_READABLESTREAMERROR 1 -extern const char* const s_readableStreamInternalsReadableStreamErrorCode; -extern const int s_readableStreamInternalsReadableStreamErrorCodeLength; -extern const JSC::ConstructAbility s_readableStreamInternalsReadableStreamErrorCodeConstructAbility; -extern const JSC::ConstructorKind s_readableStreamInternalsReadableStreamErrorCodeConstructorKind; -extern const JSC::ImplementationVisibility s_readableStreamInternalsReadableStreamErrorCodeImplementationVisibility; + WEBCORE_FOREACH_MODULE_BUILTIN_FUNCTION_NAME(DECLARE_BUILTIN_IDENTIFIER_ACCESSOR) -// readableStreamDefaultControllerShouldCallPull -#define WEBCORE_BUILTIN_READABLESTREAMINTERNALS_READABLESTREAMDEFAULTCONTROLLERSHOULDCALLPULL 1 -extern const char* const s_readableStreamInternalsReadableStreamDefaultControllerShouldCallPullCode; -extern const int s_readableStreamInternalsReadableStreamDefaultControllerShouldCallPullCodeLength; -extern const JSC::ConstructAbility s_readableStreamInternalsReadableStreamDefaultControllerShouldCallPullCodeConstructAbility; -extern const JSC::ConstructorKind s_readableStreamInternalsReadableStreamDefaultControllerShouldCallPullCodeConstructorKind; -extern const JSC::ImplementationVisibility s_readableStreamInternalsReadableStreamDefaultControllerShouldCallPullCodeImplementationVisibility; + void exportNames(); -// readableStreamDefaultControllerCallPullIfNeeded -#define WEBCORE_BUILTIN_READABLESTREAMINTERNALS_READABLESTREAMDEFAULTCONTROLLERCALLPULLIFNEEDED 1 -extern const char* const s_readableStreamInternalsReadableStreamDefaultControllerCallPullIfNeededCode; -extern const int s_readableStreamInternalsReadableStreamDefaultControllerCallPullIfNeededCodeLength; -extern const JSC::ConstructAbility s_readableStreamInternalsReadableStreamDefaultControllerCallPullIfNeededCodeConstructAbility; -extern const JSC::ConstructorKind s_readableStreamInternalsReadableStreamDefaultControllerCallPullIfNeededCodeConstructorKind; -extern const JSC::ImplementationVisibility s_readableStreamInternalsReadableStreamDefaultControllerCallPullIfNeededCodeImplementationVisibility; +private: + JSC::VM& m_vm; -// isReadableStreamLocked -#define WEBCORE_BUILTIN_READABLESTREAMINTERNALS_ISREADABLESTREAMLOCKED 1 -extern const char* const s_readableStreamInternalsIsReadableStreamLockedCode; -extern const int s_readableStreamInternalsIsReadableStreamLockedCodeLength; -extern const JSC::ConstructAbility s_readableStreamInternalsIsReadableStreamLockedCodeConstructAbility; -extern const JSC::ConstructorKind s_readableStreamInternalsIsReadableStreamLockedCodeConstructorKind; -extern const JSC::ImplementationVisibility s_readableStreamInternalsIsReadableStreamLockedCodeImplementationVisibility; + WEBCORE_FOREACH_MODULE_BUILTIN_FUNCTION_NAME(DECLARE_BUILTIN_NAMES) -// readableStreamDefaultControllerGetDesiredSize -#define WEBCORE_BUILTIN_READABLESTREAMINTERNALS_READABLESTREAMDEFAULTCONTROLLERGETDESIREDSIZE 1 -extern const char* const s_readableStreamInternalsReadableStreamDefaultControllerGetDesiredSizeCode; -extern const int s_readableStreamInternalsReadableStreamDefaultControllerGetDesiredSizeCodeLength; -extern const JSC::ConstructAbility s_readableStreamInternalsReadableStreamDefaultControllerGetDesiredSizeCodeConstructAbility; -extern const JSC::ConstructorKind s_readableStreamInternalsReadableStreamDefaultControllerGetDesiredSizeCodeConstructorKind; -extern const JSC::ImplementationVisibility s_readableStreamInternalsReadableStreamDefaultControllerGetDesiredSizeCodeImplementationVisibility; +#define DECLARE_BUILTIN_SOURCE_MEMBERS(name, functionName, overriddenName, length) \ + JSC::SourceCode m_##name##Source;\ + JSC::Weak m_##name##Executable; + WEBCORE_FOREACH_MODULE_BUILTIN_CODE(DECLARE_BUILTIN_SOURCE_MEMBERS) +#undef DECLARE_BUILTIN_SOURCE_MEMBERS -// readableStreamReaderGenericCancel -#define WEBCORE_BUILTIN_READABLESTREAMINTERNALS_READABLESTREAMREADERGENERICCANCEL 1 -extern const char* const s_readableStreamInternalsReadableStreamReaderGenericCancelCode; -extern const int s_readableStreamInternalsReadableStreamReaderGenericCancelCodeLength; -extern const JSC::ConstructAbility s_readableStreamInternalsReadableStreamReaderGenericCancelCodeConstructAbility; -extern const JSC::ConstructorKind s_readableStreamInternalsReadableStreamReaderGenericCancelCodeConstructorKind; -extern const JSC::ImplementationVisibility s_readableStreamInternalsReadableStreamReaderGenericCancelCodeImplementationVisibility; +}; -// readableStreamCancel -#define WEBCORE_BUILTIN_READABLESTREAMINTERNALS_READABLESTREAMCANCEL 1 -extern const char* const s_readableStreamInternalsReadableStreamCancelCode; -extern const int s_readableStreamInternalsReadableStreamCancelCodeLength; -extern const JSC::ConstructAbility s_readableStreamInternalsReadableStreamCancelCodeConstructAbility; -extern const JSC::ConstructorKind s_readableStreamInternalsReadableStreamCancelCodeConstructorKind; -extern const JSC::ImplementationVisibility s_readableStreamInternalsReadableStreamCancelCodeImplementationVisibility; +#define DEFINE_BUILTIN_EXECUTABLES(name, functionName, overriddenName, length) \ +inline JSC::UnlinkedFunctionExecutable* ModuleBuiltinsWrapper::name##Executable() \ +{\ + if (!m_##name##Executable) {\ + JSC::Identifier executableName = functionName##PublicName();\ + if (overriddenName)\ + executableName = JSC::Identifier::fromString(m_vm, overriddenName);\ + m_##name##Executable = JSC::Weak(JSC::createBuiltinExecutable(m_vm, m_##name##Source, executableName, s_##name##ImplementationVisibility, s_##name##ConstructorKind, s_##name##ConstructAbility), this, &m_##name##Executable);\ + }\ + return m_##name##Executable.get();\ +} +WEBCORE_FOREACH_MODULE_BUILTIN_CODE(DEFINE_BUILTIN_EXECUTABLES) +#undef DEFINE_BUILTIN_EXECUTABLES -// readableStreamDefaultControllerCancel -#define WEBCORE_BUILTIN_READABLESTREAMINTERNALS_READABLESTREAMDEFAULTCONTROLLERCANCEL 1 -extern const char* const s_readableStreamInternalsReadableStreamDefaultControllerCancelCode; -extern const int s_readableStreamInternalsReadableStreamDefaultControllerCancelCodeLength; -extern const JSC::ConstructAbility s_readableStreamInternalsReadableStreamDefaultControllerCancelCodeConstructAbility; -extern const JSC::ConstructorKind s_readableStreamInternalsReadableStreamDefaultControllerCancelCodeConstructorKind; -extern const JSC::ImplementationVisibility s_readableStreamInternalsReadableStreamDefaultControllerCancelCodeImplementationVisibility; +inline void ModuleBuiltinsWrapper::exportNames() +{ +#define EXPORT_FUNCTION_NAME(name) m_vm.propertyNames->appendExternalName(name##PublicName(), name##PrivateName()); + WEBCORE_FOREACH_MODULE_BUILTIN_FUNCTION_NAME(EXPORT_FUNCTION_NAME) +#undef EXPORT_FUNCTION_NAME +} +/* JSBufferConstructor.ts */ +// from +#define WEBCORE_BUILTIN_JSBUFFERCONSTRUCTOR_FROM 1 +extern const char* const s_jsBufferConstructorFromCode; +extern const int s_jsBufferConstructorFromCodeLength; +extern const JSC::ConstructAbility s_jsBufferConstructorFromCodeConstructAbility; +extern const JSC::ConstructorKind s_jsBufferConstructorFromCodeConstructorKind; +extern const JSC::ImplementationVisibility s_jsBufferConstructorFromCodeImplementationVisibility; -// readableStreamDefaultControllerPull -#define WEBCORE_BUILTIN_READABLESTREAMINTERNALS_READABLESTREAMDEFAULTCONTROLLERPULL 1 -extern const char* const s_readableStreamInternalsReadableStreamDefaultControllerPullCode; -extern const int s_readableStreamInternalsReadableStreamDefaultControllerPullCodeLength; -extern const JSC::ConstructAbility s_readableStreamInternalsReadableStreamDefaultControllerPullCodeConstructAbility; -extern const JSC::ConstructorKind s_readableStreamInternalsReadableStreamDefaultControllerPullCodeConstructorKind; -extern const JSC::ImplementationVisibility s_readableStreamInternalsReadableStreamDefaultControllerPullCodeImplementationVisibility; +// isBuffer +#define WEBCORE_BUILTIN_JSBUFFERCONSTRUCTOR_ISBUFFER 1 +extern const char* const s_jsBufferConstructorIsBufferCode; +extern const int s_jsBufferConstructorIsBufferCodeLength; +extern const JSC::ConstructAbility s_jsBufferConstructorIsBufferCodeConstructAbility; +extern const JSC::ConstructorKind s_jsBufferConstructorIsBufferCodeConstructorKind; +extern const JSC::ImplementationVisibility s_jsBufferConstructorIsBufferCodeImplementationVisibility; -// readableStreamDefaultControllerClose -#define WEBCORE_BUILTIN_READABLESTREAMINTERNALS_READABLESTREAMDEFAULTCONTROLLERCLOSE 1 -extern const char* const s_readableStreamInternalsReadableStreamDefaultControllerCloseCode; -extern const int s_readableStreamInternalsReadableStreamDefaultControllerCloseCodeLength; -extern const JSC::ConstructAbility s_readableStreamInternalsReadableStreamDefaultControllerCloseCodeConstructAbility; -extern const JSC::ConstructorKind s_readableStreamInternalsReadableStreamDefaultControllerCloseCodeConstructorKind; -extern const JSC::ImplementationVisibility s_readableStreamInternalsReadableStreamDefaultControllerCloseCodeImplementationVisibility; +#define WEBCORE_FOREACH_JSBUFFERCONSTRUCTOR_BUILTIN_DATA(macro) \ + macro(from, jsBufferConstructorFrom, 1) \ + macro(isBuffer, jsBufferConstructorIsBuffer, 1) \ -// readableStreamClose -#define WEBCORE_BUILTIN_READABLESTREAMINTERNALS_READABLESTREAMCLOSE 1 -extern const char* const s_readableStreamInternalsReadableStreamCloseCode; -extern const int s_readableStreamInternalsReadableStreamCloseCodeLength; -extern const JSC::ConstructAbility s_readableStreamInternalsReadableStreamCloseCodeConstructAbility; -extern const JSC::ConstructorKind s_readableStreamInternalsReadableStreamCloseCodeConstructorKind; -extern const JSC::ImplementationVisibility s_readableStreamInternalsReadableStreamCloseCodeImplementationVisibility; +#define WEBCORE_FOREACH_JSBUFFERCONSTRUCTOR_BUILTIN_CODE(macro) \ + macro(jsBufferConstructorFromCode, from, ASCIILiteral(), s_jsBufferConstructorFromCodeLength) \ + macro(jsBufferConstructorIsBufferCode, isBuffer, ASCIILiteral(), s_jsBufferConstructorIsBufferCodeLength) \ -// readableStreamFulfillReadRequest -#define WEBCORE_BUILTIN_READABLESTREAMINTERNALS_READABLESTREAMFULFILLREADREQUEST 1 -extern const char* const s_readableStreamInternalsReadableStreamFulfillReadRequestCode; -extern const int s_readableStreamInternalsReadableStreamFulfillReadRequestCodeLength; -extern const JSC::ConstructAbility s_readableStreamInternalsReadableStreamFulfillReadRequestCodeConstructAbility; -extern const JSC::ConstructorKind s_readableStreamInternalsReadableStreamFulfillReadRequestCodeConstructorKind; -extern const JSC::ImplementationVisibility s_readableStreamInternalsReadableStreamFulfillReadRequestCodeImplementationVisibility; +#define WEBCORE_FOREACH_JSBUFFERCONSTRUCTOR_BUILTIN_FUNCTION_NAME(macro) \ + macro(from) \ + macro(isBuffer) \ -// readableStreamDefaultControllerEnqueue -#define WEBCORE_BUILTIN_READABLESTREAMINTERNALS_READABLESTREAMDEFAULTCONTROLLERENQUEUE 1 -extern const char* const s_readableStreamInternalsReadableStreamDefaultControllerEnqueueCode; -extern const int s_readableStreamInternalsReadableStreamDefaultControllerEnqueueCodeLength; -extern const JSC::ConstructAbility s_readableStreamInternalsReadableStreamDefaultControllerEnqueueCodeConstructAbility; -extern const JSC::ConstructorKind s_readableStreamInternalsReadableStreamDefaultControllerEnqueueCodeConstructorKind; -extern const JSC::ImplementationVisibility s_readableStreamInternalsReadableStreamDefaultControllerEnqueueCodeImplementationVisibility; +#define DECLARE_BUILTIN_GENERATOR(codeName, functionName, overriddenName, argumentCount) \ + JSC::FunctionExecutable* codeName##Generator(JSC::VM&); -// readableStreamDefaultReaderRead -#define WEBCORE_BUILTIN_READABLESTREAMINTERNALS_READABLESTREAMDEFAULTREADERREAD 1 -extern const char* const s_readableStreamInternalsReadableStreamDefaultReaderReadCode; -extern const int s_readableStreamInternalsReadableStreamDefaultReaderReadCodeLength; -extern const JSC::ConstructAbility s_readableStreamInternalsReadableStreamDefaultReaderReadCodeConstructAbility; -extern const JSC::ConstructorKind s_readableStreamInternalsReadableStreamDefaultReaderReadCodeConstructorKind; -extern const JSC::ImplementationVisibility s_readableStreamInternalsReadableStreamDefaultReaderReadCodeImplementationVisibility; +WEBCORE_FOREACH_JSBUFFERCONSTRUCTOR_BUILTIN_CODE(DECLARE_BUILTIN_GENERATOR) +#undef DECLARE_BUILTIN_GENERATOR -// readableStreamAddReadRequest -#define WEBCORE_BUILTIN_READABLESTREAMINTERNALS_READABLESTREAMADDREADREQUEST 1 -extern const char* const s_readableStreamInternalsReadableStreamAddReadRequestCode; -extern const int s_readableStreamInternalsReadableStreamAddReadRequestCodeLength; -extern const JSC::ConstructAbility s_readableStreamInternalsReadableStreamAddReadRequestCodeConstructAbility; -extern const JSC::ConstructorKind s_readableStreamInternalsReadableStreamAddReadRequestCodeConstructorKind; -extern const JSC::ImplementationVisibility s_readableStreamInternalsReadableStreamAddReadRequestCodeImplementationVisibility; +class JSBufferConstructorBuiltinsWrapper : private JSC::WeakHandleOwner { +public: + explicit JSBufferConstructorBuiltinsWrapper(JSC::VM& vm) + : m_vm(vm) + WEBCORE_FOREACH_JSBUFFERCONSTRUCTOR_BUILTIN_FUNCTION_NAME(INITIALIZE_BUILTIN_NAMES) +#define INITIALIZE_BUILTIN_SOURCE_MEMBERS(name, functionName, overriddenName, length) , m_##name##Source(JSC::makeSource(StringImpl::createWithoutCopying(s_##name, length), { }, JSC::SourceTaintedOrigin::Untainted)) + WEBCORE_FOREACH_JSBUFFERCONSTRUCTOR_BUILTIN_CODE(INITIALIZE_BUILTIN_SOURCE_MEMBERS) +#undef INITIALIZE_BUILTIN_SOURCE_MEMBERS + { + } -// isReadableStreamDisturbed -#define WEBCORE_BUILTIN_READABLESTREAMINTERNALS_ISREADABLESTREAMDISTURBED 1 -extern const char* const s_readableStreamInternalsIsReadableStreamDisturbedCode; -extern const int s_readableStreamInternalsIsReadableStreamDisturbedCodeLength; -extern const JSC::ConstructAbility s_readableStreamInternalsIsReadableStreamDisturbedCodeConstructAbility; -extern const JSC::ConstructorKind s_readableStreamInternalsIsReadableStreamDisturbedCodeConstructorKind; -extern const JSC::ImplementationVisibility s_readableStreamInternalsIsReadableStreamDisturbedCodeImplementationVisibility; +#define EXPOSE_BUILTIN_EXECUTABLES(name, functionName, overriddenName, length) \ + JSC::UnlinkedFunctionExecutable* name##Executable(); \ + const JSC::SourceCode& name##Source() const { return m_##name##Source; } + WEBCORE_FOREACH_JSBUFFERCONSTRUCTOR_BUILTIN_CODE(EXPOSE_BUILTIN_EXECUTABLES) +#undef EXPOSE_BUILTIN_EXECUTABLES -// readableStreamReaderGenericRelease -#define WEBCORE_BUILTIN_READABLESTREAMINTERNALS_READABLESTREAMREADERGENERICRELEASE 1 -extern const char* const s_readableStreamInternalsReadableStreamReaderGenericReleaseCode; -extern const int s_readableStreamInternalsReadableStreamReaderGenericReleaseCodeLength; -extern const JSC::ConstructAbility s_readableStreamInternalsReadableStreamReaderGenericReleaseCodeConstructAbility; -extern const JSC::ConstructorKind s_readableStreamInternalsReadableStreamReaderGenericReleaseCodeConstructorKind; -extern const JSC::ImplementationVisibility s_readableStreamInternalsReadableStreamReaderGenericReleaseCodeImplementationVisibility; + WEBCORE_FOREACH_JSBUFFERCONSTRUCTOR_BUILTIN_FUNCTION_NAME(DECLARE_BUILTIN_IDENTIFIER_ACCESSOR) -// readableStreamDefaultControllerCanCloseOrEnqueue -#define WEBCORE_BUILTIN_READABLESTREAMINTERNALS_READABLESTREAMDEFAULTCONTROLLERCANCLOSEORENQUEUE 1 -extern const char* const s_readableStreamInternalsReadableStreamDefaultControllerCanCloseOrEnqueueCode; -extern const int s_readableStreamInternalsReadableStreamDefaultControllerCanCloseOrEnqueueCodeLength; -extern const JSC::ConstructAbility s_readableStreamInternalsReadableStreamDefaultControllerCanCloseOrEnqueueCodeConstructAbility; -extern const JSC::ConstructorKind s_readableStreamInternalsReadableStreamDefaultControllerCanCloseOrEnqueueCodeConstructorKind; -extern const JSC::ImplementationVisibility s_readableStreamInternalsReadableStreamDefaultControllerCanCloseOrEnqueueCodeImplementationVisibility; + void exportNames(); -// lazyLoadStream -#define WEBCORE_BUILTIN_READABLESTREAMINTERNALS_LAZYLOADSTREAM 1 -extern const char* const s_readableStreamInternalsLazyLoadStreamCode; -extern const int s_readableStreamInternalsLazyLoadStreamCodeLength; -extern const JSC::ConstructAbility s_readableStreamInternalsLazyLoadStreamCodeConstructAbility; -extern const JSC::ConstructorKind s_readableStreamInternalsLazyLoadStreamCodeConstructorKind; -extern const JSC::ImplementationVisibility s_readableStreamInternalsLazyLoadStreamCodeImplementationVisibility; +private: + JSC::VM& m_vm; -// readableStreamIntoArray -#define WEBCORE_BUILTIN_READABLESTREAMINTERNALS_READABLESTREAMINTOARRAY 1 -extern const char* const s_readableStreamInternalsReadableStreamIntoArrayCode; -extern const int s_readableStreamInternalsReadableStreamIntoArrayCodeLength; -extern const JSC::ConstructAbility s_readableStreamInternalsReadableStreamIntoArrayCodeConstructAbility; -extern const JSC::ConstructorKind s_readableStreamInternalsReadableStreamIntoArrayCodeConstructorKind; -extern const JSC::ImplementationVisibility s_readableStreamInternalsReadableStreamIntoArrayCodeImplementationVisibility; + WEBCORE_FOREACH_JSBUFFERCONSTRUCTOR_BUILTIN_FUNCTION_NAME(DECLARE_BUILTIN_NAMES) -// readableStreamIntoText -#define WEBCORE_BUILTIN_READABLESTREAMINTERNALS_READABLESTREAMINTOTEXT 1 -extern const char* const s_readableStreamInternalsReadableStreamIntoTextCode; -extern const int s_readableStreamInternalsReadableStreamIntoTextCodeLength; -extern const JSC::ConstructAbility s_readableStreamInternalsReadableStreamIntoTextCodeConstructAbility; -extern const JSC::ConstructorKind s_readableStreamInternalsReadableStreamIntoTextCodeConstructorKind; -extern const JSC::ImplementationVisibility s_readableStreamInternalsReadableStreamIntoTextCodeImplementationVisibility; +#define DECLARE_BUILTIN_SOURCE_MEMBERS(name, functionName, overriddenName, length) \ + JSC::SourceCode m_##name##Source;\ + JSC::Weak m_##name##Executable; + WEBCORE_FOREACH_JSBUFFERCONSTRUCTOR_BUILTIN_CODE(DECLARE_BUILTIN_SOURCE_MEMBERS) +#undef DECLARE_BUILTIN_SOURCE_MEMBERS -// readableStreamToArrayBufferDirect -#define WEBCORE_BUILTIN_READABLESTREAMINTERNALS_READABLESTREAMTOARRAYBUFFERDIRECT 1 -extern const char* const s_readableStreamInternalsReadableStreamToArrayBufferDirectCode; -extern const int s_readableStreamInternalsReadableStreamToArrayBufferDirectCodeLength; -extern const JSC::ConstructAbility s_readableStreamInternalsReadableStreamToArrayBufferDirectCodeConstructAbility; -extern const JSC::ConstructorKind s_readableStreamInternalsReadableStreamToArrayBufferDirectCodeConstructorKind; -extern const JSC::ImplementationVisibility s_readableStreamInternalsReadableStreamToArrayBufferDirectCodeImplementationVisibility; +}; + +#define DEFINE_BUILTIN_EXECUTABLES(name, functionName, overriddenName, length) \ +inline JSC::UnlinkedFunctionExecutable* JSBufferConstructorBuiltinsWrapper::name##Executable() \ +{\ + if (!m_##name##Executable) {\ + JSC::Identifier executableName = functionName##PublicName();\ + if (overriddenName)\ + executableName = JSC::Identifier::fromString(m_vm, overriddenName);\ + m_##name##Executable = JSC::Weak(JSC::createBuiltinExecutable(m_vm, m_##name##Source, executableName, s_##name##ImplementationVisibility, s_##name##ConstructorKind, s_##name##ConstructAbility), this, &m_##name##Executable);\ + }\ + return m_##name##Executable.get();\ +} +WEBCORE_FOREACH_JSBUFFERCONSTRUCTOR_BUILTIN_CODE(DEFINE_BUILTIN_EXECUTABLES) +#undef DEFINE_BUILTIN_EXECUTABLES + +inline void JSBufferConstructorBuiltinsWrapper::exportNames() +{ +#define EXPORT_FUNCTION_NAME(name) m_vm.propertyNames->appendExternalName(name##PublicName(), name##PrivateName()); + WEBCORE_FOREACH_JSBUFFERCONSTRUCTOR_BUILTIN_FUNCTION_NAME(EXPORT_FUNCTION_NAME) +#undef EXPORT_FUNCTION_NAME +} +/* JSBufferPrototype.ts */ +// setBigUint64 +#define WEBCORE_BUILTIN_JSBUFFERPROTOTYPE_SETBIGUINT64 1 +extern const char* const s_jsBufferPrototypeSetBigUint64Code; +extern const int s_jsBufferPrototypeSetBigUint64CodeLength; +extern const JSC::ConstructAbility s_jsBufferPrototypeSetBigUint64CodeConstructAbility; +extern const JSC::ConstructorKind s_jsBufferPrototypeSetBigUint64CodeConstructorKind; +extern const JSC::ImplementationVisibility s_jsBufferPrototypeSetBigUint64CodeImplementationVisibility; + +// readInt8 +#define WEBCORE_BUILTIN_JSBUFFERPROTOTYPE_READINT8 1 +extern const char* const s_jsBufferPrototypeReadInt8Code; +extern const int s_jsBufferPrototypeReadInt8CodeLength; +extern const JSC::ConstructAbility s_jsBufferPrototypeReadInt8CodeConstructAbility; +extern const JSC::ConstructorKind s_jsBufferPrototypeReadInt8CodeConstructorKind; +extern const JSC::ImplementationVisibility s_jsBufferPrototypeReadInt8CodeImplementationVisibility; -// readableStreamToTextDirect -#define WEBCORE_BUILTIN_READABLESTREAMINTERNALS_READABLESTREAMTOTEXTDIRECT 1 -extern const char* const s_readableStreamInternalsReadableStreamToTextDirectCode; -extern const int s_readableStreamInternalsReadableStreamToTextDirectCodeLength; -extern const JSC::ConstructAbility s_readableStreamInternalsReadableStreamToTextDirectCodeConstructAbility; -extern const JSC::ConstructorKind s_readableStreamInternalsReadableStreamToTextDirectCodeConstructorKind; -extern const JSC::ImplementationVisibility s_readableStreamInternalsReadableStreamToTextDirectCodeImplementationVisibility; +// readUInt8 +#define WEBCORE_BUILTIN_JSBUFFERPROTOTYPE_READUINT8 1 +extern const char* const s_jsBufferPrototypeReadUInt8Code; +extern const int s_jsBufferPrototypeReadUInt8CodeLength; +extern const JSC::ConstructAbility s_jsBufferPrototypeReadUInt8CodeConstructAbility; +extern const JSC::ConstructorKind s_jsBufferPrototypeReadUInt8CodeConstructorKind; +extern const JSC::ImplementationVisibility s_jsBufferPrototypeReadUInt8CodeImplementationVisibility; -// readableStreamToArrayDirect -#define WEBCORE_BUILTIN_READABLESTREAMINTERNALS_READABLESTREAMTOARRAYDIRECT 1 -extern const char* const s_readableStreamInternalsReadableStreamToArrayDirectCode; -extern const int s_readableStreamInternalsReadableStreamToArrayDirectCodeLength; -extern const JSC::ConstructAbility s_readableStreamInternalsReadableStreamToArrayDirectCodeConstructAbility; -extern const JSC::ConstructorKind s_readableStreamInternalsReadableStreamToArrayDirectCodeConstructorKind; -extern const JSC::ImplementationVisibility s_readableStreamInternalsReadableStreamToArrayDirectCodeImplementationVisibility; +// readInt16LE +#define WEBCORE_BUILTIN_JSBUFFERPROTOTYPE_READINT16LE 1 +extern const char* const s_jsBufferPrototypeReadInt16LECode; +extern const int s_jsBufferPrototypeReadInt16LECodeLength; +extern const JSC::ConstructAbility s_jsBufferPrototypeReadInt16LECodeConstructAbility; +extern const JSC::ConstructorKind s_jsBufferPrototypeReadInt16LECodeConstructorKind; +extern const JSC::ImplementationVisibility s_jsBufferPrototypeReadInt16LECodeImplementationVisibility; -// readableStreamDefineLazyIterators -#define WEBCORE_BUILTIN_READABLESTREAMINTERNALS_READABLESTREAMDEFINELAZYITERATORS 1 -extern const char* const s_readableStreamInternalsReadableStreamDefineLazyIteratorsCode; -extern const int s_readableStreamInternalsReadableStreamDefineLazyIteratorsCodeLength; -extern const JSC::ConstructAbility s_readableStreamInternalsReadableStreamDefineLazyIteratorsCodeConstructAbility; -extern const JSC::ConstructorKind s_readableStreamInternalsReadableStreamDefineLazyIteratorsCodeConstructorKind; -extern const JSC::ImplementationVisibility s_readableStreamInternalsReadableStreamDefineLazyIteratorsCodeImplementationVisibility; +// readInt16BE +#define WEBCORE_BUILTIN_JSBUFFERPROTOTYPE_READINT16BE 1 +extern const char* const s_jsBufferPrototypeReadInt16BECode; +extern const int s_jsBufferPrototypeReadInt16BECodeLength; +extern const JSC::ConstructAbility s_jsBufferPrototypeReadInt16BECodeConstructAbility; +extern const JSC::ConstructorKind s_jsBufferPrototypeReadInt16BECodeConstructorKind; +extern const JSC::ImplementationVisibility s_jsBufferPrototypeReadInt16BECodeImplementationVisibility; -#define WEBCORE_FOREACH_READABLESTREAMINTERNALS_BUILTIN_DATA(macro) \ - macro(readableStreamReaderGenericInitialize, readableStreamInternalsReadableStreamReaderGenericInitialize, 2) \ - macro(privateInitializeReadableStreamDefaultController, readableStreamInternalsPrivateInitializeReadableStreamDefaultController, 4) \ - macro(readableStreamDefaultControllerError, readableStreamInternalsReadableStreamDefaultControllerError, 2) \ - macro(readableStreamPipeTo, readableStreamInternalsReadableStreamPipeTo, 2) \ - macro(acquireReadableStreamDefaultReader, readableStreamInternalsAcquireReadableStreamDefaultReader, 1) \ - macro(setupReadableStreamDefaultController, readableStreamInternalsSetupReadableStreamDefaultController, 8) \ - macro(createReadableStreamController, readableStreamInternalsCreateReadableStreamController, 3) \ - macro(readableStreamDefaultControllerStart, readableStreamInternalsReadableStreamDefaultControllerStart, 1) \ - macro(readableStreamPipeToWritableStream, readableStreamInternalsReadableStreamPipeToWritableStream, 7) \ - macro(pipeToLoop, readableStreamInternalsPipeToLoop, 1) \ - macro(pipeToDoReadWrite, readableStreamInternalsPipeToDoReadWrite, 1) \ - macro(pipeToErrorsMustBePropagatedForward, readableStreamInternalsPipeToErrorsMustBePropagatedForward, 1) \ - macro(pipeToErrorsMustBePropagatedBackward, readableStreamInternalsPipeToErrorsMustBePropagatedBackward, 1) \ - macro(pipeToClosingMustBePropagatedForward, readableStreamInternalsPipeToClosingMustBePropagatedForward, 1) \ - macro(pipeToClosingMustBePropagatedBackward, readableStreamInternalsPipeToClosingMustBePropagatedBackward, 1) \ - macro(pipeToShutdownWithAction, readableStreamInternalsPipeToShutdownWithAction, 2) \ - macro(pipeToShutdown, readableStreamInternalsPipeToShutdown, 1) \ - macro(pipeToFinalize, readableStreamInternalsPipeToFinalize, 1) \ - macro(readableStreamTee, readableStreamInternalsReadableStreamTee, 2) \ - macro(readableStreamTeePullFunction, readableStreamInternalsReadableStreamTeePullFunction, 3) \ - macro(readableStreamTeeBranch1CancelFunction, readableStreamInternalsReadableStreamTeeBranch1CancelFunction, 2) \ - macro(readableStreamTeeBranch2CancelFunction, readableStreamInternalsReadableStreamTeeBranch2CancelFunction, 2) \ - macro(isReadableStream, readableStreamInternalsIsReadableStream, 1) \ - macro(isReadableStreamDefaultReader, readableStreamInternalsIsReadableStreamDefaultReader, 1) \ - macro(isReadableStreamDefaultController, readableStreamInternalsIsReadableStreamDefaultController, 1) \ - macro(readDirectStream, readableStreamInternalsReadDirectStream, 3) \ - macro(assignToStream, readableStreamInternalsAssignToStream, 2) \ - macro(readStreamIntoSink, readableStreamInternalsReadStreamIntoSink, 3) \ - macro(handleDirectStreamError, readableStreamInternalsHandleDirectStreamError, 1) \ - macro(handleDirectStreamErrorReject, readableStreamInternalsHandleDirectStreamErrorReject, 1) \ - macro(onPullDirectStream, readableStreamInternalsOnPullDirectStream, 1) \ - macro(noopDoneFunction, readableStreamInternalsNoopDoneFunction, 0) \ - macro(onReadableStreamDirectControllerClosed, readableStreamInternalsOnReadableStreamDirectControllerClosed, 1) \ - macro(onCloseDirectStream, readableStreamInternalsOnCloseDirectStream, 1) \ - macro(onFlushDirectStream, readableStreamInternalsOnFlushDirectStream, 0) \ - macro(createTextStream, readableStreamInternalsCreateTextStream, 1) \ - macro(initializeTextStream, readableStreamInternalsInitializeTextStream, 2) \ - macro(initializeArrayStream, readableStreamInternalsInitializeArrayStream, 2) \ - macro(initializeArrayBufferStream, readableStreamInternalsInitializeArrayBufferStream, 2) \ - macro(readableStreamError, readableStreamInternalsReadableStreamError, 2) \ - macro(readableStreamDefaultControllerShouldCallPull, readableStreamInternalsReadableStreamDefaultControllerShouldCallPull, 1) \ - macro(readableStreamDefaultControllerCallPullIfNeeded, readableStreamInternalsReadableStreamDefaultControllerCallPullIfNeeded, 1) \ - macro(isReadableStreamLocked, readableStreamInternalsIsReadableStreamLocked, 1) \ - macro(readableStreamDefaultControllerGetDesiredSize, readableStreamInternalsReadableStreamDefaultControllerGetDesiredSize, 1) \ - macro(readableStreamReaderGenericCancel, readableStreamInternalsReadableStreamReaderGenericCancel, 2) \ - macro(readableStreamCancel, readableStreamInternalsReadableStreamCancel, 2) \ - macro(readableStreamDefaultControllerCancel, readableStreamInternalsReadableStreamDefaultControllerCancel, 2) \ - macro(readableStreamDefaultControllerPull, readableStreamInternalsReadableStreamDefaultControllerPull, 1) \ - macro(readableStreamDefaultControllerClose, readableStreamInternalsReadableStreamDefaultControllerClose, 1) \ - macro(readableStreamClose, readableStreamInternalsReadableStreamClose, 1) \ - macro(readableStreamFulfillReadRequest, readableStreamInternalsReadableStreamFulfillReadRequest, 3) \ - macro(readableStreamDefaultControllerEnqueue, readableStreamInternalsReadableStreamDefaultControllerEnqueue, 2) \ - macro(readableStreamDefaultReaderRead, readableStreamInternalsReadableStreamDefaultReaderRead, 1) \ - macro(readableStreamAddReadRequest, readableStreamInternalsReadableStreamAddReadRequest, 1) \ - macro(isReadableStreamDisturbed, readableStreamInternalsIsReadableStreamDisturbed, 1) \ - macro(readableStreamReaderGenericRelease, readableStreamInternalsReadableStreamReaderGenericRelease, 1) \ - macro(readableStreamDefaultControllerCanCloseOrEnqueue, readableStreamInternalsReadableStreamDefaultControllerCanCloseOrEnqueue, 1) \ - macro(lazyLoadStream, readableStreamInternalsLazyLoadStream, 2) \ - macro(readableStreamIntoArray, readableStreamInternalsReadableStreamIntoArray, 1) \ - macro(readableStreamIntoText, readableStreamInternalsReadableStreamIntoText, 1) \ - macro(readableStreamToArrayBufferDirect, readableStreamInternalsReadableStreamToArrayBufferDirect, 2) \ - macro(readableStreamToTextDirect, readableStreamInternalsReadableStreamToTextDirect, 2) \ - macro(readableStreamToArrayDirect, readableStreamInternalsReadableStreamToArrayDirect, 2) \ - macro(readableStreamDefineLazyIterators, readableStreamInternalsReadableStreamDefineLazyIterators, 1) \ +// readUInt16LE +#define WEBCORE_BUILTIN_JSBUFFERPROTOTYPE_READUINT16LE 1 +extern const char* const s_jsBufferPrototypeReadUInt16LECode; +extern const int s_jsBufferPrototypeReadUInt16LECodeLength; +extern const JSC::ConstructAbility s_jsBufferPrototypeReadUInt16LECodeConstructAbility; +extern const JSC::ConstructorKind s_jsBufferPrototypeReadUInt16LECodeConstructorKind; +extern const JSC::ImplementationVisibility s_jsBufferPrototypeReadUInt16LECodeImplementationVisibility; -#define WEBCORE_FOREACH_READABLESTREAMINTERNALS_BUILTIN_CODE(macro) \ - macro(readableStreamInternalsReadableStreamReaderGenericInitializeCode, readableStreamReaderGenericInitialize, ASCIILiteral(), s_readableStreamInternalsReadableStreamReaderGenericInitializeCodeLength) \ - macro(readableStreamInternalsPrivateInitializeReadableStreamDefaultControllerCode, privateInitializeReadableStreamDefaultController, ASCIILiteral(), s_readableStreamInternalsPrivateInitializeReadableStreamDefaultControllerCodeLength) \ - macro(readableStreamInternalsReadableStreamDefaultControllerErrorCode, readableStreamDefaultControllerError, ASCIILiteral(), s_readableStreamInternalsReadableStreamDefaultControllerErrorCodeLength) \ - macro(readableStreamInternalsReadableStreamPipeToCode, readableStreamPipeTo, ASCIILiteral(), s_readableStreamInternalsReadableStreamPipeToCodeLength) \ - macro(readableStreamInternalsAcquireReadableStreamDefaultReaderCode, acquireReadableStreamDefaultReader, ASCIILiteral(), s_readableStreamInternalsAcquireReadableStreamDefaultReaderCodeLength) \ - macro(readableStreamInternalsSetupReadableStreamDefaultControllerCode, setupReadableStreamDefaultController, ASCIILiteral(), s_readableStreamInternalsSetupReadableStreamDefaultControllerCodeLength) \ - macro(readableStreamInternalsCreateReadableStreamControllerCode, createReadableStreamController, ASCIILiteral(), s_readableStreamInternalsCreateReadableStreamControllerCodeLength) \ - macro(readableStreamInternalsReadableStreamDefaultControllerStartCode, readableStreamDefaultControllerStart, ASCIILiteral(), s_readableStreamInternalsReadableStreamDefaultControllerStartCodeLength) \ - macro(readableStreamInternalsReadableStreamPipeToWritableStreamCode, readableStreamPipeToWritableStream, ASCIILiteral(), s_readableStreamInternalsReadableStreamPipeToWritableStreamCodeLength) \ - macro(readableStreamInternalsPipeToLoopCode, pipeToLoop, ASCIILiteral(), s_readableStreamInternalsPipeToLoopCodeLength) \ - macro(readableStreamInternalsPipeToDoReadWriteCode, pipeToDoReadWrite, ASCIILiteral(), s_readableStreamInternalsPipeToDoReadWriteCodeLength) \ - macro(readableStreamInternalsPipeToErrorsMustBePropagatedForwardCode, pipeToErrorsMustBePropagatedForward, ASCIILiteral(), s_readableStreamInternalsPipeToErrorsMustBePropagatedForwardCodeLength) \ - macro(readableStreamInternalsPipeToErrorsMustBePropagatedBackwardCode, pipeToErrorsMustBePropagatedBackward, ASCIILiteral(), s_readableStreamInternalsPipeToErrorsMustBePropagatedBackwardCodeLength) \ - macro(readableStreamInternalsPipeToClosingMustBePropagatedForwardCode, pipeToClosingMustBePropagatedForward, ASCIILiteral(), s_readableStreamInternalsPipeToClosingMustBePropagatedForwardCodeLength) \ - macro(readableStreamInternalsPipeToClosingMustBePropagatedBackwardCode, pipeToClosingMustBePropagatedBackward, ASCIILiteral(), s_readableStreamInternalsPipeToClosingMustBePropagatedBackwardCodeLength) \ - macro(readableStreamInternalsPipeToShutdownWithActionCode, pipeToShutdownWithAction, ASCIILiteral(), s_readableStreamInternalsPipeToShutdownWithActionCodeLength) \ - macro(readableStreamInternalsPipeToShutdownCode, pipeToShutdown, ASCIILiteral(), s_readableStreamInternalsPipeToShutdownCodeLength) \ - macro(readableStreamInternalsPipeToFinalizeCode, pipeToFinalize, ASCIILiteral(), s_readableStreamInternalsPipeToFinalizeCodeLength) \ - macro(readableStreamInternalsReadableStreamTeeCode, readableStreamTee, ASCIILiteral(), s_readableStreamInternalsReadableStreamTeeCodeLength) \ - macro(readableStreamInternalsReadableStreamTeePullFunctionCode, readableStreamTeePullFunction, ASCIILiteral(), s_readableStreamInternalsReadableStreamTeePullFunctionCodeLength) \ - macro(readableStreamInternalsReadableStreamTeeBranch1CancelFunctionCode, readableStreamTeeBranch1CancelFunction, ASCIILiteral(), s_readableStreamInternalsReadableStreamTeeBranch1CancelFunctionCodeLength) \ - macro(readableStreamInternalsReadableStreamTeeBranch2CancelFunctionCode, readableStreamTeeBranch2CancelFunction, ASCIILiteral(), s_readableStreamInternalsReadableStreamTeeBranch2CancelFunctionCodeLength) \ - macro(readableStreamInternalsIsReadableStreamCode, isReadableStream, ASCIILiteral(), s_readableStreamInternalsIsReadableStreamCodeLength) \ - macro(readableStreamInternalsIsReadableStreamDefaultReaderCode, isReadableStreamDefaultReader, ASCIILiteral(), s_readableStreamInternalsIsReadableStreamDefaultReaderCodeLength) \ - macro(readableStreamInternalsIsReadableStreamDefaultControllerCode, isReadableStreamDefaultController, ASCIILiteral(), s_readableStreamInternalsIsReadableStreamDefaultControllerCodeLength) \ - macro(readableStreamInternalsReadDirectStreamCode, readDirectStream, ASCIILiteral(), s_readableStreamInternalsReadDirectStreamCodeLength) \ - macro(readableStreamInternalsAssignToStreamCode, assignToStream, ASCIILiteral(), s_readableStreamInternalsAssignToStreamCodeLength) \ - macro(readableStreamInternalsReadStreamIntoSinkCode, readStreamIntoSink, ASCIILiteral(), s_readableStreamInternalsReadStreamIntoSinkCodeLength) \ - macro(readableStreamInternalsHandleDirectStreamErrorCode, handleDirectStreamError, ASCIILiteral(), s_readableStreamInternalsHandleDirectStreamErrorCodeLength) \ - macro(readableStreamInternalsHandleDirectStreamErrorRejectCode, handleDirectStreamErrorReject, ASCIILiteral(), s_readableStreamInternalsHandleDirectStreamErrorRejectCodeLength) \ - macro(readableStreamInternalsOnPullDirectStreamCode, onPullDirectStream, ASCIILiteral(), s_readableStreamInternalsOnPullDirectStreamCodeLength) \ - macro(readableStreamInternalsNoopDoneFunctionCode, noopDoneFunction, ASCIILiteral(), s_readableStreamInternalsNoopDoneFunctionCodeLength) \ - macro(readableStreamInternalsOnReadableStreamDirectControllerClosedCode, onReadableStreamDirectControllerClosed, ASCIILiteral(), s_readableStreamInternalsOnReadableStreamDirectControllerClosedCodeLength) \ - macro(readableStreamInternalsOnCloseDirectStreamCode, onCloseDirectStream, ASCIILiteral(), s_readableStreamInternalsOnCloseDirectStreamCodeLength) \ - macro(readableStreamInternalsOnFlushDirectStreamCode, onFlushDirectStream, ASCIILiteral(), s_readableStreamInternalsOnFlushDirectStreamCodeLength) \ - macro(readableStreamInternalsCreateTextStreamCode, createTextStream, ASCIILiteral(), s_readableStreamInternalsCreateTextStreamCodeLength) \ - macro(readableStreamInternalsInitializeTextStreamCode, initializeTextStream, ASCIILiteral(), s_readableStreamInternalsInitializeTextStreamCodeLength) \ - macro(readableStreamInternalsInitializeArrayStreamCode, initializeArrayStream, ASCIILiteral(), s_readableStreamInternalsInitializeArrayStreamCodeLength) \ - macro(readableStreamInternalsInitializeArrayBufferStreamCode, initializeArrayBufferStream, ASCIILiteral(), s_readableStreamInternalsInitializeArrayBufferStreamCodeLength) \ - macro(readableStreamInternalsReadableStreamErrorCode, readableStreamError, ASCIILiteral(), s_readableStreamInternalsReadableStreamErrorCodeLength) \ - macro(readableStreamInternalsReadableStreamDefaultControllerShouldCallPullCode, readableStreamDefaultControllerShouldCallPull, ASCIILiteral(), s_readableStreamInternalsReadableStreamDefaultControllerShouldCallPullCodeLength) \ - macro(readableStreamInternalsReadableStreamDefaultControllerCallPullIfNeededCode, readableStreamDefaultControllerCallPullIfNeeded, ASCIILiteral(), s_readableStreamInternalsReadableStreamDefaultControllerCallPullIfNeededCodeLength) \ - macro(readableStreamInternalsIsReadableStreamLockedCode, isReadableStreamLocked, ASCIILiteral(), s_readableStreamInternalsIsReadableStreamLockedCodeLength) \ - macro(readableStreamInternalsReadableStreamDefaultControllerGetDesiredSizeCode, readableStreamDefaultControllerGetDesiredSize, ASCIILiteral(), s_readableStreamInternalsReadableStreamDefaultControllerGetDesiredSizeCodeLength) \ - macro(readableStreamInternalsReadableStreamReaderGenericCancelCode, readableStreamReaderGenericCancel, ASCIILiteral(), s_readableStreamInternalsReadableStreamReaderGenericCancelCodeLength) \ - macro(readableStreamInternalsReadableStreamCancelCode, readableStreamCancel, ASCIILiteral(), s_readableStreamInternalsReadableStreamCancelCodeLength) \ - macro(readableStreamInternalsReadableStreamDefaultControllerCancelCode, readableStreamDefaultControllerCancel, ASCIILiteral(), s_readableStreamInternalsReadableStreamDefaultControllerCancelCodeLength) \ - macro(readableStreamInternalsReadableStreamDefaultControllerPullCode, readableStreamDefaultControllerPull, ASCIILiteral(), s_readableStreamInternalsReadableStreamDefaultControllerPullCodeLength) \ - macro(readableStreamInternalsReadableStreamDefaultControllerCloseCode, readableStreamDefaultControllerClose, ASCIILiteral(), s_readableStreamInternalsReadableStreamDefaultControllerCloseCodeLength) \ - macro(readableStreamInternalsReadableStreamCloseCode, readableStreamClose, ASCIILiteral(), s_readableStreamInternalsReadableStreamCloseCodeLength) \ - macro(readableStreamInternalsReadableStreamFulfillReadRequestCode, readableStreamFulfillReadRequest, ASCIILiteral(), s_readableStreamInternalsReadableStreamFulfillReadRequestCodeLength) \ - macro(readableStreamInternalsReadableStreamDefaultControllerEnqueueCode, readableStreamDefaultControllerEnqueue, ASCIILiteral(), s_readableStreamInternalsReadableStreamDefaultControllerEnqueueCodeLength) \ - macro(readableStreamInternalsReadableStreamDefaultReaderReadCode, readableStreamDefaultReaderRead, ASCIILiteral(), s_readableStreamInternalsReadableStreamDefaultReaderReadCodeLength) \ - macro(readableStreamInternalsReadableStreamAddReadRequestCode, readableStreamAddReadRequest, ASCIILiteral(), s_readableStreamInternalsReadableStreamAddReadRequestCodeLength) \ - macro(readableStreamInternalsIsReadableStreamDisturbedCode, isReadableStreamDisturbed, ASCIILiteral(), s_readableStreamInternalsIsReadableStreamDisturbedCodeLength) \ - macro(readableStreamInternalsReadableStreamReaderGenericReleaseCode, readableStreamReaderGenericRelease, ASCIILiteral(), s_readableStreamInternalsReadableStreamReaderGenericReleaseCodeLength) \ - macro(readableStreamInternalsReadableStreamDefaultControllerCanCloseOrEnqueueCode, readableStreamDefaultControllerCanCloseOrEnqueue, ASCIILiteral(), s_readableStreamInternalsReadableStreamDefaultControllerCanCloseOrEnqueueCodeLength) \ - macro(readableStreamInternalsLazyLoadStreamCode, lazyLoadStream, ASCIILiteral(), s_readableStreamInternalsLazyLoadStreamCodeLength) \ - macro(readableStreamInternalsReadableStreamIntoArrayCode, readableStreamIntoArray, ASCIILiteral(), s_readableStreamInternalsReadableStreamIntoArrayCodeLength) \ - macro(readableStreamInternalsReadableStreamIntoTextCode, readableStreamIntoText, ASCIILiteral(), s_readableStreamInternalsReadableStreamIntoTextCodeLength) \ - macro(readableStreamInternalsReadableStreamToArrayBufferDirectCode, readableStreamToArrayBufferDirect, ASCIILiteral(), s_readableStreamInternalsReadableStreamToArrayBufferDirectCodeLength) \ - macro(readableStreamInternalsReadableStreamToTextDirectCode, readableStreamToTextDirect, ASCIILiteral(), s_readableStreamInternalsReadableStreamToTextDirectCodeLength) \ - macro(readableStreamInternalsReadableStreamToArrayDirectCode, readableStreamToArrayDirect, ASCIILiteral(), s_readableStreamInternalsReadableStreamToArrayDirectCodeLength) \ - macro(readableStreamInternalsReadableStreamDefineLazyIteratorsCode, readableStreamDefineLazyIterators, ASCIILiteral(), s_readableStreamInternalsReadableStreamDefineLazyIteratorsCodeLength) \ +// readUInt16BE +#define WEBCORE_BUILTIN_JSBUFFERPROTOTYPE_READUINT16BE 1 +extern const char* const s_jsBufferPrototypeReadUInt16BECode; +extern const int s_jsBufferPrototypeReadUInt16BECodeLength; +extern const JSC::ConstructAbility s_jsBufferPrototypeReadUInt16BECodeConstructAbility; +extern const JSC::ConstructorKind s_jsBufferPrototypeReadUInt16BECodeConstructorKind; +extern const JSC::ImplementationVisibility s_jsBufferPrototypeReadUInt16BECodeImplementationVisibility; -#define WEBCORE_FOREACH_READABLESTREAMINTERNALS_BUILTIN_FUNCTION_NAME(macro) \ - macro(readableStreamReaderGenericInitialize) \ - macro(privateInitializeReadableStreamDefaultController) \ - macro(readableStreamDefaultControllerError) \ - macro(readableStreamPipeTo) \ - macro(acquireReadableStreamDefaultReader) \ - macro(setupReadableStreamDefaultController) \ - macro(createReadableStreamController) \ - macro(readableStreamDefaultControllerStart) \ - macro(readableStreamPipeToWritableStream) \ - macro(pipeToLoop) \ - macro(pipeToDoReadWrite) \ - macro(pipeToErrorsMustBePropagatedForward) \ - macro(pipeToErrorsMustBePropagatedBackward) \ - macro(pipeToClosingMustBePropagatedForward) \ - macro(pipeToClosingMustBePropagatedBackward) \ - macro(pipeToShutdownWithAction) \ - macro(pipeToShutdown) \ - macro(pipeToFinalize) \ - macro(readableStreamTee) \ - macro(readableStreamTeePullFunction) \ - macro(readableStreamTeeBranch1CancelFunction) \ - macro(readableStreamTeeBranch2CancelFunction) \ - macro(isReadableStream) \ - macro(isReadableStreamDefaultReader) \ - macro(isReadableStreamDefaultController) \ - macro(readDirectStream) \ - macro(assignToStream) \ - macro(readStreamIntoSink) \ - macro(handleDirectStreamError) \ - macro(handleDirectStreamErrorReject) \ - macro(onPullDirectStream) \ - macro(noopDoneFunction) \ - macro(onReadableStreamDirectControllerClosed) \ - macro(onCloseDirectStream) \ - macro(onFlushDirectStream) \ - macro(createTextStream) \ - macro(initializeTextStream) \ - macro(initializeArrayStream) \ - macro(initializeArrayBufferStream) \ - macro(readableStreamError) \ - macro(readableStreamDefaultControllerShouldCallPull) \ - macro(readableStreamDefaultControllerCallPullIfNeeded) \ - macro(isReadableStreamLocked) \ - macro(readableStreamDefaultControllerGetDesiredSize) \ - macro(readableStreamReaderGenericCancel) \ - macro(readableStreamCancel) \ - macro(readableStreamDefaultControllerCancel) \ - macro(readableStreamDefaultControllerPull) \ - macro(readableStreamDefaultControllerClose) \ - macro(readableStreamClose) \ - macro(readableStreamFulfillReadRequest) \ - macro(readableStreamDefaultControllerEnqueue) \ - macro(readableStreamDefaultReaderRead) \ - macro(readableStreamAddReadRequest) \ - macro(isReadableStreamDisturbed) \ - macro(readableStreamReaderGenericRelease) \ - macro(readableStreamDefaultControllerCanCloseOrEnqueue) \ - macro(lazyLoadStream) \ - macro(readableStreamIntoArray) \ - macro(readableStreamIntoText) \ - macro(readableStreamToArrayBufferDirect) \ - macro(readableStreamToTextDirect) \ - macro(readableStreamToArrayDirect) \ - macro(readableStreamDefineLazyIterators) \ +// readInt32LE +#define WEBCORE_BUILTIN_JSBUFFERPROTOTYPE_READINT32LE 1 +extern const char* const s_jsBufferPrototypeReadInt32LECode; +extern const int s_jsBufferPrototypeReadInt32LECodeLength; +extern const JSC::ConstructAbility s_jsBufferPrototypeReadInt32LECodeConstructAbility; +extern const JSC::ConstructorKind s_jsBufferPrototypeReadInt32LECodeConstructorKind; +extern const JSC::ImplementationVisibility s_jsBufferPrototypeReadInt32LECodeImplementationVisibility; -#define DECLARE_BUILTIN_GENERATOR(codeName, functionName, overriddenName, argumentCount) \ - JSC::FunctionExecutable* codeName##Generator(JSC::VM&); +// readInt32BE +#define WEBCORE_BUILTIN_JSBUFFERPROTOTYPE_READINT32BE 1 +extern const char* const s_jsBufferPrototypeReadInt32BECode; +extern const int s_jsBufferPrototypeReadInt32BECodeLength; +extern const JSC::ConstructAbility s_jsBufferPrototypeReadInt32BECodeConstructAbility; +extern const JSC::ConstructorKind s_jsBufferPrototypeReadInt32BECodeConstructorKind; +extern const JSC::ImplementationVisibility s_jsBufferPrototypeReadInt32BECodeImplementationVisibility; -WEBCORE_FOREACH_READABLESTREAMINTERNALS_BUILTIN_CODE(DECLARE_BUILTIN_GENERATOR) -#undef DECLARE_BUILTIN_GENERATOR +// readUInt32LE +#define WEBCORE_BUILTIN_JSBUFFERPROTOTYPE_READUINT32LE 1 +extern const char* const s_jsBufferPrototypeReadUInt32LECode; +extern const int s_jsBufferPrototypeReadUInt32LECodeLength; +extern const JSC::ConstructAbility s_jsBufferPrototypeReadUInt32LECodeConstructAbility; +extern const JSC::ConstructorKind s_jsBufferPrototypeReadUInt32LECodeConstructorKind; +extern const JSC::ImplementationVisibility s_jsBufferPrototypeReadUInt32LECodeImplementationVisibility; -class ReadableStreamInternalsBuiltinsWrapper : private JSC::WeakHandleOwner { -public: - explicit ReadableStreamInternalsBuiltinsWrapper(JSC::VM& vm) - : m_vm(vm) - WEBCORE_FOREACH_READABLESTREAMINTERNALS_BUILTIN_FUNCTION_NAME(INITIALIZE_BUILTIN_NAMES) -#define INITIALIZE_BUILTIN_SOURCE_MEMBERS(name, functionName, overriddenName, length) , m_##name##Source(JSC::makeSource(StringImpl::createWithoutCopying(s_##name, length), { }, JSC::SourceTaintedOrigin::Untainted)) - WEBCORE_FOREACH_READABLESTREAMINTERNALS_BUILTIN_CODE(INITIALIZE_BUILTIN_SOURCE_MEMBERS) -#undef INITIALIZE_BUILTIN_SOURCE_MEMBERS - { - } +// readUInt32BE +#define WEBCORE_BUILTIN_JSBUFFERPROTOTYPE_READUINT32BE 1 +extern const char* const s_jsBufferPrototypeReadUInt32BECode; +extern const int s_jsBufferPrototypeReadUInt32BECodeLength; +extern const JSC::ConstructAbility s_jsBufferPrototypeReadUInt32BECodeConstructAbility; +extern const JSC::ConstructorKind s_jsBufferPrototypeReadUInt32BECodeConstructorKind; +extern const JSC::ImplementationVisibility s_jsBufferPrototypeReadUInt32BECodeImplementationVisibility; -#define EXPOSE_BUILTIN_EXECUTABLES(name, functionName, overriddenName, length) \ - JSC::UnlinkedFunctionExecutable* name##Executable(); \ - const JSC::SourceCode& name##Source() const { return m_##name##Source; } - WEBCORE_FOREACH_READABLESTREAMINTERNALS_BUILTIN_CODE(EXPOSE_BUILTIN_EXECUTABLES) -#undef EXPOSE_BUILTIN_EXECUTABLES +// readIntLE +#define WEBCORE_BUILTIN_JSBUFFERPROTOTYPE_READINTLE 1 +extern const char* const s_jsBufferPrototypeReadIntLECode; +extern const int s_jsBufferPrototypeReadIntLECodeLength; +extern const JSC::ConstructAbility s_jsBufferPrototypeReadIntLECodeConstructAbility; +extern const JSC::ConstructorKind s_jsBufferPrototypeReadIntLECodeConstructorKind; +extern const JSC::ImplementationVisibility s_jsBufferPrototypeReadIntLECodeImplementationVisibility; - WEBCORE_FOREACH_READABLESTREAMINTERNALS_BUILTIN_FUNCTION_NAME(DECLARE_BUILTIN_IDENTIFIER_ACCESSOR) +// readIntBE +#define WEBCORE_BUILTIN_JSBUFFERPROTOTYPE_READINTBE 1 +extern const char* const s_jsBufferPrototypeReadIntBECode; +extern const int s_jsBufferPrototypeReadIntBECodeLength; +extern const JSC::ConstructAbility s_jsBufferPrototypeReadIntBECodeConstructAbility; +extern const JSC::ConstructorKind s_jsBufferPrototypeReadIntBECodeConstructorKind; +extern const JSC::ImplementationVisibility s_jsBufferPrototypeReadIntBECodeImplementationVisibility; - void exportNames(); +// readUIntLE +#define WEBCORE_BUILTIN_JSBUFFERPROTOTYPE_READUINTLE 1 +extern const char* const s_jsBufferPrototypeReadUIntLECode; +extern const int s_jsBufferPrototypeReadUIntLECodeLength; +extern const JSC::ConstructAbility s_jsBufferPrototypeReadUIntLECodeConstructAbility; +extern const JSC::ConstructorKind s_jsBufferPrototypeReadUIntLECodeConstructorKind; +extern const JSC::ImplementationVisibility s_jsBufferPrototypeReadUIntLECodeImplementationVisibility; -private: - JSC::VM& m_vm; +// readUIntBE +#define WEBCORE_BUILTIN_JSBUFFERPROTOTYPE_READUINTBE 1 +extern const char* const s_jsBufferPrototypeReadUIntBECode; +extern const int s_jsBufferPrototypeReadUIntBECodeLength; +extern const JSC::ConstructAbility s_jsBufferPrototypeReadUIntBECodeConstructAbility; +extern const JSC::ConstructorKind s_jsBufferPrototypeReadUIntBECodeConstructorKind; +extern const JSC::ImplementationVisibility s_jsBufferPrototypeReadUIntBECodeImplementationVisibility; - WEBCORE_FOREACH_READABLESTREAMINTERNALS_BUILTIN_FUNCTION_NAME(DECLARE_BUILTIN_NAMES) +// readFloatLE +#define WEBCORE_BUILTIN_JSBUFFERPROTOTYPE_READFLOATLE 1 +extern const char* const s_jsBufferPrototypeReadFloatLECode; +extern const int s_jsBufferPrototypeReadFloatLECodeLength; +extern const JSC::ConstructAbility s_jsBufferPrototypeReadFloatLECodeConstructAbility; +extern const JSC::ConstructorKind s_jsBufferPrototypeReadFloatLECodeConstructorKind; +extern const JSC::ImplementationVisibility s_jsBufferPrototypeReadFloatLECodeImplementationVisibility; -#define DECLARE_BUILTIN_SOURCE_MEMBERS(name, functionName, overriddenName, length) \ - JSC::SourceCode m_##name##Source;\ - JSC::Weak m_##name##Executable; - WEBCORE_FOREACH_READABLESTREAMINTERNALS_BUILTIN_CODE(DECLARE_BUILTIN_SOURCE_MEMBERS) -#undef DECLARE_BUILTIN_SOURCE_MEMBERS +// readFloatBE +#define WEBCORE_BUILTIN_JSBUFFERPROTOTYPE_READFLOATBE 1 +extern const char* const s_jsBufferPrototypeReadFloatBECode; +extern const int s_jsBufferPrototypeReadFloatBECodeLength; +extern const JSC::ConstructAbility s_jsBufferPrototypeReadFloatBECodeConstructAbility; +extern const JSC::ConstructorKind s_jsBufferPrototypeReadFloatBECodeConstructorKind; +extern const JSC::ImplementationVisibility s_jsBufferPrototypeReadFloatBECodeImplementationVisibility; -}; +// readDoubleLE +#define WEBCORE_BUILTIN_JSBUFFERPROTOTYPE_READDOUBLELE 1 +extern const char* const s_jsBufferPrototypeReadDoubleLECode; +extern const int s_jsBufferPrototypeReadDoubleLECodeLength; +extern const JSC::ConstructAbility s_jsBufferPrototypeReadDoubleLECodeConstructAbility; +extern const JSC::ConstructorKind s_jsBufferPrototypeReadDoubleLECodeConstructorKind; +extern const JSC::ImplementationVisibility s_jsBufferPrototypeReadDoubleLECodeImplementationVisibility; -#define DEFINE_BUILTIN_EXECUTABLES(name, functionName, overriddenName, length) \ -inline JSC::UnlinkedFunctionExecutable* ReadableStreamInternalsBuiltinsWrapper::name##Executable() \ -{\ - if (!m_##name##Executable) {\ - JSC::Identifier executableName = functionName##PublicName();\ - if (overriddenName)\ - executableName = JSC::Identifier::fromString(m_vm, overriddenName);\ - m_##name##Executable = JSC::Weak(JSC::createBuiltinExecutable(m_vm, m_##name##Source, executableName, s_##name##ImplementationVisibility, s_##name##ConstructorKind, s_##name##ConstructAbility), this, &m_##name##Executable);\ - }\ - return m_##name##Executable.get();\ -} -WEBCORE_FOREACH_READABLESTREAMINTERNALS_BUILTIN_CODE(DEFINE_BUILTIN_EXECUTABLES) -#undef DEFINE_BUILTIN_EXECUTABLES +// readDoubleBE +#define WEBCORE_BUILTIN_JSBUFFERPROTOTYPE_READDOUBLEBE 1 +extern const char* const s_jsBufferPrototypeReadDoubleBECode; +extern const int s_jsBufferPrototypeReadDoubleBECodeLength; +extern const JSC::ConstructAbility s_jsBufferPrototypeReadDoubleBECodeConstructAbility; +extern const JSC::ConstructorKind s_jsBufferPrototypeReadDoubleBECodeConstructorKind; +extern const JSC::ImplementationVisibility s_jsBufferPrototypeReadDoubleBECodeImplementationVisibility; -inline void ReadableStreamInternalsBuiltinsWrapper::exportNames() -{ -#define EXPORT_FUNCTION_NAME(name) m_vm.propertyNames->appendExternalName(name##PublicName(), name##PrivateName()); - WEBCORE_FOREACH_READABLESTREAMINTERNALS_BUILTIN_FUNCTION_NAME(EXPORT_FUNCTION_NAME) -#undef EXPORT_FUNCTION_NAME -} -class ReadableStreamInternalsBuiltinFunctions { -public: - explicit ReadableStreamInternalsBuiltinFunctions(JSC::VM& vm) : m_vm(vm) { } +// readBigInt64LE +#define WEBCORE_BUILTIN_JSBUFFERPROTOTYPE_READBIGINT64LE 1 +extern const char* const s_jsBufferPrototypeReadBigInt64LECode; +extern const int s_jsBufferPrototypeReadBigInt64LECodeLength; +extern const JSC::ConstructAbility s_jsBufferPrototypeReadBigInt64LECodeConstructAbility; +extern const JSC::ConstructorKind s_jsBufferPrototypeReadBigInt64LECodeConstructorKind; +extern const JSC::ImplementationVisibility s_jsBufferPrototypeReadBigInt64LECodeImplementationVisibility; - void init(JSC::JSGlobalObject&); - template void visit(Visitor&); +// readBigInt64BE +#define WEBCORE_BUILTIN_JSBUFFERPROTOTYPE_READBIGINT64BE 1 +extern const char* const s_jsBufferPrototypeReadBigInt64BECode; +extern const int s_jsBufferPrototypeReadBigInt64BECodeLength; +extern const JSC::ConstructAbility s_jsBufferPrototypeReadBigInt64BECodeConstructAbility; +extern const JSC::ConstructorKind s_jsBufferPrototypeReadBigInt64BECodeConstructorKind; +extern const JSC::ImplementationVisibility s_jsBufferPrototypeReadBigInt64BECodeImplementationVisibility; -public: - JSC::VM& m_vm; +// readBigUInt64LE +#define WEBCORE_BUILTIN_JSBUFFERPROTOTYPE_READBIGUINT64LE 1 +extern const char* const s_jsBufferPrototypeReadBigUInt64LECode; +extern const int s_jsBufferPrototypeReadBigUInt64LECodeLength; +extern const JSC::ConstructAbility s_jsBufferPrototypeReadBigUInt64LECodeConstructAbility; +extern const JSC::ConstructorKind s_jsBufferPrototypeReadBigUInt64LECodeConstructorKind; +extern const JSC::ImplementationVisibility s_jsBufferPrototypeReadBigUInt64LECodeImplementationVisibility; -#define DECLARE_BUILTIN_SOURCE_MEMBERS(functionName) \ - JSC::WriteBarrier m_##functionName##Function; - WEBCORE_FOREACH_READABLESTREAMINTERNALS_BUILTIN_FUNCTION_NAME(DECLARE_BUILTIN_SOURCE_MEMBERS) -#undef DECLARE_BUILTIN_SOURCE_MEMBERS -}; +// readBigUInt64BE +#define WEBCORE_BUILTIN_JSBUFFERPROTOTYPE_READBIGUINT64BE 1 +extern const char* const s_jsBufferPrototypeReadBigUInt64BECode; +extern const int s_jsBufferPrototypeReadBigUInt64BECodeLength; +extern const JSC::ConstructAbility s_jsBufferPrototypeReadBigUInt64BECodeConstructAbility; +extern const JSC::ConstructorKind s_jsBufferPrototypeReadBigUInt64BECodeConstructorKind; +extern const JSC::ImplementationVisibility s_jsBufferPrototypeReadBigUInt64BECodeImplementationVisibility; -inline void ReadableStreamInternalsBuiltinFunctions::init(JSC::JSGlobalObject& globalObject) -{ -#define EXPORT_FUNCTION(codeName, functionName, overriddenName, length) \ - m_##functionName##Function.set(m_vm, &globalObject, JSC::JSFunction::create(m_vm, codeName##Generator(m_vm), &globalObject)); - WEBCORE_FOREACH_READABLESTREAMINTERNALS_BUILTIN_CODE(EXPORT_FUNCTION) -#undef EXPORT_FUNCTION -} +// writeInt8 +#define WEBCORE_BUILTIN_JSBUFFERPROTOTYPE_WRITEINT8 1 +extern const char* const s_jsBufferPrototypeWriteInt8Code; +extern const int s_jsBufferPrototypeWriteInt8CodeLength; +extern const JSC::ConstructAbility s_jsBufferPrototypeWriteInt8CodeConstructAbility; +extern const JSC::ConstructorKind s_jsBufferPrototypeWriteInt8CodeConstructorKind; +extern const JSC::ImplementationVisibility s_jsBufferPrototypeWriteInt8CodeImplementationVisibility; -template -inline void ReadableStreamInternalsBuiltinFunctions::visit(Visitor& visitor) -{ -#define VISIT_FUNCTION(name) visitor.append(m_##name##Function); - WEBCORE_FOREACH_READABLESTREAMINTERNALS_BUILTIN_FUNCTION_NAME(VISIT_FUNCTION) -#undef VISIT_FUNCTION -} +// writeUInt8 +#define WEBCORE_BUILTIN_JSBUFFERPROTOTYPE_WRITEUINT8 1 +extern const char* const s_jsBufferPrototypeWriteUInt8Code; +extern const int s_jsBufferPrototypeWriteUInt8CodeLength; +extern const JSC::ConstructAbility s_jsBufferPrototypeWriteUInt8CodeConstructAbility; +extern const JSC::ConstructorKind s_jsBufferPrototypeWriteUInt8CodeConstructorKind; +extern const JSC::ImplementationVisibility s_jsBufferPrototypeWriteUInt8CodeImplementationVisibility; -template void ReadableStreamInternalsBuiltinFunctions::visit(JSC::AbstractSlotVisitor&); -template void ReadableStreamInternalsBuiltinFunctions::visit(JSC::SlotVisitor&); - /* TransformStreamDefaultController.ts */ -// initializeTransformStreamDefaultController -#define WEBCORE_BUILTIN_TRANSFORMSTREAMDEFAULTCONTROLLER_INITIALIZETRANSFORMSTREAMDEFAULTCONTROLLER 1 -extern const char* const s_transformStreamDefaultControllerInitializeTransformStreamDefaultControllerCode; -extern const int s_transformStreamDefaultControllerInitializeTransformStreamDefaultControllerCodeLength; -extern const JSC::ConstructAbility s_transformStreamDefaultControllerInitializeTransformStreamDefaultControllerCodeConstructAbility; -extern const JSC::ConstructorKind s_transformStreamDefaultControllerInitializeTransformStreamDefaultControllerCodeConstructorKind; -extern const JSC::ImplementationVisibility s_transformStreamDefaultControllerInitializeTransformStreamDefaultControllerCodeImplementationVisibility; +// writeInt16LE +#define WEBCORE_BUILTIN_JSBUFFERPROTOTYPE_WRITEINT16LE 1 +extern const char* const s_jsBufferPrototypeWriteInt16LECode; +extern const int s_jsBufferPrototypeWriteInt16LECodeLength; +extern const JSC::ConstructAbility s_jsBufferPrototypeWriteInt16LECodeConstructAbility; +extern const JSC::ConstructorKind s_jsBufferPrototypeWriteInt16LECodeConstructorKind; +extern const JSC::ImplementationVisibility s_jsBufferPrototypeWriteInt16LECodeImplementationVisibility; -// desiredSize -#define WEBCORE_BUILTIN_TRANSFORMSTREAMDEFAULTCONTROLLER_DESIREDSIZE 1 -extern const char* const s_transformStreamDefaultControllerDesiredSizeCode; -extern const int s_transformStreamDefaultControllerDesiredSizeCodeLength; -extern const JSC::ConstructAbility s_transformStreamDefaultControllerDesiredSizeCodeConstructAbility; -extern const JSC::ConstructorKind s_transformStreamDefaultControllerDesiredSizeCodeConstructorKind; -extern const JSC::ImplementationVisibility s_transformStreamDefaultControllerDesiredSizeCodeImplementationVisibility; +// writeInt16BE +#define WEBCORE_BUILTIN_JSBUFFERPROTOTYPE_WRITEINT16BE 1 +extern const char* const s_jsBufferPrototypeWriteInt16BECode; +extern const int s_jsBufferPrototypeWriteInt16BECodeLength; +extern const JSC::ConstructAbility s_jsBufferPrototypeWriteInt16BECodeConstructAbility; +extern const JSC::ConstructorKind s_jsBufferPrototypeWriteInt16BECodeConstructorKind; +extern const JSC::ImplementationVisibility s_jsBufferPrototypeWriteInt16BECodeImplementationVisibility; -// enqueue -#define WEBCORE_BUILTIN_TRANSFORMSTREAMDEFAULTCONTROLLER_ENQUEUE 1 -extern const char* const s_transformStreamDefaultControllerEnqueueCode; -extern const int s_transformStreamDefaultControllerEnqueueCodeLength; -extern const JSC::ConstructAbility s_transformStreamDefaultControllerEnqueueCodeConstructAbility; -extern const JSC::ConstructorKind s_transformStreamDefaultControllerEnqueueCodeConstructorKind; -extern const JSC::ImplementationVisibility s_transformStreamDefaultControllerEnqueueCodeImplementationVisibility; +// writeUInt16LE +#define WEBCORE_BUILTIN_JSBUFFERPROTOTYPE_WRITEUINT16LE 1 +extern const char* const s_jsBufferPrototypeWriteUInt16LECode; +extern const int s_jsBufferPrototypeWriteUInt16LECodeLength; +extern const JSC::ConstructAbility s_jsBufferPrototypeWriteUInt16LECodeConstructAbility; +extern const JSC::ConstructorKind s_jsBufferPrototypeWriteUInt16LECodeConstructorKind; +extern const JSC::ImplementationVisibility s_jsBufferPrototypeWriteUInt16LECodeImplementationVisibility; -// error -#define WEBCORE_BUILTIN_TRANSFORMSTREAMDEFAULTCONTROLLER_ERROR 1 -extern const char* const s_transformStreamDefaultControllerErrorCode; -extern const int s_transformStreamDefaultControllerErrorCodeLength; -extern const JSC::ConstructAbility s_transformStreamDefaultControllerErrorCodeConstructAbility; -extern const JSC::ConstructorKind s_transformStreamDefaultControllerErrorCodeConstructorKind; -extern const JSC::ImplementationVisibility s_transformStreamDefaultControllerErrorCodeImplementationVisibility; +// writeUInt16BE +#define WEBCORE_BUILTIN_JSBUFFERPROTOTYPE_WRITEUINT16BE 1 +extern const char* const s_jsBufferPrototypeWriteUInt16BECode; +extern const int s_jsBufferPrototypeWriteUInt16BECodeLength; +extern const JSC::ConstructAbility s_jsBufferPrototypeWriteUInt16BECodeConstructAbility; +extern const JSC::ConstructorKind s_jsBufferPrototypeWriteUInt16BECodeConstructorKind; +extern const JSC::ImplementationVisibility s_jsBufferPrototypeWriteUInt16BECodeImplementationVisibility; -// terminate -#define WEBCORE_BUILTIN_TRANSFORMSTREAMDEFAULTCONTROLLER_TERMINATE 1 -extern const char* const s_transformStreamDefaultControllerTerminateCode; -extern const int s_transformStreamDefaultControllerTerminateCodeLength; -extern const JSC::ConstructAbility s_transformStreamDefaultControllerTerminateCodeConstructAbility; -extern const JSC::ConstructorKind s_transformStreamDefaultControllerTerminateCodeConstructorKind; -extern const JSC::ImplementationVisibility s_transformStreamDefaultControllerTerminateCodeImplementationVisibility; +// writeInt32LE +#define WEBCORE_BUILTIN_JSBUFFERPROTOTYPE_WRITEINT32LE 1 +extern const char* const s_jsBufferPrototypeWriteInt32LECode; +extern const int s_jsBufferPrototypeWriteInt32LECodeLength; +extern const JSC::ConstructAbility s_jsBufferPrototypeWriteInt32LECodeConstructAbility; +extern const JSC::ConstructorKind s_jsBufferPrototypeWriteInt32LECodeConstructorKind; +extern const JSC::ImplementationVisibility s_jsBufferPrototypeWriteInt32LECodeImplementationVisibility; -#define WEBCORE_FOREACH_TRANSFORMSTREAMDEFAULTCONTROLLER_BUILTIN_DATA(macro) \ - macro(initializeTransformStreamDefaultController, transformStreamDefaultControllerInitializeTransformStreamDefaultController, 0) \ - macro(desiredSize, transformStreamDefaultControllerDesiredSize, 0) \ - macro(enqueue, transformStreamDefaultControllerEnqueue, 1) \ - macro(error, transformStreamDefaultControllerError, 1) \ - macro(terminate, transformStreamDefaultControllerTerminate, 0) \ +// writeInt32BE +#define WEBCORE_BUILTIN_JSBUFFERPROTOTYPE_WRITEINT32BE 1 +extern const char* const s_jsBufferPrototypeWriteInt32BECode; +extern const int s_jsBufferPrototypeWriteInt32BECodeLength; +extern const JSC::ConstructAbility s_jsBufferPrototypeWriteInt32BECodeConstructAbility; +extern const JSC::ConstructorKind s_jsBufferPrototypeWriteInt32BECodeConstructorKind; +extern const JSC::ImplementationVisibility s_jsBufferPrototypeWriteInt32BECodeImplementationVisibility; -#define WEBCORE_FOREACH_TRANSFORMSTREAMDEFAULTCONTROLLER_BUILTIN_CODE(macro) \ - macro(transformStreamDefaultControllerInitializeTransformStreamDefaultControllerCode, initializeTransformStreamDefaultController, ASCIILiteral(), s_transformStreamDefaultControllerInitializeTransformStreamDefaultControllerCodeLength) \ - macro(transformStreamDefaultControllerDesiredSizeCode, desiredSize, "get desiredSize"_s, s_transformStreamDefaultControllerDesiredSizeCodeLength) \ - macro(transformStreamDefaultControllerEnqueueCode, enqueue, ASCIILiteral(), s_transformStreamDefaultControllerEnqueueCodeLength) \ - macro(transformStreamDefaultControllerErrorCode, error, ASCIILiteral(), s_transformStreamDefaultControllerErrorCodeLength) \ - macro(transformStreamDefaultControllerTerminateCode, terminate, ASCIILiteral(), s_transformStreamDefaultControllerTerminateCodeLength) \ +// writeUInt32LE +#define WEBCORE_BUILTIN_JSBUFFERPROTOTYPE_WRITEUINT32LE 1 +extern const char* const s_jsBufferPrototypeWriteUInt32LECode; +extern const int s_jsBufferPrototypeWriteUInt32LECodeLength; +extern const JSC::ConstructAbility s_jsBufferPrototypeWriteUInt32LECodeConstructAbility; +extern const JSC::ConstructorKind s_jsBufferPrototypeWriteUInt32LECodeConstructorKind; +extern const JSC::ImplementationVisibility s_jsBufferPrototypeWriteUInt32LECodeImplementationVisibility; -#define WEBCORE_FOREACH_TRANSFORMSTREAMDEFAULTCONTROLLER_BUILTIN_FUNCTION_NAME(macro) \ - macro(initializeTransformStreamDefaultController) \ - macro(desiredSize) \ - macro(enqueue) \ - macro(error) \ - macro(terminate) \ +// writeUInt32BE +#define WEBCORE_BUILTIN_JSBUFFERPROTOTYPE_WRITEUINT32BE 1 +extern const char* const s_jsBufferPrototypeWriteUInt32BECode; +extern const int s_jsBufferPrototypeWriteUInt32BECodeLength; +extern const JSC::ConstructAbility s_jsBufferPrototypeWriteUInt32BECodeConstructAbility; +extern const JSC::ConstructorKind s_jsBufferPrototypeWriteUInt32BECodeConstructorKind; +extern const JSC::ImplementationVisibility s_jsBufferPrototypeWriteUInt32BECodeImplementationVisibility; -#define DECLARE_BUILTIN_GENERATOR(codeName, functionName, overriddenName, argumentCount) \ - JSC::FunctionExecutable* codeName##Generator(JSC::VM&); +// writeIntLE +#define WEBCORE_BUILTIN_JSBUFFERPROTOTYPE_WRITEINTLE 1 +extern const char* const s_jsBufferPrototypeWriteIntLECode; +extern const int s_jsBufferPrototypeWriteIntLECodeLength; +extern const JSC::ConstructAbility s_jsBufferPrototypeWriteIntLECodeConstructAbility; +extern const JSC::ConstructorKind s_jsBufferPrototypeWriteIntLECodeConstructorKind; +extern const JSC::ImplementationVisibility s_jsBufferPrototypeWriteIntLECodeImplementationVisibility; -WEBCORE_FOREACH_TRANSFORMSTREAMDEFAULTCONTROLLER_BUILTIN_CODE(DECLARE_BUILTIN_GENERATOR) -#undef DECLARE_BUILTIN_GENERATOR +// writeIntBE +#define WEBCORE_BUILTIN_JSBUFFERPROTOTYPE_WRITEINTBE 1 +extern const char* const s_jsBufferPrototypeWriteIntBECode; +extern const int s_jsBufferPrototypeWriteIntBECodeLength; +extern const JSC::ConstructAbility s_jsBufferPrototypeWriteIntBECodeConstructAbility; +extern const JSC::ConstructorKind s_jsBufferPrototypeWriteIntBECodeConstructorKind; +extern const JSC::ImplementationVisibility s_jsBufferPrototypeWriteIntBECodeImplementationVisibility; -class TransformStreamDefaultControllerBuiltinsWrapper : private JSC::WeakHandleOwner { -public: - explicit TransformStreamDefaultControllerBuiltinsWrapper(JSC::VM& vm) - : m_vm(vm) - WEBCORE_FOREACH_TRANSFORMSTREAMDEFAULTCONTROLLER_BUILTIN_FUNCTION_NAME(INITIALIZE_BUILTIN_NAMES) -#define INITIALIZE_BUILTIN_SOURCE_MEMBERS(name, functionName, overriddenName, length) , m_##name##Source(JSC::makeSource(StringImpl::createWithoutCopying(s_##name, length), { }, JSC::SourceTaintedOrigin::Untainted)) - WEBCORE_FOREACH_TRANSFORMSTREAMDEFAULTCONTROLLER_BUILTIN_CODE(INITIALIZE_BUILTIN_SOURCE_MEMBERS) -#undef INITIALIZE_BUILTIN_SOURCE_MEMBERS - { - } +// writeUIntLE +#define WEBCORE_BUILTIN_JSBUFFERPROTOTYPE_WRITEUINTLE 1 +extern const char* const s_jsBufferPrototypeWriteUIntLECode; +extern const int s_jsBufferPrototypeWriteUIntLECodeLength; +extern const JSC::ConstructAbility s_jsBufferPrototypeWriteUIntLECodeConstructAbility; +extern const JSC::ConstructorKind s_jsBufferPrototypeWriteUIntLECodeConstructorKind; +extern const JSC::ImplementationVisibility s_jsBufferPrototypeWriteUIntLECodeImplementationVisibility; -#define EXPOSE_BUILTIN_EXECUTABLES(name, functionName, overriddenName, length) \ - JSC::UnlinkedFunctionExecutable* name##Executable(); \ - const JSC::SourceCode& name##Source() const { return m_##name##Source; } - WEBCORE_FOREACH_TRANSFORMSTREAMDEFAULTCONTROLLER_BUILTIN_CODE(EXPOSE_BUILTIN_EXECUTABLES) -#undef EXPOSE_BUILTIN_EXECUTABLES +// writeUIntBE +#define WEBCORE_BUILTIN_JSBUFFERPROTOTYPE_WRITEUINTBE 1 +extern const char* const s_jsBufferPrototypeWriteUIntBECode; +extern const int s_jsBufferPrototypeWriteUIntBECodeLength; +extern const JSC::ConstructAbility s_jsBufferPrototypeWriteUIntBECodeConstructAbility; +extern const JSC::ConstructorKind s_jsBufferPrototypeWriteUIntBECodeConstructorKind; +extern const JSC::ImplementationVisibility s_jsBufferPrototypeWriteUIntBECodeImplementationVisibility; - WEBCORE_FOREACH_TRANSFORMSTREAMDEFAULTCONTROLLER_BUILTIN_FUNCTION_NAME(DECLARE_BUILTIN_IDENTIFIER_ACCESSOR) +// writeFloatLE +#define WEBCORE_BUILTIN_JSBUFFERPROTOTYPE_WRITEFLOATLE 1 +extern const char* const s_jsBufferPrototypeWriteFloatLECode; +extern const int s_jsBufferPrototypeWriteFloatLECodeLength; +extern const JSC::ConstructAbility s_jsBufferPrototypeWriteFloatLECodeConstructAbility; +extern const JSC::ConstructorKind s_jsBufferPrototypeWriteFloatLECodeConstructorKind; +extern const JSC::ImplementationVisibility s_jsBufferPrototypeWriteFloatLECodeImplementationVisibility; - void exportNames(); +// writeFloatBE +#define WEBCORE_BUILTIN_JSBUFFERPROTOTYPE_WRITEFLOATBE 1 +extern const char* const s_jsBufferPrototypeWriteFloatBECode; +extern const int s_jsBufferPrototypeWriteFloatBECodeLength; +extern const JSC::ConstructAbility s_jsBufferPrototypeWriteFloatBECodeConstructAbility; +extern const JSC::ConstructorKind s_jsBufferPrototypeWriteFloatBECodeConstructorKind; +extern const JSC::ImplementationVisibility s_jsBufferPrototypeWriteFloatBECodeImplementationVisibility; -private: - JSC::VM& m_vm; +// writeDoubleLE +#define WEBCORE_BUILTIN_JSBUFFERPROTOTYPE_WRITEDOUBLELE 1 +extern const char* const s_jsBufferPrototypeWriteDoubleLECode; +extern const int s_jsBufferPrototypeWriteDoubleLECodeLength; +extern const JSC::ConstructAbility s_jsBufferPrototypeWriteDoubleLECodeConstructAbility; +extern const JSC::ConstructorKind s_jsBufferPrototypeWriteDoubleLECodeConstructorKind; +extern const JSC::ImplementationVisibility s_jsBufferPrototypeWriteDoubleLECodeImplementationVisibility; - WEBCORE_FOREACH_TRANSFORMSTREAMDEFAULTCONTROLLER_BUILTIN_FUNCTION_NAME(DECLARE_BUILTIN_NAMES) +// writeDoubleBE +#define WEBCORE_BUILTIN_JSBUFFERPROTOTYPE_WRITEDOUBLEBE 1 +extern const char* const s_jsBufferPrototypeWriteDoubleBECode; +extern const int s_jsBufferPrototypeWriteDoubleBECodeLength; +extern const JSC::ConstructAbility s_jsBufferPrototypeWriteDoubleBECodeConstructAbility; +extern const JSC::ConstructorKind s_jsBufferPrototypeWriteDoubleBECodeConstructorKind; +extern const JSC::ImplementationVisibility s_jsBufferPrototypeWriteDoubleBECodeImplementationVisibility; -#define DECLARE_BUILTIN_SOURCE_MEMBERS(name, functionName, overriddenName, length) \ - JSC::SourceCode m_##name##Source;\ - JSC::Weak m_##name##Executable; - WEBCORE_FOREACH_TRANSFORMSTREAMDEFAULTCONTROLLER_BUILTIN_CODE(DECLARE_BUILTIN_SOURCE_MEMBERS) -#undef DECLARE_BUILTIN_SOURCE_MEMBERS +// writeBigInt64LE +#define WEBCORE_BUILTIN_JSBUFFERPROTOTYPE_WRITEBIGINT64LE 1 +extern const char* const s_jsBufferPrototypeWriteBigInt64LECode; +extern const int s_jsBufferPrototypeWriteBigInt64LECodeLength; +extern const JSC::ConstructAbility s_jsBufferPrototypeWriteBigInt64LECodeConstructAbility; +extern const JSC::ConstructorKind s_jsBufferPrototypeWriteBigInt64LECodeConstructorKind; +extern const JSC::ImplementationVisibility s_jsBufferPrototypeWriteBigInt64LECodeImplementationVisibility; -}; +// writeBigInt64BE +#define WEBCORE_BUILTIN_JSBUFFERPROTOTYPE_WRITEBIGINT64BE 1 +extern const char* const s_jsBufferPrototypeWriteBigInt64BECode; +extern const int s_jsBufferPrototypeWriteBigInt64BECodeLength; +extern const JSC::ConstructAbility s_jsBufferPrototypeWriteBigInt64BECodeConstructAbility; +extern const JSC::ConstructorKind s_jsBufferPrototypeWriteBigInt64BECodeConstructorKind; +extern const JSC::ImplementationVisibility s_jsBufferPrototypeWriteBigInt64BECodeImplementationVisibility; -#define DEFINE_BUILTIN_EXECUTABLES(name, functionName, overriddenName, length) \ -inline JSC::UnlinkedFunctionExecutable* TransformStreamDefaultControllerBuiltinsWrapper::name##Executable() \ -{\ - if (!m_##name##Executable) {\ - JSC::Identifier executableName = functionName##PublicName();\ - if (overriddenName)\ - executableName = JSC::Identifier::fromString(m_vm, overriddenName);\ - m_##name##Executable = JSC::Weak(JSC::createBuiltinExecutable(m_vm, m_##name##Source, executableName, s_##name##ImplementationVisibility, s_##name##ConstructorKind, s_##name##ConstructAbility), this, &m_##name##Executable);\ - }\ - return m_##name##Executable.get();\ -} -WEBCORE_FOREACH_TRANSFORMSTREAMDEFAULTCONTROLLER_BUILTIN_CODE(DEFINE_BUILTIN_EXECUTABLES) -#undef DEFINE_BUILTIN_EXECUTABLES +// writeBigUInt64LE +#define WEBCORE_BUILTIN_JSBUFFERPROTOTYPE_WRITEBIGUINT64LE 1 +extern const char* const s_jsBufferPrototypeWriteBigUInt64LECode; +extern const int s_jsBufferPrototypeWriteBigUInt64LECodeLength; +extern const JSC::ConstructAbility s_jsBufferPrototypeWriteBigUInt64LECodeConstructAbility; +extern const JSC::ConstructorKind s_jsBufferPrototypeWriteBigUInt64LECodeConstructorKind; +extern const JSC::ImplementationVisibility s_jsBufferPrototypeWriteBigUInt64LECodeImplementationVisibility; -inline void TransformStreamDefaultControllerBuiltinsWrapper::exportNames() -{ -#define EXPORT_FUNCTION_NAME(name) m_vm.propertyNames->appendExternalName(name##PublicName(), name##PrivateName()); - WEBCORE_FOREACH_TRANSFORMSTREAMDEFAULTCONTROLLER_BUILTIN_FUNCTION_NAME(EXPORT_FUNCTION_NAME) -#undef EXPORT_FUNCTION_NAME -} -/* ReadableStreamBYOBReader.ts */ -// initializeReadableStreamBYOBReader -#define WEBCORE_BUILTIN_READABLESTREAMBYOBREADER_INITIALIZEREADABLESTREAMBYOBREADER 1 -extern const char* const s_readableStreamBYOBReaderInitializeReadableStreamBYOBReaderCode; -extern const int s_readableStreamBYOBReaderInitializeReadableStreamBYOBReaderCodeLength; -extern const JSC::ConstructAbility s_readableStreamBYOBReaderInitializeReadableStreamBYOBReaderCodeConstructAbility; -extern const JSC::ConstructorKind s_readableStreamBYOBReaderInitializeReadableStreamBYOBReaderCodeConstructorKind; -extern const JSC::ImplementationVisibility s_readableStreamBYOBReaderInitializeReadableStreamBYOBReaderCodeImplementationVisibility; +// writeBigUInt64BE +#define WEBCORE_BUILTIN_JSBUFFERPROTOTYPE_WRITEBIGUINT64BE 1 +extern const char* const s_jsBufferPrototypeWriteBigUInt64BECode; +extern const int s_jsBufferPrototypeWriteBigUInt64BECodeLength; +extern const JSC::ConstructAbility s_jsBufferPrototypeWriteBigUInt64BECodeConstructAbility; +extern const JSC::ConstructorKind s_jsBufferPrototypeWriteBigUInt64BECodeConstructorKind; +extern const JSC::ImplementationVisibility s_jsBufferPrototypeWriteBigUInt64BECodeImplementationVisibility; -// cancel -#define WEBCORE_BUILTIN_READABLESTREAMBYOBREADER_CANCEL 1 -extern const char* const s_readableStreamBYOBReaderCancelCode; -extern const int s_readableStreamBYOBReaderCancelCodeLength; -extern const JSC::ConstructAbility s_readableStreamBYOBReaderCancelCodeConstructAbility; -extern const JSC::ConstructorKind s_readableStreamBYOBReaderCancelCodeConstructorKind; -extern const JSC::ImplementationVisibility s_readableStreamBYOBReaderCancelCodeImplementationVisibility; +// utf8Write +#define WEBCORE_BUILTIN_JSBUFFERPROTOTYPE_UTF8WRITE 1 +extern const char* const s_jsBufferPrototypeUtf8WriteCode; +extern const int s_jsBufferPrototypeUtf8WriteCodeLength; +extern const JSC::ConstructAbility s_jsBufferPrototypeUtf8WriteCodeConstructAbility; +extern const JSC::ConstructorKind s_jsBufferPrototypeUtf8WriteCodeConstructorKind; +extern const JSC::ImplementationVisibility s_jsBufferPrototypeUtf8WriteCodeImplementationVisibility; -// read -#define WEBCORE_BUILTIN_READABLESTREAMBYOBREADER_READ 1 -extern const char* const s_readableStreamBYOBReaderReadCode; -extern const int s_readableStreamBYOBReaderReadCodeLength; -extern const JSC::ConstructAbility s_readableStreamBYOBReaderReadCodeConstructAbility; -extern const JSC::ConstructorKind s_readableStreamBYOBReaderReadCodeConstructorKind; -extern const JSC::ImplementationVisibility s_readableStreamBYOBReaderReadCodeImplementationVisibility; +// ucs2Write +#define WEBCORE_BUILTIN_JSBUFFERPROTOTYPE_UCS2WRITE 1 +extern const char* const s_jsBufferPrototypeUcs2WriteCode; +extern const int s_jsBufferPrototypeUcs2WriteCodeLength; +extern const JSC::ConstructAbility s_jsBufferPrototypeUcs2WriteCodeConstructAbility; +extern const JSC::ConstructorKind s_jsBufferPrototypeUcs2WriteCodeConstructorKind; +extern const JSC::ImplementationVisibility s_jsBufferPrototypeUcs2WriteCodeImplementationVisibility; -// releaseLock -#define WEBCORE_BUILTIN_READABLESTREAMBYOBREADER_RELEASELOCK 1 -extern const char* const s_readableStreamBYOBReaderReleaseLockCode; -extern const int s_readableStreamBYOBReaderReleaseLockCodeLength; -extern const JSC::ConstructAbility s_readableStreamBYOBReaderReleaseLockCodeConstructAbility; -extern const JSC::ConstructorKind s_readableStreamBYOBReaderReleaseLockCodeConstructorKind; -extern const JSC::ImplementationVisibility s_readableStreamBYOBReaderReleaseLockCodeImplementationVisibility; +// utf16leWrite +#define WEBCORE_BUILTIN_JSBUFFERPROTOTYPE_UTF16LEWRITE 1 +extern const char* const s_jsBufferPrototypeUtf16leWriteCode; +extern const int s_jsBufferPrototypeUtf16leWriteCodeLength; +extern const JSC::ConstructAbility s_jsBufferPrototypeUtf16leWriteCodeConstructAbility; +extern const JSC::ConstructorKind s_jsBufferPrototypeUtf16leWriteCodeConstructorKind; +extern const JSC::ImplementationVisibility s_jsBufferPrototypeUtf16leWriteCodeImplementationVisibility; -// closed -#define WEBCORE_BUILTIN_READABLESTREAMBYOBREADER_CLOSED 1 -extern const char* const s_readableStreamBYOBReaderClosedCode; -extern const int s_readableStreamBYOBReaderClosedCodeLength; -extern const JSC::ConstructAbility s_readableStreamBYOBReaderClosedCodeConstructAbility; -extern const JSC::ConstructorKind s_readableStreamBYOBReaderClosedCodeConstructorKind; -extern const JSC::ImplementationVisibility s_readableStreamBYOBReaderClosedCodeImplementationVisibility; +// latin1Write +#define WEBCORE_BUILTIN_JSBUFFERPROTOTYPE_LATIN1WRITE 1 +extern const char* const s_jsBufferPrototypeLatin1WriteCode; +extern const int s_jsBufferPrototypeLatin1WriteCodeLength; +extern const JSC::ConstructAbility s_jsBufferPrototypeLatin1WriteCodeConstructAbility; +extern const JSC::ConstructorKind s_jsBufferPrototypeLatin1WriteCodeConstructorKind; +extern const JSC::ImplementationVisibility s_jsBufferPrototypeLatin1WriteCodeImplementationVisibility; + +// asciiWrite +#define WEBCORE_BUILTIN_JSBUFFERPROTOTYPE_ASCIIWRITE 1 +extern const char* const s_jsBufferPrototypeAsciiWriteCode; +extern const int s_jsBufferPrototypeAsciiWriteCodeLength; +extern const JSC::ConstructAbility s_jsBufferPrototypeAsciiWriteCodeConstructAbility; +extern const JSC::ConstructorKind s_jsBufferPrototypeAsciiWriteCodeConstructorKind; +extern const JSC::ImplementationVisibility s_jsBufferPrototypeAsciiWriteCodeImplementationVisibility; -#define WEBCORE_FOREACH_READABLESTREAMBYOBREADER_BUILTIN_DATA(macro) \ - macro(initializeReadableStreamBYOBReader, readableStreamBYOBReaderInitializeReadableStreamBYOBReader, 1) \ - macro(cancel, readableStreamBYOBReaderCancel, 1) \ - macro(read, readableStreamBYOBReaderRead, 1) \ - macro(releaseLock, readableStreamBYOBReaderReleaseLock, 0) \ - macro(closed, readableStreamBYOBReaderClosed, 0) \ +// base64Write +#define WEBCORE_BUILTIN_JSBUFFERPROTOTYPE_BASE64WRITE 1 +extern const char* const s_jsBufferPrototypeBase64WriteCode; +extern const int s_jsBufferPrototypeBase64WriteCodeLength; +extern const JSC::ConstructAbility s_jsBufferPrototypeBase64WriteCodeConstructAbility; +extern const JSC::ConstructorKind s_jsBufferPrototypeBase64WriteCodeConstructorKind; +extern const JSC::ImplementationVisibility s_jsBufferPrototypeBase64WriteCodeImplementationVisibility; -#define WEBCORE_FOREACH_READABLESTREAMBYOBREADER_BUILTIN_CODE(macro) \ - macro(readableStreamBYOBReaderInitializeReadableStreamBYOBReaderCode, initializeReadableStreamBYOBReader, ASCIILiteral(), s_readableStreamBYOBReaderInitializeReadableStreamBYOBReaderCodeLength) \ - macro(readableStreamBYOBReaderCancelCode, cancel, ASCIILiteral(), s_readableStreamBYOBReaderCancelCodeLength) \ - macro(readableStreamBYOBReaderReadCode, read, ASCIILiteral(), s_readableStreamBYOBReaderReadCodeLength) \ - macro(readableStreamBYOBReaderReleaseLockCode, releaseLock, ASCIILiteral(), s_readableStreamBYOBReaderReleaseLockCodeLength) \ - macro(readableStreamBYOBReaderClosedCode, closed, "get closed"_s, s_readableStreamBYOBReaderClosedCodeLength) \ +// base64urlWrite +#define WEBCORE_BUILTIN_JSBUFFERPROTOTYPE_BASE64URLWRITE 1 +extern const char* const s_jsBufferPrototypeBase64urlWriteCode; +extern const int s_jsBufferPrototypeBase64urlWriteCodeLength; +extern const JSC::ConstructAbility s_jsBufferPrototypeBase64urlWriteCodeConstructAbility; +extern const JSC::ConstructorKind s_jsBufferPrototypeBase64urlWriteCodeConstructorKind; +extern const JSC::ImplementationVisibility s_jsBufferPrototypeBase64urlWriteCodeImplementationVisibility; -#define WEBCORE_FOREACH_READABLESTREAMBYOBREADER_BUILTIN_FUNCTION_NAME(macro) \ - macro(initializeReadableStreamBYOBReader) \ - macro(cancel) \ - macro(read) \ - macro(releaseLock) \ - macro(closed) \ +// hexWrite +#define WEBCORE_BUILTIN_JSBUFFERPROTOTYPE_HEXWRITE 1 +extern const char* const s_jsBufferPrototypeHexWriteCode; +extern const int s_jsBufferPrototypeHexWriteCodeLength; +extern const JSC::ConstructAbility s_jsBufferPrototypeHexWriteCodeConstructAbility; +extern const JSC::ConstructorKind s_jsBufferPrototypeHexWriteCodeConstructorKind; +extern const JSC::ImplementationVisibility s_jsBufferPrototypeHexWriteCodeImplementationVisibility; -#define DECLARE_BUILTIN_GENERATOR(codeName, functionName, overriddenName, argumentCount) \ - JSC::FunctionExecutable* codeName##Generator(JSC::VM&); +// utf8Slice +#define WEBCORE_BUILTIN_JSBUFFERPROTOTYPE_UTF8SLICE 1 +extern const char* const s_jsBufferPrototypeUtf8SliceCode; +extern const int s_jsBufferPrototypeUtf8SliceCodeLength; +extern const JSC::ConstructAbility s_jsBufferPrototypeUtf8SliceCodeConstructAbility; +extern const JSC::ConstructorKind s_jsBufferPrototypeUtf8SliceCodeConstructorKind; +extern const JSC::ImplementationVisibility s_jsBufferPrototypeUtf8SliceCodeImplementationVisibility; -WEBCORE_FOREACH_READABLESTREAMBYOBREADER_BUILTIN_CODE(DECLARE_BUILTIN_GENERATOR) -#undef DECLARE_BUILTIN_GENERATOR +// ucs2Slice +#define WEBCORE_BUILTIN_JSBUFFERPROTOTYPE_UCS2SLICE 1 +extern const char* const s_jsBufferPrototypeUcs2SliceCode; +extern const int s_jsBufferPrototypeUcs2SliceCodeLength; +extern const JSC::ConstructAbility s_jsBufferPrototypeUcs2SliceCodeConstructAbility; +extern const JSC::ConstructorKind s_jsBufferPrototypeUcs2SliceCodeConstructorKind; +extern const JSC::ImplementationVisibility s_jsBufferPrototypeUcs2SliceCodeImplementationVisibility; -class ReadableStreamBYOBReaderBuiltinsWrapper : private JSC::WeakHandleOwner { -public: - explicit ReadableStreamBYOBReaderBuiltinsWrapper(JSC::VM& vm) - : m_vm(vm) - WEBCORE_FOREACH_READABLESTREAMBYOBREADER_BUILTIN_FUNCTION_NAME(INITIALIZE_BUILTIN_NAMES) -#define INITIALIZE_BUILTIN_SOURCE_MEMBERS(name, functionName, overriddenName, length) , m_##name##Source(JSC::makeSource(StringImpl::createWithoutCopying(s_##name, length), { }, JSC::SourceTaintedOrigin::Untainted)) - WEBCORE_FOREACH_READABLESTREAMBYOBREADER_BUILTIN_CODE(INITIALIZE_BUILTIN_SOURCE_MEMBERS) -#undef INITIALIZE_BUILTIN_SOURCE_MEMBERS - { - } +// utf16leSlice +#define WEBCORE_BUILTIN_JSBUFFERPROTOTYPE_UTF16LESLICE 1 +extern const char* const s_jsBufferPrototypeUtf16leSliceCode; +extern const int s_jsBufferPrototypeUtf16leSliceCodeLength; +extern const JSC::ConstructAbility s_jsBufferPrototypeUtf16leSliceCodeConstructAbility; +extern const JSC::ConstructorKind s_jsBufferPrototypeUtf16leSliceCodeConstructorKind; +extern const JSC::ImplementationVisibility s_jsBufferPrototypeUtf16leSliceCodeImplementationVisibility; -#define EXPOSE_BUILTIN_EXECUTABLES(name, functionName, overriddenName, length) \ - JSC::UnlinkedFunctionExecutable* name##Executable(); \ - const JSC::SourceCode& name##Source() const { return m_##name##Source; } - WEBCORE_FOREACH_READABLESTREAMBYOBREADER_BUILTIN_CODE(EXPOSE_BUILTIN_EXECUTABLES) -#undef EXPOSE_BUILTIN_EXECUTABLES +// latin1Slice +#define WEBCORE_BUILTIN_JSBUFFERPROTOTYPE_LATIN1SLICE 1 +extern const char* const s_jsBufferPrototypeLatin1SliceCode; +extern const int s_jsBufferPrototypeLatin1SliceCodeLength; +extern const JSC::ConstructAbility s_jsBufferPrototypeLatin1SliceCodeConstructAbility; +extern const JSC::ConstructorKind s_jsBufferPrototypeLatin1SliceCodeConstructorKind; +extern const JSC::ImplementationVisibility s_jsBufferPrototypeLatin1SliceCodeImplementationVisibility; - WEBCORE_FOREACH_READABLESTREAMBYOBREADER_BUILTIN_FUNCTION_NAME(DECLARE_BUILTIN_IDENTIFIER_ACCESSOR) +// asciiSlice +#define WEBCORE_BUILTIN_JSBUFFERPROTOTYPE_ASCIISLICE 1 +extern const char* const s_jsBufferPrototypeAsciiSliceCode; +extern const int s_jsBufferPrototypeAsciiSliceCodeLength; +extern const JSC::ConstructAbility s_jsBufferPrototypeAsciiSliceCodeConstructAbility; +extern const JSC::ConstructorKind s_jsBufferPrototypeAsciiSliceCodeConstructorKind; +extern const JSC::ImplementationVisibility s_jsBufferPrototypeAsciiSliceCodeImplementationVisibility; - void exportNames(); +// base64Slice +#define WEBCORE_BUILTIN_JSBUFFERPROTOTYPE_BASE64SLICE 1 +extern const char* const s_jsBufferPrototypeBase64SliceCode; +extern const int s_jsBufferPrototypeBase64SliceCodeLength; +extern const JSC::ConstructAbility s_jsBufferPrototypeBase64SliceCodeConstructAbility; +extern const JSC::ConstructorKind s_jsBufferPrototypeBase64SliceCodeConstructorKind; +extern const JSC::ImplementationVisibility s_jsBufferPrototypeBase64SliceCodeImplementationVisibility; -private: - JSC::VM& m_vm; +// base64urlSlice +#define WEBCORE_BUILTIN_JSBUFFERPROTOTYPE_BASE64URLSLICE 1 +extern const char* const s_jsBufferPrototypeBase64urlSliceCode; +extern const int s_jsBufferPrototypeBase64urlSliceCodeLength; +extern const JSC::ConstructAbility s_jsBufferPrototypeBase64urlSliceCodeConstructAbility; +extern const JSC::ConstructorKind s_jsBufferPrototypeBase64urlSliceCodeConstructorKind; +extern const JSC::ImplementationVisibility s_jsBufferPrototypeBase64urlSliceCodeImplementationVisibility; - WEBCORE_FOREACH_READABLESTREAMBYOBREADER_BUILTIN_FUNCTION_NAME(DECLARE_BUILTIN_NAMES) +// hexSlice +#define WEBCORE_BUILTIN_JSBUFFERPROTOTYPE_HEXSLICE 1 +extern const char* const s_jsBufferPrototypeHexSliceCode; +extern const int s_jsBufferPrototypeHexSliceCodeLength; +extern const JSC::ConstructAbility s_jsBufferPrototypeHexSliceCodeConstructAbility; +extern const JSC::ConstructorKind s_jsBufferPrototypeHexSliceCodeConstructorKind; +extern const JSC::ImplementationVisibility s_jsBufferPrototypeHexSliceCodeImplementationVisibility; -#define DECLARE_BUILTIN_SOURCE_MEMBERS(name, functionName, overriddenName, length) \ - JSC::SourceCode m_##name##Source;\ - JSC::Weak m_##name##Executable; - WEBCORE_FOREACH_READABLESTREAMBYOBREADER_BUILTIN_CODE(DECLARE_BUILTIN_SOURCE_MEMBERS) -#undef DECLARE_BUILTIN_SOURCE_MEMBERS +// toJSON +#define WEBCORE_BUILTIN_JSBUFFERPROTOTYPE_TOJSON 1 +extern const char* const s_jsBufferPrototypeToJSONCode; +extern const int s_jsBufferPrototypeToJSONCodeLength; +extern const JSC::ConstructAbility s_jsBufferPrototypeToJSONCodeConstructAbility; +extern const JSC::ConstructorKind s_jsBufferPrototypeToJSONCodeConstructorKind; +extern const JSC::ImplementationVisibility s_jsBufferPrototypeToJSONCodeImplementationVisibility; -}; +// slice +#define WEBCORE_BUILTIN_JSBUFFERPROTOTYPE_SLICE 1 +extern const char* const s_jsBufferPrototypeSliceCode; +extern const int s_jsBufferPrototypeSliceCodeLength; +extern const JSC::ConstructAbility s_jsBufferPrototypeSliceCodeConstructAbility; +extern const JSC::ConstructorKind s_jsBufferPrototypeSliceCodeConstructorKind; +extern const JSC::ImplementationVisibility s_jsBufferPrototypeSliceCodeImplementationVisibility; -#define DEFINE_BUILTIN_EXECUTABLES(name, functionName, overriddenName, length) \ -inline JSC::UnlinkedFunctionExecutable* ReadableStreamBYOBReaderBuiltinsWrapper::name##Executable() \ -{\ - if (!m_##name##Executable) {\ - JSC::Identifier executableName = functionName##PublicName();\ - if (overriddenName)\ - executableName = JSC::Identifier::fromString(m_vm, overriddenName);\ - m_##name##Executable = JSC::Weak(JSC::createBuiltinExecutable(m_vm, m_##name##Source, executableName, s_##name##ImplementationVisibility, s_##name##ConstructorKind, s_##name##ConstructAbility), this, &m_##name##Executable);\ - }\ - return m_##name##Executable.get();\ -} -WEBCORE_FOREACH_READABLESTREAMBYOBREADER_BUILTIN_CODE(DEFINE_BUILTIN_EXECUTABLES) -#undef DEFINE_BUILTIN_EXECUTABLES +// parent +#define WEBCORE_BUILTIN_JSBUFFERPROTOTYPE_PARENT 1 +extern const char* const s_jsBufferPrototypeParentCode; +extern const int s_jsBufferPrototypeParentCodeLength; +extern const JSC::ConstructAbility s_jsBufferPrototypeParentCodeConstructAbility; +extern const JSC::ConstructorKind s_jsBufferPrototypeParentCodeConstructorKind; +extern const JSC::ImplementationVisibility s_jsBufferPrototypeParentCodeImplementationVisibility; -inline void ReadableStreamBYOBReaderBuiltinsWrapper::exportNames() -{ -#define EXPORT_FUNCTION_NAME(name) m_vm.propertyNames->appendExternalName(name##PublicName(), name##PrivateName()); - WEBCORE_FOREACH_READABLESTREAMBYOBREADER_BUILTIN_FUNCTION_NAME(EXPORT_FUNCTION_NAME) -#undef EXPORT_FUNCTION_NAME -} -/* JSBufferConstructor.ts */ -// from -#define WEBCORE_BUILTIN_JSBUFFERCONSTRUCTOR_FROM 1 -extern const char* const s_jsBufferConstructorFromCode; -extern const int s_jsBufferConstructorFromCodeLength; -extern const JSC::ConstructAbility s_jsBufferConstructorFromCodeConstructAbility; -extern const JSC::ConstructorKind s_jsBufferConstructorFromCodeConstructorKind; -extern const JSC::ImplementationVisibility s_jsBufferConstructorFromCodeImplementationVisibility; +// offset +#define WEBCORE_BUILTIN_JSBUFFERPROTOTYPE_OFFSET 1 +extern const char* const s_jsBufferPrototypeOffsetCode; +extern const int s_jsBufferPrototypeOffsetCodeLength; +extern const JSC::ConstructAbility s_jsBufferPrototypeOffsetCodeConstructAbility; +extern const JSC::ConstructorKind s_jsBufferPrototypeOffsetCodeConstructorKind; +extern const JSC::ImplementationVisibility s_jsBufferPrototypeOffsetCodeImplementationVisibility; -// isBuffer -#define WEBCORE_BUILTIN_JSBUFFERCONSTRUCTOR_ISBUFFER 1 -extern const char* const s_jsBufferConstructorIsBufferCode; -extern const int s_jsBufferConstructorIsBufferCodeLength; -extern const JSC::ConstructAbility s_jsBufferConstructorIsBufferCodeConstructAbility; -extern const JSC::ConstructorKind s_jsBufferConstructorIsBufferCodeConstructorKind; -extern const JSC::ImplementationVisibility s_jsBufferConstructorIsBufferCodeImplementationVisibility; +// inspect +#define WEBCORE_BUILTIN_JSBUFFERPROTOTYPE_INSPECT 1 +extern const char* const s_jsBufferPrototypeInspectCode; +extern const int s_jsBufferPrototypeInspectCodeLength; +extern const JSC::ConstructAbility s_jsBufferPrototypeInspectCodeConstructAbility; +extern const JSC::ConstructorKind s_jsBufferPrototypeInspectCodeConstructorKind; +extern const JSC::ImplementationVisibility s_jsBufferPrototypeInspectCodeImplementationVisibility; -#define WEBCORE_FOREACH_JSBUFFERCONSTRUCTOR_BUILTIN_DATA(macro) \ - macro(from, jsBufferConstructorFrom, 1) \ - macro(isBuffer, jsBufferConstructorIsBuffer, 1) \ +#define WEBCORE_FOREACH_JSBUFFERPROTOTYPE_BUILTIN_DATA(macro) \ + macro(setBigUint64, jsBufferPrototypeSetBigUint64, 3) \ + macro(readInt8, jsBufferPrototypeReadInt8, 1) \ + macro(readUInt8, jsBufferPrototypeReadUInt8, 1) \ + macro(readInt16LE, jsBufferPrototypeReadInt16LE, 1) \ + macro(readInt16BE, jsBufferPrototypeReadInt16BE, 1) \ + macro(readUInt16LE, jsBufferPrototypeReadUInt16LE, 1) \ + macro(readUInt16BE, jsBufferPrototypeReadUInt16BE, 1) \ + macro(readInt32LE, jsBufferPrototypeReadInt32LE, 1) \ + macro(readInt32BE, jsBufferPrototypeReadInt32BE, 1) \ + macro(readUInt32LE, jsBufferPrototypeReadUInt32LE, 1) \ + macro(readUInt32BE, jsBufferPrototypeReadUInt32BE, 1) \ + macro(readIntLE, jsBufferPrototypeReadIntLE, 2) \ + macro(readIntBE, jsBufferPrototypeReadIntBE, 2) \ + macro(readUIntLE, jsBufferPrototypeReadUIntLE, 2) \ + macro(readUIntBE, jsBufferPrototypeReadUIntBE, 2) \ + macro(readFloatLE, jsBufferPrototypeReadFloatLE, 1) \ + macro(readFloatBE, jsBufferPrototypeReadFloatBE, 1) \ + macro(readDoubleLE, jsBufferPrototypeReadDoubleLE, 1) \ + macro(readDoubleBE, jsBufferPrototypeReadDoubleBE, 1) \ + macro(readBigInt64LE, jsBufferPrototypeReadBigInt64LE, 1) \ + macro(readBigInt64BE, jsBufferPrototypeReadBigInt64BE, 1) \ + macro(readBigUInt64LE, jsBufferPrototypeReadBigUInt64LE, 1) \ + macro(readBigUInt64BE, jsBufferPrototypeReadBigUInt64BE, 1) \ + macro(writeInt8, jsBufferPrototypeWriteInt8, 2) \ + macro(writeUInt8, jsBufferPrototypeWriteUInt8, 2) \ + macro(writeInt16LE, jsBufferPrototypeWriteInt16LE, 2) \ + macro(writeInt16BE, jsBufferPrototypeWriteInt16BE, 2) \ + macro(writeUInt16LE, jsBufferPrototypeWriteUInt16LE, 2) \ + macro(writeUInt16BE, jsBufferPrototypeWriteUInt16BE, 2) \ + macro(writeInt32LE, jsBufferPrototypeWriteInt32LE, 2) \ + macro(writeInt32BE, jsBufferPrototypeWriteInt32BE, 2) \ + macro(writeUInt32LE, jsBufferPrototypeWriteUInt32LE, 2) \ + macro(writeUInt32BE, jsBufferPrototypeWriteUInt32BE, 2) \ + macro(writeIntLE, jsBufferPrototypeWriteIntLE, 3) \ + macro(writeIntBE, jsBufferPrototypeWriteIntBE, 3) \ + macro(writeUIntLE, jsBufferPrototypeWriteUIntLE, 3) \ + macro(writeUIntBE, jsBufferPrototypeWriteUIntBE, 3) \ + macro(writeFloatLE, jsBufferPrototypeWriteFloatLE, 2) \ + macro(writeFloatBE, jsBufferPrototypeWriteFloatBE, 2) \ + macro(writeDoubleLE, jsBufferPrototypeWriteDoubleLE, 2) \ + macro(writeDoubleBE, jsBufferPrototypeWriteDoubleBE, 2) \ + macro(writeBigInt64LE, jsBufferPrototypeWriteBigInt64LE, 2) \ + macro(writeBigInt64BE, jsBufferPrototypeWriteBigInt64BE, 2) \ + macro(writeBigUInt64LE, jsBufferPrototypeWriteBigUInt64LE, 2) \ + macro(writeBigUInt64BE, jsBufferPrototypeWriteBigUInt64BE, 2) \ + macro(utf8Write, jsBufferPrototypeUtf8Write, 3) \ + macro(ucs2Write, jsBufferPrototypeUcs2Write, 3) \ + macro(utf16leWrite, jsBufferPrototypeUtf16leWrite, 3) \ + macro(latin1Write, jsBufferPrototypeLatin1Write, 3) \ + macro(asciiWrite, jsBufferPrototypeAsciiWrite, 3) \ + macro(base64Write, jsBufferPrototypeBase64Write, 3) \ + macro(base64urlWrite, jsBufferPrototypeBase64urlWrite, 3) \ + macro(hexWrite, jsBufferPrototypeHexWrite, 3) \ + macro(utf8Slice, jsBufferPrototypeUtf8Slice, 2) \ + macro(ucs2Slice, jsBufferPrototypeUcs2Slice, 2) \ + macro(utf16leSlice, jsBufferPrototypeUtf16leSlice, 2) \ + macro(latin1Slice, jsBufferPrototypeLatin1Slice, 2) \ + macro(asciiSlice, jsBufferPrototypeAsciiSlice, 2) \ + macro(base64Slice, jsBufferPrototypeBase64Slice, 2) \ + macro(base64urlSlice, jsBufferPrototypeBase64urlSlice, 2) \ + macro(hexSlice, jsBufferPrototypeHexSlice, 2) \ + macro(toJSON, jsBufferPrototypeToJSON, 0) \ + macro(slice, jsBufferPrototypeSlice, 2) \ + macro(parent, jsBufferPrototypeParent, 0) \ + macro(offset, jsBufferPrototypeOffset, 0) \ + macro(inspect, jsBufferPrototypeInspect, 2) \ -#define WEBCORE_FOREACH_JSBUFFERCONSTRUCTOR_BUILTIN_CODE(macro) \ - macro(jsBufferConstructorFromCode, from, ASCIILiteral(), s_jsBufferConstructorFromCodeLength) \ - macro(jsBufferConstructorIsBufferCode, isBuffer, ASCIILiteral(), s_jsBufferConstructorIsBufferCodeLength) \ +#define WEBCORE_FOREACH_JSBUFFERPROTOTYPE_BUILTIN_CODE(macro) \ + macro(jsBufferPrototypeSetBigUint64Code, setBigUint64, ASCIILiteral(), s_jsBufferPrototypeSetBigUint64CodeLength) \ + macro(jsBufferPrototypeReadInt8Code, readInt8, ASCIILiteral(), s_jsBufferPrototypeReadInt8CodeLength) \ + macro(jsBufferPrototypeReadUInt8Code, readUInt8, ASCIILiteral(), s_jsBufferPrototypeReadUInt8CodeLength) \ + macro(jsBufferPrototypeReadInt16LECode, readInt16LE, ASCIILiteral(), s_jsBufferPrototypeReadInt16LECodeLength) \ + macro(jsBufferPrototypeReadInt16BECode, readInt16BE, ASCIILiteral(), s_jsBufferPrototypeReadInt16BECodeLength) \ + macro(jsBufferPrototypeReadUInt16LECode, readUInt16LE, ASCIILiteral(), s_jsBufferPrototypeReadUInt16LECodeLength) \ + macro(jsBufferPrototypeReadUInt16BECode, readUInt16BE, ASCIILiteral(), s_jsBufferPrototypeReadUInt16BECodeLength) \ + macro(jsBufferPrototypeReadInt32LECode, readInt32LE, ASCIILiteral(), s_jsBufferPrototypeReadInt32LECodeLength) \ + macro(jsBufferPrototypeReadInt32BECode, readInt32BE, ASCIILiteral(), s_jsBufferPrototypeReadInt32BECodeLength) \ + macro(jsBufferPrototypeReadUInt32LECode, readUInt32LE, ASCIILiteral(), s_jsBufferPrototypeReadUInt32LECodeLength) \ + macro(jsBufferPrototypeReadUInt32BECode, readUInt32BE, ASCIILiteral(), s_jsBufferPrototypeReadUInt32BECodeLength) \ + macro(jsBufferPrototypeReadIntLECode, readIntLE, ASCIILiteral(), s_jsBufferPrototypeReadIntLECodeLength) \ + macro(jsBufferPrototypeReadIntBECode, readIntBE, ASCIILiteral(), s_jsBufferPrototypeReadIntBECodeLength) \ + macro(jsBufferPrototypeReadUIntLECode, readUIntLE, ASCIILiteral(), s_jsBufferPrototypeReadUIntLECodeLength) \ + macro(jsBufferPrototypeReadUIntBECode, readUIntBE, ASCIILiteral(), s_jsBufferPrototypeReadUIntBECodeLength) \ + macro(jsBufferPrototypeReadFloatLECode, readFloatLE, ASCIILiteral(), s_jsBufferPrototypeReadFloatLECodeLength) \ + macro(jsBufferPrototypeReadFloatBECode, readFloatBE, ASCIILiteral(), s_jsBufferPrototypeReadFloatBECodeLength) \ + macro(jsBufferPrototypeReadDoubleLECode, readDoubleLE, ASCIILiteral(), s_jsBufferPrototypeReadDoubleLECodeLength) \ + macro(jsBufferPrototypeReadDoubleBECode, readDoubleBE, ASCIILiteral(), s_jsBufferPrototypeReadDoubleBECodeLength) \ + macro(jsBufferPrototypeReadBigInt64LECode, readBigInt64LE, ASCIILiteral(), s_jsBufferPrototypeReadBigInt64LECodeLength) \ + macro(jsBufferPrototypeReadBigInt64BECode, readBigInt64BE, ASCIILiteral(), s_jsBufferPrototypeReadBigInt64BECodeLength) \ + macro(jsBufferPrototypeReadBigUInt64LECode, readBigUInt64LE, ASCIILiteral(), s_jsBufferPrototypeReadBigUInt64LECodeLength) \ + macro(jsBufferPrototypeReadBigUInt64BECode, readBigUInt64BE, ASCIILiteral(), s_jsBufferPrototypeReadBigUInt64BECodeLength) \ + macro(jsBufferPrototypeWriteInt8Code, writeInt8, ASCIILiteral(), s_jsBufferPrototypeWriteInt8CodeLength) \ + macro(jsBufferPrototypeWriteUInt8Code, writeUInt8, ASCIILiteral(), s_jsBufferPrototypeWriteUInt8CodeLength) \ + macro(jsBufferPrototypeWriteInt16LECode, writeInt16LE, ASCIILiteral(), s_jsBufferPrototypeWriteInt16LECodeLength) \ + macro(jsBufferPrototypeWriteInt16BECode, writeInt16BE, ASCIILiteral(), s_jsBufferPrototypeWriteInt16BECodeLength) \ + macro(jsBufferPrototypeWriteUInt16LECode, writeUInt16LE, ASCIILiteral(), s_jsBufferPrototypeWriteUInt16LECodeLength) \ + macro(jsBufferPrototypeWriteUInt16BECode, writeUInt16BE, ASCIILiteral(), s_jsBufferPrototypeWriteUInt16BECodeLength) \ + macro(jsBufferPrototypeWriteInt32LECode, writeInt32LE, ASCIILiteral(), s_jsBufferPrototypeWriteInt32LECodeLength) \ + macro(jsBufferPrototypeWriteInt32BECode, writeInt32BE, ASCIILiteral(), s_jsBufferPrototypeWriteInt32BECodeLength) \ + macro(jsBufferPrototypeWriteUInt32LECode, writeUInt32LE, ASCIILiteral(), s_jsBufferPrototypeWriteUInt32LECodeLength) \ + macro(jsBufferPrototypeWriteUInt32BECode, writeUInt32BE, ASCIILiteral(), s_jsBufferPrototypeWriteUInt32BECodeLength) \ + macro(jsBufferPrototypeWriteIntLECode, writeIntLE, ASCIILiteral(), s_jsBufferPrototypeWriteIntLECodeLength) \ + macro(jsBufferPrototypeWriteIntBECode, writeIntBE, ASCIILiteral(), s_jsBufferPrototypeWriteIntBECodeLength) \ + macro(jsBufferPrototypeWriteUIntLECode, writeUIntLE, ASCIILiteral(), s_jsBufferPrototypeWriteUIntLECodeLength) \ + macro(jsBufferPrototypeWriteUIntBECode, writeUIntBE, ASCIILiteral(), s_jsBufferPrototypeWriteUIntBECodeLength) \ + macro(jsBufferPrototypeWriteFloatLECode, writeFloatLE, ASCIILiteral(), s_jsBufferPrototypeWriteFloatLECodeLength) \ + macro(jsBufferPrototypeWriteFloatBECode, writeFloatBE, ASCIILiteral(), s_jsBufferPrototypeWriteFloatBECodeLength) \ + macro(jsBufferPrototypeWriteDoubleLECode, writeDoubleLE, ASCIILiteral(), s_jsBufferPrototypeWriteDoubleLECodeLength) \ + macro(jsBufferPrototypeWriteDoubleBECode, writeDoubleBE, ASCIILiteral(), s_jsBufferPrototypeWriteDoubleBECodeLength) \ + macro(jsBufferPrototypeWriteBigInt64LECode, writeBigInt64LE, ASCIILiteral(), s_jsBufferPrototypeWriteBigInt64LECodeLength) \ + macro(jsBufferPrototypeWriteBigInt64BECode, writeBigInt64BE, ASCIILiteral(), s_jsBufferPrototypeWriteBigInt64BECodeLength) \ + macro(jsBufferPrototypeWriteBigUInt64LECode, writeBigUInt64LE, ASCIILiteral(), s_jsBufferPrototypeWriteBigUInt64LECodeLength) \ + macro(jsBufferPrototypeWriteBigUInt64BECode, writeBigUInt64BE, ASCIILiteral(), s_jsBufferPrototypeWriteBigUInt64BECodeLength) \ + macro(jsBufferPrototypeUtf8WriteCode, utf8Write, ASCIILiteral(), s_jsBufferPrototypeUtf8WriteCodeLength) \ + macro(jsBufferPrototypeUcs2WriteCode, ucs2Write, ASCIILiteral(), s_jsBufferPrototypeUcs2WriteCodeLength) \ + macro(jsBufferPrototypeUtf16leWriteCode, utf16leWrite, ASCIILiteral(), s_jsBufferPrototypeUtf16leWriteCodeLength) \ + macro(jsBufferPrototypeLatin1WriteCode, latin1Write, ASCIILiteral(), s_jsBufferPrototypeLatin1WriteCodeLength) \ + macro(jsBufferPrototypeAsciiWriteCode, asciiWrite, ASCIILiteral(), s_jsBufferPrototypeAsciiWriteCodeLength) \ + macro(jsBufferPrototypeBase64WriteCode, base64Write, ASCIILiteral(), s_jsBufferPrototypeBase64WriteCodeLength) \ + macro(jsBufferPrototypeBase64urlWriteCode, base64urlWrite, ASCIILiteral(), s_jsBufferPrototypeBase64urlWriteCodeLength) \ + macro(jsBufferPrototypeHexWriteCode, hexWrite, ASCIILiteral(), s_jsBufferPrototypeHexWriteCodeLength) \ + macro(jsBufferPrototypeUtf8SliceCode, utf8Slice, ASCIILiteral(), s_jsBufferPrototypeUtf8SliceCodeLength) \ + macro(jsBufferPrototypeUcs2SliceCode, ucs2Slice, ASCIILiteral(), s_jsBufferPrototypeUcs2SliceCodeLength) \ + macro(jsBufferPrototypeUtf16leSliceCode, utf16leSlice, ASCIILiteral(), s_jsBufferPrototypeUtf16leSliceCodeLength) \ + macro(jsBufferPrototypeLatin1SliceCode, latin1Slice, ASCIILiteral(), s_jsBufferPrototypeLatin1SliceCodeLength) \ + macro(jsBufferPrototypeAsciiSliceCode, asciiSlice, ASCIILiteral(), s_jsBufferPrototypeAsciiSliceCodeLength) \ + macro(jsBufferPrototypeBase64SliceCode, base64Slice, ASCIILiteral(), s_jsBufferPrototypeBase64SliceCodeLength) \ + macro(jsBufferPrototypeBase64urlSliceCode, base64urlSlice, ASCIILiteral(), s_jsBufferPrototypeBase64urlSliceCodeLength) \ + macro(jsBufferPrototypeHexSliceCode, hexSlice, ASCIILiteral(), s_jsBufferPrototypeHexSliceCodeLength) \ + macro(jsBufferPrototypeToJSONCode, toJSON, ASCIILiteral(), s_jsBufferPrototypeToJSONCodeLength) \ + macro(jsBufferPrototypeSliceCode, slice, ASCIILiteral(), s_jsBufferPrototypeSliceCodeLength) \ + macro(jsBufferPrototypeParentCode, parent, "get parent"_s, s_jsBufferPrototypeParentCodeLength) \ + macro(jsBufferPrototypeOffsetCode, offset, "get offset"_s, s_jsBufferPrototypeOffsetCodeLength) \ + macro(jsBufferPrototypeInspectCode, inspect, ASCIILiteral(), s_jsBufferPrototypeInspectCodeLength) \ -#define WEBCORE_FOREACH_JSBUFFERCONSTRUCTOR_BUILTIN_FUNCTION_NAME(macro) \ - macro(from) \ - macro(isBuffer) \ +#define WEBCORE_FOREACH_JSBUFFERPROTOTYPE_BUILTIN_FUNCTION_NAME(macro) \ + macro(setBigUint64) \ + macro(readInt8) \ + macro(readUInt8) \ + macro(readInt16LE) \ + macro(readInt16BE) \ + macro(readUInt16LE) \ + macro(readUInt16BE) \ + macro(readInt32LE) \ + macro(readInt32BE) \ + macro(readUInt32LE) \ + macro(readUInt32BE) \ + macro(readIntLE) \ + macro(readIntBE) \ + macro(readUIntLE) \ + macro(readUIntBE) \ + macro(readFloatLE) \ + macro(readFloatBE) \ + macro(readDoubleLE) \ + macro(readDoubleBE) \ + macro(readBigInt64LE) \ + macro(readBigInt64BE) \ + macro(readBigUInt64LE) \ + macro(readBigUInt64BE) \ + macro(writeInt8) \ + macro(writeUInt8) \ + macro(writeInt16LE) \ + macro(writeInt16BE) \ + macro(writeUInt16LE) \ + macro(writeUInt16BE) \ + macro(writeInt32LE) \ + macro(writeInt32BE) \ + macro(writeUInt32LE) \ + macro(writeUInt32BE) \ + macro(writeIntLE) \ + macro(writeIntBE) \ + macro(writeUIntLE) \ + macro(writeUIntBE) \ + macro(writeFloatLE) \ + macro(writeFloatBE) \ + macro(writeDoubleLE) \ + macro(writeDoubleBE) \ + macro(writeBigInt64LE) \ + macro(writeBigInt64BE) \ + macro(writeBigUInt64LE) \ + macro(writeBigUInt64BE) \ + macro(utf8Write) \ + macro(ucs2Write) \ + macro(utf16leWrite) \ + macro(latin1Write) \ + macro(asciiWrite) \ + macro(base64Write) \ + macro(base64urlWrite) \ + macro(hexWrite) \ + macro(utf8Slice) \ + macro(ucs2Slice) \ + macro(utf16leSlice) \ + macro(latin1Slice) \ + macro(asciiSlice) \ + macro(base64Slice) \ + macro(base64urlSlice) \ + macro(hexSlice) \ + macro(toJSON) \ + macro(slice) \ + macro(parent) \ + macro(offset) \ + macro(inspect) \ #define DECLARE_BUILTIN_GENERATOR(codeName, functionName, overriddenName, argumentCount) \ JSC::FunctionExecutable* codeName##Generator(JSC::VM&); -WEBCORE_FOREACH_JSBUFFERCONSTRUCTOR_BUILTIN_CODE(DECLARE_BUILTIN_GENERATOR) +WEBCORE_FOREACH_JSBUFFERPROTOTYPE_BUILTIN_CODE(DECLARE_BUILTIN_GENERATOR) #undef DECLARE_BUILTIN_GENERATOR -class JSBufferConstructorBuiltinsWrapper : private JSC::WeakHandleOwner { +class JSBufferPrototypeBuiltinsWrapper : private JSC::WeakHandleOwner { public: - explicit JSBufferConstructorBuiltinsWrapper(JSC::VM& vm) + explicit JSBufferPrototypeBuiltinsWrapper(JSC::VM& vm) : m_vm(vm) - WEBCORE_FOREACH_JSBUFFERCONSTRUCTOR_BUILTIN_FUNCTION_NAME(INITIALIZE_BUILTIN_NAMES) + WEBCORE_FOREACH_JSBUFFERPROTOTYPE_BUILTIN_FUNCTION_NAME(INITIALIZE_BUILTIN_NAMES) #define INITIALIZE_BUILTIN_SOURCE_MEMBERS(name, functionName, overriddenName, length) , m_##name##Source(JSC::makeSource(StringImpl::createWithoutCopying(s_##name, length), { }, JSC::SourceTaintedOrigin::Untainted)) - WEBCORE_FOREACH_JSBUFFERCONSTRUCTOR_BUILTIN_CODE(INITIALIZE_BUILTIN_SOURCE_MEMBERS) + WEBCORE_FOREACH_JSBUFFERPROTOTYPE_BUILTIN_CODE(INITIALIZE_BUILTIN_SOURCE_MEMBERS) #undef INITIALIZE_BUILTIN_SOURCE_MEMBERS { } @@ -3678,28 +3790,28 @@ public: #define EXPOSE_BUILTIN_EXECUTABLES(name, functionName, overriddenName, length) \ JSC::UnlinkedFunctionExecutable* name##Executable(); \ const JSC::SourceCode& name##Source() const { return m_##name##Source; } - WEBCORE_FOREACH_JSBUFFERCONSTRUCTOR_BUILTIN_CODE(EXPOSE_BUILTIN_EXECUTABLES) + WEBCORE_FOREACH_JSBUFFERPROTOTYPE_BUILTIN_CODE(EXPOSE_BUILTIN_EXECUTABLES) #undef EXPOSE_BUILTIN_EXECUTABLES - WEBCORE_FOREACH_JSBUFFERCONSTRUCTOR_BUILTIN_FUNCTION_NAME(DECLARE_BUILTIN_IDENTIFIER_ACCESSOR) + WEBCORE_FOREACH_JSBUFFERPROTOTYPE_BUILTIN_FUNCTION_NAME(DECLARE_BUILTIN_IDENTIFIER_ACCESSOR) void exportNames(); private: JSC::VM& m_vm; - WEBCORE_FOREACH_JSBUFFERCONSTRUCTOR_BUILTIN_FUNCTION_NAME(DECLARE_BUILTIN_NAMES) + WEBCORE_FOREACH_JSBUFFERPROTOTYPE_BUILTIN_FUNCTION_NAME(DECLARE_BUILTIN_NAMES) #define DECLARE_BUILTIN_SOURCE_MEMBERS(name, functionName, overriddenName, length) \ JSC::SourceCode m_##name##Source;\ JSC::Weak m_##name##Executable; - WEBCORE_FOREACH_JSBUFFERCONSTRUCTOR_BUILTIN_CODE(DECLARE_BUILTIN_SOURCE_MEMBERS) + WEBCORE_FOREACH_JSBUFFERPROTOTYPE_BUILTIN_CODE(DECLARE_BUILTIN_SOURCE_MEMBERS) #undef DECLARE_BUILTIN_SOURCE_MEMBERS }; #define DEFINE_BUILTIN_EXECUTABLES(name, functionName, overriddenName, length) \ -inline JSC::UnlinkedFunctionExecutable* JSBufferConstructorBuiltinsWrapper::name##Executable() \ +inline JSC::UnlinkedFunctionExecutable* JSBufferPrototypeBuiltinsWrapper::name##Executable() \ {\ if (!m_##name##Executable) {\ JSC::Identifier executableName = functionName##PublicName();\ @@ -3709,101 +3821,101 @@ inline JSC::UnlinkedFunctionExecutable* JSBufferConstructorBuiltinsWrapper::name }\ return m_##name##Executable.get();\ } -WEBCORE_FOREACH_JSBUFFERCONSTRUCTOR_BUILTIN_CODE(DEFINE_BUILTIN_EXECUTABLES) +WEBCORE_FOREACH_JSBUFFERPROTOTYPE_BUILTIN_CODE(DEFINE_BUILTIN_EXECUTABLES) #undef DEFINE_BUILTIN_EXECUTABLES -inline void JSBufferConstructorBuiltinsWrapper::exportNames() +inline void JSBufferPrototypeBuiltinsWrapper::exportNames() { #define EXPORT_FUNCTION_NAME(name) m_vm.propertyNames->appendExternalName(name##PublicName(), name##PrivateName()); - WEBCORE_FOREACH_JSBUFFERCONSTRUCTOR_BUILTIN_FUNCTION_NAME(EXPORT_FUNCTION_NAME) + WEBCORE_FOREACH_JSBUFFERPROTOTYPE_BUILTIN_FUNCTION_NAME(EXPORT_FUNCTION_NAME) #undef EXPORT_FUNCTION_NAME } -/* ReadableStreamDefaultReader.ts */ -// initializeReadableStreamDefaultReader -#define WEBCORE_BUILTIN_READABLESTREAMDEFAULTREADER_INITIALIZEREADABLESTREAMDEFAULTREADER 1 -extern const char* const s_readableStreamDefaultReaderInitializeReadableStreamDefaultReaderCode; -extern const int s_readableStreamDefaultReaderInitializeReadableStreamDefaultReaderCodeLength; -extern const JSC::ConstructAbility s_readableStreamDefaultReaderInitializeReadableStreamDefaultReaderCodeConstructAbility; -extern const JSC::ConstructorKind s_readableStreamDefaultReaderInitializeReadableStreamDefaultReaderCodeConstructorKind; -extern const JSC::ImplementationVisibility s_readableStreamDefaultReaderInitializeReadableStreamDefaultReaderCodeImplementationVisibility; +/* ReadableByteStreamController.ts */ +// initializeReadableByteStreamController +#define WEBCORE_BUILTIN_READABLEBYTESTREAMCONTROLLER_INITIALIZEREADABLEBYTESTREAMCONTROLLER 1 +extern const char* const s_readableByteStreamControllerInitializeReadableByteStreamControllerCode; +extern const int s_readableByteStreamControllerInitializeReadableByteStreamControllerCodeLength; +extern const JSC::ConstructAbility s_readableByteStreamControllerInitializeReadableByteStreamControllerCodeConstructAbility; +extern const JSC::ConstructorKind s_readableByteStreamControllerInitializeReadableByteStreamControllerCodeConstructorKind; +extern const JSC::ImplementationVisibility s_readableByteStreamControllerInitializeReadableByteStreamControllerCodeImplementationVisibility; -// cancel -#define WEBCORE_BUILTIN_READABLESTREAMDEFAULTREADER_CANCEL 1 -extern const char* const s_readableStreamDefaultReaderCancelCode; -extern const int s_readableStreamDefaultReaderCancelCodeLength; -extern const JSC::ConstructAbility s_readableStreamDefaultReaderCancelCodeConstructAbility; -extern const JSC::ConstructorKind s_readableStreamDefaultReaderCancelCodeConstructorKind; -extern const JSC::ImplementationVisibility s_readableStreamDefaultReaderCancelCodeImplementationVisibility; +// enqueue +#define WEBCORE_BUILTIN_READABLEBYTESTREAMCONTROLLER_ENQUEUE 1 +extern const char* const s_readableByteStreamControllerEnqueueCode; +extern const int s_readableByteStreamControllerEnqueueCodeLength; +extern const JSC::ConstructAbility s_readableByteStreamControllerEnqueueCodeConstructAbility; +extern const JSC::ConstructorKind s_readableByteStreamControllerEnqueueCodeConstructorKind; +extern const JSC::ImplementationVisibility s_readableByteStreamControllerEnqueueCodeImplementationVisibility; -// readMany -#define WEBCORE_BUILTIN_READABLESTREAMDEFAULTREADER_READMANY 1 -extern const char* const s_readableStreamDefaultReaderReadManyCode; -extern const int s_readableStreamDefaultReaderReadManyCodeLength; -extern const JSC::ConstructAbility s_readableStreamDefaultReaderReadManyCodeConstructAbility; -extern const JSC::ConstructorKind s_readableStreamDefaultReaderReadManyCodeConstructorKind; -extern const JSC::ImplementationVisibility s_readableStreamDefaultReaderReadManyCodeImplementationVisibility; +// error +#define WEBCORE_BUILTIN_READABLEBYTESTREAMCONTROLLER_ERROR 1 +extern const char* const s_readableByteStreamControllerErrorCode; +extern const int s_readableByteStreamControllerErrorCodeLength; +extern const JSC::ConstructAbility s_readableByteStreamControllerErrorCodeConstructAbility; +extern const JSC::ConstructorKind s_readableByteStreamControllerErrorCodeConstructorKind; +extern const JSC::ImplementationVisibility s_readableByteStreamControllerErrorCodeImplementationVisibility; -// read -#define WEBCORE_BUILTIN_READABLESTREAMDEFAULTREADER_READ 1 -extern const char* const s_readableStreamDefaultReaderReadCode; -extern const int s_readableStreamDefaultReaderReadCodeLength; -extern const JSC::ConstructAbility s_readableStreamDefaultReaderReadCodeConstructAbility; -extern const JSC::ConstructorKind s_readableStreamDefaultReaderReadCodeConstructorKind; -extern const JSC::ImplementationVisibility s_readableStreamDefaultReaderReadCodeImplementationVisibility; +// close +#define WEBCORE_BUILTIN_READABLEBYTESTREAMCONTROLLER_CLOSE 1 +extern const char* const s_readableByteStreamControllerCloseCode; +extern const int s_readableByteStreamControllerCloseCodeLength; +extern const JSC::ConstructAbility s_readableByteStreamControllerCloseCodeConstructAbility; +extern const JSC::ConstructorKind s_readableByteStreamControllerCloseCodeConstructorKind; +extern const JSC::ImplementationVisibility s_readableByteStreamControllerCloseCodeImplementationVisibility; -// releaseLock -#define WEBCORE_BUILTIN_READABLESTREAMDEFAULTREADER_RELEASELOCK 1 -extern const char* const s_readableStreamDefaultReaderReleaseLockCode; -extern const int s_readableStreamDefaultReaderReleaseLockCodeLength; -extern const JSC::ConstructAbility s_readableStreamDefaultReaderReleaseLockCodeConstructAbility; -extern const JSC::ConstructorKind s_readableStreamDefaultReaderReleaseLockCodeConstructorKind; -extern const JSC::ImplementationVisibility s_readableStreamDefaultReaderReleaseLockCodeImplementationVisibility; +// byobRequest +#define WEBCORE_BUILTIN_READABLEBYTESTREAMCONTROLLER_BYOBREQUEST 1 +extern const char* const s_readableByteStreamControllerByobRequestCode; +extern const int s_readableByteStreamControllerByobRequestCodeLength; +extern const JSC::ConstructAbility s_readableByteStreamControllerByobRequestCodeConstructAbility; +extern const JSC::ConstructorKind s_readableByteStreamControllerByobRequestCodeConstructorKind; +extern const JSC::ImplementationVisibility s_readableByteStreamControllerByobRequestCodeImplementationVisibility; -// closed -#define WEBCORE_BUILTIN_READABLESTREAMDEFAULTREADER_CLOSED 1 -extern const char* const s_readableStreamDefaultReaderClosedCode; -extern const int s_readableStreamDefaultReaderClosedCodeLength; -extern const JSC::ConstructAbility s_readableStreamDefaultReaderClosedCodeConstructAbility; -extern const JSC::ConstructorKind s_readableStreamDefaultReaderClosedCodeConstructorKind; -extern const JSC::ImplementationVisibility s_readableStreamDefaultReaderClosedCodeImplementationVisibility; +// desiredSize +#define WEBCORE_BUILTIN_READABLEBYTESTREAMCONTROLLER_DESIREDSIZE 1 +extern const char* const s_readableByteStreamControllerDesiredSizeCode; +extern const int s_readableByteStreamControllerDesiredSizeCodeLength; +extern const JSC::ConstructAbility s_readableByteStreamControllerDesiredSizeCodeConstructAbility; +extern const JSC::ConstructorKind s_readableByteStreamControllerDesiredSizeCodeConstructorKind; +extern const JSC::ImplementationVisibility s_readableByteStreamControllerDesiredSizeCodeImplementationVisibility; -#define WEBCORE_FOREACH_READABLESTREAMDEFAULTREADER_BUILTIN_DATA(macro) \ - macro(initializeReadableStreamDefaultReader, readableStreamDefaultReaderInitializeReadableStreamDefaultReader, 1) \ - macro(cancel, readableStreamDefaultReaderCancel, 1) \ - macro(readMany, readableStreamDefaultReaderReadMany, 0) \ - macro(read, readableStreamDefaultReaderRead, 0) \ - macro(releaseLock, readableStreamDefaultReaderReleaseLock, 0) \ - macro(closed, readableStreamDefaultReaderClosed, 0) \ +#define WEBCORE_FOREACH_READABLEBYTESTREAMCONTROLLER_BUILTIN_DATA(macro) \ + macro(initializeReadableByteStreamController, readableByteStreamControllerInitializeReadableByteStreamController, 3) \ + macro(enqueue, readableByteStreamControllerEnqueue, 1) \ + macro(error, readableByteStreamControllerError, 1) \ + macro(close, readableByteStreamControllerClose, 0) \ + macro(byobRequest, readableByteStreamControllerByobRequest, 0) \ + macro(desiredSize, readableByteStreamControllerDesiredSize, 0) \ -#define WEBCORE_FOREACH_READABLESTREAMDEFAULTREADER_BUILTIN_CODE(macro) \ - macro(readableStreamDefaultReaderInitializeReadableStreamDefaultReaderCode, initializeReadableStreamDefaultReader, ASCIILiteral(), s_readableStreamDefaultReaderInitializeReadableStreamDefaultReaderCodeLength) \ - macro(readableStreamDefaultReaderCancelCode, cancel, ASCIILiteral(), s_readableStreamDefaultReaderCancelCodeLength) \ - macro(readableStreamDefaultReaderReadManyCode, readMany, ASCIILiteral(), s_readableStreamDefaultReaderReadManyCodeLength) \ - macro(readableStreamDefaultReaderReadCode, read, ASCIILiteral(), s_readableStreamDefaultReaderReadCodeLength) \ - macro(readableStreamDefaultReaderReleaseLockCode, releaseLock, ASCIILiteral(), s_readableStreamDefaultReaderReleaseLockCodeLength) \ - macro(readableStreamDefaultReaderClosedCode, closed, "get closed"_s, s_readableStreamDefaultReaderClosedCodeLength) \ +#define WEBCORE_FOREACH_READABLEBYTESTREAMCONTROLLER_BUILTIN_CODE(macro) \ + macro(readableByteStreamControllerInitializeReadableByteStreamControllerCode, initializeReadableByteStreamController, ASCIILiteral(), s_readableByteStreamControllerInitializeReadableByteStreamControllerCodeLength) \ + macro(readableByteStreamControllerEnqueueCode, enqueue, ASCIILiteral(), s_readableByteStreamControllerEnqueueCodeLength) \ + macro(readableByteStreamControllerErrorCode, error, ASCIILiteral(), s_readableByteStreamControllerErrorCodeLength) \ + macro(readableByteStreamControllerCloseCode, close, ASCIILiteral(), s_readableByteStreamControllerCloseCodeLength) \ + macro(readableByteStreamControllerByobRequestCode, byobRequest, "get byobRequest"_s, s_readableByteStreamControllerByobRequestCodeLength) \ + macro(readableByteStreamControllerDesiredSizeCode, desiredSize, "get desiredSize"_s, s_readableByteStreamControllerDesiredSizeCodeLength) \ -#define WEBCORE_FOREACH_READABLESTREAMDEFAULTREADER_BUILTIN_FUNCTION_NAME(macro) \ - macro(initializeReadableStreamDefaultReader) \ - macro(cancel) \ - macro(readMany) \ - macro(read) \ - macro(releaseLock) \ - macro(closed) \ +#define WEBCORE_FOREACH_READABLEBYTESTREAMCONTROLLER_BUILTIN_FUNCTION_NAME(macro) \ + macro(initializeReadableByteStreamController) \ + macro(enqueue) \ + macro(error) \ + macro(close) \ + macro(byobRequest) \ + macro(desiredSize) \ #define DECLARE_BUILTIN_GENERATOR(codeName, functionName, overriddenName, argumentCount) \ JSC::FunctionExecutable* codeName##Generator(JSC::VM&); -WEBCORE_FOREACH_READABLESTREAMDEFAULTREADER_BUILTIN_CODE(DECLARE_BUILTIN_GENERATOR) +WEBCORE_FOREACH_READABLEBYTESTREAMCONTROLLER_BUILTIN_CODE(DECLARE_BUILTIN_GENERATOR) #undef DECLARE_BUILTIN_GENERATOR -class ReadableStreamDefaultReaderBuiltinsWrapper : private JSC::WeakHandleOwner { +class ReadableByteStreamControllerBuiltinsWrapper : private JSC::WeakHandleOwner { public: - explicit ReadableStreamDefaultReaderBuiltinsWrapper(JSC::VM& vm) + explicit ReadableByteStreamControllerBuiltinsWrapper(JSC::VM& vm) : m_vm(vm) - WEBCORE_FOREACH_READABLESTREAMDEFAULTREADER_BUILTIN_FUNCTION_NAME(INITIALIZE_BUILTIN_NAMES) + WEBCORE_FOREACH_READABLEBYTESTREAMCONTROLLER_BUILTIN_FUNCTION_NAME(INITIALIZE_BUILTIN_NAMES) #define INITIALIZE_BUILTIN_SOURCE_MEMBERS(name, functionName, overriddenName, length) , m_##name##Source(JSC::makeSource(StringImpl::createWithoutCopying(s_##name, length), { }, JSC::SourceTaintedOrigin::Untainted)) - WEBCORE_FOREACH_READABLESTREAMDEFAULTREADER_BUILTIN_CODE(INITIALIZE_BUILTIN_SOURCE_MEMBERS) + WEBCORE_FOREACH_READABLEBYTESTREAMCONTROLLER_BUILTIN_CODE(INITIALIZE_BUILTIN_SOURCE_MEMBERS) #undef INITIALIZE_BUILTIN_SOURCE_MEMBERS { } @@ -3811,28 +3923,28 @@ public: #define EXPOSE_BUILTIN_EXECUTABLES(name, functionName, overriddenName, length) \ JSC::UnlinkedFunctionExecutable* name##Executable(); \ const JSC::SourceCode& name##Source() const { return m_##name##Source; } - WEBCORE_FOREACH_READABLESTREAMDEFAULTREADER_BUILTIN_CODE(EXPOSE_BUILTIN_EXECUTABLES) + WEBCORE_FOREACH_READABLEBYTESTREAMCONTROLLER_BUILTIN_CODE(EXPOSE_BUILTIN_EXECUTABLES) #undef EXPOSE_BUILTIN_EXECUTABLES - WEBCORE_FOREACH_READABLESTREAMDEFAULTREADER_BUILTIN_FUNCTION_NAME(DECLARE_BUILTIN_IDENTIFIER_ACCESSOR) + WEBCORE_FOREACH_READABLEBYTESTREAMCONTROLLER_BUILTIN_FUNCTION_NAME(DECLARE_BUILTIN_IDENTIFIER_ACCESSOR) void exportNames(); private: JSC::VM& m_vm; - WEBCORE_FOREACH_READABLESTREAMDEFAULTREADER_BUILTIN_FUNCTION_NAME(DECLARE_BUILTIN_NAMES) + WEBCORE_FOREACH_READABLEBYTESTREAMCONTROLLER_BUILTIN_FUNCTION_NAME(DECLARE_BUILTIN_NAMES) #define DECLARE_BUILTIN_SOURCE_MEMBERS(name, functionName, overriddenName, length) \ JSC::SourceCode m_##name##Source;\ JSC::Weak m_##name##Executable; - WEBCORE_FOREACH_READABLESTREAMDEFAULTREADER_BUILTIN_CODE(DECLARE_BUILTIN_SOURCE_MEMBERS) + WEBCORE_FOREACH_READABLEBYTESTREAMCONTROLLER_BUILTIN_CODE(DECLARE_BUILTIN_SOURCE_MEMBERS) #undef DECLARE_BUILTIN_SOURCE_MEMBERS }; #define DEFINE_BUILTIN_EXECUTABLES(name, functionName, overriddenName, length) \ -inline JSC::UnlinkedFunctionExecutable* ReadableStreamDefaultReaderBuiltinsWrapper::name##Executable() \ +inline JSC::UnlinkedFunctionExecutable* ReadableByteStreamControllerBuiltinsWrapper::name##Executable() \ {\ if (!m_##name##Executable) {\ JSC::Identifier executableName = functionName##PublicName();\ @@ -3842,13 +3954,13 @@ inline JSC::UnlinkedFunctionExecutable* ReadableStreamDefaultReaderBuiltinsWrapp }\ return m_##name##Executable.get();\ } -WEBCORE_FOREACH_READABLESTREAMDEFAULTREADER_BUILTIN_CODE(DEFINE_BUILTIN_EXECUTABLES) +WEBCORE_FOREACH_READABLEBYTESTREAMCONTROLLER_BUILTIN_CODE(DEFINE_BUILTIN_EXECUTABLES) #undef DEFINE_BUILTIN_EXECUTABLES -inline void ReadableStreamDefaultReaderBuiltinsWrapper::exportNames() +inline void ReadableByteStreamControllerBuiltinsWrapper::exportNames() { #define EXPORT_FUNCTION_NAME(name) m_vm.propertyNames->appendExternalName(name##PublicName(), name##PrivateName()); - WEBCORE_FOREACH_READABLESTREAMDEFAULTREADER_BUILTIN_FUNCTION_NAME(EXPORT_FUNCTION_NAME) + WEBCORE_FOREACH_READABLEBYTESTREAMCONTROLLER_BUILTIN_FUNCTION_NAME(EXPORT_FUNCTION_NAME) #undef EXPORT_FUNCTION_NAME } /* StreamInternals.ts */ @@ -4161,81 +4273,81 @@ inline void StreamInternalsBuiltinFunctions::visit(Visitor& visitor) template void StreamInternalsBuiltinFunctions::visit(JSC::AbstractSlotVisitor&); template void StreamInternalsBuiltinFunctions::visit(JSC::SlotVisitor&); - /* ImportMetaObject.ts */ -// loadCJS2ESM -#define WEBCORE_BUILTIN_IMPORTMETAOBJECT_LOADCJS2ESM 1 -extern const char* const s_importMetaObjectLoadCJS2ESMCode; -extern const int s_importMetaObjectLoadCJS2ESMCodeLength; -extern const JSC::ConstructAbility s_importMetaObjectLoadCJS2ESMCodeConstructAbility; -extern const JSC::ConstructorKind s_importMetaObjectLoadCJS2ESMCodeConstructorKind; -extern const JSC::ImplementationVisibility s_importMetaObjectLoadCJS2ESMCodeImplementationVisibility; + /* ReadableStreamDefaultController.ts */ +// initializeReadableStreamDefaultController +#define WEBCORE_BUILTIN_READABLESTREAMDEFAULTCONTROLLER_INITIALIZEREADABLESTREAMDEFAULTCONTROLLER 1 +extern const char* const s_readableStreamDefaultControllerInitializeReadableStreamDefaultControllerCode; +extern const int s_readableStreamDefaultControllerInitializeReadableStreamDefaultControllerCodeLength; +extern const JSC::ConstructAbility s_readableStreamDefaultControllerInitializeReadableStreamDefaultControllerCodeConstructAbility; +extern const JSC::ConstructorKind s_readableStreamDefaultControllerInitializeReadableStreamDefaultControllerCodeConstructorKind; +extern const JSC::ImplementationVisibility s_readableStreamDefaultControllerInitializeReadableStreamDefaultControllerCodeImplementationVisibility; -// requireESM -#define WEBCORE_BUILTIN_IMPORTMETAOBJECT_REQUIREESM 1 -extern const char* const s_importMetaObjectRequireESMCode; -extern const int s_importMetaObjectRequireESMCodeLength; -extern const JSC::ConstructAbility s_importMetaObjectRequireESMCodeConstructAbility; -extern const JSC::ConstructorKind s_importMetaObjectRequireESMCodeConstructorKind; -extern const JSC::ImplementationVisibility s_importMetaObjectRequireESMCodeImplementationVisibility; +// enqueue +#define WEBCORE_BUILTIN_READABLESTREAMDEFAULTCONTROLLER_ENQUEUE 1 +extern const char* const s_readableStreamDefaultControllerEnqueueCode; +extern const int s_readableStreamDefaultControllerEnqueueCodeLength; +extern const JSC::ConstructAbility s_readableStreamDefaultControllerEnqueueCodeConstructAbility; +extern const JSC::ConstructorKind s_readableStreamDefaultControllerEnqueueCodeConstructorKind; +extern const JSC::ImplementationVisibility s_readableStreamDefaultControllerEnqueueCodeImplementationVisibility; -// internalRequire -#define WEBCORE_BUILTIN_IMPORTMETAOBJECT_INTERNALREQUIRE 1 -extern const char* const s_importMetaObjectInternalRequireCode; -extern const int s_importMetaObjectInternalRequireCodeLength; -extern const JSC::ConstructAbility s_importMetaObjectInternalRequireCodeConstructAbility; -extern const JSC::ConstructorKind s_importMetaObjectInternalRequireCodeConstructorKind; -extern const JSC::ImplementationVisibility s_importMetaObjectInternalRequireCodeImplementationVisibility; +// error +#define WEBCORE_BUILTIN_READABLESTREAMDEFAULTCONTROLLER_ERROR 1 +extern const char* const s_readableStreamDefaultControllerErrorCode; +extern const int s_readableStreamDefaultControllerErrorCodeLength; +extern const JSC::ConstructAbility s_readableStreamDefaultControllerErrorCodeConstructAbility; +extern const JSC::ConstructorKind s_readableStreamDefaultControllerErrorCodeConstructorKind; +extern const JSC::ImplementationVisibility s_readableStreamDefaultControllerErrorCodeImplementationVisibility; -// createRequireCache -#define WEBCORE_BUILTIN_IMPORTMETAOBJECT_CREATEREQUIRECACHE 1 -extern const char* const s_importMetaObjectCreateRequireCacheCode; -extern const int s_importMetaObjectCreateRequireCacheCodeLength; -extern const JSC::ConstructAbility s_importMetaObjectCreateRequireCacheCodeConstructAbility; -extern const JSC::ConstructorKind s_importMetaObjectCreateRequireCacheCodeConstructorKind; -extern const JSC::ImplementationVisibility s_importMetaObjectCreateRequireCacheCodeImplementationVisibility; +// close +#define WEBCORE_BUILTIN_READABLESTREAMDEFAULTCONTROLLER_CLOSE 1 +extern const char* const s_readableStreamDefaultControllerCloseCode; +extern const int s_readableStreamDefaultControllerCloseCodeLength; +extern const JSC::ConstructAbility s_readableStreamDefaultControllerCloseCodeConstructAbility; +extern const JSC::ConstructorKind s_readableStreamDefaultControllerCloseCodeConstructorKind; +extern const JSC::ImplementationVisibility s_readableStreamDefaultControllerCloseCodeImplementationVisibility; -// main -#define WEBCORE_BUILTIN_IMPORTMETAOBJECT_MAIN 1 -extern const char* const s_importMetaObjectMainCode; -extern const int s_importMetaObjectMainCodeLength; -extern const JSC::ConstructAbility s_importMetaObjectMainCodeConstructAbility; -extern const JSC::ConstructorKind s_importMetaObjectMainCodeConstructorKind; -extern const JSC::ImplementationVisibility s_importMetaObjectMainCodeImplementationVisibility; +// desiredSize +#define WEBCORE_BUILTIN_READABLESTREAMDEFAULTCONTROLLER_DESIREDSIZE 1 +extern const char* const s_readableStreamDefaultControllerDesiredSizeCode; +extern const int s_readableStreamDefaultControllerDesiredSizeCodeLength; +extern const JSC::ConstructAbility s_readableStreamDefaultControllerDesiredSizeCodeConstructAbility; +extern const JSC::ConstructorKind s_readableStreamDefaultControllerDesiredSizeCodeConstructorKind; +extern const JSC::ImplementationVisibility s_readableStreamDefaultControllerDesiredSizeCodeImplementationVisibility; -#define WEBCORE_FOREACH_IMPORTMETAOBJECT_BUILTIN_DATA(macro) \ - macro(loadCJS2ESM, importMetaObjectLoadCJS2ESM, 1) \ - macro(requireESM, importMetaObjectRequireESM, 1) \ - macro(internalRequire, importMetaObjectInternalRequire, 1) \ - macro(createRequireCache, importMetaObjectCreateRequireCache, 0) \ - macro(main, importMetaObjectMain, 0) \ +#define WEBCORE_FOREACH_READABLESTREAMDEFAULTCONTROLLER_BUILTIN_DATA(macro) \ + macro(initializeReadableStreamDefaultController, readableStreamDefaultControllerInitializeReadableStreamDefaultController, 4) \ + macro(enqueue, readableStreamDefaultControllerEnqueue, 1) \ + macro(error, readableStreamDefaultControllerError, 1) \ + macro(close, readableStreamDefaultControllerClose, 0) \ + macro(desiredSize, readableStreamDefaultControllerDesiredSize, 0) \ -#define WEBCORE_FOREACH_IMPORTMETAOBJECT_BUILTIN_CODE(macro) \ - macro(importMetaObjectLoadCJS2ESMCode, loadCJS2ESM, ASCIILiteral(), s_importMetaObjectLoadCJS2ESMCodeLength) \ - macro(importMetaObjectRequireESMCode, requireESM, ASCIILiteral(), s_importMetaObjectRequireESMCodeLength) \ - macro(importMetaObjectInternalRequireCode, internalRequire, ASCIILiteral(), s_importMetaObjectInternalRequireCodeLength) \ - macro(importMetaObjectCreateRequireCacheCode, createRequireCache, ASCIILiteral(), s_importMetaObjectCreateRequireCacheCodeLength) \ - macro(importMetaObjectMainCode, main, "get main"_s, s_importMetaObjectMainCodeLength) \ +#define WEBCORE_FOREACH_READABLESTREAMDEFAULTCONTROLLER_BUILTIN_CODE(macro) \ + macro(readableStreamDefaultControllerInitializeReadableStreamDefaultControllerCode, initializeReadableStreamDefaultController, ASCIILiteral(), s_readableStreamDefaultControllerInitializeReadableStreamDefaultControllerCodeLength) \ + macro(readableStreamDefaultControllerEnqueueCode, enqueue, ASCIILiteral(), s_readableStreamDefaultControllerEnqueueCodeLength) \ + macro(readableStreamDefaultControllerErrorCode, error, ASCIILiteral(), s_readableStreamDefaultControllerErrorCodeLength) \ + macro(readableStreamDefaultControllerCloseCode, close, ASCIILiteral(), s_readableStreamDefaultControllerCloseCodeLength) \ + macro(readableStreamDefaultControllerDesiredSizeCode, desiredSize, "get desiredSize"_s, s_readableStreamDefaultControllerDesiredSizeCodeLength) \ -#define WEBCORE_FOREACH_IMPORTMETAOBJECT_BUILTIN_FUNCTION_NAME(macro) \ - macro(loadCJS2ESM) \ - macro(requireESM) \ - macro(internalRequire) \ - macro(createRequireCache) \ - macro(main) \ +#define WEBCORE_FOREACH_READABLESTREAMDEFAULTCONTROLLER_BUILTIN_FUNCTION_NAME(macro) \ + macro(initializeReadableStreamDefaultController) \ + macro(enqueue) \ + macro(error) \ + macro(close) \ + macro(desiredSize) \ #define DECLARE_BUILTIN_GENERATOR(codeName, functionName, overriddenName, argumentCount) \ JSC::FunctionExecutable* codeName##Generator(JSC::VM&); -WEBCORE_FOREACH_IMPORTMETAOBJECT_BUILTIN_CODE(DECLARE_BUILTIN_GENERATOR) +WEBCORE_FOREACH_READABLESTREAMDEFAULTCONTROLLER_BUILTIN_CODE(DECLARE_BUILTIN_GENERATOR) #undef DECLARE_BUILTIN_GENERATOR -class ImportMetaObjectBuiltinsWrapper : private JSC::WeakHandleOwner { +class ReadableStreamDefaultControllerBuiltinsWrapper : private JSC::WeakHandleOwner { public: - explicit ImportMetaObjectBuiltinsWrapper(JSC::VM& vm) + explicit ReadableStreamDefaultControllerBuiltinsWrapper(JSC::VM& vm) : m_vm(vm) - WEBCORE_FOREACH_IMPORTMETAOBJECT_BUILTIN_FUNCTION_NAME(INITIALIZE_BUILTIN_NAMES) + WEBCORE_FOREACH_READABLESTREAMDEFAULTCONTROLLER_BUILTIN_FUNCTION_NAME(INITIALIZE_BUILTIN_NAMES) #define INITIALIZE_BUILTIN_SOURCE_MEMBERS(name, functionName, overriddenName, length) , m_##name##Source(JSC::makeSource(StringImpl::createWithoutCopying(s_##name, length), { }, JSC::SourceTaintedOrigin::Untainted)) - WEBCORE_FOREACH_IMPORTMETAOBJECT_BUILTIN_CODE(INITIALIZE_BUILTIN_SOURCE_MEMBERS) + WEBCORE_FOREACH_READABLESTREAMDEFAULTCONTROLLER_BUILTIN_CODE(INITIALIZE_BUILTIN_SOURCE_MEMBERS) #undef INITIALIZE_BUILTIN_SOURCE_MEMBERS { } @@ -4243,28 +4355,28 @@ public: #define EXPOSE_BUILTIN_EXECUTABLES(name, functionName, overriddenName, length) \ JSC::UnlinkedFunctionExecutable* name##Executable(); \ const JSC::SourceCode& name##Source() const { return m_##name##Source; } - WEBCORE_FOREACH_IMPORTMETAOBJECT_BUILTIN_CODE(EXPOSE_BUILTIN_EXECUTABLES) + WEBCORE_FOREACH_READABLESTREAMDEFAULTCONTROLLER_BUILTIN_CODE(EXPOSE_BUILTIN_EXECUTABLES) #undef EXPOSE_BUILTIN_EXECUTABLES - WEBCORE_FOREACH_IMPORTMETAOBJECT_BUILTIN_FUNCTION_NAME(DECLARE_BUILTIN_IDENTIFIER_ACCESSOR) + WEBCORE_FOREACH_READABLESTREAMDEFAULTCONTROLLER_BUILTIN_FUNCTION_NAME(DECLARE_BUILTIN_IDENTIFIER_ACCESSOR) void exportNames(); private: JSC::VM& m_vm; - WEBCORE_FOREACH_IMPORTMETAOBJECT_BUILTIN_FUNCTION_NAME(DECLARE_BUILTIN_NAMES) + WEBCORE_FOREACH_READABLESTREAMDEFAULTCONTROLLER_BUILTIN_FUNCTION_NAME(DECLARE_BUILTIN_NAMES) #define DECLARE_BUILTIN_SOURCE_MEMBERS(name, functionName, overriddenName, length) \ JSC::SourceCode m_##name##Source;\ JSC::Weak m_##name##Executable; - WEBCORE_FOREACH_IMPORTMETAOBJECT_BUILTIN_CODE(DECLARE_BUILTIN_SOURCE_MEMBERS) + WEBCORE_FOREACH_READABLESTREAMDEFAULTCONTROLLER_BUILTIN_CODE(DECLARE_BUILTIN_SOURCE_MEMBERS) #undef DECLARE_BUILTIN_SOURCE_MEMBERS }; #define DEFINE_BUILTIN_EXECUTABLES(name, functionName, overriddenName, length) \ -inline JSC::UnlinkedFunctionExecutable* ImportMetaObjectBuiltinsWrapper::name##Executable() \ +inline JSC::UnlinkedFunctionExecutable* ReadableStreamDefaultControllerBuiltinsWrapper::name##Executable() \ {\ if (!m_##name##Executable) {\ JSC::Identifier executableName = functionName##PublicName();\ @@ -4274,68 +4386,68 @@ inline JSC::UnlinkedFunctionExecutable* ImportMetaObjectBuiltinsWrapper::name##E }\ return m_##name##Executable.get();\ } -WEBCORE_FOREACH_IMPORTMETAOBJECT_BUILTIN_CODE(DEFINE_BUILTIN_EXECUTABLES) +WEBCORE_FOREACH_READABLESTREAMDEFAULTCONTROLLER_BUILTIN_CODE(DEFINE_BUILTIN_EXECUTABLES) #undef DEFINE_BUILTIN_EXECUTABLES -inline void ImportMetaObjectBuiltinsWrapper::exportNames() +inline void ReadableStreamDefaultControllerBuiltinsWrapper::exportNames() { #define EXPORT_FUNCTION_NAME(name) m_vm.propertyNames->appendExternalName(name##PublicName(), name##PrivateName()); - WEBCORE_FOREACH_IMPORTMETAOBJECT_BUILTIN_FUNCTION_NAME(EXPORT_FUNCTION_NAME) + WEBCORE_FOREACH_READABLESTREAMDEFAULTCONTROLLER_BUILTIN_FUNCTION_NAME(EXPORT_FUNCTION_NAME) #undef EXPORT_FUNCTION_NAME } -/* CountQueuingStrategy.ts */ -// highWaterMark -#define WEBCORE_BUILTIN_COUNTQUEUINGSTRATEGY_HIGHWATERMARK 1 -extern const char* const s_countQueuingStrategyHighWaterMarkCode; -extern const int s_countQueuingStrategyHighWaterMarkCodeLength; -extern const JSC::ConstructAbility s_countQueuingStrategyHighWaterMarkCodeConstructAbility; -extern const JSC::ConstructorKind s_countQueuingStrategyHighWaterMarkCodeConstructorKind; -extern const JSC::ImplementationVisibility s_countQueuingStrategyHighWaterMarkCodeImplementationVisibility; - -// size -#define WEBCORE_BUILTIN_COUNTQUEUINGSTRATEGY_SIZE 1 -extern const char* const s_countQueuingStrategySizeCode; -extern const int s_countQueuingStrategySizeCodeLength; -extern const JSC::ConstructAbility s_countQueuingStrategySizeCodeConstructAbility; -extern const JSC::ConstructorKind s_countQueuingStrategySizeCodeConstructorKind; -extern const JSC::ImplementationVisibility s_countQueuingStrategySizeCodeImplementationVisibility; +/* BundlerPlugin.ts */ +// runSetupFunction +#define WEBCORE_BUILTIN_BUNDLERPLUGIN_RUNSETUPFUNCTION 1 +extern const char* const s_bundlerPluginRunSetupFunctionCode; +extern const int s_bundlerPluginRunSetupFunctionCodeLength; +extern const JSC::ConstructAbility s_bundlerPluginRunSetupFunctionCodeConstructAbility; +extern const JSC::ConstructorKind s_bundlerPluginRunSetupFunctionCodeConstructorKind; +extern const JSC::ImplementationVisibility s_bundlerPluginRunSetupFunctionCodeImplementationVisibility; -// initializeCountQueuingStrategy -#define WEBCORE_BUILTIN_COUNTQUEUINGSTRATEGY_INITIALIZECOUNTQUEUINGSTRATEGY 1 -extern const char* const s_countQueuingStrategyInitializeCountQueuingStrategyCode; -extern const int s_countQueuingStrategyInitializeCountQueuingStrategyCodeLength; -extern const JSC::ConstructAbility s_countQueuingStrategyInitializeCountQueuingStrategyCodeConstructAbility; -extern const JSC::ConstructorKind s_countQueuingStrategyInitializeCountQueuingStrategyCodeConstructorKind; -extern const JSC::ImplementationVisibility s_countQueuingStrategyInitializeCountQueuingStrategyCodeImplementationVisibility; +// runOnResolvePlugins +#define WEBCORE_BUILTIN_BUNDLERPLUGIN_RUNONRESOLVEPLUGINS 1 +extern const char* const s_bundlerPluginRunOnResolvePluginsCode; +extern const int s_bundlerPluginRunOnResolvePluginsCodeLength; +extern const JSC::ConstructAbility s_bundlerPluginRunOnResolvePluginsCodeConstructAbility; +extern const JSC::ConstructorKind s_bundlerPluginRunOnResolvePluginsCodeConstructorKind; +extern const JSC::ImplementationVisibility s_bundlerPluginRunOnResolvePluginsCodeImplementationVisibility; -#define WEBCORE_FOREACH_COUNTQUEUINGSTRATEGY_BUILTIN_DATA(macro) \ - macro(highWaterMark, countQueuingStrategyHighWaterMark, 0) \ - macro(size, countQueuingStrategySize, 0) \ - macro(initializeCountQueuingStrategy, countQueuingStrategyInitializeCountQueuingStrategy, 1) \ +// runOnLoadPlugins +#define WEBCORE_BUILTIN_BUNDLERPLUGIN_RUNONLOADPLUGINS 1 +extern const char* const s_bundlerPluginRunOnLoadPluginsCode; +extern const int s_bundlerPluginRunOnLoadPluginsCodeLength; +extern const JSC::ConstructAbility s_bundlerPluginRunOnLoadPluginsCodeConstructAbility; +extern const JSC::ConstructorKind s_bundlerPluginRunOnLoadPluginsCodeConstructorKind; +extern const JSC::ImplementationVisibility s_bundlerPluginRunOnLoadPluginsCodeImplementationVisibility; -#define WEBCORE_FOREACH_COUNTQUEUINGSTRATEGY_BUILTIN_CODE(macro) \ - macro(countQueuingStrategyHighWaterMarkCode, highWaterMark, "get highWaterMark"_s, s_countQueuingStrategyHighWaterMarkCodeLength) \ - macro(countQueuingStrategySizeCode, size, ASCIILiteral(), s_countQueuingStrategySizeCodeLength) \ - macro(countQueuingStrategyInitializeCountQueuingStrategyCode, initializeCountQueuingStrategy, ASCIILiteral(), s_countQueuingStrategyInitializeCountQueuingStrategyCodeLength) \ +#define WEBCORE_FOREACH_BUNDLERPLUGIN_BUILTIN_DATA(macro) \ + macro(runSetupFunction, bundlerPluginRunSetupFunction, 2) \ + macro(runOnResolvePlugins, bundlerPluginRunOnResolvePlugins, 5) \ + macro(runOnLoadPlugins, bundlerPluginRunOnLoadPlugins, 4) \ -#define WEBCORE_FOREACH_COUNTQUEUINGSTRATEGY_BUILTIN_FUNCTION_NAME(macro) \ - macro(highWaterMark) \ - macro(size) \ - macro(initializeCountQueuingStrategy) \ +#define WEBCORE_FOREACH_BUNDLERPLUGIN_BUILTIN_CODE(macro) \ + macro(bundlerPluginRunSetupFunctionCode, runSetupFunction, ASCIILiteral(), s_bundlerPluginRunSetupFunctionCodeLength) \ + macro(bundlerPluginRunOnResolvePluginsCode, runOnResolvePlugins, ASCIILiteral(), s_bundlerPluginRunOnResolvePluginsCodeLength) \ + macro(bundlerPluginRunOnLoadPluginsCode, runOnLoadPlugins, ASCIILiteral(), s_bundlerPluginRunOnLoadPluginsCodeLength) \ + +#define WEBCORE_FOREACH_BUNDLERPLUGIN_BUILTIN_FUNCTION_NAME(macro) \ + macro(runSetupFunction) \ + macro(runOnResolvePlugins) \ + macro(runOnLoadPlugins) \ #define DECLARE_BUILTIN_GENERATOR(codeName, functionName, overriddenName, argumentCount) \ JSC::FunctionExecutable* codeName##Generator(JSC::VM&); -WEBCORE_FOREACH_COUNTQUEUINGSTRATEGY_BUILTIN_CODE(DECLARE_BUILTIN_GENERATOR) +WEBCORE_FOREACH_BUNDLERPLUGIN_BUILTIN_CODE(DECLARE_BUILTIN_GENERATOR) #undef DECLARE_BUILTIN_GENERATOR -class CountQueuingStrategyBuiltinsWrapper : private JSC::WeakHandleOwner { +class BundlerPluginBuiltinsWrapper : private JSC::WeakHandleOwner { public: - explicit CountQueuingStrategyBuiltinsWrapper(JSC::VM& vm) + explicit BundlerPluginBuiltinsWrapper(JSC::VM& vm) : m_vm(vm) - WEBCORE_FOREACH_COUNTQUEUINGSTRATEGY_BUILTIN_FUNCTION_NAME(INITIALIZE_BUILTIN_NAMES) + WEBCORE_FOREACH_BUNDLERPLUGIN_BUILTIN_FUNCTION_NAME(INITIALIZE_BUILTIN_NAMES) #define INITIALIZE_BUILTIN_SOURCE_MEMBERS(name, functionName, overriddenName, length) , m_##name##Source(JSC::makeSource(StringImpl::createWithoutCopying(s_##name, length), { }, JSC::SourceTaintedOrigin::Untainted)) - WEBCORE_FOREACH_COUNTQUEUINGSTRATEGY_BUILTIN_CODE(INITIALIZE_BUILTIN_SOURCE_MEMBERS) + WEBCORE_FOREACH_BUNDLERPLUGIN_BUILTIN_CODE(INITIALIZE_BUILTIN_SOURCE_MEMBERS) #undef INITIALIZE_BUILTIN_SOURCE_MEMBERS { } @@ -4343,28 +4455,28 @@ public: #define EXPOSE_BUILTIN_EXECUTABLES(name, functionName, overriddenName, length) \ JSC::UnlinkedFunctionExecutable* name##Executable(); \ const JSC::SourceCode& name##Source() const { return m_##name##Source; } - WEBCORE_FOREACH_COUNTQUEUINGSTRATEGY_BUILTIN_CODE(EXPOSE_BUILTIN_EXECUTABLES) + WEBCORE_FOREACH_BUNDLERPLUGIN_BUILTIN_CODE(EXPOSE_BUILTIN_EXECUTABLES) #undef EXPOSE_BUILTIN_EXECUTABLES - WEBCORE_FOREACH_COUNTQUEUINGSTRATEGY_BUILTIN_FUNCTION_NAME(DECLARE_BUILTIN_IDENTIFIER_ACCESSOR) + WEBCORE_FOREACH_BUNDLERPLUGIN_BUILTIN_FUNCTION_NAME(DECLARE_BUILTIN_IDENTIFIER_ACCESSOR) void exportNames(); private: JSC::VM& m_vm; - WEBCORE_FOREACH_COUNTQUEUINGSTRATEGY_BUILTIN_FUNCTION_NAME(DECLARE_BUILTIN_NAMES) + WEBCORE_FOREACH_BUNDLERPLUGIN_BUILTIN_FUNCTION_NAME(DECLARE_BUILTIN_NAMES) #define DECLARE_BUILTIN_SOURCE_MEMBERS(name, functionName, overriddenName, length) \ JSC::SourceCode m_##name##Source;\ JSC::Weak m_##name##Executable; - WEBCORE_FOREACH_COUNTQUEUINGSTRATEGY_BUILTIN_CODE(DECLARE_BUILTIN_SOURCE_MEMBERS) + WEBCORE_FOREACH_BUNDLERPLUGIN_BUILTIN_CODE(DECLARE_BUILTIN_SOURCE_MEMBERS) #undef DECLARE_BUILTIN_SOURCE_MEMBERS }; #define DEFINE_BUILTIN_EXECUTABLES(name, functionName, overriddenName, length) \ -inline JSC::UnlinkedFunctionExecutable* CountQueuingStrategyBuiltinsWrapper::name##Executable() \ +inline JSC::UnlinkedFunctionExecutable* BundlerPluginBuiltinsWrapper::name##Executable() \ {\ if (!m_##name##Executable) {\ JSC::Identifier executableName = functionName##PublicName();\ @@ -4374,79 +4486,68 @@ inline JSC::UnlinkedFunctionExecutable* CountQueuingStrategyBuiltinsWrapper::nam }\ return m_##name##Executable.get();\ } -WEBCORE_FOREACH_COUNTQUEUINGSTRATEGY_BUILTIN_CODE(DEFINE_BUILTIN_EXECUTABLES) +WEBCORE_FOREACH_BUNDLERPLUGIN_BUILTIN_CODE(DEFINE_BUILTIN_EXECUTABLES) #undef DEFINE_BUILTIN_EXECUTABLES -inline void CountQueuingStrategyBuiltinsWrapper::exportNames() +inline void BundlerPluginBuiltinsWrapper::exportNames() { #define EXPORT_FUNCTION_NAME(name) m_vm.propertyNames->appendExternalName(name##PublicName(), name##PrivateName()); - WEBCORE_FOREACH_COUNTQUEUINGSTRATEGY_BUILTIN_FUNCTION_NAME(EXPORT_FUNCTION_NAME) + WEBCORE_FOREACH_BUNDLERPLUGIN_BUILTIN_FUNCTION_NAME(EXPORT_FUNCTION_NAME) #undef EXPORT_FUNCTION_NAME } -/* ReadableStreamBYOBRequest.ts */ -// initializeReadableStreamBYOBRequest -#define WEBCORE_BUILTIN_READABLESTREAMBYOBREQUEST_INITIALIZEREADABLESTREAMBYOBREQUEST 1 -extern const char* const s_readableStreamBYOBRequestInitializeReadableStreamBYOBRequestCode; -extern const int s_readableStreamBYOBRequestInitializeReadableStreamBYOBRequestCodeLength; -extern const JSC::ConstructAbility s_readableStreamBYOBRequestInitializeReadableStreamBYOBRequestCodeConstructAbility; -extern const JSC::ConstructorKind s_readableStreamBYOBRequestInitializeReadableStreamBYOBRequestCodeConstructorKind; -extern const JSC::ImplementationVisibility s_readableStreamBYOBRequestInitializeReadableStreamBYOBRequestCodeImplementationVisibility; - -// respond -#define WEBCORE_BUILTIN_READABLESTREAMBYOBREQUEST_RESPOND 1 -extern const char* const s_readableStreamBYOBRequestRespondCode; -extern const int s_readableStreamBYOBRequestRespondCodeLength; -extern const JSC::ConstructAbility s_readableStreamBYOBRequestRespondCodeConstructAbility; -extern const JSC::ConstructorKind s_readableStreamBYOBRequestRespondCodeConstructorKind; -extern const JSC::ImplementationVisibility s_readableStreamBYOBRequestRespondCodeImplementationVisibility; +/* TransformStream.ts */ +// initializeTransformStream +#define WEBCORE_BUILTIN_TRANSFORMSTREAM_INITIALIZETRANSFORMSTREAM 1 +extern const char* const s_transformStreamInitializeTransformStreamCode; +extern const int s_transformStreamInitializeTransformStreamCodeLength; +extern const JSC::ConstructAbility s_transformStreamInitializeTransformStreamCodeConstructAbility; +extern const JSC::ConstructorKind s_transformStreamInitializeTransformStreamCodeConstructorKind; +extern const JSC::ImplementationVisibility s_transformStreamInitializeTransformStreamCodeImplementationVisibility; -// respondWithNewView -#define WEBCORE_BUILTIN_READABLESTREAMBYOBREQUEST_RESPONDWITHNEWVIEW 1 -extern const char* const s_readableStreamBYOBRequestRespondWithNewViewCode; -extern const int s_readableStreamBYOBRequestRespondWithNewViewCodeLength; -extern const JSC::ConstructAbility s_readableStreamBYOBRequestRespondWithNewViewCodeConstructAbility; -extern const JSC::ConstructorKind s_readableStreamBYOBRequestRespondWithNewViewCodeConstructorKind; -extern const JSC::ImplementationVisibility s_readableStreamBYOBRequestRespondWithNewViewCodeImplementationVisibility; +// readable +#define WEBCORE_BUILTIN_TRANSFORMSTREAM_READABLE 1 +extern const char* const s_transformStreamReadableCode; +extern const int s_transformStreamReadableCodeLength; +extern const JSC::ConstructAbility s_transformStreamReadableCodeConstructAbility; +extern const JSC::ConstructorKind s_transformStreamReadableCodeConstructorKind; +extern const JSC::ImplementationVisibility s_transformStreamReadableCodeImplementationVisibility; -// view -#define WEBCORE_BUILTIN_READABLESTREAMBYOBREQUEST_VIEW 1 -extern const char* const s_readableStreamBYOBRequestViewCode; -extern const int s_readableStreamBYOBRequestViewCodeLength; -extern const JSC::ConstructAbility s_readableStreamBYOBRequestViewCodeConstructAbility; -extern const JSC::ConstructorKind s_readableStreamBYOBRequestViewCodeConstructorKind; -extern const JSC::ImplementationVisibility s_readableStreamBYOBRequestViewCodeImplementationVisibility; +// writable +#define WEBCORE_BUILTIN_TRANSFORMSTREAM_WRITABLE 1 +extern const char* const s_transformStreamWritableCode; +extern const int s_transformStreamWritableCodeLength; +extern const JSC::ConstructAbility s_transformStreamWritableCodeConstructAbility; +extern const JSC::ConstructorKind s_transformStreamWritableCodeConstructorKind; +extern const JSC::ImplementationVisibility s_transformStreamWritableCodeImplementationVisibility; -#define WEBCORE_FOREACH_READABLESTREAMBYOBREQUEST_BUILTIN_DATA(macro) \ - macro(initializeReadableStreamBYOBRequest, readableStreamBYOBRequestInitializeReadableStreamBYOBRequest, 2) \ - macro(respond, readableStreamBYOBRequestRespond, 1) \ - macro(respondWithNewView, readableStreamBYOBRequestRespondWithNewView, 1) \ - macro(view, readableStreamBYOBRequestView, 0) \ +#define WEBCORE_FOREACH_TRANSFORMSTREAM_BUILTIN_DATA(macro) \ + macro(initializeTransformStream, transformStreamInitializeTransformStream, 0) \ + macro(readable, transformStreamReadable, 0) \ + macro(writable, transformStreamWritable, 0) \ -#define WEBCORE_FOREACH_READABLESTREAMBYOBREQUEST_BUILTIN_CODE(macro) \ - macro(readableStreamBYOBRequestInitializeReadableStreamBYOBRequestCode, initializeReadableStreamBYOBRequest, ASCIILiteral(), s_readableStreamBYOBRequestInitializeReadableStreamBYOBRequestCodeLength) \ - macro(readableStreamBYOBRequestRespondCode, respond, ASCIILiteral(), s_readableStreamBYOBRequestRespondCodeLength) \ - macro(readableStreamBYOBRequestRespondWithNewViewCode, respondWithNewView, ASCIILiteral(), s_readableStreamBYOBRequestRespondWithNewViewCodeLength) \ - macro(readableStreamBYOBRequestViewCode, view, "get view"_s, s_readableStreamBYOBRequestViewCodeLength) \ +#define WEBCORE_FOREACH_TRANSFORMSTREAM_BUILTIN_CODE(macro) \ + macro(transformStreamInitializeTransformStreamCode, initializeTransformStream, ASCIILiteral(), s_transformStreamInitializeTransformStreamCodeLength) \ + macro(transformStreamReadableCode, readable, "get readable"_s, s_transformStreamReadableCodeLength) \ + macro(transformStreamWritableCode, writable, ASCIILiteral(), s_transformStreamWritableCodeLength) \ -#define WEBCORE_FOREACH_READABLESTREAMBYOBREQUEST_BUILTIN_FUNCTION_NAME(macro) \ - macro(initializeReadableStreamBYOBRequest) \ - macro(respond) \ - macro(respondWithNewView) \ - macro(view) \ +#define WEBCORE_FOREACH_TRANSFORMSTREAM_BUILTIN_FUNCTION_NAME(macro) \ + macro(initializeTransformStream) \ + macro(readable) \ + macro(writable) \ #define DECLARE_BUILTIN_GENERATOR(codeName, functionName, overriddenName, argumentCount) \ JSC::FunctionExecutable* codeName##Generator(JSC::VM&); -WEBCORE_FOREACH_READABLESTREAMBYOBREQUEST_BUILTIN_CODE(DECLARE_BUILTIN_GENERATOR) +WEBCORE_FOREACH_TRANSFORMSTREAM_BUILTIN_CODE(DECLARE_BUILTIN_GENERATOR) #undef DECLARE_BUILTIN_GENERATOR -class ReadableStreamBYOBRequestBuiltinsWrapper : private JSC::WeakHandleOwner { +class TransformStreamBuiltinsWrapper : private JSC::WeakHandleOwner { public: - explicit ReadableStreamBYOBRequestBuiltinsWrapper(JSC::VM& vm) + explicit TransformStreamBuiltinsWrapper(JSC::VM& vm) : m_vm(vm) - WEBCORE_FOREACH_READABLESTREAMBYOBREQUEST_BUILTIN_FUNCTION_NAME(INITIALIZE_BUILTIN_NAMES) + WEBCORE_FOREACH_TRANSFORMSTREAM_BUILTIN_FUNCTION_NAME(INITIALIZE_BUILTIN_NAMES) #define INITIALIZE_BUILTIN_SOURCE_MEMBERS(name, functionName, overriddenName, length) , m_##name##Source(JSC::makeSource(StringImpl::createWithoutCopying(s_##name, length), { }, JSC::SourceTaintedOrigin::Untainted)) - WEBCORE_FOREACH_READABLESTREAMBYOBREQUEST_BUILTIN_CODE(INITIALIZE_BUILTIN_SOURCE_MEMBERS) + WEBCORE_FOREACH_TRANSFORMSTREAM_BUILTIN_CODE(INITIALIZE_BUILTIN_SOURCE_MEMBERS) #undef INITIALIZE_BUILTIN_SOURCE_MEMBERS { } @@ -4454,28 +4555,28 @@ public: #define EXPOSE_BUILTIN_EXECUTABLES(name, functionName, overriddenName, length) \ JSC::UnlinkedFunctionExecutable* name##Executable(); \ const JSC::SourceCode& name##Source() const { return m_##name##Source; } - WEBCORE_FOREACH_READABLESTREAMBYOBREQUEST_BUILTIN_CODE(EXPOSE_BUILTIN_EXECUTABLES) + WEBCORE_FOREACH_TRANSFORMSTREAM_BUILTIN_CODE(EXPOSE_BUILTIN_EXECUTABLES) #undef EXPOSE_BUILTIN_EXECUTABLES - WEBCORE_FOREACH_READABLESTREAMBYOBREQUEST_BUILTIN_FUNCTION_NAME(DECLARE_BUILTIN_IDENTIFIER_ACCESSOR) + WEBCORE_FOREACH_TRANSFORMSTREAM_BUILTIN_FUNCTION_NAME(DECLARE_BUILTIN_IDENTIFIER_ACCESSOR) void exportNames(); private: JSC::VM& m_vm; - WEBCORE_FOREACH_READABLESTREAMBYOBREQUEST_BUILTIN_FUNCTION_NAME(DECLARE_BUILTIN_NAMES) + WEBCORE_FOREACH_TRANSFORMSTREAM_BUILTIN_FUNCTION_NAME(DECLARE_BUILTIN_NAMES) #define DECLARE_BUILTIN_SOURCE_MEMBERS(name, functionName, overriddenName, length) \ JSC::SourceCode m_##name##Source;\ JSC::Weak m_##name##Executable; - WEBCORE_FOREACH_READABLESTREAMBYOBREQUEST_BUILTIN_CODE(DECLARE_BUILTIN_SOURCE_MEMBERS) + WEBCORE_FOREACH_TRANSFORMSTREAM_BUILTIN_CODE(DECLARE_BUILTIN_SOURCE_MEMBERS) #undef DECLARE_BUILTIN_SOURCE_MEMBERS }; #define DEFINE_BUILTIN_EXECUTABLES(name, functionName, overriddenName, length) \ -inline JSC::UnlinkedFunctionExecutable* ReadableStreamBYOBRequestBuiltinsWrapper::name##Executable() \ +inline JSC::UnlinkedFunctionExecutable* TransformStreamBuiltinsWrapper::name##Executable() \ {\ if (!m_##name##Executable) {\ JSC::Identifier executableName = functionName##PublicName();\ @@ -4485,123 +4586,90 @@ inline JSC::UnlinkedFunctionExecutable* ReadableStreamBYOBRequestBuiltinsWrapper }\ return m_##name##Executable.get();\ } -WEBCORE_FOREACH_READABLESTREAMBYOBREQUEST_BUILTIN_CODE(DEFINE_BUILTIN_EXECUTABLES) +WEBCORE_FOREACH_TRANSFORMSTREAM_BUILTIN_CODE(DEFINE_BUILTIN_EXECUTABLES) #undef DEFINE_BUILTIN_EXECUTABLES -inline void ReadableStreamBYOBRequestBuiltinsWrapper::exportNames() +inline void TransformStreamBuiltinsWrapper::exportNames() { #define EXPORT_FUNCTION_NAME(name) m_vm.propertyNames->appendExternalName(name##PublicName(), name##PrivateName()); - WEBCORE_FOREACH_READABLESTREAMBYOBREQUEST_BUILTIN_FUNCTION_NAME(EXPORT_FUNCTION_NAME) + WEBCORE_FOREACH_TRANSFORMSTREAM_BUILTIN_FUNCTION_NAME(EXPORT_FUNCTION_NAME) #undef EXPORT_FUNCTION_NAME } -/* WritableStreamDefaultWriter.ts */ -// initializeWritableStreamDefaultWriter -#define WEBCORE_BUILTIN_WRITABLESTREAMDEFAULTWRITER_INITIALIZEWRITABLESTREAMDEFAULTWRITER 1 -extern const char* const s_writableStreamDefaultWriterInitializeWritableStreamDefaultWriterCode; -extern const int s_writableStreamDefaultWriterInitializeWritableStreamDefaultWriterCodeLength; -extern const JSC::ConstructAbility s_writableStreamDefaultWriterInitializeWritableStreamDefaultWriterCodeConstructAbility; -extern const JSC::ConstructorKind s_writableStreamDefaultWriterInitializeWritableStreamDefaultWriterCodeConstructorKind; -extern const JSC::ImplementationVisibility s_writableStreamDefaultWriterInitializeWritableStreamDefaultWriterCodeImplementationVisibility; - -// closed -#define WEBCORE_BUILTIN_WRITABLESTREAMDEFAULTWRITER_CLOSED 1 -extern const char* const s_writableStreamDefaultWriterClosedCode; -extern const int s_writableStreamDefaultWriterClosedCodeLength; -extern const JSC::ConstructAbility s_writableStreamDefaultWriterClosedCodeConstructAbility; -extern const JSC::ConstructorKind s_writableStreamDefaultWriterClosedCodeConstructorKind; -extern const JSC::ImplementationVisibility s_writableStreamDefaultWriterClosedCodeImplementationVisibility; - -// desiredSize -#define WEBCORE_BUILTIN_WRITABLESTREAMDEFAULTWRITER_DESIREDSIZE 1 -extern const char* const s_writableStreamDefaultWriterDesiredSizeCode; -extern const int s_writableStreamDefaultWriterDesiredSizeCodeLength; -extern const JSC::ConstructAbility s_writableStreamDefaultWriterDesiredSizeCodeConstructAbility; -extern const JSC::ConstructorKind s_writableStreamDefaultWriterDesiredSizeCodeConstructorKind; -extern const JSC::ImplementationVisibility s_writableStreamDefaultWriterDesiredSizeCodeImplementationVisibility; - -// ready -#define WEBCORE_BUILTIN_WRITABLESTREAMDEFAULTWRITER_READY 1 -extern const char* const s_writableStreamDefaultWriterReadyCode; -extern const int s_writableStreamDefaultWriterReadyCodeLength; -extern const JSC::ConstructAbility s_writableStreamDefaultWriterReadyCodeConstructAbility; -extern const JSC::ConstructorKind s_writableStreamDefaultWriterReadyCodeConstructorKind; -extern const JSC::ImplementationVisibility s_writableStreamDefaultWriterReadyCodeImplementationVisibility; +/* ReadableStreamBYOBReader.ts */ +// initializeReadableStreamBYOBReader +#define WEBCORE_BUILTIN_READABLESTREAMBYOBREADER_INITIALIZEREADABLESTREAMBYOBREADER 1 +extern const char* const s_readableStreamBYOBReaderInitializeReadableStreamBYOBReaderCode; +extern const int s_readableStreamBYOBReaderInitializeReadableStreamBYOBReaderCodeLength; +extern const JSC::ConstructAbility s_readableStreamBYOBReaderInitializeReadableStreamBYOBReaderCodeConstructAbility; +extern const JSC::ConstructorKind s_readableStreamBYOBReaderInitializeReadableStreamBYOBReaderCodeConstructorKind; +extern const JSC::ImplementationVisibility s_readableStreamBYOBReaderInitializeReadableStreamBYOBReaderCodeImplementationVisibility; -// abort -#define WEBCORE_BUILTIN_WRITABLESTREAMDEFAULTWRITER_ABORT 1 -extern const char* const s_writableStreamDefaultWriterAbortCode; -extern const int s_writableStreamDefaultWriterAbortCodeLength; -extern const JSC::ConstructAbility s_writableStreamDefaultWriterAbortCodeConstructAbility; -extern const JSC::ConstructorKind s_writableStreamDefaultWriterAbortCodeConstructorKind; -extern const JSC::ImplementationVisibility s_writableStreamDefaultWriterAbortCodeImplementationVisibility; +// cancel +#define WEBCORE_BUILTIN_READABLESTREAMBYOBREADER_CANCEL 1 +extern const char* const s_readableStreamBYOBReaderCancelCode; +extern const int s_readableStreamBYOBReaderCancelCodeLength; +extern const JSC::ConstructAbility s_readableStreamBYOBReaderCancelCodeConstructAbility; +extern const JSC::ConstructorKind s_readableStreamBYOBReaderCancelCodeConstructorKind; +extern const JSC::ImplementationVisibility s_readableStreamBYOBReaderCancelCodeImplementationVisibility; -// close -#define WEBCORE_BUILTIN_WRITABLESTREAMDEFAULTWRITER_CLOSE 1 -extern const char* const s_writableStreamDefaultWriterCloseCode; -extern const int s_writableStreamDefaultWriterCloseCodeLength; -extern const JSC::ConstructAbility s_writableStreamDefaultWriterCloseCodeConstructAbility; -extern const JSC::ConstructorKind s_writableStreamDefaultWriterCloseCodeConstructorKind; -extern const JSC::ImplementationVisibility s_writableStreamDefaultWriterCloseCodeImplementationVisibility; +// read +#define WEBCORE_BUILTIN_READABLESTREAMBYOBREADER_READ 1 +extern const char* const s_readableStreamBYOBReaderReadCode; +extern const int s_readableStreamBYOBReaderReadCodeLength; +extern const JSC::ConstructAbility s_readableStreamBYOBReaderReadCodeConstructAbility; +extern const JSC::ConstructorKind s_readableStreamBYOBReaderReadCodeConstructorKind; +extern const JSC::ImplementationVisibility s_readableStreamBYOBReaderReadCodeImplementationVisibility; // releaseLock -#define WEBCORE_BUILTIN_WRITABLESTREAMDEFAULTWRITER_RELEASELOCK 1 -extern const char* const s_writableStreamDefaultWriterReleaseLockCode; -extern const int s_writableStreamDefaultWriterReleaseLockCodeLength; -extern const JSC::ConstructAbility s_writableStreamDefaultWriterReleaseLockCodeConstructAbility; -extern const JSC::ConstructorKind s_writableStreamDefaultWriterReleaseLockCodeConstructorKind; -extern const JSC::ImplementationVisibility s_writableStreamDefaultWriterReleaseLockCodeImplementationVisibility; - -// write -#define WEBCORE_BUILTIN_WRITABLESTREAMDEFAULTWRITER_WRITE 1 -extern const char* const s_writableStreamDefaultWriterWriteCode; -extern const int s_writableStreamDefaultWriterWriteCodeLength; -extern const JSC::ConstructAbility s_writableStreamDefaultWriterWriteCodeConstructAbility; -extern const JSC::ConstructorKind s_writableStreamDefaultWriterWriteCodeConstructorKind; -extern const JSC::ImplementationVisibility s_writableStreamDefaultWriterWriteCodeImplementationVisibility; +#define WEBCORE_BUILTIN_READABLESTREAMBYOBREADER_RELEASELOCK 1 +extern const char* const s_readableStreamBYOBReaderReleaseLockCode; +extern const int s_readableStreamBYOBReaderReleaseLockCodeLength; +extern const JSC::ConstructAbility s_readableStreamBYOBReaderReleaseLockCodeConstructAbility; +extern const JSC::ConstructorKind s_readableStreamBYOBReaderReleaseLockCodeConstructorKind; +extern const JSC::ImplementationVisibility s_readableStreamBYOBReaderReleaseLockCodeImplementationVisibility; -#define WEBCORE_FOREACH_WRITABLESTREAMDEFAULTWRITER_BUILTIN_DATA(macro) \ - macro(initializeWritableStreamDefaultWriter, writableStreamDefaultWriterInitializeWritableStreamDefaultWriter, 1) \ - macro(closed, writableStreamDefaultWriterClosed, 0) \ - macro(desiredSize, writableStreamDefaultWriterDesiredSize, 0) \ - macro(ready, writableStreamDefaultWriterReady, 0) \ - macro(abort, writableStreamDefaultWriterAbort, 1) \ - macro(close, writableStreamDefaultWriterClose, 0) \ - macro(releaseLock, writableStreamDefaultWriterReleaseLock, 0) \ - macro(write, writableStreamDefaultWriterWrite, 1) \ +// closed +#define WEBCORE_BUILTIN_READABLESTREAMBYOBREADER_CLOSED 1 +extern const char* const s_readableStreamBYOBReaderClosedCode; +extern const int s_readableStreamBYOBReaderClosedCodeLength; +extern const JSC::ConstructAbility s_readableStreamBYOBReaderClosedCodeConstructAbility; +extern const JSC::ConstructorKind s_readableStreamBYOBReaderClosedCodeConstructorKind; +extern const JSC::ImplementationVisibility s_readableStreamBYOBReaderClosedCodeImplementationVisibility; -#define WEBCORE_FOREACH_WRITABLESTREAMDEFAULTWRITER_BUILTIN_CODE(macro) \ - macro(writableStreamDefaultWriterInitializeWritableStreamDefaultWriterCode, initializeWritableStreamDefaultWriter, ASCIILiteral(), s_writableStreamDefaultWriterInitializeWritableStreamDefaultWriterCodeLength) \ - macro(writableStreamDefaultWriterClosedCode, closed, "get closed"_s, s_writableStreamDefaultWriterClosedCodeLength) \ - macro(writableStreamDefaultWriterDesiredSizeCode, desiredSize, "get desiredSize"_s, s_writableStreamDefaultWriterDesiredSizeCodeLength) \ - macro(writableStreamDefaultWriterReadyCode, ready, "get ready"_s, s_writableStreamDefaultWriterReadyCodeLength) \ - macro(writableStreamDefaultWriterAbortCode, abort, ASCIILiteral(), s_writableStreamDefaultWriterAbortCodeLength) \ - macro(writableStreamDefaultWriterCloseCode, close, ASCIILiteral(), s_writableStreamDefaultWriterCloseCodeLength) \ - macro(writableStreamDefaultWriterReleaseLockCode, releaseLock, ASCIILiteral(), s_writableStreamDefaultWriterReleaseLockCodeLength) \ - macro(writableStreamDefaultWriterWriteCode, write, ASCIILiteral(), s_writableStreamDefaultWriterWriteCodeLength) \ +#define WEBCORE_FOREACH_READABLESTREAMBYOBREADER_BUILTIN_DATA(macro) \ + macro(initializeReadableStreamBYOBReader, readableStreamBYOBReaderInitializeReadableStreamBYOBReader, 1) \ + macro(cancel, readableStreamBYOBReaderCancel, 1) \ + macro(read, readableStreamBYOBReaderRead, 1) \ + macro(releaseLock, readableStreamBYOBReaderReleaseLock, 0) \ + macro(closed, readableStreamBYOBReaderClosed, 0) \ -#define WEBCORE_FOREACH_WRITABLESTREAMDEFAULTWRITER_BUILTIN_FUNCTION_NAME(macro) \ - macro(initializeWritableStreamDefaultWriter) \ - macro(closed) \ - macro(desiredSize) \ - macro(ready) \ - macro(abort) \ - macro(close) \ +#define WEBCORE_FOREACH_READABLESTREAMBYOBREADER_BUILTIN_CODE(macro) \ + macro(readableStreamBYOBReaderInitializeReadableStreamBYOBReaderCode, initializeReadableStreamBYOBReader, ASCIILiteral(), s_readableStreamBYOBReaderInitializeReadableStreamBYOBReaderCodeLength) \ + macro(readableStreamBYOBReaderCancelCode, cancel, ASCIILiteral(), s_readableStreamBYOBReaderCancelCodeLength) \ + macro(readableStreamBYOBReaderReadCode, read, ASCIILiteral(), s_readableStreamBYOBReaderReadCodeLength) \ + macro(readableStreamBYOBReaderReleaseLockCode, releaseLock, ASCIILiteral(), s_readableStreamBYOBReaderReleaseLockCodeLength) \ + macro(readableStreamBYOBReaderClosedCode, closed, "get closed"_s, s_readableStreamBYOBReaderClosedCodeLength) \ + +#define WEBCORE_FOREACH_READABLESTREAMBYOBREADER_BUILTIN_FUNCTION_NAME(macro) \ + macro(initializeReadableStreamBYOBReader) \ + macro(cancel) \ + macro(read) \ macro(releaseLock) \ - macro(write) \ + macro(closed) \ #define DECLARE_BUILTIN_GENERATOR(codeName, functionName, overriddenName, argumentCount) \ JSC::FunctionExecutable* codeName##Generator(JSC::VM&); -WEBCORE_FOREACH_WRITABLESTREAMDEFAULTWRITER_BUILTIN_CODE(DECLARE_BUILTIN_GENERATOR) +WEBCORE_FOREACH_READABLESTREAMBYOBREADER_BUILTIN_CODE(DECLARE_BUILTIN_GENERATOR) #undef DECLARE_BUILTIN_GENERATOR -class WritableStreamDefaultWriterBuiltinsWrapper : private JSC::WeakHandleOwner { +class ReadableStreamBYOBReaderBuiltinsWrapper : private JSC::WeakHandleOwner { public: - explicit WritableStreamDefaultWriterBuiltinsWrapper(JSC::VM& vm) + explicit ReadableStreamBYOBReaderBuiltinsWrapper(JSC::VM& vm) : m_vm(vm) - WEBCORE_FOREACH_WRITABLESTREAMDEFAULTWRITER_BUILTIN_FUNCTION_NAME(INITIALIZE_BUILTIN_NAMES) + WEBCORE_FOREACH_READABLESTREAMBYOBREADER_BUILTIN_FUNCTION_NAME(INITIALIZE_BUILTIN_NAMES) #define INITIALIZE_BUILTIN_SOURCE_MEMBERS(name, functionName, overriddenName, length) , m_##name##Source(JSC::makeSource(StringImpl::createWithoutCopying(s_##name, length), { }, JSC::SourceTaintedOrigin::Untainted)) - WEBCORE_FOREACH_WRITABLESTREAMDEFAULTWRITER_BUILTIN_CODE(INITIALIZE_BUILTIN_SOURCE_MEMBERS) + WEBCORE_FOREACH_READABLESTREAMBYOBREADER_BUILTIN_CODE(INITIALIZE_BUILTIN_SOURCE_MEMBERS) #undef INITIALIZE_BUILTIN_SOURCE_MEMBERS { } @@ -4609,28 +4677,28 @@ public: #define EXPOSE_BUILTIN_EXECUTABLES(name, functionName, overriddenName, length) \ JSC::UnlinkedFunctionExecutable* name##Executable(); \ const JSC::SourceCode& name##Source() const { return m_##name##Source; } - WEBCORE_FOREACH_WRITABLESTREAMDEFAULTWRITER_BUILTIN_CODE(EXPOSE_BUILTIN_EXECUTABLES) + WEBCORE_FOREACH_READABLESTREAMBYOBREADER_BUILTIN_CODE(EXPOSE_BUILTIN_EXECUTABLES) #undef EXPOSE_BUILTIN_EXECUTABLES - WEBCORE_FOREACH_WRITABLESTREAMDEFAULTWRITER_BUILTIN_FUNCTION_NAME(DECLARE_BUILTIN_IDENTIFIER_ACCESSOR) + WEBCORE_FOREACH_READABLESTREAMBYOBREADER_BUILTIN_FUNCTION_NAME(DECLARE_BUILTIN_IDENTIFIER_ACCESSOR) void exportNames(); private: JSC::VM& m_vm; - WEBCORE_FOREACH_WRITABLESTREAMDEFAULTWRITER_BUILTIN_FUNCTION_NAME(DECLARE_BUILTIN_NAMES) + WEBCORE_FOREACH_READABLESTREAMBYOBREADER_BUILTIN_FUNCTION_NAME(DECLARE_BUILTIN_NAMES) #define DECLARE_BUILTIN_SOURCE_MEMBERS(name, functionName, overriddenName, length) \ JSC::SourceCode m_##name##Source;\ JSC::Weak m_##name##Executable; - WEBCORE_FOREACH_WRITABLESTREAMDEFAULTWRITER_BUILTIN_CODE(DECLARE_BUILTIN_SOURCE_MEMBERS) + WEBCORE_FOREACH_READABLESTREAMBYOBREADER_BUILTIN_CODE(DECLARE_BUILTIN_SOURCE_MEMBERS) #undef DECLARE_BUILTIN_SOURCE_MEMBERS }; #define DEFINE_BUILTIN_EXECUTABLES(name, functionName, overriddenName, length) \ -inline JSC::UnlinkedFunctionExecutable* WritableStreamDefaultWriterBuiltinsWrapper::name##Executable() \ +inline JSC::UnlinkedFunctionExecutable* ReadableStreamBYOBReaderBuiltinsWrapper::name##Executable() \ {\ if (!m_##name##Executable) {\ JSC::Identifier executableName = functionName##PublicName();\ @@ -4640,355 +4708,739 @@ inline JSC::UnlinkedFunctionExecutable* WritableStreamDefaultWriterBuiltinsWrapp }\ return m_##name##Executable.get();\ } -WEBCORE_FOREACH_WRITABLESTREAMDEFAULTWRITER_BUILTIN_CODE(DEFINE_BUILTIN_EXECUTABLES) +WEBCORE_FOREACH_READABLESTREAMBYOBREADER_BUILTIN_CODE(DEFINE_BUILTIN_EXECUTABLES) #undef DEFINE_BUILTIN_EXECUTABLES -inline void WritableStreamDefaultWriterBuiltinsWrapper::exportNames() -{ -#define EXPORT_FUNCTION_NAME(name) m_vm.propertyNames->appendExternalName(name##PublicName(), name##PrivateName()); - WEBCORE_FOREACH_WRITABLESTREAMDEFAULTWRITER_BUILTIN_FUNCTION_NAME(EXPORT_FUNCTION_NAME) -#undef EXPORT_FUNCTION_NAME -} -/* ReadableStream.ts */ -// initializeReadableStream -#define WEBCORE_BUILTIN_READABLESTREAM_INITIALIZEREADABLESTREAM 1 -extern const char* const s_readableStreamInitializeReadableStreamCode; -extern const int s_readableStreamInitializeReadableStreamCodeLength; -extern const JSC::ConstructAbility s_readableStreamInitializeReadableStreamCodeConstructAbility; -extern const JSC::ConstructorKind s_readableStreamInitializeReadableStreamCodeConstructorKind; -extern const JSC::ImplementationVisibility s_readableStreamInitializeReadableStreamCodeImplementationVisibility; +inline void ReadableStreamBYOBReaderBuiltinsWrapper::exportNames() +{ +#define EXPORT_FUNCTION_NAME(name) m_vm.propertyNames->appendExternalName(name##PublicName(), name##PrivateName()); + WEBCORE_FOREACH_READABLESTREAMBYOBREADER_BUILTIN_FUNCTION_NAME(EXPORT_FUNCTION_NAME) +#undef EXPORT_FUNCTION_NAME +} +/* ReadableStreamInternals.ts */ +// readableStreamReaderGenericInitialize +#define WEBCORE_BUILTIN_READABLESTREAMINTERNALS_READABLESTREAMREADERGENERICINITIALIZE 1 +extern const char* const s_readableStreamInternalsReadableStreamReaderGenericInitializeCode; +extern const int s_readableStreamInternalsReadableStreamReaderGenericInitializeCodeLength; +extern const JSC::ConstructAbility s_readableStreamInternalsReadableStreamReaderGenericInitializeCodeConstructAbility; +extern const JSC::ConstructorKind s_readableStreamInternalsReadableStreamReaderGenericInitializeCodeConstructorKind; +extern const JSC::ImplementationVisibility s_readableStreamInternalsReadableStreamReaderGenericInitializeCodeImplementationVisibility; + +// privateInitializeReadableStreamDefaultController +#define WEBCORE_BUILTIN_READABLESTREAMINTERNALS_PRIVATEINITIALIZEREADABLESTREAMDEFAULTCONTROLLER 1 +extern const char* const s_readableStreamInternalsPrivateInitializeReadableStreamDefaultControllerCode; +extern const int s_readableStreamInternalsPrivateInitializeReadableStreamDefaultControllerCodeLength; +extern const JSC::ConstructAbility s_readableStreamInternalsPrivateInitializeReadableStreamDefaultControllerCodeConstructAbility; +extern const JSC::ConstructorKind s_readableStreamInternalsPrivateInitializeReadableStreamDefaultControllerCodeConstructorKind; +extern const JSC::ImplementationVisibility s_readableStreamInternalsPrivateInitializeReadableStreamDefaultControllerCodeImplementationVisibility; + +// readableStreamDefaultControllerError +#define WEBCORE_BUILTIN_READABLESTREAMINTERNALS_READABLESTREAMDEFAULTCONTROLLERERROR 1 +extern const char* const s_readableStreamInternalsReadableStreamDefaultControllerErrorCode; +extern const int s_readableStreamInternalsReadableStreamDefaultControllerErrorCodeLength; +extern const JSC::ConstructAbility s_readableStreamInternalsReadableStreamDefaultControllerErrorCodeConstructAbility; +extern const JSC::ConstructorKind s_readableStreamInternalsReadableStreamDefaultControllerErrorCodeConstructorKind; +extern const JSC::ImplementationVisibility s_readableStreamInternalsReadableStreamDefaultControllerErrorCodeImplementationVisibility; + +// readableStreamPipeTo +#define WEBCORE_BUILTIN_READABLESTREAMINTERNALS_READABLESTREAMPIPETO 1 +extern const char* const s_readableStreamInternalsReadableStreamPipeToCode; +extern const int s_readableStreamInternalsReadableStreamPipeToCodeLength; +extern const JSC::ConstructAbility s_readableStreamInternalsReadableStreamPipeToCodeConstructAbility; +extern const JSC::ConstructorKind s_readableStreamInternalsReadableStreamPipeToCodeConstructorKind; +extern const JSC::ImplementationVisibility s_readableStreamInternalsReadableStreamPipeToCodeImplementationVisibility; + +// acquireReadableStreamDefaultReader +#define WEBCORE_BUILTIN_READABLESTREAMINTERNALS_ACQUIREREADABLESTREAMDEFAULTREADER 1 +extern const char* const s_readableStreamInternalsAcquireReadableStreamDefaultReaderCode; +extern const int s_readableStreamInternalsAcquireReadableStreamDefaultReaderCodeLength; +extern const JSC::ConstructAbility s_readableStreamInternalsAcquireReadableStreamDefaultReaderCodeConstructAbility; +extern const JSC::ConstructorKind s_readableStreamInternalsAcquireReadableStreamDefaultReaderCodeConstructorKind; +extern const JSC::ImplementationVisibility s_readableStreamInternalsAcquireReadableStreamDefaultReaderCodeImplementationVisibility; + +// setupReadableStreamDefaultController +#define WEBCORE_BUILTIN_READABLESTREAMINTERNALS_SETUPREADABLESTREAMDEFAULTCONTROLLER 1 +extern const char* const s_readableStreamInternalsSetupReadableStreamDefaultControllerCode; +extern const int s_readableStreamInternalsSetupReadableStreamDefaultControllerCodeLength; +extern const JSC::ConstructAbility s_readableStreamInternalsSetupReadableStreamDefaultControllerCodeConstructAbility; +extern const JSC::ConstructorKind s_readableStreamInternalsSetupReadableStreamDefaultControllerCodeConstructorKind; +extern const JSC::ImplementationVisibility s_readableStreamInternalsSetupReadableStreamDefaultControllerCodeImplementationVisibility; + +// createReadableStreamController +#define WEBCORE_BUILTIN_READABLESTREAMINTERNALS_CREATEREADABLESTREAMCONTROLLER 1 +extern const char* const s_readableStreamInternalsCreateReadableStreamControllerCode; +extern const int s_readableStreamInternalsCreateReadableStreamControllerCodeLength; +extern const JSC::ConstructAbility s_readableStreamInternalsCreateReadableStreamControllerCodeConstructAbility; +extern const JSC::ConstructorKind s_readableStreamInternalsCreateReadableStreamControllerCodeConstructorKind; +extern const JSC::ImplementationVisibility s_readableStreamInternalsCreateReadableStreamControllerCodeImplementationVisibility; + +// readableStreamDefaultControllerStart +#define WEBCORE_BUILTIN_READABLESTREAMINTERNALS_READABLESTREAMDEFAULTCONTROLLERSTART 1 +extern const char* const s_readableStreamInternalsReadableStreamDefaultControllerStartCode; +extern const int s_readableStreamInternalsReadableStreamDefaultControllerStartCodeLength; +extern const JSC::ConstructAbility s_readableStreamInternalsReadableStreamDefaultControllerStartCodeConstructAbility; +extern const JSC::ConstructorKind s_readableStreamInternalsReadableStreamDefaultControllerStartCodeConstructorKind; +extern const JSC::ImplementationVisibility s_readableStreamInternalsReadableStreamDefaultControllerStartCodeImplementationVisibility; + +// readableStreamPipeToWritableStream +#define WEBCORE_BUILTIN_READABLESTREAMINTERNALS_READABLESTREAMPIPETOWRITABLESTREAM 1 +extern const char* const s_readableStreamInternalsReadableStreamPipeToWritableStreamCode; +extern const int s_readableStreamInternalsReadableStreamPipeToWritableStreamCodeLength; +extern const JSC::ConstructAbility s_readableStreamInternalsReadableStreamPipeToWritableStreamCodeConstructAbility; +extern const JSC::ConstructorKind s_readableStreamInternalsReadableStreamPipeToWritableStreamCodeConstructorKind; +extern const JSC::ImplementationVisibility s_readableStreamInternalsReadableStreamPipeToWritableStreamCodeImplementationVisibility; + +// pipeToLoop +#define WEBCORE_BUILTIN_READABLESTREAMINTERNALS_PIPETOLOOP 1 +extern const char* const s_readableStreamInternalsPipeToLoopCode; +extern const int s_readableStreamInternalsPipeToLoopCodeLength; +extern const JSC::ConstructAbility s_readableStreamInternalsPipeToLoopCodeConstructAbility; +extern const JSC::ConstructorKind s_readableStreamInternalsPipeToLoopCodeConstructorKind; +extern const JSC::ImplementationVisibility s_readableStreamInternalsPipeToLoopCodeImplementationVisibility; + +// pipeToDoReadWrite +#define WEBCORE_BUILTIN_READABLESTREAMINTERNALS_PIPETODOREADWRITE 1 +extern const char* const s_readableStreamInternalsPipeToDoReadWriteCode; +extern const int s_readableStreamInternalsPipeToDoReadWriteCodeLength; +extern const JSC::ConstructAbility s_readableStreamInternalsPipeToDoReadWriteCodeConstructAbility; +extern const JSC::ConstructorKind s_readableStreamInternalsPipeToDoReadWriteCodeConstructorKind; +extern const JSC::ImplementationVisibility s_readableStreamInternalsPipeToDoReadWriteCodeImplementationVisibility; + +// pipeToErrorsMustBePropagatedForward +#define WEBCORE_BUILTIN_READABLESTREAMINTERNALS_PIPETOERRORSMUSTBEPROPAGATEDFORWARD 1 +extern const char* const s_readableStreamInternalsPipeToErrorsMustBePropagatedForwardCode; +extern const int s_readableStreamInternalsPipeToErrorsMustBePropagatedForwardCodeLength; +extern const JSC::ConstructAbility s_readableStreamInternalsPipeToErrorsMustBePropagatedForwardCodeConstructAbility; +extern const JSC::ConstructorKind s_readableStreamInternalsPipeToErrorsMustBePropagatedForwardCodeConstructorKind; +extern const JSC::ImplementationVisibility s_readableStreamInternalsPipeToErrorsMustBePropagatedForwardCodeImplementationVisibility; + +// pipeToErrorsMustBePropagatedBackward +#define WEBCORE_BUILTIN_READABLESTREAMINTERNALS_PIPETOERRORSMUSTBEPROPAGATEDBACKWARD 1 +extern const char* const s_readableStreamInternalsPipeToErrorsMustBePropagatedBackwardCode; +extern const int s_readableStreamInternalsPipeToErrorsMustBePropagatedBackwardCodeLength; +extern const JSC::ConstructAbility s_readableStreamInternalsPipeToErrorsMustBePropagatedBackwardCodeConstructAbility; +extern const JSC::ConstructorKind s_readableStreamInternalsPipeToErrorsMustBePropagatedBackwardCodeConstructorKind; +extern const JSC::ImplementationVisibility s_readableStreamInternalsPipeToErrorsMustBePropagatedBackwardCodeImplementationVisibility; + +// pipeToClosingMustBePropagatedForward +#define WEBCORE_BUILTIN_READABLESTREAMINTERNALS_PIPETOCLOSINGMUSTBEPROPAGATEDFORWARD 1 +extern const char* const s_readableStreamInternalsPipeToClosingMustBePropagatedForwardCode; +extern const int s_readableStreamInternalsPipeToClosingMustBePropagatedForwardCodeLength; +extern const JSC::ConstructAbility s_readableStreamInternalsPipeToClosingMustBePropagatedForwardCodeConstructAbility; +extern const JSC::ConstructorKind s_readableStreamInternalsPipeToClosingMustBePropagatedForwardCodeConstructorKind; +extern const JSC::ImplementationVisibility s_readableStreamInternalsPipeToClosingMustBePropagatedForwardCodeImplementationVisibility; + +// pipeToClosingMustBePropagatedBackward +#define WEBCORE_BUILTIN_READABLESTREAMINTERNALS_PIPETOCLOSINGMUSTBEPROPAGATEDBACKWARD 1 +extern const char* const s_readableStreamInternalsPipeToClosingMustBePropagatedBackwardCode; +extern const int s_readableStreamInternalsPipeToClosingMustBePropagatedBackwardCodeLength; +extern const JSC::ConstructAbility s_readableStreamInternalsPipeToClosingMustBePropagatedBackwardCodeConstructAbility; +extern const JSC::ConstructorKind s_readableStreamInternalsPipeToClosingMustBePropagatedBackwardCodeConstructorKind; +extern const JSC::ImplementationVisibility s_readableStreamInternalsPipeToClosingMustBePropagatedBackwardCodeImplementationVisibility; + +// pipeToShutdownWithAction +#define WEBCORE_BUILTIN_READABLESTREAMINTERNALS_PIPETOSHUTDOWNWITHACTION 1 +extern const char* const s_readableStreamInternalsPipeToShutdownWithActionCode; +extern const int s_readableStreamInternalsPipeToShutdownWithActionCodeLength; +extern const JSC::ConstructAbility s_readableStreamInternalsPipeToShutdownWithActionCodeConstructAbility; +extern const JSC::ConstructorKind s_readableStreamInternalsPipeToShutdownWithActionCodeConstructorKind; +extern const JSC::ImplementationVisibility s_readableStreamInternalsPipeToShutdownWithActionCodeImplementationVisibility; + +// pipeToShutdown +#define WEBCORE_BUILTIN_READABLESTREAMINTERNALS_PIPETOSHUTDOWN 1 +extern const char* const s_readableStreamInternalsPipeToShutdownCode; +extern const int s_readableStreamInternalsPipeToShutdownCodeLength; +extern const JSC::ConstructAbility s_readableStreamInternalsPipeToShutdownCodeConstructAbility; +extern const JSC::ConstructorKind s_readableStreamInternalsPipeToShutdownCodeConstructorKind; +extern const JSC::ImplementationVisibility s_readableStreamInternalsPipeToShutdownCodeImplementationVisibility; + +// pipeToFinalize +#define WEBCORE_BUILTIN_READABLESTREAMINTERNALS_PIPETOFINALIZE 1 +extern const char* const s_readableStreamInternalsPipeToFinalizeCode; +extern const int s_readableStreamInternalsPipeToFinalizeCodeLength; +extern const JSC::ConstructAbility s_readableStreamInternalsPipeToFinalizeCodeConstructAbility; +extern const JSC::ConstructorKind s_readableStreamInternalsPipeToFinalizeCodeConstructorKind; +extern const JSC::ImplementationVisibility s_readableStreamInternalsPipeToFinalizeCodeImplementationVisibility; + +// readableStreamTee +#define WEBCORE_BUILTIN_READABLESTREAMINTERNALS_READABLESTREAMTEE 1 +extern const char* const s_readableStreamInternalsReadableStreamTeeCode; +extern const int s_readableStreamInternalsReadableStreamTeeCodeLength; +extern const JSC::ConstructAbility s_readableStreamInternalsReadableStreamTeeCodeConstructAbility; +extern const JSC::ConstructorKind s_readableStreamInternalsReadableStreamTeeCodeConstructorKind; +extern const JSC::ImplementationVisibility s_readableStreamInternalsReadableStreamTeeCodeImplementationVisibility; + +// readableStreamTeePullFunction +#define WEBCORE_BUILTIN_READABLESTREAMINTERNALS_READABLESTREAMTEEPULLFUNCTION 1 +extern const char* const s_readableStreamInternalsReadableStreamTeePullFunctionCode; +extern const int s_readableStreamInternalsReadableStreamTeePullFunctionCodeLength; +extern const JSC::ConstructAbility s_readableStreamInternalsReadableStreamTeePullFunctionCodeConstructAbility; +extern const JSC::ConstructorKind s_readableStreamInternalsReadableStreamTeePullFunctionCodeConstructorKind; +extern const JSC::ImplementationVisibility s_readableStreamInternalsReadableStreamTeePullFunctionCodeImplementationVisibility; + +// readableStreamTeeBranch1CancelFunction +#define WEBCORE_BUILTIN_READABLESTREAMINTERNALS_READABLESTREAMTEEBRANCH1CANCELFUNCTION 1 +extern const char* const s_readableStreamInternalsReadableStreamTeeBranch1CancelFunctionCode; +extern const int s_readableStreamInternalsReadableStreamTeeBranch1CancelFunctionCodeLength; +extern const JSC::ConstructAbility s_readableStreamInternalsReadableStreamTeeBranch1CancelFunctionCodeConstructAbility; +extern const JSC::ConstructorKind s_readableStreamInternalsReadableStreamTeeBranch1CancelFunctionCodeConstructorKind; +extern const JSC::ImplementationVisibility s_readableStreamInternalsReadableStreamTeeBranch1CancelFunctionCodeImplementationVisibility; + +// readableStreamTeeBranch2CancelFunction +#define WEBCORE_BUILTIN_READABLESTREAMINTERNALS_READABLESTREAMTEEBRANCH2CANCELFUNCTION 1 +extern const char* const s_readableStreamInternalsReadableStreamTeeBranch2CancelFunctionCode; +extern const int s_readableStreamInternalsReadableStreamTeeBranch2CancelFunctionCodeLength; +extern const JSC::ConstructAbility s_readableStreamInternalsReadableStreamTeeBranch2CancelFunctionCodeConstructAbility; +extern const JSC::ConstructorKind s_readableStreamInternalsReadableStreamTeeBranch2CancelFunctionCodeConstructorKind; +extern const JSC::ImplementationVisibility s_readableStreamInternalsReadableStreamTeeBranch2CancelFunctionCodeImplementationVisibility; + +// isReadableStream +#define WEBCORE_BUILTIN_READABLESTREAMINTERNALS_ISREADABLESTREAM 1 +extern const char* const s_readableStreamInternalsIsReadableStreamCode; +extern const int s_readableStreamInternalsIsReadableStreamCodeLength; +extern const JSC::ConstructAbility s_readableStreamInternalsIsReadableStreamCodeConstructAbility; +extern const JSC::ConstructorKind s_readableStreamInternalsIsReadableStreamCodeConstructorKind; +extern const JSC::ImplementationVisibility s_readableStreamInternalsIsReadableStreamCodeImplementationVisibility; + +// isReadableStreamDefaultReader +#define WEBCORE_BUILTIN_READABLESTREAMINTERNALS_ISREADABLESTREAMDEFAULTREADER 1 +extern const char* const s_readableStreamInternalsIsReadableStreamDefaultReaderCode; +extern const int s_readableStreamInternalsIsReadableStreamDefaultReaderCodeLength; +extern const JSC::ConstructAbility s_readableStreamInternalsIsReadableStreamDefaultReaderCodeConstructAbility; +extern const JSC::ConstructorKind s_readableStreamInternalsIsReadableStreamDefaultReaderCodeConstructorKind; +extern const JSC::ImplementationVisibility s_readableStreamInternalsIsReadableStreamDefaultReaderCodeImplementationVisibility; + +// isReadableStreamDefaultController +#define WEBCORE_BUILTIN_READABLESTREAMINTERNALS_ISREADABLESTREAMDEFAULTCONTROLLER 1 +extern const char* const s_readableStreamInternalsIsReadableStreamDefaultControllerCode; +extern const int s_readableStreamInternalsIsReadableStreamDefaultControllerCodeLength; +extern const JSC::ConstructAbility s_readableStreamInternalsIsReadableStreamDefaultControllerCodeConstructAbility; +extern const JSC::ConstructorKind s_readableStreamInternalsIsReadableStreamDefaultControllerCodeConstructorKind; +extern const JSC::ImplementationVisibility s_readableStreamInternalsIsReadableStreamDefaultControllerCodeImplementationVisibility; -// readableStreamToArray -#define WEBCORE_BUILTIN_READABLESTREAM_READABLESTREAMTOARRAY 1 -extern const char* const s_readableStreamReadableStreamToArrayCode; -extern const int s_readableStreamReadableStreamToArrayCodeLength; -extern const JSC::ConstructAbility s_readableStreamReadableStreamToArrayCodeConstructAbility; -extern const JSC::ConstructorKind s_readableStreamReadableStreamToArrayCodeConstructorKind; -extern const JSC::ImplementationVisibility s_readableStreamReadableStreamToArrayCodeImplementationVisibility; +// readDirectStream +#define WEBCORE_BUILTIN_READABLESTREAMINTERNALS_READDIRECTSTREAM 1 +extern const char* const s_readableStreamInternalsReadDirectStreamCode; +extern const int s_readableStreamInternalsReadDirectStreamCodeLength; +extern const JSC::ConstructAbility s_readableStreamInternalsReadDirectStreamCodeConstructAbility; +extern const JSC::ConstructorKind s_readableStreamInternalsReadDirectStreamCodeConstructorKind; +extern const JSC::ImplementationVisibility s_readableStreamInternalsReadDirectStreamCodeImplementationVisibility; -// readableStreamToText -#define WEBCORE_BUILTIN_READABLESTREAM_READABLESTREAMTOTEXT 1 -extern const char* const s_readableStreamReadableStreamToTextCode; -extern const int s_readableStreamReadableStreamToTextCodeLength; -extern const JSC::ConstructAbility s_readableStreamReadableStreamToTextCodeConstructAbility; -extern const JSC::ConstructorKind s_readableStreamReadableStreamToTextCodeConstructorKind; -extern const JSC::ImplementationVisibility s_readableStreamReadableStreamToTextCodeImplementationVisibility; +// assignToStream +#define WEBCORE_BUILTIN_READABLESTREAMINTERNALS_ASSIGNTOSTREAM 1 +extern const char* const s_readableStreamInternalsAssignToStreamCode; +extern const int s_readableStreamInternalsAssignToStreamCodeLength; +extern const JSC::ConstructAbility s_readableStreamInternalsAssignToStreamCodeConstructAbility; +extern const JSC::ConstructorKind s_readableStreamInternalsAssignToStreamCodeConstructorKind; +extern const JSC::ImplementationVisibility s_readableStreamInternalsAssignToStreamCodeImplementationVisibility; -// readableStreamToArrayBuffer -#define WEBCORE_BUILTIN_READABLESTREAM_READABLESTREAMTOARRAYBUFFER 1 -extern const char* const s_readableStreamReadableStreamToArrayBufferCode; -extern const int s_readableStreamReadableStreamToArrayBufferCodeLength; -extern const JSC::ConstructAbility s_readableStreamReadableStreamToArrayBufferCodeConstructAbility; -extern const JSC::ConstructorKind s_readableStreamReadableStreamToArrayBufferCodeConstructorKind; -extern const JSC::ImplementationVisibility s_readableStreamReadableStreamToArrayBufferCodeImplementationVisibility; +// readStreamIntoSink +#define WEBCORE_BUILTIN_READABLESTREAMINTERNALS_READSTREAMINTOSINK 1 +extern const char* const s_readableStreamInternalsReadStreamIntoSinkCode; +extern const int s_readableStreamInternalsReadStreamIntoSinkCodeLength; +extern const JSC::ConstructAbility s_readableStreamInternalsReadStreamIntoSinkCodeConstructAbility; +extern const JSC::ConstructorKind s_readableStreamInternalsReadStreamIntoSinkCodeConstructorKind; +extern const JSC::ImplementationVisibility s_readableStreamInternalsReadStreamIntoSinkCodeImplementationVisibility; -// readableStreamToFormData -#define WEBCORE_BUILTIN_READABLESTREAM_READABLESTREAMTOFORMDATA 1 -extern const char* const s_readableStreamReadableStreamToFormDataCode; -extern const int s_readableStreamReadableStreamToFormDataCodeLength; -extern const JSC::ConstructAbility s_readableStreamReadableStreamToFormDataCodeConstructAbility; -extern const JSC::ConstructorKind s_readableStreamReadableStreamToFormDataCodeConstructorKind; -extern const JSC::ImplementationVisibility s_readableStreamReadableStreamToFormDataCodeImplementationVisibility; +// handleDirectStreamError +#define WEBCORE_BUILTIN_READABLESTREAMINTERNALS_HANDLEDIRECTSTREAMERROR 1 +extern const char* const s_readableStreamInternalsHandleDirectStreamErrorCode; +extern const int s_readableStreamInternalsHandleDirectStreamErrorCodeLength; +extern const JSC::ConstructAbility s_readableStreamInternalsHandleDirectStreamErrorCodeConstructAbility; +extern const JSC::ConstructorKind s_readableStreamInternalsHandleDirectStreamErrorCodeConstructorKind; +extern const JSC::ImplementationVisibility s_readableStreamInternalsHandleDirectStreamErrorCodeImplementationVisibility; -// readableStreamToJSON -#define WEBCORE_BUILTIN_READABLESTREAM_READABLESTREAMTOJSON 1 -extern const char* const s_readableStreamReadableStreamToJSONCode; -extern const int s_readableStreamReadableStreamToJSONCodeLength; -extern const JSC::ConstructAbility s_readableStreamReadableStreamToJSONCodeConstructAbility; -extern const JSC::ConstructorKind s_readableStreamReadableStreamToJSONCodeConstructorKind; -extern const JSC::ImplementationVisibility s_readableStreamReadableStreamToJSONCodeImplementationVisibility; +// handleDirectStreamErrorReject +#define WEBCORE_BUILTIN_READABLESTREAMINTERNALS_HANDLEDIRECTSTREAMERRORREJECT 1 +extern const char* const s_readableStreamInternalsHandleDirectStreamErrorRejectCode; +extern const int s_readableStreamInternalsHandleDirectStreamErrorRejectCodeLength; +extern const JSC::ConstructAbility s_readableStreamInternalsHandleDirectStreamErrorRejectCodeConstructAbility; +extern const JSC::ConstructorKind s_readableStreamInternalsHandleDirectStreamErrorRejectCodeConstructorKind; +extern const JSC::ImplementationVisibility s_readableStreamInternalsHandleDirectStreamErrorRejectCodeImplementationVisibility; -// readableStreamToBlob -#define WEBCORE_BUILTIN_READABLESTREAM_READABLESTREAMTOBLOB 1 -extern const char* const s_readableStreamReadableStreamToBlobCode; -extern const int s_readableStreamReadableStreamToBlobCodeLength; -extern const JSC::ConstructAbility s_readableStreamReadableStreamToBlobCodeConstructAbility; -extern const JSC::ConstructorKind s_readableStreamReadableStreamToBlobCodeConstructorKind; -extern const JSC::ImplementationVisibility s_readableStreamReadableStreamToBlobCodeImplementationVisibility; +// onPullDirectStream +#define WEBCORE_BUILTIN_READABLESTREAMINTERNALS_ONPULLDIRECTSTREAM 1 +extern const char* const s_readableStreamInternalsOnPullDirectStreamCode; +extern const int s_readableStreamInternalsOnPullDirectStreamCodeLength; +extern const JSC::ConstructAbility s_readableStreamInternalsOnPullDirectStreamCodeConstructAbility; +extern const JSC::ConstructorKind s_readableStreamInternalsOnPullDirectStreamCodeConstructorKind; +extern const JSC::ImplementationVisibility s_readableStreamInternalsOnPullDirectStreamCodeImplementationVisibility; -// consumeReadableStream -#define WEBCORE_BUILTIN_READABLESTREAM_CONSUMEREADABLESTREAM 1 -extern const char* const s_readableStreamConsumeReadableStreamCode; -extern const int s_readableStreamConsumeReadableStreamCodeLength; -extern const JSC::ConstructAbility s_readableStreamConsumeReadableStreamCodeConstructAbility; -extern const JSC::ConstructorKind s_readableStreamConsumeReadableStreamCodeConstructorKind; -extern const JSC::ImplementationVisibility s_readableStreamConsumeReadableStreamCodeImplementationVisibility; +// noopDoneFunction +#define WEBCORE_BUILTIN_READABLESTREAMINTERNALS_NOOPDONEFUNCTION 1 +extern const char* const s_readableStreamInternalsNoopDoneFunctionCode; +extern const int s_readableStreamInternalsNoopDoneFunctionCodeLength; +extern const JSC::ConstructAbility s_readableStreamInternalsNoopDoneFunctionCodeConstructAbility; +extern const JSC::ConstructorKind s_readableStreamInternalsNoopDoneFunctionCodeConstructorKind; +extern const JSC::ImplementationVisibility s_readableStreamInternalsNoopDoneFunctionCodeImplementationVisibility; -// createEmptyReadableStream -#define WEBCORE_BUILTIN_READABLESTREAM_CREATEEMPTYREADABLESTREAM 1 -extern const char* const s_readableStreamCreateEmptyReadableStreamCode; -extern const int s_readableStreamCreateEmptyReadableStreamCodeLength; -extern const JSC::ConstructAbility s_readableStreamCreateEmptyReadableStreamCodeConstructAbility; -extern const JSC::ConstructorKind s_readableStreamCreateEmptyReadableStreamCodeConstructorKind; -extern const JSC::ImplementationVisibility s_readableStreamCreateEmptyReadableStreamCodeImplementationVisibility; +// onReadableStreamDirectControllerClosed +#define WEBCORE_BUILTIN_READABLESTREAMINTERNALS_ONREADABLESTREAMDIRECTCONTROLLERCLOSED 1 +extern const char* const s_readableStreamInternalsOnReadableStreamDirectControllerClosedCode; +extern const int s_readableStreamInternalsOnReadableStreamDirectControllerClosedCodeLength; +extern const JSC::ConstructAbility s_readableStreamInternalsOnReadableStreamDirectControllerClosedCodeConstructAbility; +extern const JSC::ConstructorKind s_readableStreamInternalsOnReadableStreamDirectControllerClosedCodeConstructorKind; +extern const JSC::ImplementationVisibility s_readableStreamInternalsOnReadableStreamDirectControllerClosedCodeImplementationVisibility; -// createNativeReadableStream -#define WEBCORE_BUILTIN_READABLESTREAM_CREATENATIVEREADABLESTREAM 1 -extern const char* const s_readableStreamCreateNativeReadableStreamCode; -extern const int s_readableStreamCreateNativeReadableStreamCodeLength; -extern const JSC::ConstructAbility s_readableStreamCreateNativeReadableStreamCodeConstructAbility; -extern const JSC::ConstructorKind s_readableStreamCreateNativeReadableStreamCodeConstructorKind; -extern const JSC::ImplementationVisibility s_readableStreamCreateNativeReadableStreamCodeImplementationVisibility; +// onCloseDirectStream +#define WEBCORE_BUILTIN_READABLESTREAMINTERNALS_ONCLOSEDIRECTSTREAM 1 +extern const char* const s_readableStreamInternalsOnCloseDirectStreamCode; +extern const int s_readableStreamInternalsOnCloseDirectStreamCodeLength; +extern const JSC::ConstructAbility s_readableStreamInternalsOnCloseDirectStreamCodeConstructAbility; +extern const JSC::ConstructorKind s_readableStreamInternalsOnCloseDirectStreamCodeConstructorKind; +extern const JSC::ImplementationVisibility s_readableStreamInternalsOnCloseDirectStreamCodeImplementationVisibility; -// cancel -#define WEBCORE_BUILTIN_READABLESTREAM_CANCEL 1 -extern const char* const s_readableStreamCancelCode; -extern const int s_readableStreamCancelCodeLength; -extern const JSC::ConstructAbility s_readableStreamCancelCodeConstructAbility; -extern const JSC::ConstructorKind s_readableStreamCancelCodeConstructorKind; -extern const JSC::ImplementationVisibility s_readableStreamCancelCodeImplementationVisibility; +// onFlushDirectStream +#define WEBCORE_BUILTIN_READABLESTREAMINTERNALS_ONFLUSHDIRECTSTREAM 1 +extern const char* const s_readableStreamInternalsOnFlushDirectStreamCode; +extern const int s_readableStreamInternalsOnFlushDirectStreamCodeLength; +extern const JSC::ConstructAbility s_readableStreamInternalsOnFlushDirectStreamCodeConstructAbility; +extern const JSC::ConstructorKind s_readableStreamInternalsOnFlushDirectStreamCodeConstructorKind; +extern const JSC::ImplementationVisibility s_readableStreamInternalsOnFlushDirectStreamCodeImplementationVisibility; -// getReader -#define WEBCORE_BUILTIN_READABLESTREAM_GETREADER 1 -extern const char* const s_readableStreamGetReaderCode; -extern const int s_readableStreamGetReaderCodeLength; -extern const JSC::ConstructAbility s_readableStreamGetReaderCodeConstructAbility; -extern const JSC::ConstructorKind s_readableStreamGetReaderCodeConstructorKind; -extern const JSC::ImplementationVisibility s_readableStreamGetReaderCodeImplementationVisibility; +// createTextStream +#define WEBCORE_BUILTIN_READABLESTREAMINTERNALS_CREATETEXTSTREAM 1 +extern const char* const s_readableStreamInternalsCreateTextStreamCode; +extern const int s_readableStreamInternalsCreateTextStreamCodeLength; +extern const JSC::ConstructAbility s_readableStreamInternalsCreateTextStreamCodeConstructAbility; +extern const JSC::ConstructorKind s_readableStreamInternalsCreateTextStreamCodeConstructorKind; +extern const JSC::ImplementationVisibility s_readableStreamInternalsCreateTextStreamCodeImplementationVisibility; -// pipeThrough -#define WEBCORE_BUILTIN_READABLESTREAM_PIPETHROUGH 1 -extern const char* const s_readableStreamPipeThroughCode; -extern const int s_readableStreamPipeThroughCodeLength; -extern const JSC::ConstructAbility s_readableStreamPipeThroughCodeConstructAbility; -extern const JSC::ConstructorKind s_readableStreamPipeThroughCodeConstructorKind; -extern const JSC::ImplementationVisibility s_readableStreamPipeThroughCodeImplementationVisibility; +// initializeTextStream +#define WEBCORE_BUILTIN_READABLESTREAMINTERNALS_INITIALIZETEXTSTREAM 1 +extern const char* const s_readableStreamInternalsInitializeTextStreamCode; +extern const int s_readableStreamInternalsInitializeTextStreamCodeLength; +extern const JSC::ConstructAbility s_readableStreamInternalsInitializeTextStreamCodeConstructAbility; +extern const JSC::ConstructorKind s_readableStreamInternalsInitializeTextStreamCodeConstructorKind; +extern const JSC::ImplementationVisibility s_readableStreamInternalsInitializeTextStreamCodeImplementationVisibility; -// pipeTo -#define WEBCORE_BUILTIN_READABLESTREAM_PIPETO 1 -extern const char* const s_readableStreamPipeToCode; -extern const int s_readableStreamPipeToCodeLength; -extern const JSC::ConstructAbility s_readableStreamPipeToCodeConstructAbility; -extern const JSC::ConstructorKind s_readableStreamPipeToCodeConstructorKind; -extern const JSC::ImplementationVisibility s_readableStreamPipeToCodeImplementationVisibility; +// initializeArrayStream +#define WEBCORE_BUILTIN_READABLESTREAMINTERNALS_INITIALIZEARRAYSTREAM 1 +extern const char* const s_readableStreamInternalsInitializeArrayStreamCode; +extern const int s_readableStreamInternalsInitializeArrayStreamCodeLength; +extern const JSC::ConstructAbility s_readableStreamInternalsInitializeArrayStreamCodeConstructAbility; +extern const JSC::ConstructorKind s_readableStreamInternalsInitializeArrayStreamCodeConstructorKind; +extern const JSC::ImplementationVisibility s_readableStreamInternalsInitializeArrayStreamCodeImplementationVisibility; -// tee -#define WEBCORE_BUILTIN_READABLESTREAM_TEE 1 -extern const char* const s_readableStreamTeeCode; -extern const int s_readableStreamTeeCodeLength; -extern const JSC::ConstructAbility s_readableStreamTeeCodeConstructAbility; -extern const JSC::ConstructorKind s_readableStreamTeeCodeConstructorKind; -extern const JSC::ImplementationVisibility s_readableStreamTeeCodeImplementationVisibility; +// initializeArrayBufferStream +#define WEBCORE_BUILTIN_READABLESTREAMINTERNALS_INITIALIZEARRAYBUFFERSTREAM 1 +extern const char* const s_readableStreamInternalsInitializeArrayBufferStreamCode; +extern const int s_readableStreamInternalsInitializeArrayBufferStreamCodeLength; +extern const JSC::ConstructAbility s_readableStreamInternalsInitializeArrayBufferStreamCodeConstructAbility; +extern const JSC::ConstructorKind s_readableStreamInternalsInitializeArrayBufferStreamCodeConstructorKind; +extern const JSC::ImplementationVisibility s_readableStreamInternalsInitializeArrayBufferStreamCodeImplementationVisibility; -// locked -#define WEBCORE_BUILTIN_READABLESTREAM_LOCKED 1 -extern const char* const s_readableStreamLockedCode; -extern const int s_readableStreamLockedCodeLength; -extern const JSC::ConstructAbility s_readableStreamLockedCodeConstructAbility; -extern const JSC::ConstructorKind s_readableStreamLockedCodeConstructorKind; -extern const JSC::ImplementationVisibility s_readableStreamLockedCodeImplementationVisibility; +// readableStreamError +#define WEBCORE_BUILTIN_READABLESTREAMINTERNALS_READABLESTREAMERROR 1 +extern const char* const s_readableStreamInternalsReadableStreamErrorCode; +extern const int s_readableStreamInternalsReadableStreamErrorCodeLength; +extern const JSC::ConstructAbility s_readableStreamInternalsReadableStreamErrorCodeConstructAbility; +extern const JSC::ConstructorKind s_readableStreamInternalsReadableStreamErrorCodeConstructorKind; +extern const JSC::ImplementationVisibility s_readableStreamInternalsReadableStreamErrorCodeImplementationVisibility; -// values -#define WEBCORE_BUILTIN_READABLESTREAM_VALUES 1 -extern const char* const s_readableStreamValuesCode; -extern const int s_readableStreamValuesCodeLength; -extern const JSC::ConstructAbility s_readableStreamValuesCodeConstructAbility; -extern const JSC::ConstructorKind s_readableStreamValuesCodeConstructorKind; -extern const JSC::ImplementationVisibility s_readableStreamValuesCodeImplementationVisibility; +// readableStreamDefaultControllerShouldCallPull +#define WEBCORE_BUILTIN_READABLESTREAMINTERNALS_READABLESTREAMDEFAULTCONTROLLERSHOULDCALLPULL 1 +extern const char* const s_readableStreamInternalsReadableStreamDefaultControllerShouldCallPullCode; +extern const int s_readableStreamInternalsReadableStreamDefaultControllerShouldCallPullCodeLength; +extern const JSC::ConstructAbility s_readableStreamInternalsReadableStreamDefaultControllerShouldCallPullCodeConstructAbility; +extern const JSC::ConstructorKind s_readableStreamInternalsReadableStreamDefaultControllerShouldCallPullCodeConstructorKind; +extern const JSC::ImplementationVisibility s_readableStreamInternalsReadableStreamDefaultControllerShouldCallPullCodeImplementationVisibility; + +// readableStreamDefaultControllerCallPullIfNeeded +#define WEBCORE_BUILTIN_READABLESTREAMINTERNALS_READABLESTREAMDEFAULTCONTROLLERCALLPULLIFNEEDED 1 +extern const char* const s_readableStreamInternalsReadableStreamDefaultControllerCallPullIfNeededCode; +extern const int s_readableStreamInternalsReadableStreamDefaultControllerCallPullIfNeededCodeLength; +extern const JSC::ConstructAbility s_readableStreamInternalsReadableStreamDefaultControllerCallPullIfNeededCodeConstructAbility; +extern const JSC::ConstructorKind s_readableStreamInternalsReadableStreamDefaultControllerCallPullIfNeededCodeConstructorKind; +extern const JSC::ImplementationVisibility s_readableStreamInternalsReadableStreamDefaultControllerCallPullIfNeededCodeImplementationVisibility; + +// isReadableStreamLocked +#define WEBCORE_BUILTIN_READABLESTREAMINTERNALS_ISREADABLESTREAMLOCKED 1 +extern const char* const s_readableStreamInternalsIsReadableStreamLockedCode; +extern const int s_readableStreamInternalsIsReadableStreamLockedCodeLength; +extern const JSC::ConstructAbility s_readableStreamInternalsIsReadableStreamLockedCodeConstructAbility; +extern const JSC::ConstructorKind s_readableStreamInternalsIsReadableStreamLockedCodeConstructorKind; +extern const JSC::ImplementationVisibility s_readableStreamInternalsIsReadableStreamLockedCodeImplementationVisibility; -// lazyAsyncIterator -#define WEBCORE_BUILTIN_READABLESTREAM_LAZYASYNCITERATOR 1 -extern const char* const s_readableStreamLazyAsyncIteratorCode; -extern const int s_readableStreamLazyAsyncIteratorCodeLength; -extern const JSC::ConstructAbility s_readableStreamLazyAsyncIteratorCodeConstructAbility; -extern const JSC::ConstructorKind s_readableStreamLazyAsyncIteratorCodeConstructorKind; -extern const JSC::ImplementationVisibility s_readableStreamLazyAsyncIteratorCodeImplementationVisibility; +// readableStreamDefaultControllerGetDesiredSize +#define WEBCORE_BUILTIN_READABLESTREAMINTERNALS_READABLESTREAMDEFAULTCONTROLLERGETDESIREDSIZE 1 +extern const char* const s_readableStreamInternalsReadableStreamDefaultControllerGetDesiredSizeCode; +extern const int s_readableStreamInternalsReadableStreamDefaultControllerGetDesiredSizeCodeLength; +extern const JSC::ConstructAbility s_readableStreamInternalsReadableStreamDefaultControllerGetDesiredSizeCodeConstructAbility; +extern const JSC::ConstructorKind s_readableStreamInternalsReadableStreamDefaultControllerGetDesiredSizeCodeConstructorKind; +extern const JSC::ImplementationVisibility s_readableStreamInternalsReadableStreamDefaultControllerGetDesiredSizeCodeImplementationVisibility; -#define WEBCORE_FOREACH_READABLESTREAM_BUILTIN_DATA(macro) \ - macro(initializeReadableStream, readableStreamInitializeReadableStream, 3) \ - macro(readableStreamToArray, readableStreamReadableStreamToArray, 1) \ - macro(readableStreamToText, readableStreamReadableStreamToText, 1) \ - macro(readableStreamToArrayBuffer, readableStreamReadableStreamToArrayBuffer, 1) \ - macro(readableStreamToFormData, readableStreamReadableStreamToFormData, 3) \ - macro(readableStreamToJSON, readableStreamReadableStreamToJSON, 1) \ - macro(readableStreamToBlob, readableStreamReadableStreamToBlob, 1) \ - macro(consumeReadableStream, readableStreamConsumeReadableStream, 3) \ - macro(createEmptyReadableStream, readableStreamCreateEmptyReadableStream, 0) \ - macro(createNativeReadableStream, readableStreamCreateNativeReadableStream, 3) \ - macro(cancel, readableStreamCancel, 1) \ - macro(getReader, readableStreamGetReader, 1) \ - macro(pipeThrough, readableStreamPipeThrough, 2) \ - macro(pipeTo, readableStreamPipeTo, 1) \ - macro(tee, readableStreamTee, 0) \ - macro(locked, readableStreamLocked, 0) \ - macro(values, readableStreamValues, 1) \ - macro(lazyAsyncIterator, readableStreamLazyAsyncIterator, 0) \ +// readableStreamReaderGenericCancel +#define WEBCORE_BUILTIN_READABLESTREAMINTERNALS_READABLESTREAMREADERGENERICCANCEL 1 +extern const char* const s_readableStreamInternalsReadableStreamReaderGenericCancelCode; +extern const int s_readableStreamInternalsReadableStreamReaderGenericCancelCodeLength; +extern const JSC::ConstructAbility s_readableStreamInternalsReadableStreamReaderGenericCancelCodeConstructAbility; +extern const JSC::ConstructorKind s_readableStreamInternalsReadableStreamReaderGenericCancelCodeConstructorKind; +extern const JSC::ImplementationVisibility s_readableStreamInternalsReadableStreamReaderGenericCancelCodeImplementationVisibility; -#define WEBCORE_FOREACH_READABLESTREAM_BUILTIN_CODE(macro) \ - macro(readableStreamInitializeReadableStreamCode, initializeReadableStream, ASCIILiteral(), s_readableStreamInitializeReadableStreamCodeLength) \ - macro(readableStreamReadableStreamToArrayCode, readableStreamToArray, ASCIILiteral(), s_readableStreamReadableStreamToArrayCodeLength) \ - macro(readableStreamReadableStreamToTextCode, readableStreamToText, ASCIILiteral(), s_readableStreamReadableStreamToTextCodeLength) \ - macro(readableStreamReadableStreamToArrayBufferCode, readableStreamToArrayBuffer, ASCIILiteral(), s_readableStreamReadableStreamToArrayBufferCodeLength) \ - macro(readableStreamReadableStreamToFormDataCode, readableStreamToFormData, ASCIILiteral(), s_readableStreamReadableStreamToFormDataCodeLength) \ - macro(readableStreamReadableStreamToJSONCode, readableStreamToJSON, ASCIILiteral(), s_readableStreamReadableStreamToJSONCodeLength) \ - macro(readableStreamReadableStreamToBlobCode, readableStreamToBlob, ASCIILiteral(), s_readableStreamReadableStreamToBlobCodeLength) \ - macro(readableStreamConsumeReadableStreamCode, consumeReadableStream, ASCIILiteral(), s_readableStreamConsumeReadableStreamCodeLength) \ - macro(readableStreamCreateEmptyReadableStreamCode, createEmptyReadableStream, ASCIILiteral(), s_readableStreamCreateEmptyReadableStreamCodeLength) \ - macro(readableStreamCreateNativeReadableStreamCode, createNativeReadableStream, ASCIILiteral(), s_readableStreamCreateNativeReadableStreamCodeLength) \ - macro(readableStreamCancelCode, cancel, ASCIILiteral(), s_readableStreamCancelCodeLength) \ - macro(readableStreamGetReaderCode, getReader, ASCIILiteral(), s_readableStreamGetReaderCodeLength) \ - macro(readableStreamPipeThroughCode, pipeThrough, ASCIILiteral(), s_readableStreamPipeThroughCodeLength) \ - macro(readableStreamPipeToCode, pipeTo, ASCIILiteral(), s_readableStreamPipeToCodeLength) \ - macro(readableStreamTeeCode, tee, ASCIILiteral(), s_readableStreamTeeCodeLength) \ - macro(readableStreamLockedCode, locked, "get locked"_s, s_readableStreamLockedCodeLength) \ - macro(readableStreamValuesCode, values, ASCIILiteral(), s_readableStreamValuesCodeLength) \ - macro(readableStreamLazyAsyncIteratorCode, lazyAsyncIterator, ASCIILiteral(), s_readableStreamLazyAsyncIteratorCodeLength) \ +// readableStreamCancel +#define WEBCORE_BUILTIN_READABLESTREAMINTERNALS_READABLESTREAMCANCEL 1 +extern const char* const s_readableStreamInternalsReadableStreamCancelCode; +extern const int s_readableStreamInternalsReadableStreamCancelCodeLength; +extern const JSC::ConstructAbility s_readableStreamInternalsReadableStreamCancelCodeConstructAbility; +extern const JSC::ConstructorKind s_readableStreamInternalsReadableStreamCancelCodeConstructorKind; +extern const JSC::ImplementationVisibility s_readableStreamInternalsReadableStreamCancelCodeImplementationVisibility; -#define WEBCORE_FOREACH_READABLESTREAM_BUILTIN_FUNCTION_NAME(macro) \ - macro(initializeReadableStream) \ - macro(readableStreamToArray) \ - macro(readableStreamToText) \ - macro(readableStreamToArrayBuffer) \ - macro(readableStreamToFormData) \ - macro(readableStreamToJSON) \ - macro(readableStreamToBlob) \ - macro(consumeReadableStream) \ - macro(createEmptyReadableStream) \ - macro(createNativeReadableStream) \ - macro(cancel) \ - macro(getReader) \ - macro(pipeThrough) \ - macro(pipeTo) \ - macro(tee) \ - macro(locked) \ - macro(values) \ - macro(lazyAsyncIterator) \ +// readableStreamDefaultControllerCancel +#define WEBCORE_BUILTIN_READABLESTREAMINTERNALS_READABLESTREAMDEFAULTCONTROLLERCANCEL 1 +extern const char* const s_readableStreamInternalsReadableStreamDefaultControllerCancelCode; +extern const int s_readableStreamInternalsReadableStreamDefaultControllerCancelCodeLength; +extern const JSC::ConstructAbility s_readableStreamInternalsReadableStreamDefaultControllerCancelCodeConstructAbility; +extern const JSC::ConstructorKind s_readableStreamInternalsReadableStreamDefaultControllerCancelCodeConstructorKind; +extern const JSC::ImplementationVisibility s_readableStreamInternalsReadableStreamDefaultControllerCancelCodeImplementationVisibility; -#define DECLARE_BUILTIN_GENERATOR(codeName, functionName, overriddenName, argumentCount) \ - JSC::FunctionExecutable* codeName##Generator(JSC::VM&); +// readableStreamDefaultControllerPull +#define WEBCORE_BUILTIN_READABLESTREAMINTERNALS_READABLESTREAMDEFAULTCONTROLLERPULL 1 +extern const char* const s_readableStreamInternalsReadableStreamDefaultControllerPullCode; +extern const int s_readableStreamInternalsReadableStreamDefaultControllerPullCodeLength; +extern const JSC::ConstructAbility s_readableStreamInternalsReadableStreamDefaultControllerPullCodeConstructAbility; +extern const JSC::ConstructorKind s_readableStreamInternalsReadableStreamDefaultControllerPullCodeConstructorKind; +extern const JSC::ImplementationVisibility s_readableStreamInternalsReadableStreamDefaultControllerPullCodeImplementationVisibility; -WEBCORE_FOREACH_READABLESTREAM_BUILTIN_CODE(DECLARE_BUILTIN_GENERATOR) -#undef DECLARE_BUILTIN_GENERATOR +// readableStreamDefaultControllerClose +#define WEBCORE_BUILTIN_READABLESTREAMINTERNALS_READABLESTREAMDEFAULTCONTROLLERCLOSE 1 +extern const char* const s_readableStreamInternalsReadableStreamDefaultControllerCloseCode; +extern const int s_readableStreamInternalsReadableStreamDefaultControllerCloseCodeLength; +extern const JSC::ConstructAbility s_readableStreamInternalsReadableStreamDefaultControllerCloseCodeConstructAbility; +extern const JSC::ConstructorKind s_readableStreamInternalsReadableStreamDefaultControllerCloseCodeConstructorKind; +extern const JSC::ImplementationVisibility s_readableStreamInternalsReadableStreamDefaultControllerCloseCodeImplementationVisibility; -class ReadableStreamBuiltinsWrapper : private JSC::WeakHandleOwner { -public: - explicit ReadableStreamBuiltinsWrapper(JSC::VM& vm) - : m_vm(vm) - WEBCORE_FOREACH_READABLESTREAM_BUILTIN_FUNCTION_NAME(INITIALIZE_BUILTIN_NAMES) -#define INITIALIZE_BUILTIN_SOURCE_MEMBERS(name, functionName, overriddenName, length) , m_##name##Source(JSC::makeSource(StringImpl::createWithoutCopying(s_##name, length), { }, JSC::SourceTaintedOrigin::Untainted)) - WEBCORE_FOREACH_READABLESTREAM_BUILTIN_CODE(INITIALIZE_BUILTIN_SOURCE_MEMBERS) -#undef INITIALIZE_BUILTIN_SOURCE_MEMBERS - { - } +// readableStreamClose +#define WEBCORE_BUILTIN_READABLESTREAMINTERNALS_READABLESTREAMCLOSE 1 +extern const char* const s_readableStreamInternalsReadableStreamCloseCode; +extern const int s_readableStreamInternalsReadableStreamCloseCodeLength; +extern const JSC::ConstructAbility s_readableStreamInternalsReadableStreamCloseCodeConstructAbility; +extern const JSC::ConstructorKind s_readableStreamInternalsReadableStreamCloseCodeConstructorKind; +extern const JSC::ImplementationVisibility s_readableStreamInternalsReadableStreamCloseCodeImplementationVisibility; -#define EXPOSE_BUILTIN_EXECUTABLES(name, functionName, overriddenName, length) \ - JSC::UnlinkedFunctionExecutable* name##Executable(); \ - const JSC::SourceCode& name##Source() const { return m_##name##Source; } - WEBCORE_FOREACH_READABLESTREAM_BUILTIN_CODE(EXPOSE_BUILTIN_EXECUTABLES) -#undef EXPOSE_BUILTIN_EXECUTABLES +// readableStreamFulfillReadRequest +#define WEBCORE_BUILTIN_READABLESTREAMINTERNALS_READABLESTREAMFULFILLREADREQUEST 1 +extern const char* const s_readableStreamInternalsReadableStreamFulfillReadRequestCode; +extern const int s_readableStreamInternalsReadableStreamFulfillReadRequestCodeLength; +extern const JSC::ConstructAbility s_readableStreamInternalsReadableStreamFulfillReadRequestCodeConstructAbility; +extern const JSC::ConstructorKind s_readableStreamInternalsReadableStreamFulfillReadRequestCodeConstructorKind; +extern const JSC::ImplementationVisibility s_readableStreamInternalsReadableStreamFulfillReadRequestCodeImplementationVisibility; - WEBCORE_FOREACH_READABLESTREAM_BUILTIN_FUNCTION_NAME(DECLARE_BUILTIN_IDENTIFIER_ACCESSOR) +// readableStreamDefaultControllerEnqueue +#define WEBCORE_BUILTIN_READABLESTREAMINTERNALS_READABLESTREAMDEFAULTCONTROLLERENQUEUE 1 +extern const char* const s_readableStreamInternalsReadableStreamDefaultControllerEnqueueCode; +extern const int s_readableStreamInternalsReadableStreamDefaultControllerEnqueueCodeLength; +extern const JSC::ConstructAbility s_readableStreamInternalsReadableStreamDefaultControllerEnqueueCodeConstructAbility; +extern const JSC::ConstructorKind s_readableStreamInternalsReadableStreamDefaultControllerEnqueueCodeConstructorKind; +extern const JSC::ImplementationVisibility s_readableStreamInternalsReadableStreamDefaultControllerEnqueueCodeImplementationVisibility; - void exportNames(); +// readableStreamDefaultReaderRead +#define WEBCORE_BUILTIN_READABLESTREAMINTERNALS_READABLESTREAMDEFAULTREADERREAD 1 +extern const char* const s_readableStreamInternalsReadableStreamDefaultReaderReadCode; +extern const int s_readableStreamInternalsReadableStreamDefaultReaderReadCodeLength; +extern const JSC::ConstructAbility s_readableStreamInternalsReadableStreamDefaultReaderReadCodeConstructAbility; +extern const JSC::ConstructorKind s_readableStreamInternalsReadableStreamDefaultReaderReadCodeConstructorKind; +extern const JSC::ImplementationVisibility s_readableStreamInternalsReadableStreamDefaultReaderReadCodeImplementationVisibility; -private: - JSC::VM& m_vm; +// readableStreamAddReadRequest +#define WEBCORE_BUILTIN_READABLESTREAMINTERNALS_READABLESTREAMADDREADREQUEST 1 +extern const char* const s_readableStreamInternalsReadableStreamAddReadRequestCode; +extern const int s_readableStreamInternalsReadableStreamAddReadRequestCodeLength; +extern const JSC::ConstructAbility s_readableStreamInternalsReadableStreamAddReadRequestCodeConstructAbility; +extern const JSC::ConstructorKind s_readableStreamInternalsReadableStreamAddReadRequestCodeConstructorKind; +extern const JSC::ImplementationVisibility s_readableStreamInternalsReadableStreamAddReadRequestCodeImplementationVisibility; - WEBCORE_FOREACH_READABLESTREAM_BUILTIN_FUNCTION_NAME(DECLARE_BUILTIN_NAMES) +// isReadableStreamDisturbed +#define WEBCORE_BUILTIN_READABLESTREAMINTERNALS_ISREADABLESTREAMDISTURBED 1 +extern const char* const s_readableStreamInternalsIsReadableStreamDisturbedCode; +extern const int s_readableStreamInternalsIsReadableStreamDisturbedCodeLength; +extern const JSC::ConstructAbility s_readableStreamInternalsIsReadableStreamDisturbedCodeConstructAbility; +extern const JSC::ConstructorKind s_readableStreamInternalsIsReadableStreamDisturbedCodeConstructorKind; +extern const JSC::ImplementationVisibility s_readableStreamInternalsIsReadableStreamDisturbedCodeImplementationVisibility; -#define DECLARE_BUILTIN_SOURCE_MEMBERS(name, functionName, overriddenName, length) \ - JSC::SourceCode m_##name##Source;\ - JSC::Weak m_##name##Executable; - WEBCORE_FOREACH_READABLESTREAM_BUILTIN_CODE(DECLARE_BUILTIN_SOURCE_MEMBERS) -#undef DECLARE_BUILTIN_SOURCE_MEMBERS +// readableStreamReaderGenericRelease +#define WEBCORE_BUILTIN_READABLESTREAMINTERNALS_READABLESTREAMREADERGENERICRELEASE 1 +extern const char* const s_readableStreamInternalsReadableStreamReaderGenericReleaseCode; +extern const int s_readableStreamInternalsReadableStreamReaderGenericReleaseCodeLength; +extern const JSC::ConstructAbility s_readableStreamInternalsReadableStreamReaderGenericReleaseCodeConstructAbility; +extern const JSC::ConstructorKind s_readableStreamInternalsReadableStreamReaderGenericReleaseCodeConstructorKind; +extern const JSC::ImplementationVisibility s_readableStreamInternalsReadableStreamReaderGenericReleaseCodeImplementationVisibility; -}; +// readableStreamDefaultControllerCanCloseOrEnqueue +#define WEBCORE_BUILTIN_READABLESTREAMINTERNALS_READABLESTREAMDEFAULTCONTROLLERCANCLOSEORENQUEUE 1 +extern const char* const s_readableStreamInternalsReadableStreamDefaultControllerCanCloseOrEnqueueCode; +extern const int s_readableStreamInternalsReadableStreamDefaultControllerCanCloseOrEnqueueCodeLength; +extern const JSC::ConstructAbility s_readableStreamInternalsReadableStreamDefaultControllerCanCloseOrEnqueueCodeConstructAbility; +extern const JSC::ConstructorKind s_readableStreamInternalsReadableStreamDefaultControllerCanCloseOrEnqueueCodeConstructorKind; +extern const JSC::ImplementationVisibility s_readableStreamInternalsReadableStreamDefaultControllerCanCloseOrEnqueueCodeImplementationVisibility; -#define DEFINE_BUILTIN_EXECUTABLES(name, functionName, overriddenName, length) \ -inline JSC::UnlinkedFunctionExecutable* ReadableStreamBuiltinsWrapper::name##Executable() \ -{\ - if (!m_##name##Executable) {\ - JSC::Identifier executableName = functionName##PublicName();\ - if (overriddenName)\ - executableName = JSC::Identifier::fromString(m_vm, overriddenName);\ - m_##name##Executable = JSC::Weak(JSC::createBuiltinExecutable(m_vm, m_##name##Source, executableName, s_##name##ImplementationVisibility, s_##name##ConstructorKind, s_##name##ConstructAbility), this, &m_##name##Executable);\ - }\ - return m_##name##Executable.get();\ -} -WEBCORE_FOREACH_READABLESTREAM_BUILTIN_CODE(DEFINE_BUILTIN_EXECUTABLES) -#undef DEFINE_BUILTIN_EXECUTABLES +// lazyLoadStream +#define WEBCORE_BUILTIN_READABLESTREAMINTERNALS_LAZYLOADSTREAM 1 +extern const char* const s_readableStreamInternalsLazyLoadStreamCode; +extern const int s_readableStreamInternalsLazyLoadStreamCodeLength; +extern const JSC::ConstructAbility s_readableStreamInternalsLazyLoadStreamCodeConstructAbility; +extern const JSC::ConstructorKind s_readableStreamInternalsLazyLoadStreamCodeConstructorKind; +extern const JSC::ImplementationVisibility s_readableStreamInternalsLazyLoadStreamCodeImplementationVisibility; -inline void ReadableStreamBuiltinsWrapper::exportNames() -{ -#define EXPORT_FUNCTION_NAME(name) m_vm.propertyNames->appendExternalName(name##PublicName(), name##PrivateName()); - WEBCORE_FOREACH_READABLESTREAM_BUILTIN_FUNCTION_NAME(EXPORT_FUNCTION_NAME) -#undef EXPORT_FUNCTION_NAME -} -/* ReadableStreamDefaultController.ts */ -// initializeReadableStreamDefaultController -#define WEBCORE_BUILTIN_READABLESTREAMDEFAULTCONTROLLER_INITIALIZEREADABLESTREAMDEFAULTCONTROLLER 1 -extern const char* const s_readableStreamDefaultControllerInitializeReadableStreamDefaultControllerCode; -extern const int s_readableStreamDefaultControllerInitializeReadableStreamDefaultControllerCodeLength; -extern const JSC::ConstructAbility s_readableStreamDefaultControllerInitializeReadableStreamDefaultControllerCodeConstructAbility; -extern const JSC::ConstructorKind s_readableStreamDefaultControllerInitializeReadableStreamDefaultControllerCodeConstructorKind; -extern const JSC::ImplementationVisibility s_readableStreamDefaultControllerInitializeReadableStreamDefaultControllerCodeImplementationVisibility; +// readableStreamIntoArray +#define WEBCORE_BUILTIN_READABLESTREAMINTERNALS_READABLESTREAMINTOARRAY 1 +extern const char* const s_readableStreamInternalsReadableStreamIntoArrayCode; +extern const int s_readableStreamInternalsReadableStreamIntoArrayCodeLength; +extern const JSC::ConstructAbility s_readableStreamInternalsReadableStreamIntoArrayCodeConstructAbility; +extern const JSC::ConstructorKind s_readableStreamInternalsReadableStreamIntoArrayCodeConstructorKind; +extern const JSC::ImplementationVisibility s_readableStreamInternalsReadableStreamIntoArrayCodeImplementationVisibility; -// enqueue -#define WEBCORE_BUILTIN_READABLESTREAMDEFAULTCONTROLLER_ENQUEUE 1 -extern const char* const s_readableStreamDefaultControllerEnqueueCode; -extern const int s_readableStreamDefaultControllerEnqueueCodeLength; -extern const JSC::ConstructAbility s_readableStreamDefaultControllerEnqueueCodeConstructAbility; -extern const JSC::ConstructorKind s_readableStreamDefaultControllerEnqueueCodeConstructorKind; -extern const JSC::ImplementationVisibility s_readableStreamDefaultControllerEnqueueCodeImplementationVisibility; +// readableStreamIntoText +#define WEBCORE_BUILTIN_READABLESTREAMINTERNALS_READABLESTREAMINTOTEXT 1 +extern const char* const s_readableStreamInternalsReadableStreamIntoTextCode; +extern const int s_readableStreamInternalsReadableStreamIntoTextCodeLength; +extern const JSC::ConstructAbility s_readableStreamInternalsReadableStreamIntoTextCodeConstructAbility; +extern const JSC::ConstructorKind s_readableStreamInternalsReadableStreamIntoTextCodeConstructorKind; +extern const JSC::ImplementationVisibility s_readableStreamInternalsReadableStreamIntoTextCodeImplementationVisibility; + +// readableStreamToArrayBufferDirect +#define WEBCORE_BUILTIN_READABLESTREAMINTERNALS_READABLESTREAMTOARRAYBUFFERDIRECT 1 +extern const char* const s_readableStreamInternalsReadableStreamToArrayBufferDirectCode; +extern const int s_readableStreamInternalsReadableStreamToArrayBufferDirectCodeLength; +extern const JSC::ConstructAbility s_readableStreamInternalsReadableStreamToArrayBufferDirectCodeConstructAbility; +extern const JSC::ConstructorKind s_readableStreamInternalsReadableStreamToArrayBufferDirectCodeConstructorKind; +extern const JSC::ImplementationVisibility s_readableStreamInternalsReadableStreamToArrayBufferDirectCodeImplementationVisibility; -// error -#define WEBCORE_BUILTIN_READABLESTREAMDEFAULTCONTROLLER_ERROR 1 -extern const char* const s_readableStreamDefaultControllerErrorCode; -extern const int s_readableStreamDefaultControllerErrorCodeLength; -extern const JSC::ConstructAbility s_readableStreamDefaultControllerErrorCodeConstructAbility; -extern const JSC::ConstructorKind s_readableStreamDefaultControllerErrorCodeConstructorKind; -extern const JSC::ImplementationVisibility s_readableStreamDefaultControllerErrorCodeImplementationVisibility; +// readableStreamToTextDirect +#define WEBCORE_BUILTIN_READABLESTREAMINTERNALS_READABLESTREAMTOTEXTDIRECT 1 +extern const char* const s_readableStreamInternalsReadableStreamToTextDirectCode; +extern const int s_readableStreamInternalsReadableStreamToTextDirectCodeLength; +extern const JSC::ConstructAbility s_readableStreamInternalsReadableStreamToTextDirectCodeConstructAbility; +extern const JSC::ConstructorKind s_readableStreamInternalsReadableStreamToTextDirectCodeConstructorKind; +extern const JSC::ImplementationVisibility s_readableStreamInternalsReadableStreamToTextDirectCodeImplementationVisibility; -// close -#define WEBCORE_BUILTIN_READABLESTREAMDEFAULTCONTROLLER_CLOSE 1 -extern const char* const s_readableStreamDefaultControllerCloseCode; -extern const int s_readableStreamDefaultControllerCloseCodeLength; -extern const JSC::ConstructAbility s_readableStreamDefaultControllerCloseCodeConstructAbility; -extern const JSC::ConstructorKind s_readableStreamDefaultControllerCloseCodeConstructorKind; -extern const JSC::ImplementationVisibility s_readableStreamDefaultControllerCloseCodeImplementationVisibility; +// readableStreamToArrayDirect +#define WEBCORE_BUILTIN_READABLESTREAMINTERNALS_READABLESTREAMTOARRAYDIRECT 1 +extern const char* const s_readableStreamInternalsReadableStreamToArrayDirectCode; +extern const int s_readableStreamInternalsReadableStreamToArrayDirectCodeLength; +extern const JSC::ConstructAbility s_readableStreamInternalsReadableStreamToArrayDirectCodeConstructAbility; +extern const JSC::ConstructorKind s_readableStreamInternalsReadableStreamToArrayDirectCodeConstructorKind; +extern const JSC::ImplementationVisibility s_readableStreamInternalsReadableStreamToArrayDirectCodeImplementationVisibility; -// desiredSize -#define WEBCORE_BUILTIN_READABLESTREAMDEFAULTCONTROLLER_DESIREDSIZE 1 -extern const char* const s_readableStreamDefaultControllerDesiredSizeCode; -extern const int s_readableStreamDefaultControllerDesiredSizeCodeLength; -extern const JSC::ConstructAbility s_readableStreamDefaultControllerDesiredSizeCodeConstructAbility; -extern const JSC::ConstructorKind s_readableStreamDefaultControllerDesiredSizeCodeConstructorKind; -extern const JSC::ImplementationVisibility s_readableStreamDefaultControllerDesiredSizeCodeImplementationVisibility; +// readableStreamDefineLazyIterators +#define WEBCORE_BUILTIN_READABLESTREAMINTERNALS_READABLESTREAMDEFINELAZYITERATORS 1 +extern const char* const s_readableStreamInternalsReadableStreamDefineLazyIteratorsCode; +extern const int s_readableStreamInternalsReadableStreamDefineLazyIteratorsCodeLength; +extern const JSC::ConstructAbility s_readableStreamInternalsReadableStreamDefineLazyIteratorsCodeConstructAbility; +extern const JSC::ConstructorKind s_readableStreamInternalsReadableStreamDefineLazyIteratorsCodeConstructorKind; +extern const JSC::ImplementationVisibility s_readableStreamInternalsReadableStreamDefineLazyIteratorsCodeImplementationVisibility; -#define WEBCORE_FOREACH_READABLESTREAMDEFAULTCONTROLLER_BUILTIN_DATA(macro) \ - macro(initializeReadableStreamDefaultController, readableStreamDefaultControllerInitializeReadableStreamDefaultController, 4) \ - macro(enqueue, readableStreamDefaultControllerEnqueue, 1) \ - macro(error, readableStreamDefaultControllerError, 1) \ - macro(close, readableStreamDefaultControllerClose, 0) \ - macro(desiredSize, readableStreamDefaultControllerDesiredSize, 0) \ +#define WEBCORE_FOREACH_READABLESTREAMINTERNALS_BUILTIN_DATA(macro) \ + macro(readableStreamReaderGenericInitialize, readableStreamInternalsReadableStreamReaderGenericInitialize, 2) \ + macro(privateInitializeReadableStreamDefaultController, readableStreamInternalsPrivateInitializeReadableStreamDefaultController, 4) \ + macro(readableStreamDefaultControllerError, readableStreamInternalsReadableStreamDefaultControllerError, 2) \ + macro(readableStreamPipeTo, readableStreamInternalsReadableStreamPipeTo, 2) \ + macro(acquireReadableStreamDefaultReader, readableStreamInternalsAcquireReadableStreamDefaultReader, 1) \ + macro(setupReadableStreamDefaultController, readableStreamInternalsSetupReadableStreamDefaultController, 8) \ + macro(createReadableStreamController, readableStreamInternalsCreateReadableStreamController, 3) \ + macro(readableStreamDefaultControllerStart, readableStreamInternalsReadableStreamDefaultControllerStart, 1) \ + macro(readableStreamPipeToWritableStream, readableStreamInternalsReadableStreamPipeToWritableStream, 7) \ + macro(pipeToLoop, readableStreamInternalsPipeToLoop, 1) \ + macro(pipeToDoReadWrite, readableStreamInternalsPipeToDoReadWrite, 1) \ + macro(pipeToErrorsMustBePropagatedForward, readableStreamInternalsPipeToErrorsMustBePropagatedForward, 1) \ + macro(pipeToErrorsMustBePropagatedBackward, readableStreamInternalsPipeToErrorsMustBePropagatedBackward, 1) \ + macro(pipeToClosingMustBePropagatedForward, readableStreamInternalsPipeToClosingMustBePropagatedForward, 1) \ + macro(pipeToClosingMustBePropagatedBackward, readableStreamInternalsPipeToClosingMustBePropagatedBackward, 1) \ + macro(pipeToShutdownWithAction, readableStreamInternalsPipeToShutdownWithAction, 2) \ + macro(pipeToShutdown, readableStreamInternalsPipeToShutdown, 1) \ + macro(pipeToFinalize, readableStreamInternalsPipeToFinalize, 1) \ + macro(readableStreamTee, readableStreamInternalsReadableStreamTee, 2) \ + macro(readableStreamTeePullFunction, readableStreamInternalsReadableStreamTeePullFunction, 3) \ + macro(readableStreamTeeBranch1CancelFunction, readableStreamInternalsReadableStreamTeeBranch1CancelFunction, 2) \ + macro(readableStreamTeeBranch2CancelFunction, readableStreamInternalsReadableStreamTeeBranch2CancelFunction, 2) \ + macro(isReadableStream, readableStreamInternalsIsReadableStream, 1) \ + macro(isReadableStreamDefaultReader, readableStreamInternalsIsReadableStreamDefaultReader, 1) \ + macro(isReadableStreamDefaultController, readableStreamInternalsIsReadableStreamDefaultController, 1) \ + macro(readDirectStream, readableStreamInternalsReadDirectStream, 3) \ + macro(assignToStream, readableStreamInternalsAssignToStream, 2) \ + macro(readStreamIntoSink, readableStreamInternalsReadStreamIntoSink, 3) \ + macro(handleDirectStreamError, readableStreamInternalsHandleDirectStreamError, 1) \ + macro(handleDirectStreamErrorReject, readableStreamInternalsHandleDirectStreamErrorReject, 1) \ + macro(onPullDirectStream, readableStreamInternalsOnPullDirectStream, 1) \ + macro(noopDoneFunction, readableStreamInternalsNoopDoneFunction, 0) \ + macro(onReadableStreamDirectControllerClosed, readableStreamInternalsOnReadableStreamDirectControllerClosed, 1) \ + macro(onCloseDirectStream, readableStreamInternalsOnCloseDirectStream, 1) \ + macro(onFlushDirectStream, readableStreamInternalsOnFlushDirectStream, 0) \ + macro(createTextStream, readableStreamInternalsCreateTextStream, 1) \ + macro(initializeTextStream, readableStreamInternalsInitializeTextStream, 2) \ + macro(initializeArrayStream, readableStreamInternalsInitializeArrayStream, 2) \ + macro(initializeArrayBufferStream, readableStreamInternalsInitializeArrayBufferStream, 2) \ + macro(readableStreamError, readableStreamInternalsReadableStreamError, 2) \ + macro(readableStreamDefaultControllerShouldCallPull, readableStreamInternalsReadableStreamDefaultControllerShouldCallPull, 1) \ + macro(readableStreamDefaultControllerCallPullIfNeeded, readableStreamInternalsReadableStreamDefaultControllerCallPullIfNeeded, 1) \ + macro(isReadableStreamLocked, readableStreamInternalsIsReadableStreamLocked, 1) \ + macro(readableStreamDefaultControllerGetDesiredSize, readableStreamInternalsReadableStreamDefaultControllerGetDesiredSize, 1) \ + macro(readableStreamReaderGenericCancel, readableStreamInternalsReadableStreamReaderGenericCancel, 2) \ + macro(readableStreamCancel, readableStreamInternalsReadableStreamCancel, 2) \ + macro(readableStreamDefaultControllerCancel, readableStreamInternalsReadableStreamDefaultControllerCancel, 2) \ + macro(readableStreamDefaultControllerPull, readableStreamInternalsReadableStreamDefaultControllerPull, 1) \ + macro(readableStreamDefaultControllerClose, readableStreamInternalsReadableStreamDefaultControllerClose, 1) \ + macro(readableStreamClose, readableStreamInternalsReadableStreamClose, 1) \ + macro(readableStreamFulfillReadRequest, readableStreamInternalsReadableStreamFulfillReadRequest, 3) \ + macro(readableStreamDefaultControllerEnqueue, readableStreamInternalsReadableStreamDefaultControllerEnqueue, 2) \ + macro(readableStreamDefaultReaderRead, readableStreamInternalsReadableStreamDefaultReaderRead, 1) \ + macro(readableStreamAddReadRequest, readableStreamInternalsReadableStreamAddReadRequest, 1) \ + macro(isReadableStreamDisturbed, readableStreamInternalsIsReadableStreamDisturbed, 1) \ + macro(readableStreamReaderGenericRelease, readableStreamInternalsReadableStreamReaderGenericRelease, 1) \ + macro(readableStreamDefaultControllerCanCloseOrEnqueue, readableStreamInternalsReadableStreamDefaultControllerCanCloseOrEnqueue, 1) \ + macro(lazyLoadStream, readableStreamInternalsLazyLoadStream, 2) \ + macro(readableStreamIntoArray, readableStreamInternalsReadableStreamIntoArray, 1) \ + macro(readableStreamIntoText, readableStreamInternalsReadableStreamIntoText, 1) \ + macro(readableStreamToArrayBufferDirect, readableStreamInternalsReadableStreamToArrayBufferDirect, 2) \ + macro(readableStreamToTextDirect, readableStreamInternalsReadableStreamToTextDirect, 2) \ + macro(readableStreamToArrayDirect, readableStreamInternalsReadableStreamToArrayDirect, 2) \ + macro(readableStreamDefineLazyIterators, readableStreamInternalsReadableStreamDefineLazyIterators, 1) \ -#define WEBCORE_FOREACH_READABLESTREAMDEFAULTCONTROLLER_BUILTIN_CODE(macro) \ - macro(readableStreamDefaultControllerInitializeReadableStreamDefaultControllerCode, initializeReadableStreamDefaultController, ASCIILiteral(), s_readableStreamDefaultControllerInitializeReadableStreamDefaultControllerCodeLength) \ - macro(readableStreamDefaultControllerEnqueueCode, enqueue, ASCIILiteral(), s_readableStreamDefaultControllerEnqueueCodeLength) \ - macro(readableStreamDefaultControllerErrorCode, error, ASCIILiteral(), s_readableStreamDefaultControllerErrorCodeLength) \ - macro(readableStreamDefaultControllerCloseCode, close, ASCIILiteral(), s_readableStreamDefaultControllerCloseCodeLength) \ - macro(readableStreamDefaultControllerDesiredSizeCode, desiredSize, "get desiredSize"_s, s_readableStreamDefaultControllerDesiredSizeCodeLength) \ +#define WEBCORE_FOREACH_READABLESTREAMINTERNALS_BUILTIN_CODE(macro) \ + macro(readableStreamInternalsReadableStreamReaderGenericInitializeCode, readableStreamReaderGenericInitialize, ASCIILiteral(), s_readableStreamInternalsReadableStreamReaderGenericInitializeCodeLength) \ + macro(readableStreamInternalsPrivateInitializeReadableStreamDefaultControllerCode, privateInitializeReadableStreamDefaultController, ASCIILiteral(), s_readableStreamInternalsPrivateInitializeReadableStreamDefaultControllerCodeLength) \ + macro(readableStreamInternalsReadableStreamDefaultControllerErrorCode, readableStreamDefaultControllerError, ASCIILiteral(), s_readableStreamInternalsReadableStreamDefaultControllerErrorCodeLength) \ + macro(readableStreamInternalsReadableStreamPipeToCode, readableStreamPipeTo, ASCIILiteral(), s_readableStreamInternalsReadableStreamPipeToCodeLength) \ + macro(readableStreamInternalsAcquireReadableStreamDefaultReaderCode, acquireReadableStreamDefaultReader, ASCIILiteral(), s_readableStreamInternalsAcquireReadableStreamDefaultReaderCodeLength) \ + macro(readableStreamInternalsSetupReadableStreamDefaultControllerCode, setupReadableStreamDefaultController, ASCIILiteral(), s_readableStreamInternalsSetupReadableStreamDefaultControllerCodeLength) \ + macro(readableStreamInternalsCreateReadableStreamControllerCode, createReadableStreamController, ASCIILiteral(), s_readableStreamInternalsCreateReadableStreamControllerCodeLength) \ + macro(readableStreamInternalsReadableStreamDefaultControllerStartCode, readableStreamDefaultControllerStart, ASCIILiteral(), s_readableStreamInternalsReadableStreamDefaultControllerStartCodeLength) \ + macro(readableStreamInternalsReadableStreamPipeToWritableStreamCode, readableStreamPipeToWritableStream, ASCIILiteral(), s_readableStreamInternalsReadableStreamPipeToWritableStreamCodeLength) \ + macro(readableStreamInternalsPipeToLoopCode, pipeToLoop, ASCIILiteral(), s_readableStreamInternalsPipeToLoopCodeLength) \ + macro(readableStreamInternalsPipeToDoReadWriteCode, pipeToDoReadWrite, ASCIILiteral(), s_readableStreamInternalsPipeToDoReadWriteCodeLength) \ + macro(readableStreamInternalsPipeToErrorsMustBePropagatedForwardCode, pipeToErrorsMustBePropagatedForward, ASCIILiteral(), s_readableStreamInternalsPipeToErrorsMustBePropagatedForwardCodeLength) \ + macro(readableStreamInternalsPipeToErrorsMustBePropagatedBackwardCode, pipeToErrorsMustBePropagatedBackward, ASCIILiteral(), s_readableStreamInternalsPipeToErrorsMustBePropagatedBackwardCodeLength) \ + macro(readableStreamInternalsPipeToClosingMustBePropagatedForwardCode, pipeToClosingMustBePropagatedForward, ASCIILiteral(), s_readableStreamInternalsPipeToClosingMustBePropagatedForwardCodeLength) \ + macro(readableStreamInternalsPipeToClosingMustBePropagatedBackwardCode, pipeToClosingMustBePropagatedBackward, ASCIILiteral(), s_readableStreamInternalsPipeToClosingMustBePropagatedBackwardCodeLength) \ + macro(readableStreamInternalsPipeToShutdownWithActionCode, pipeToShutdownWithAction, ASCIILiteral(), s_readableStreamInternalsPipeToShutdownWithActionCodeLength) \ + macro(readableStreamInternalsPipeToShutdownCode, pipeToShutdown, ASCIILiteral(), s_readableStreamInternalsPipeToShutdownCodeLength) \ + macro(readableStreamInternalsPipeToFinalizeCode, pipeToFinalize, ASCIILiteral(), s_readableStreamInternalsPipeToFinalizeCodeLength) \ + macro(readableStreamInternalsReadableStreamTeeCode, readableStreamTee, ASCIILiteral(), s_readableStreamInternalsReadableStreamTeeCodeLength) \ + macro(readableStreamInternalsReadableStreamTeePullFunctionCode, readableStreamTeePullFunction, ASCIILiteral(), s_readableStreamInternalsReadableStreamTeePullFunctionCodeLength) \ + macro(readableStreamInternalsReadableStreamTeeBranch1CancelFunctionCode, readableStreamTeeBranch1CancelFunction, ASCIILiteral(), s_readableStreamInternalsReadableStreamTeeBranch1CancelFunctionCodeLength) \ + macro(readableStreamInternalsReadableStreamTeeBranch2CancelFunctionCode, readableStreamTeeBranch2CancelFunction, ASCIILiteral(), s_readableStreamInternalsReadableStreamTeeBranch2CancelFunctionCodeLength) \ + macro(readableStreamInternalsIsReadableStreamCode, isReadableStream, ASCIILiteral(), s_readableStreamInternalsIsReadableStreamCodeLength) \ + macro(readableStreamInternalsIsReadableStreamDefaultReaderCode, isReadableStreamDefaultReader, ASCIILiteral(), s_readableStreamInternalsIsReadableStreamDefaultReaderCodeLength) \ + macro(readableStreamInternalsIsReadableStreamDefaultControllerCode, isReadableStreamDefaultController, ASCIILiteral(), s_readableStreamInternalsIsReadableStreamDefaultControllerCodeLength) \ + macro(readableStreamInternalsReadDirectStreamCode, readDirectStream, ASCIILiteral(), s_readableStreamInternalsReadDirectStreamCodeLength) \ + macro(readableStreamInternalsAssignToStreamCode, assignToStream, ASCIILiteral(), s_readableStreamInternalsAssignToStreamCodeLength) \ + macro(readableStreamInternalsReadStreamIntoSinkCode, readStreamIntoSink, ASCIILiteral(), s_readableStreamInternalsReadStreamIntoSinkCodeLength) \ + macro(readableStreamInternalsHandleDirectStreamErrorCode, handleDirectStreamError, ASCIILiteral(), s_readableStreamInternalsHandleDirectStreamErrorCodeLength) \ + macro(readableStreamInternalsHandleDirectStreamErrorRejectCode, handleDirectStreamErrorReject, ASCIILiteral(), s_readableStreamInternalsHandleDirectStreamErrorRejectCodeLength) \ + macro(readableStreamInternalsOnPullDirectStreamCode, onPullDirectStream, ASCIILiteral(), s_readableStreamInternalsOnPullDirectStreamCodeLength) \ + macro(readableStreamInternalsNoopDoneFunctionCode, noopDoneFunction, ASCIILiteral(), s_readableStreamInternalsNoopDoneFunctionCodeLength) \ + macro(readableStreamInternalsOnReadableStreamDirectControllerClosedCode, onReadableStreamDirectControllerClosed, ASCIILiteral(), s_readableStreamInternalsOnReadableStreamDirectControllerClosedCodeLength) \ + macro(readableStreamInternalsOnCloseDirectStreamCode, onCloseDirectStream, ASCIILiteral(), s_readableStreamInternalsOnCloseDirectStreamCodeLength) \ + macro(readableStreamInternalsOnFlushDirectStreamCode, onFlushDirectStream, ASCIILiteral(), s_readableStreamInternalsOnFlushDirectStreamCodeLength) \ + macro(readableStreamInternalsCreateTextStreamCode, createTextStream, ASCIILiteral(), s_readableStreamInternalsCreateTextStreamCodeLength) \ + macro(readableStreamInternalsInitializeTextStreamCode, initializeTextStream, ASCIILiteral(), s_readableStreamInternalsInitializeTextStreamCodeLength) \ + macro(readableStreamInternalsInitializeArrayStreamCode, initializeArrayStream, ASCIILiteral(), s_readableStreamInternalsInitializeArrayStreamCodeLength) \ + macro(readableStreamInternalsInitializeArrayBufferStreamCode, initializeArrayBufferStream, ASCIILiteral(), s_readableStreamInternalsInitializeArrayBufferStreamCodeLength) \ + macro(readableStreamInternalsReadableStreamErrorCode, readableStreamError, ASCIILiteral(), s_readableStreamInternalsReadableStreamErrorCodeLength) \ + macro(readableStreamInternalsReadableStreamDefaultControllerShouldCallPullCode, readableStreamDefaultControllerShouldCallPull, ASCIILiteral(), s_readableStreamInternalsReadableStreamDefaultControllerShouldCallPullCodeLength) \ + macro(readableStreamInternalsReadableStreamDefaultControllerCallPullIfNeededCode, readableStreamDefaultControllerCallPullIfNeeded, ASCIILiteral(), s_readableStreamInternalsReadableStreamDefaultControllerCallPullIfNeededCodeLength) \ + macro(readableStreamInternalsIsReadableStreamLockedCode, isReadableStreamLocked, ASCIILiteral(), s_readableStreamInternalsIsReadableStreamLockedCodeLength) \ + macro(readableStreamInternalsReadableStreamDefaultControllerGetDesiredSizeCode, readableStreamDefaultControllerGetDesiredSize, ASCIILiteral(), s_readableStreamInternalsReadableStreamDefaultControllerGetDesiredSizeCodeLength) \ + macro(readableStreamInternalsReadableStreamReaderGenericCancelCode, readableStreamReaderGenericCancel, ASCIILiteral(), s_readableStreamInternalsReadableStreamReaderGenericCancelCodeLength) \ + macro(readableStreamInternalsReadableStreamCancelCode, readableStreamCancel, ASCIILiteral(), s_readableStreamInternalsReadableStreamCancelCodeLength) \ + macro(readableStreamInternalsReadableStreamDefaultControllerCancelCode, readableStreamDefaultControllerCancel, ASCIILiteral(), s_readableStreamInternalsReadableStreamDefaultControllerCancelCodeLength) \ + macro(readableStreamInternalsReadableStreamDefaultControllerPullCode, readableStreamDefaultControllerPull, ASCIILiteral(), s_readableStreamInternalsReadableStreamDefaultControllerPullCodeLength) \ + macro(readableStreamInternalsReadableStreamDefaultControllerCloseCode, readableStreamDefaultControllerClose, ASCIILiteral(), s_readableStreamInternalsReadableStreamDefaultControllerCloseCodeLength) \ + macro(readableStreamInternalsReadableStreamCloseCode, readableStreamClose, ASCIILiteral(), s_readableStreamInternalsReadableStreamCloseCodeLength) \ + macro(readableStreamInternalsReadableStreamFulfillReadRequestCode, readableStreamFulfillReadRequest, ASCIILiteral(), s_readableStreamInternalsReadableStreamFulfillReadRequestCodeLength) \ + macro(readableStreamInternalsReadableStreamDefaultControllerEnqueueCode, readableStreamDefaultControllerEnqueue, ASCIILiteral(), s_readableStreamInternalsReadableStreamDefaultControllerEnqueueCodeLength) \ + macro(readableStreamInternalsReadableStreamDefaultReaderReadCode, readableStreamDefaultReaderRead, ASCIILiteral(), s_readableStreamInternalsReadableStreamDefaultReaderReadCodeLength) \ + macro(readableStreamInternalsReadableStreamAddReadRequestCode, readableStreamAddReadRequest, ASCIILiteral(), s_readableStreamInternalsReadableStreamAddReadRequestCodeLength) \ + macro(readableStreamInternalsIsReadableStreamDisturbedCode, isReadableStreamDisturbed, ASCIILiteral(), s_readableStreamInternalsIsReadableStreamDisturbedCodeLength) \ + macro(readableStreamInternalsReadableStreamReaderGenericReleaseCode, readableStreamReaderGenericRelease, ASCIILiteral(), s_readableStreamInternalsReadableStreamReaderGenericReleaseCodeLength) \ + macro(readableStreamInternalsReadableStreamDefaultControllerCanCloseOrEnqueueCode, readableStreamDefaultControllerCanCloseOrEnqueue, ASCIILiteral(), s_readableStreamInternalsReadableStreamDefaultControllerCanCloseOrEnqueueCodeLength) \ + macro(readableStreamInternalsLazyLoadStreamCode, lazyLoadStream, ASCIILiteral(), s_readableStreamInternalsLazyLoadStreamCodeLength) \ + macro(readableStreamInternalsReadableStreamIntoArrayCode, readableStreamIntoArray, ASCIILiteral(), s_readableStreamInternalsReadableStreamIntoArrayCodeLength) \ + macro(readableStreamInternalsReadableStreamIntoTextCode, readableStreamIntoText, ASCIILiteral(), s_readableStreamInternalsReadableStreamIntoTextCodeLength) \ + macro(readableStreamInternalsReadableStreamToArrayBufferDirectCode, readableStreamToArrayBufferDirect, ASCIILiteral(), s_readableStreamInternalsReadableStreamToArrayBufferDirectCodeLength) \ + macro(readableStreamInternalsReadableStreamToTextDirectCode, readableStreamToTextDirect, ASCIILiteral(), s_readableStreamInternalsReadableStreamToTextDirectCodeLength) \ + macro(readableStreamInternalsReadableStreamToArrayDirectCode, readableStreamToArrayDirect, ASCIILiteral(), s_readableStreamInternalsReadableStreamToArrayDirectCodeLength) \ + macro(readableStreamInternalsReadableStreamDefineLazyIteratorsCode, readableStreamDefineLazyIterators, ASCIILiteral(), s_readableStreamInternalsReadableStreamDefineLazyIteratorsCodeLength) \ -#define WEBCORE_FOREACH_READABLESTREAMDEFAULTCONTROLLER_BUILTIN_FUNCTION_NAME(macro) \ - macro(initializeReadableStreamDefaultController) \ - macro(enqueue) \ - macro(error) \ - macro(close) \ - macro(desiredSize) \ +#define WEBCORE_FOREACH_READABLESTREAMINTERNALS_BUILTIN_FUNCTION_NAME(macro) \ + macro(readableStreamReaderGenericInitialize) \ + macro(privateInitializeReadableStreamDefaultController) \ + macro(readableStreamDefaultControllerError) \ + macro(readableStreamPipeTo) \ + macro(acquireReadableStreamDefaultReader) \ + macro(setupReadableStreamDefaultController) \ + macro(createReadableStreamController) \ + macro(readableStreamDefaultControllerStart) \ + macro(readableStreamPipeToWritableStream) \ + macro(pipeToLoop) \ + macro(pipeToDoReadWrite) \ + macro(pipeToErrorsMustBePropagatedForward) \ + macro(pipeToErrorsMustBePropagatedBackward) \ + macro(pipeToClosingMustBePropagatedForward) \ + macro(pipeToClosingMustBePropagatedBackward) \ + macro(pipeToShutdownWithAction) \ + macro(pipeToShutdown) \ + macro(pipeToFinalize) \ + macro(readableStreamTee) \ + macro(readableStreamTeePullFunction) \ + macro(readableStreamTeeBranch1CancelFunction) \ + macro(readableStreamTeeBranch2CancelFunction) \ + macro(isReadableStream) \ + macro(isReadableStreamDefaultReader) \ + macro(isReadableStreamDefaultController) \ + macro(readDirectStream) \ + macro(assignToStream) \ + macro(readStreamIntoSink) \ + macro(handleDirectStreamError) \ + macro(handleDirectStreamErrorReject) \ + macro(onPullDirectStream) \ + macro(noopDoneFunction) \ + macro(onReadableStreamDirectControllerClosed) \ + macro(onCloseDirectStream) \ + macro(onFlushDirectStream) \ + macro(createTextStream) \ + macro(initializeTextStream) \ + macro(initializeArrayStream) \ + macro(initializeArrayBufferStream) \ + macro(readableStreamError) \ + macro(readableStreamDefaultControllerShouldCallPull) \ + macro(readableStreamDefaultControllerCallPullIfNeeded) \ + macro(isReadableStreamLocked) \ + macro(readableStreamDefaultControllerGetDesiredSize) \ + macro(readableStreamReaderGenericCancel) \ + macro(readableStreamCancel) \ + macro(readableStreamDefaultControllerCancel) \ + macro(readableStreamDefaultControllerPull) \ + macro(readableStreamDefaultControllerClose) \ + macro(readableStreamClose) \ + macro(readableStreamFulfillReadRequest) \ + macro(readableStreamDefaultControllerEnqueue) \ + macro(readableStreamDefaultReaderRead) \ + macro(readableStreamAddReadRequest) \ + macro(isReadableStreamDisturbed) \ + macro(readableStreamReaderGenericRelease) \ + macro(readableStreamDefaultControllerCanCloseOrEnqueue) \ + macro(lazyLoadStream) \ + macro(readableStreamIntoArray) \ + macro(readableStreamIntoText) \ + macro(readableStreamToArrayBufferDirect) \ + macro(readableStreamToTextDirect) \ + macro(readableStreamToArrayDirect) \ + macro(readableStreamDefineLazyIterators) \ #define DECLARE_BUILTIN_GENERATOR(codeName, functionName, overriddenName, argumentCount) \ JSC::FunctionExecutable* codeName##Generator(JSC::VM&); -WEBCORE_FOREACH_READABLESTREAMDEFAULTCONTROLLER_BUILTIN_CODE(DECLARE_BUILTIN_GENERATOR) +WEBCORE_FOREACH_READABLESTREAMINTERNALS_BUILTIN_CODE(DECLARE_BUILTIN_GENERATOR) #undef DECLARE_BUILTIN_GENERATOR -class ReadableStreamDefaultControllerBuiltinsWrapper : private JSC::WeakHandleOwner { +class ReadableStreamInternalsBuiltinsWrapper : private JSC::WeakHandleOwner { public: - explicit ReadableStreamDefaultControllerBuiltinsWrapper(JSC::VM& vm) + explicit ReadableStreamInternalsBuiltinsWrapper(JSC::VM& vm) : m_vm(vm) - WEBCORE_FOREACH_READABLESTREAMDEFAULTCONTROLLER_BUILTIN_FUNCTION_NAME(INITIALIZE_BUILTIN_NAMES) + WEBCORE_FOREACH_READABLESTREAMINTERNALS_BUILTIN_FUNCTION_NAME(INITIALIZE_BUILTIN_NAMES) #define INITIALIZE_BUILTIN_SOURCE_MEMBERS(name, functionName, overriddenName, length) , m_##name##Source(JSC::makeSource(StringImpl::createWithoutCopying(s_##name, length), { }, JSC::SourceTaintedOrigin::Untainted)) - WEBCORE_FOREACH_READABLESTREAMDEFAULTCONTROLLER_BUILTIN_CODE(INITIALIZE_BUILTIN_SOURCE_MEMBERS) + WEBCORE_FOREACH_READABLESTREAMINTERNALS_BUILTIN_CODE(INITIALIZE_BUILTIN_SOURCE_MEMBERS) #undef INITIALIZE_BUILTIN_SOURCE_MEMBERS { } @@ -4996,462 +5448,122 @@ public: #define EXPOSE_BUILTIN_EXECUTABLES(name, functionName, overriddenName, length) \ JSC::UnlinkedFunctionExecutable* name##Executable(); \ const JSC::SourceCode& name##Source() const { return m_##name##Source; } - WEBCORE_FOREACH_READABLESTREAMDEFAULTCONTROLLER_BUILTIN_CODE(EXPOSE_BUILTIN_EXECUTABLES) + WEBCORE_FOREACH_READABLESTREAMINTERNALS_BUILTIN_CODE(EXPOSE_BUILTIN_EXECUTABLES) #undef EXPOSE_BUILTIN_EXECUTABLES - WEBCORE_FOREACH_READABLESTREAMDEFAULTCONTROLLER_BUILTIN_FUNCTION_NAME(DECLARE_BUILTIN_IDENTIFIER_ACCESSOR) + WEBCORE_FOREACH_READABLESTREAMINTERNALS_BUILTIN_FUNCTION_NAME(DECLARE_BUILTIN_IDENTIFIER_ACCESSOR) void exportNames(); private: - JSC::VM& m_vm; - - WEBCORE_FOREACH_READABLESTREAMDEFAULTCONTROLLER_BUILTIN_FUNCTION_NAME(DECLARE_BUILTIN_NAMES) - -#define DECLARE_BUILTIN_SOURCE_MEMBERS(name, functionName, overriddenName, length) \ - JSC::SourceCode m_##name##Source;\ - JSC::Weak m_##name##Executable; - WEBCORE_FOREACH_READABLESTREAMDEFAULTCONTROLLER_BUILTIN_CODE(DECLARE_BUILTIN_SOURCE_MEMBERS) -#undef DECLARE_BUILTIN_SOURCE_MEMBERS - -}; - -#define DEFINE_BUILTIN_EXECUTABLES(name, functionName, overriddenName, length) \ -inline JSC::UnlinkedFunctionExecutable* ReadableStreamDefaultControllerBuiltinsWrapper::name##Executable() \ -{\ - if (!m_##name##Executable) {\ - JSC::Identifier executableName = functionName##PublicName();\ - if (overriddenName)\ - executableName = JSC::Identifier::fromString(m_vm, overriddenName);\ - m_##name##Executable = JSC::Weak(JSC::createBuiltinExecutable(m_vm, m_##name##Source, executableName, s_##name##ImplementationVisibility, s_##name##ConstructorKind, s_##name##ConstructAbility), this, &m_##name##Executable);\ - }\ - return m_##name##Executable.get();\ -} -WEBCORE_FOREACH_READABLESTREAMDEFAULTCONTROLLER_BUILTIN_CODE(DEFINE_BUILTIN_EXECUTABLES) -#undef DEFINE_BUILTIN_EXECUTABLES - -inline void ReadableStreamDefaultControllerBuiltinsWrapper::exportNames() -{ -#define EXPORT_FUNCTION_NAME(name) m_vm.propertyNames->appendExternalName(name##PublicName(), name##PrivateName()); - WEBCORE_FOREACH_READABLESTREAMDEFAULTCONTROLLER_BUILTIN_FUNCTION_NAME(EXPORT_FUNCTION_NAME) -#undef EXPORT_FUNCTION_NAME -} -/* ReadableByteStreamInternals.ts */ -// privateInitializeReadableByteStreamController -#define WEBCORE_BUILTIN_READABLEBYTESTREAMINTERNALS_PRIVATEINITIALIZEREADABLEBYTESTREAMCONTROLLER 1 -extern const char* const s_readableByteStreamInternalsPrivateInitializeReadableByteStreamControllerCode; -extern const int s_readableByteStreamInternalsPrivateInitializeReadableByteStreamControllerCodeLength; -extern const JSC::ConstructAbility s_readableByteStreamInternalsPrivateInitializeReadableByteStreamControllerCodeConstructAbility; -extern const JSC::ConstructorKind s_readableByteStreamInternalsPrivateInitializeReadableByteStreamControllerCodeConstructorKind; -extern const JSC::ImplementationVisibility s_readableByteStreamInternalsPrivateInitializeReadableByteStreamControllerCodeImplementationVisibility; - -// readableStreamByteStreamControllerStart -#define WEBCORE_BUILTIN_READABLEBYTESTREAMINTERNALS_READABLESTREAMBYTESTREAMCONTROLLERSTART 1 -extern const char* const s_readableByteStreamInternalsReadableStreamByteStreamControllerStartCode; -extern const int s_readableByteStreamInternalsReadableStreamByteStreamControllerStartCodeLength; -extern const JSC::ConstructAbility s_readableByteStreamInternalsReadableStreamByteStreamControllerStartCodeConstructAbility; -extern const JSC::ConstructorKind s_readableByteStreamInternalsReadableStreamByteStreamControllerStartCodeConstructorKind; -extern const JSC::ImplementationVisibility s_readableByteStreamInternalsReadableStreamByteStreamControllerStartCodeImplementationVisibility; - -// privateInitializeReadableStreamBYOBRequest -#define WEBCORE_BUILTIN_READABLEBYTESTREAMINTERNALS_PRIVATEINITIALIZEREADABLESTREAMBYOBREQUEST 1 -extern const char* const s_readableByteStreamInternalsPrivateInitializeReadableStreamBYOBRequestCode; -extern const int s_readableByteStreamInternalsPrivateInitializeReadableStreamBYOBRequestCodeLength; -extern const JSC::ConstructAbility s_readableByteStreamInternalsPrivateInitializeReadableStreamBYOBRequestCodeConstructAbility; -extern const JSC::ConstructorKind s_readableByteStreamInternalsPrivateInitializeReadableStreamBYOBRequestCodeConstructorKind; -extern const JSC::ImplementationVisibility s_readableByteStreamInternalsPrivateInitializeReadableStreamBYOBRequestCodeImplementationVisibility; - -// isReadableByteStreamController -#define WEBCORE_BUILTIN_READABLEBYTESTREAMINTERNALS_ISREADABLEBYTESTREAMCONTROLLER 1 -extern const char* const s_readableByteStreamInternalsIsReadableByteStreamControllerCode; -extern const int s_readableByteStreamInternalsIsReadableByteStreamControllerCodeLength; -extern const JSC::ConstructAbility s_readableByteStreamInternalsIsReadableByteStreamControllerCodeConstructAbility; -extern const JSC::ConstructorKind s_readableByteStreamInternalsIsReadableByteStreamControllerCodeConstructorKind; -extern const JSC::ImplementationVisibility s_readableByteStreamInternalsIsReadableByteStreamControllerCodeImplementationVisibility; - -// isReadableStreamBYOBRequest -#define WEBCORE_BUILTIN_READABLEBYTESTREAMINTERNALS_ISREADABLESTREAMBYOBREQUEST 1 -extern const char* const s_readableByteStreamInternalsIsReadableStreamBYOBRequestCode; -extern const int s_readableByteStreamInternalsIsReadableStreamBYOBRequestCodeLength; -extern const JSC::ConstructAbility s_readableByteStreamInternalsIsReadableStreamBYOBRequestCodeConstructAbility; -extern const JSC::ConstructorKind s_readableByteStreamInternalsIsReadableStreamBYOBRequestCodeConstructorKind; -extern const JSC::ImplementationVisibility s_readableByteStreamInternalsIsReadableStreamBYOBRequestCodeImplementationVisibility; - -// isReadableStreamBYOBReader -#define WEBCORE_BUILTIN_READABLEBYTESTREAMINTERNALS_ISREADABLESTREAMBYOBREADER 1 -extern const char* const s_readableByteStreamInternalsIsReadableStreamBYOBReaderCode; -extern const int s_readableByteStreamInternalsIsReadableStreamBYOBReaderCodeLength; -extern const JSC::ConstructAbility s_readableByteStreamInternalsIsReadableStreamBYOBReaderCodeConstructAbility; -extern const JSC::ConstructorKind s_readableByteStreamInternalsIsReadableStreamBYOBReaderCodeConstructorKind; -extern const JSC::ImplementationVisibility s_readableByteStreamInternalsIsReadableStreamBYOBReaderCodeImplementationVisibility; - -// readableByteStreamControllerCancel -#define WEBCORE_BUILTIN_READABLEBYTESTREAMINTERNALS_READABLEBYTESTREAMCONTROLLERCANCEL 1 -extern const char* const s_readableByteStreamInternalsReadableByteStreamControllerCancelCode; -extern const int s_readableByteStreamInternalsReadableByteStreamControllerCancelCodeLength; -extern const JSC::ConstructAbility s_readableByteStreamInternalsReadableByteStreamControllerCancelCodeConstructAbility; -extern const JSC::ConstructorKind s_readableByteStreamInternalsReadableByteStreamControllerCancelCodeConstructorKind; -extern const JSC::ImplementationVisibility s_readableByteStreamInternalsReadableByteStreamControllerCancelCodeImplementationVisibility; - -// readableByteStreamControllerError -#define WEBCORE_BUILTIN_READABLEBYTESTREAMINTERNALS_READABLEBYTESTREAMCONTROLLERERROR 1 -extern const char* const s_readableByteStreamInternalsReadableByteStreamControllerErrorCode; -extern const int s_readableByteStreamInternalsReadableByteStreamControllerErrorCodeLength; -extern const JSC::ConstructAbility s_readableByteStreamInternalsReadableByteStreamControllerErrorCodeConstructAbility; -extern const JSC::ConstructorKind s_readableByteStreamInternalsReadableByteStreamControllerErrorCodeConstructorKind; -extern const JSC::ImplementationVisibility s_readableByteStreamInternalsReadableByteStreamControllerErrorCodeImplementationVisibility; - -// readableByteStreamControllerClose -#define WEBCORE_BUILTIN_READABLEBYTESTREAMINTERNALS_READABLEBYTESTREAMCONTROLLERCLOSE 1 -extern const char* const s_readableByteStreamInternalsReadableByteStreamControllerCloseCode; -extern const int s_readableByteStreamInternalsReadableByteStreamControllerCloseCodeLength; -extern const JSC::ConstructAbility s_readableByteStreamInternalsReadableByteStreamControllerCloseCodeConstructAbility; -extern const JSC::ConstructorKind s_readableByteStreamInternalsReadableByteStreamControllerCloseCodeConstructorKind; -extern const JSC::ImplementationVisibility s_readableByteStreamInternalsReadableByteStreamControllerCloseCodeImplementationVisibility; - -// readableByteStreamControllerClearPendingPullIntos -#define WEBCORE_BUILTIN_READABLEBYTESTREAMINTERNALS_READABLEBYTESTREAMCONTROLLERCLEARPENDINGPULLINTOS 1 -extern const char* const s_readableByteStreamInternalsReadableByteStreamControllerClearPendingPullIntosCode; -extern const int s_readableByteStreamInternalsReadableByteStreamControllerClearPendingPullIntosCodeLength; -extern const JSC::ConstructAbility s_readableByteStreamInternalsReadableByteStreamControllerClearPendingPullIntosCodeConstructAbility; -extern const JSC::ConstructorKind s_readableByteStreamInternalsReadableByteStreamControllerClearPendingPullIntosCodeConstructorKind; -extern const JSC::ImplementationVisibility s_readableByteStreamInternalsReadableByteStreamControllerClearPendingPullIntosCodeImplementationVisibility; - -// readableByteStreamControllerGetDesiredSize -#define WEBCORE_BUILTIN_READABLEBYTESTREAMINTERNALS_READABLEBYTESTREAMCONTROLLERGETDESIREDSIZE 1 -extern const char* const s_readableByteStreamInternalsReadableByteStreamControllerGetDesiredSizeCode; -extern const int s_readableByteStreamInternalsReadableByteStreamControllerGetDesiredSizeCodeLength; -extern const JSC::ConstructAbility s_readableByteStreamInternalsReadableByteStreamControllerGetDesiredSizeCodeConstructAbility; -extern const JSC::ConstructorKind s_readableByteStreamInternalsReadableByteStreamControllerGetDesiredSizeCodeConstructorKind; -extern const JSC::ImplementationVisibility s_readableByteStreamInternalsReadableByteStreamControllerGetDesiredSizeCodeImplementationVisibility; - -// readableStreamHasBYOBReader -#define WEBCORE_BUILTIN_READABLEBYTESTREAMINTERNALS_READABLESTREAMHASBYOBREADER 1 -extern const char* const s_readableByteStreamInternalsReadableStreamHasBYOBReaderCode; -extern const int s_readableByteStreamInternalsReadableStreamHasBYOBReaderCodeLength; -extern const JSC::ConstructAbility s_readableByteStreamInternalsReadableStreamHasBYOBReaderCodeConstructAbility; -extern const JSC::ConstructorKind s_readableByteStreamInternalsReadableStreamHasBYOBReaderCodeConstructorKind; -extern const JSC::ImplementationVisibility s_readableByteStreamInternalsReadableStreamHasBYOBReaderCodeImplementationVisibility; - -// readableStreamHasDefaultReader -#define WEBCORE_BUILTIN_READABLEBYTESTREAMINTERNALS_READABLESTREAMHASDEFAULTREADER 1 -extern const char* const s_readableByteStreamInternalsReadableStreamHasDefaultReaderCode; -extern const int s_readableByteStreamInternalsReadableStreamHasDefaultReaderCodeLength; -extern const JSC::ConstructAbility s_readableByteStreamInternalsReadableStreamHasDefaultReaderCodeConstructAbility; -extern const JSC::ConstructorKind s_readableByteStreamInternalsReadableStreamHasDefaultReaderCodeConstructorKind; -extern const JSC::ImplementationVisibility s_readableByteStreamInternalsReadableStreamHasDefaultReaderCodeImplementationVisibility; - -// readableByteStreamControllerHandleQueueDrain -#define WEBCORE_BUILTIN_READABLEBYTESTREAMINTERNALS_READABLEBYTESTREAMCONTROLLERHANDLEQUEUEDRAIN 1 -extern const char* const s_readableByteStreamInternalsReadableByteStreamControllerHandleQueueDrainCode; -extern const int s_readableByteStreamInternalsReadableByteStreamControllerHandleQueueDrainCodeLength; -extern const JSC::ConstructAbility s_readableByteStreamInternalsReadableByteStreamControllerHandleQueueDrainCodeConstructAbility; -extern const JSC::ConstructorKind s_readableByteStreamInternalsReadableByteStreamControllerHandleQueueDrainCodeConstructorKind; -extern const JSC::ImplementationVisibility s_readableByteStreamInternalsReadableByteStreamControllerHandleQueueDrainCodeImplementationVisibility; - -// readableByteStreamControllerPull -#define WEBCORE_BUILTIN_READABLEBYTESTREAMINTERNALS_READABLEBYTESTREAMCONTROLLERPULL 1 -extern const char* const s_readableByteStreamInternalsReadableByteStreamControllerPullCode; -extern const int s_readableByteStreamInternalsReadableByteStreamControllerPullCodeLength; -extern const JSC::ConstructAbility s_readableByteStreamInternalsReadableByteStreamControllerPullCodeConstructAbility; -extern const JSC::ConstructorKind s_readableByteStreamInternalsReadableByteStreamControllerPullCodeConstructorKind; -extern const JSC::ImplementationVisibility s_readableByteStreamInternalsReadableByteStreamControllerPullCodeImplementationVisibility; - -// readableByteStreamControllerShouldCallPull -#define WEBCORE_BUILTIN_READABLEBYTESTREAMINTERNALS_READABLEBYTESTREAMCONTROLLERSHOULDCALLPULL 1 -extern const char* const s_readableByteStreamInternalsReadableByteStreamControllerShouldCallPullCode; -extern const int s_readableByteStreamInternalsReadableByteStreamControllerShouldCallPullCodeLength; -extern const JSC::ConstructAbility s_readableByteStreamInternalsReadableByteStreamControllerShouldCallPullCodeConstructAbility; -extern const JSC::ConstructorKind s_readableByteStreamInternalsReadableByteStreamControllerShouldCallPullCodeConstructorKind; -extern const JSC::ImplementationVisibility s_readableByteStreamInternalsReadableByteStreamControllerShouldCallPullCodeImplementationVisibility; - -// readableByteStreamControllerCallPullIfNeeded -#define WEBCORE_BUILTIN_READABLEBYTESTREAMINTERNALS_READABLEBYTESTREAMCONTROLLERCALLPULLIFNEEDED 1 -extern const char* const s_readableByteStreamInternalsReadableByteStreamControllerCallPullIfNeededCode; -extern const int s_readableByteStreamInternalsReadableByteStreamControllerCallPullIfNeededCodeLength; -extern const JSC::ConstructAbility s_readableByteStreamInternalsReadableByteStreamControllerCallPullIfNeededCodeConstructAbility; -extern const JSC::ConstructorKind s_readableByteStreamInternalsReadableByteStreamControllerCallPullIfNeededCodeConstructorKind; -extern const JSC::ImplementationVisibility s_readableByteStreamInternalsReadableByteStreamControllerCallPullIfNeededCodeImplementationVisibility; - -// transferBufferToCurrentRealm -#define WEBCORE_BUILTIN_READABLEBYTESTREAMINTERNALS_TRANSFERBUFFERTOCURRENTREALM 1 -extern const char* const s_readableByteStreamInternalsTransferBufferToCurrentRealmCode; -extern const int s_readableByteStreamInternalsTransferBufferToCurrentRealmCodeLength; -extern const JSC::ConstructAbility s_readableByteStreamInternalsTransferBufferToCurrentRealmCodeConstructAbility; -extern const JSC::ConstructorKind s_readableByteStreamInternalsTransferBufferToCurrentRealmCodeConstructorKind; -extern const JSC::ImplementationVisibility s_readableByteStreamInternalsTransferBufferToCurrentRealmCodeImplementationVisibility; - -// readableStreamReaderKind -#define WEBCORE_BUILTIN_READABLEBYTESTREAMINTERNALS_READABLESTREAMREADERKIND 1 -extern const char* const s_readableByteStreamInternalsReadableStreamReaderKindCode; -extern const int s_readableByteStreamInternalsReadableStreamReaderKindCodeLength; -extern const JSC::ConstructAbility s_readableByteStreamInternalsReadableStreamReaderKindCodeConstructAbility; -extern const JSC::ConstructorKind s_readableByteStreamInternalsReadableStreamReaderKindCodeConstructorKind; -extern const JSC::ImplementationVisibility s_readableByteStreamInternalsReadableStreamReaderKindCodeImplementationVisibility; - -// readableByteStreamControllerEnqueue -#define WEBCORE_BUILTIN_READABLEBYTESTREAMINTERNALS_READABLEBYTESTREAMCONTROLLERENQUEUE 1 -extern const char* const s_readableByteStreamInternalsReadableByteStreamControllerEnqueueCode; -extern const int s_readableByteStreamInternalsReadableByteStreamControllerEnqueueCodeLength; -extern const JSC::ConstructAbility s_readableByteStreamInternalsReadableByteStreamControllerEnqueueCodeConstructAbility; -extern const JSC::ConstructorKind s_readableByteStreamInternalsReadableByteStreamControllerEnqueueCodeConstructorKind; -extern const JSC::ImplementationVisibility s_readableByteStreamInternalsReadableByteStreamControllerEnqueueCodeImplementationVisibility; - -// readableByteStreamControllerEnqueueChunk -#define WEBCORE_BUILTIN_READABLEBYTESTREAMINTERNALS_READABLEBYTESTREAMCONTROLLERENQUEUECHUNK 1 -extern const char* const s_readableByteStreamInternalsReadableByteStreamControllerEnqueueChunkCode; -extern const int s_readableByteStreamInternalsReadableByteStreamControllerEnqueueChunkCodeLength; -extern const JSC::ConstructAbility s_readableByteStreamInternalsReadableByteStreamControllerEnqueueChunkCodeConstructAbility; -extern const JSC::ConstructorKind s_readableByteStreamInternalsReadableByteStreamControllerEnqueueChunkCodeConstructorKind; -extern const JSC::ImplementationVisibility s_readableByteStreamInternalsReadableByteStreamControllerEnqueueChunkCodeImplementationVisibility; - -// readableByteStreamControllerRespondWithNewView -#define WEBCORE_BUILTIN_READABLEBYTESTREAMINTERNALS_READABLEBYTESTREAMCONTROLLERRESPONDWITHNEWVIEW 1 -extern const char* const s_readableByteStreamInternalsReadableByteStreamControllerRespondWithNewViewCode; -extern const int s_readableByteStreamInternalsReadableByteStreamControllerRespondWithNewViewCodeLength; -extern const JSC::ConstructAbility s_readableByteStreamInternalsReadableByteStreamControllerRespondWithNewViewCodeConstructAbility; -extern const JSC::ConstructorKind s_readableByteStreamInternalsReadableByteStreamControllerRespondWithNewViewCodeConstructorKind; -extern const JSC::ImplementationVisibility s_readableByteStreamInternalsReadableByteStreamControllerRespondWithNewViewCodeImplementationVisibility; - -// readableByteStreamControllerRespond -#define WEBCORE_BUILTIN_READABLEBYTESTREAMINTERNALS_READABLEBYTESTREAMCONTROLLERRESPOND 1 -extern const char* const s_readableByteStreamInternalsReadableByteStreamControllerRespondCode; -extern const int s_readableByteStreamInternalsReadableByteStreamControllerRespondCodeLength; -extern const JSC::ConstructAbility s_readableByteStreamInternalsReadableByteStreamControllerRespondCodeConstructAbility; -extern const JSC::ConstructorKind s_readableByteStreamInternalsReadableByteStreamControllerRespondCodeConstructorKind; -extern const JSC::ImplementationVisibility s_readableByteStreamInternalsReadableByteStreamControllerRespondCodeImplementationVisibility; - -// readableByteStreamControllerRespondInternal -#define WEBCORE_BUILTIN_READABLEBYTESTREAMINTERNALS_READABLEBYTESTREAMCONTROLLERRESPONDINTERNAL 1 -extern const char* const s_readableByteStreamInternalsReadableByteStreamControllerRespondInternalCode; -extern const int s_readableByteStreamInternalsReadableByteStreamControllerRespondInternalCodeLength; -extern const JSC::ConstructAbility s_readableByteStreamInternalsReadableByteStreamControllerRespondInternalCodeConstructAbility; -extern const JSC::ConstructorKind s_readableByteStreamInternalsReadableByteStreamControllerRespondInternalCodeConstructorKind; -extern const JSC::ImplementationVisibility s_readableByteStreamInternalsReadableByteStreamControllerRespondInternalCodeImplementationVisibility; - -// readableByteStreamControllerRespondInReadableState -#define WEBCORE_BUILTIN_READABLEBYTESTREAMINTERNALS_READABLEBYTESTREAMCONTROLLERRESPONDINREADABLESTATE 1 -extern const char* const s_readableByteStreamInternalsReadableByteStreamControllerRespondInReadableStateCode; -extern const int s_readableByteStreamInternalsReadableByteStreamControllerRespondInReadableStateCodeLength; -extern const JSC::ConstructAbility s_readableByteStreamInternalsReadableByteStreamControllerRespondInReadableStateCodeConstructAbility; -extern const JSC::ConstructorKind s_readableByteStreamInternalsReadableByteStreamControllerRespondInReadableStateCodeConstructorKind; -extern const JSC::ImplementationVisibility s_readableByteStreamInternalsReadableByteStreamControllerRespondInReadableStateCodeImplementationVisibility; - -// readableByteStreamControllerRespondInClosedState -#define WEBCORE_BUILTIN_READABLEBYTESTREAMINTERNALS_READABLEBYTESTREAMCONTROLLERRESPONDINCLOSEDSTATE 1 -extern const char* const s_readableByteStreamInternalsReadableByteStreamControllerRespondInClosedStateCode; -extern const int s_readableByteStreamInternalsReadableByteStreamControllerRespondInClosedStateCodeLength; -extern const JSC::ConstructAbility s_readableByteStreamInternalsReadableByteStreamControllerRespondInClosedStateCodeConstructAbility; -extern const JSC::ConstructorKind s_readableByteStreamInternalsReadableByteStreamControllerRespondInClosedStateCodeConstructorKind; -extern const JSC::ImplementationVisibility s_readableByteStreamInternalsReadableByteStreamControllerRespondInClosedStateCodeImplementationVisibility; + JSC::VM& m_vm; -// readableByteStreamControllerProcessPullDescriptors -#define WEBCORE_BUILTIN_READABLEBYTESTREAMINTERNALS_READABLEBYTESTREAMCONTROLLERPROCESSPULLDESCRIPTORS 1 -extern const char* const s_readableByteStreamInternalsReadableByteStreamControllerProcessPullDescriptorsCode; -extern const int s_readableByteStreamInternalsReadableByteStreamControllerProcessPullDescriptorsCodeLength; -extern const JSC::ConstructAbility s_readableByteStreamInternalsReadableByteStreamControllerProcessPullDescriptorsCodeConstructAbility; -extern const JSC::ConstructorKind s_readableByteStreamInternalsReadableByteStreamControllerProcessPullDescriptorsCodeConstructorKind; -extern const JSC::ImplementationVisibility s_readableByteStreamInternalsReadableByteStreamControllerProcessPullDescriptorsCodeImplementationVisibility; + WEBCORE_FOREACH_READABLESTREAMINTERNALS_BUILTIN_FUNCTION_NAME(DECLARE_BUILTIN_NAMES) -// readableByteStreamControllerFillDescriptorFromQueue -#define WEBCORE_BUILTIN_READABLEBYTESTREAMINTERNALS_READABLEBYTESTREAMCONTROLLERFILLDESCRIPTORFROMQUEUE 1 -extern const char* const s_readableByteStreamInternalsReadableByteStreamControllerFillDescriptorFromQueueCode; -extern const int s_readableByteStreamInternalsReadableByteStreamControllerFillDescriptorFromQueueCodeLength; -extern const JSC::ConstructAbility s_readableByteStreamInternalsReadableByteStreamControllerFillDescriptorFromQueueCodeConstructAbility; -extern const JSC::ConstructorKind s_readableByteStreamInternalsReadableByteStreamControllerFillDescriptorFromQueueCodeConstructorKind; -extern const JSC::ImplementationVisibility s_readableByteStreamInternalsReadableByteStreamControllerFillDescriptorFromQueueCodeImplementationVisibility; +#define DECLARE_BUILTIN_SOURCE_MEMBERS(name, functionName, overriddenName, length) \ + JSC::SourceCode m_##name##Source;\ + JSC::Weak m_##name##Executable; + WEBCORE_FOREACH_READABLESTREAMINTERNALS_BUILTIN_CODE(DECLARE_BUILTIN_SOURCE_MEMBERS) +#undef DECLARE_BUILTIN_SOURCE_MEMBERS -// readableByteStreamControllerShiftPendingDescriptor -#define WEBCORE_BUILTIN_READABLEBYTESTREAMINTERNALS_READABLEBYTESTREAMCONTROLLERSHIFTPENDINGDESCRIPTOR 1 -extern const char* const s_readableByteStreamInternalsReadableByteStreamControllerShiftPendingDescriptorCode; -extern const int s_readableByteStreamInternalsReadableByteStreamControllerShiftPendingDescriptorCodeLength; -extern const JSC::ConstructAbility s_readableByteStreamInternalsReadableByteStreamControllerShiftPendingDescriptorCodeConstructAbility; -extern const JSC::ConstructorKind s_readableByteStreamInternalsReadableByteStreamControllerShiftPendingDescriptorCodeConstructorKind; -extern const JSC::ImplementationVisibility s_readableByteStreamInternalsReadableByteStreamControllerShiftPendingDescriptorCodeImplementationVisibility; +}; -// readableByteStreamControllerInvalidateBYOBRequest -#define WEBCORE_BUILTIN_READABLEBYTESTREAMINTERNALS_READABLEBYTESTREAMCONTROLLERINVALIDATEBYOBREQUEST 1 -extern const char* const s_readableByteStreamInternalsReadableByteStreamControllerInvalidateBYOBRequestCode; -extern const int s_readableByteStreamInternalsReadableByteStreamControllerInvalidateBYOBRequestCodeLength; -extern const JSC::ConstructAbility s_readableByteStreamInternalsReadableByteStreamControllerInvalidateBYOBRequestCodeConstructAbility; -extern const JSC::ConstructorKind s_readableByteStreamInternalsReadableByteStreamControllerInvalidateBYOBRequestCodeConstructorKind; -extern const JSC::ImplementationVisibility s_readableByteStreamInternalsReadableByteStreamControllerInvalidateBYOBRequestCodeImplementationVisibility; +#define DEFINE_BUILTIN_EXECUTABLES(name, functionName, overriddenName, length) \ +inline JSC::UnlinkedFunctionExecutable* ReadableStreamInternalsBuiltinsWrapper::name##Executable() \ +{\ + if (!m_##name##Executable) {\ + JSC::Identifier executableName = functionName##PublicName();\ + if (overriddenName)\ + executableName = JSC::Identifier::fromString(m_vm, overriddenName);\ + m_##name##Executable = JSC::Weak(JSC::createBuiltinExecutable(m_vm, m_##name##Source, executableName, s_##name##ImplementationVisibility, s_##name##ConstructorKind, s_##name##ConstructAbility), this, &m_##name##Executable);\ + }\ + return m_##name##Executable.get();\ +} +WEBCORE_FOREACH_READABLESTREAMINTERNALS_BUILTIN_CODE(DEFINE_BUILTIN_EXECUTABLES) +#undef DEFINE_BUILTIN_EXECUTABLES -// readableByteStreamControllerCommitDescriptor -#define WEBCORE_BUILTIN_READABLEBYTESTREAMINTERNALS_READABLEBYTESTREAMCONTROLLERCOMMITDESCRIPTOR 1 -extern const char* const s_readableByteStreamInternalsReadableByteStreamControllerCommitDescriptorCode; -extern const int s_readableByteStreamInternalsReadableByteStreamControllerCommitDescriptorCodeLength; -extern const JSC::ConstructAbility s_readableByteStreamInternalsReadableByteStreamControllerCommitDescriptorCodeConstructAbility; -extern const JSC::ConstructorKind s_readableByteStreamInternalsReadableByteStreamControllerCommitDescriptorCodeConstructorKind; -extern const JSC::ImplementationVisibility s_readableByteStreamInternalsReadableByteStreamControllerCommitDescriptorCodeImplementationVisibility; +inline void ReadableStreamInternalsBuiltinsWrapper::exportNames() +{ +#define EXPORT_FUNCTION_NAME(name) m_vm.propertyNames->appendExternalName(name##PublicName(), name##PrivateName()); + WEBCORE_FOREACH_READABLESTREAMINTERNALS_BUILTIN_FUNCTION_NAME(EXPORT_FUNCTION_NAME) +#undef EXPORT_FUNCTION_NAME +} +class ReadableStreamInternalsBuiltinFunctions { +public: + explicit ReadableStreamInternalsBuiltinFunctions(JSC::VM& vm) : m_vm(vm) { } -// readableByteStreamControllerConvertDescriptor -#define WEBCORE_BUILTIN_READABLEBYTESTREAMINTERNALS_READABLEBYTESTREAMCONTROLLERCONVERTDESCRIPTOR 1 -extern const char* const s_readableByteStreamInternalsReadableByteStreamControllerConvertDescriptorCode; -extern const int s_readableByteStreamInternalsReadableByteStreamControllerConvertDescriptorCodeLength; -extern const JSC::ConstructAbility s_readableByteStreamInternalsReadableByteStreamControllerConvertDescriptorCodeConstructAbility; -extern const JSC::ConstructorKind s_readableByteStreamInternalsReadableByteStreamControllerConvertDescriptorCodeConstructorKind; -extern const JSC::ImplementationVisibility s_readableByteStreamInternalsReadableByteStreamControllerConvertDescriptorCodeImplementationVisibility; + void init(JSC::JSGlobalObject&); + template void visit(Visitor&); -// readableStreamFulfillReadIntoRequest -#define WEBCORE_BUILTIN_READABLEBYTESTREAMINTERNALS_READABLESTREAMFULFILLREADINTOREQUEST 1 -extern const char* const s_readableByteStreamInternalsReadableStreamFulfillReadIntoRequestCode; -extern const int s_readableByteStreamInternalsReadableStreamFulfillReadIntoRequestCodeLength; -extern const JSC::ConstructAbility s_readableByteStreamInternalsReadableStreamFulfillReadIntoRequestCodeConstructAbility; -extern const JSC::ConstructorKind s_readableByteStreamInternalsReadableStreamFulfillReadIntoRequestCodeConstructorKind; -extern const JSC::ImplementationVisibility s_readableByteStreamInternalsReadableStreamFulfillReadIntoRequestCodeImplementationVisibility; +public: + JSC::VM& m_vm; -// readableStreamBYOBReaderRead -#define WEBCORE_BUILTIN_READABLEBYTESTREAMINTERNALS_READABLESTREAMBYOBREADERREAD 1 -extern const char* const s_readableByteStreamInternalsReadableStreamBYOBReaderReadCode; -extern const int s_readableByteStreamInternalsReadableStreamBYOBReaderReadCodeLength; -extern const JSC::ConstructAbility s_readableByteStreamInternalsReadableStreamBYOBReaderReadCodeConstructAbility; -extern const JSC::ConstructorKind s_readableByteStreamInternalsReadableStreamBYOBReaderReadCodeConstructorKind; -extern const JSC::ImplementationVisibility s_readableByteStreamInternalsReadableStreamBYOBReaderReadCodeImplementationVisibility; +#define DECLARE_BUILTIN_SOURCE_MEMBERS(functionName) \ + JSC::WriteBarrier m_##functionName##Function; + WEBCORE_FOREACH_READABLESTREAMINTERNALS_BUILTIN_FUNCTION_NAME(DECLARE_BUILTIN_SOURCE_MEMBERS) +#undef DECLARE_BUILTIN_SOURCE_MEMBERS +}; -// readableByteStreamControllerPullInto -#define WEBCORE_BUILTIN_READABLEBYTESTREAMINTERNALS_READABLEBYTESTREAMCONTROLLERPULLINTO 1 -extern const char* const s_readableByteStreamInternalsReadableByteStreamControllerPullIntoCode; -extern const int s_readableByteStreamInternalsReadableByteStreamControllerPullIntoCodeLength; -extern const JSC::ConstructAbility s_readableByteStreamInternalsReadableByteStreamControllerPullIntoCodeConstructAbility; -extern const JSC::ConstructorKind s_readableByteStreamInternalsReadableByteStreamControllerPullIntoCodeConstructorKind; -extern const JSC::ImplementationVisibility s_readableByteStreamInternalsReadableByteStreamControllerPullIntoCodeImplementationVisibility; +inline void ReadableStreamInternalsBuiltinFunctions::init(JSC::JSGlobalObject& globalObject) +{ +#define EXPORT_FUNCTION(codeName, functionName, overriddenName, length) \ + m_##functionName##Function.set(m_vm, &globalObject, JSC::JSFunction::create(m_vm, codeName##Generator(m_vm), &globalObject)); + WEBCORE_FOREACH_READABLESTREAMINTERNALS_BUILTIN_CODE(EXPORT_FUNCTION) +#undef EXPORT_FUNCTION +} -// readableStreamAddReadIntoRequest -#define WEBCORE_BUILTIN_READABLEBYTESTREAMINTERNALS_READABLESTREAMADDREADINTOREQUEST 1 -extern const char* const s_readableByteStreamInternalsReadableStreamAddReadIntoRequestCode; -extern const int s_readableByteStreamInternalsReadableStreamAddReadIntoRequestCodeLength; -extern const JSC::ConstructAbility s_readableByteStreamInternalsReadableStreamAddReadIntoRequestCodeConstructAbility; -extern const JSC::ConstructorKind s_readableByteStreamInternalsReadableStreamAddReadIntoRequestCodeConstructorKind; -extern const JSC::ImplementationVisibility s_readableByteStreamInternalsReadableStreamAddReadIntoRequestCodeImplementationVisibility; +template +inline void ReadableStreamInternalsBuiltinFunctions::visit(Visitor& visitor) +{ +#define VISIT_FUNCTION(name) visitor.append(m_##name##Function); + WEBCORE_FOREACH_READABLESTREAMINTERNALS_BUILTIN_FUNCTION_NAME(VISIT_FUNCTION) +#undef VISIT_FUNCTION +} -#define WEBCORE_FOREACH_READABLEBYTESTREAMINTERNALS_BUILTIN_DATA(macro) \ - macro(privateInitializeReadableByteStreamController, readableByteStreamInternalsPrivateInitializeReadableByteStreamController, 3) \ - macro(readableStreamByteStreamControllerStart, readableByteStreamInternalsReadableStreamByteStreamControllerStart, 1) \ - macro(privateInitializeReadableStreamBYOBRequest, readableByteStreamInternalsPrivateInitializeReadableStreamBYOBRequest, 2) \ - macro(isReadableByteStreamController, readableByteStreamInternalsIsReadableByteStreamController, 1) \ - macro(isReadableStreamBYOBRequest, readableByteStreamInternalsIsReadableStreamBYOBRequest, 1) \ - macro(isReadableStreamBYOBReader, readableByteStreamInternalsIsReadableStreamBYOBReader, 1) \ - macro(readableByteStreamControllerCancel, readableByteStreamInternalsReadableByteStreamControllerCancel, 2) \ - macro(readableByteStreamControllerError, readableByteStreamInternalsReadableByteStreamControllerError, 2) \ - macro(readableByteStreamControllerClose, readableByteStreamInternalsReadableByteStreamControllerClose, 1) \ - macro(readableByteStreamControllerClearPendingPullIntos, readableByteStreamInternalsReadableByteStreamControllerClearPendingPullIntos, 1) \ - macro(readableByteStreamControllerGetDesiredSize, readableByteStreamInternalsReadableByteStreamControllerGetDesiredSize, 1) \ - macro(readableStreamHasBYOBReader, readableByteStreamInternalsReadableStreamHasBYOBReader, 1) \ - macro(readableStreamHasDefaultReader, readableByteStreamInternalsReadableStreamHasDefaultReader, 1) \ - macro(readableByteStreamControllerHandleQueueDrain, readableByteStreamInternalsReadableByteStreamControllerHandleQueueDrain, 1) \ - macro(readableByteStreamControllerPull, readableByteStreamInternalsReadableByteStreamControllerPull, 1) \ - macro(readableByteStreamControllerShouldCallPull, readableByteStreamInternalsReadableByteStreamControllerShouldCallPull, 1) \ - macro(readableByteStreamControllerCallPullIfNeeded, readableByteStreamInternalsReadableByteStreamControllerCallPullIfNeeded, 1) \ - macro(transferBufferToCurrentRealm, readableByteStreamInternalsTransferBufferToCurrentRealm, 1) \ - macro(readableStreamReaderKind, readableByteStreamInternalsReadableStreamReaderKind, 1) \ - macro(readableByteStreamControllerEnqueue, readableByteStreamInternalsReadableByteStreamControllerEnqueue, 2) \ - macro(readableByteStreamControllerEnqueueChunk, readableByteStreamInternalsReadableByteStreamControllerEnqueueChunk, 4) \ - macro(readableByteStreamControllerRespondWithNewView, readableByteStreamInternalsReadableByteStreamControllerRespondWithNewView, 2) \ - macro(readableByteStreamControllerRespond, readableByteStreamInternalsReadableByteStreamControllerRespond, 2) \ - macro(readableByteStreamControllerRespondInternal, readableByteStreamInternalsReadableByteStreamControllerRespondInternal, 2) \ - macro(readableByteStreamControllerRespondInReadableState, readableByteStreamInternalsReadableByteStreamControllerRespondInReadableState, 3) \ - macro(readableByteStreamControllerRespondInClosedState, readableByteStreamInternalsReadableByteStreamControllerRespondInClosedState, 2) \ - macro(readableByteStreamControllerProcessPullDescriptors, readableByteStreamInternalsReadableByteStreamControllerProcessPullDescriptors, 1) \ - macro(readableByteStreamControllerFillDescriptorFromQueue, readableByteStreamInternalsReadableByteStreamControllerFillDescriptorFromQueue, 2) \ - macro(readableByteStreamControllerShiftPendingDescriptor, readableByteStreamInternalsReadableByteStreamControllerShiftPendingDescriptor, 1) \ - macro(readableByteStreamControllerInvalidateBYOBRequest, readableByteStreamInternalsReadableByteStreamControllerInvalidateBYOBRequest, 1) \ - macro(readableByteStreamControllerCommitDescriptor, readableByteStreamInternalsReadableByteStreamControllerCommitDescriptor, 2) \ - macro(readableByteStreamControllerConvertDescriptor, readableByteStreamInternalsReadableByteStreamControllerConvertDescriptor, 1) \ - macro(readableStreamFulfillReadIntoRequest, readableByteStreamInternalsReadableStreamFulfillReadIntoRequest, 3) \ - macro(readableStreamBYOBReaderRead, readableByteStreamInternalsReadableStreamBYOBReaderRead, 2) \ - macro(readableByteStreamControllerPullInto, readableByteStreamInternalsReadableByteStreamControllerPullInto, 2) \ - macro(readableStreamAddReadIntoRequest, readableByteStreamInternalsReadableStreamAddReadIntoRequest, 1) \ +template void ReadableStreamInternalsBuiltinFunctions::visit(JSC::AbstractSlotVisitor&); +template void ReadableStreamInternalsBuiltinFunctions::visit(JSC::SlotVisitor&); + /* UtilInspect.ts */ +// getStylizeWithColor +#define WEBCORE_BUILTIN_UTILINSPECT_GETSTYLIZEWITHCOLOR 1 +extern const char* const s_utilInspectGetStylizeWithColorCode; +extern const int s_utilInspectGetStylizeWithColorCodeLength; +extern const JSC::ConstructAbility s_utilInspectGetStylizeWithColorCodeConstructAbility; +extern const JSC::ConstructorKind s_utilInspectGetStylizeWithColorCodeConstructorKind; +extern const JSC::ImplementationVisibility s_utilInspectGetStylizeWithColorCodeImplementationVisibility; -#define WEBCORE_FOREACH_READABLEBYTESTREAMINTERNALS_BUILTIN_CODE(macro) \ - macro(readableByteStreamInternalsPrivateInitializeReadableByteStreamControllerCode, privateInitializeReadableByteStreamController, ASCIILiteral(), s_readableByteStreamInternalsPrivateInitializeReadableByteStreamControllerCodeLength) \ - macro(readableByteStreamInternalsReadableStreamByteStreamControllerStartCode, readableStreamByteStreamControllerStart, ASCIILiteral(), s_readableByteStreamInternalsReadableStreamByteStreamControllerStartCodeLength) \ - macro(readableByteStreamInternalsPrivateInitializeReadableStreamBYOBRequestCode, privateInitializeReadableStreamBYOBRequest, ASCIILiteral(), s_readableByteStreamInternalsPrivateInitializeReadableStreamBYOBRequestCodeLength) \ - macro(readableByteStreamInternalsIsReadableByteStreamControllerCode, isReadableByteStreamController, ASCIILiteral(), s_readableByteStreamInternalsIsReadableByteStreamControllerCodeLength) \ - macro(readableByteStreamInternalsIsReadableStreamBYOBRequestCode, isReadableStreamBYOBRequest, ASCIILiteral(), s_readableByteStreamInternalsIsReadableStreamBYOBRequestCodeLength) \ - macro(readableByteStreamInternalsIsReadableStreamBYOBReaderCode, isReadableStreamBYOBReader, ASCIILiteral(), s_readableByteStreamInternalsIsReadableStreamBYOBReaderCodeLength) \ - macro(readableByteStreamInternalsReadableByteStreamControllerCancelCode, readableByteStreamControllerCancel, ASCIILiteral(), s_readableByteStreamInternalsReadableByteStreamControllerCancelCodeLength) \ - macro(readableByteStreamInternalsReadableByteStreamControllerErrorCode, readableByteStreamControllerError, ASCIILiteral(), s_readableByteStreamInternalsReadableByteStreamControllerErrorCodeLength) \ - macro(readableByteStreamInternalsReadableByteStreamControllerCloseCode, readableByteStreamControllerClose, ASCIILiteral(), s_readableByteStreamInternalsReadableByteStreamControllerCloseCodeLength) \ - macro(readableByteStreamInternalsReadableByteStreamControllerClearPendingPullIntosCode, readableByteStreamControllerClearPendingPullIntos, ASCIILiteral(), s_readableByteStreamInternalsReadableByteStreamControllerClearPendingPullIntosCodeLength) \ - macro(readableByteStreamInternalsReadableByteStreamControllerGetDesiredSizeCode, readableByteStreamControllerGetDesiredSize, ASCIILiteral(), s_readableByteStreamInternalsReadableByteStreamControllerGetDesiredSizeCodeLength) \ - macro(readableByteStreamInternalsReadableStreamHasBYOBReaderCode, readableStreamHasBYOBReader, ASCIILiteral(), s_readableByteStreamInternalsReadableStreamHasBYOBReaderCodeLength) \ - macro(readableByteStreamInternalsReadableStreamHasDefaultReaderCode, readableStreamHasDefaultReader, ASCIILiteral(), s_readableByteStreamInternalsReadableStreamHasDefaultReaderCodeLength) \ - macro(readableByteStreamInternalsReadableByteStreamControllerHandleQueueDrainCode, readableByteStreamControllerHandleQueueDrain, ASCIILiteral(), s_readableByteStreamInternalsReadableByteStreamControllerHandleQueueDrainCodeLength) \ - macro(readableByteStreamInternalsReadableByteStreamControllerPullCode, readableByteStreamControllerPull, ASCIILiteral(), s_readableByteStreamInternalsReadableByteStreamControllerPullCodeLength) \ - macro(readableByteStreamInternalsReadableByteStreamControllerShouldCallPullCode, readableByteStreamControllerShouldCallPull, ASCIILiteral(), s_readableByteStreamInternalsReadableByteStreamControllerShouldCallPullCodeLength) \ - macro(readableByteStreamInternalsReadableByteStreamControllerCallPullIfNeededCode, readableByteStreamControllerCallPullIfNeeded, ASCIILiteral(), s_readableByteStreamInternalsReadableByteStreamControllerCallPullIfNeededCodeLength) \ - macro(readableByteStreamInternalsTransferBufferToCurrentRealmCode, transferBufferToCurrentRealm, ASCIILiteral(), s_readableByteStreamInternalsTransferBufferToCurrentRealmCodeLength) \ - macro(readableByteStreamInternalsReadableStreamReaderKindCode, readableStreamReaderKind, ASCIILiteral(), s_readableByteStreamInternalsReadableStreamReaderKindCodeLength) \ - macro(readableByteStreamInternalsReadableByteStreamControllerEnqueueCode, readableByteStreamControllerEnqueue, ASCIILiteral(), s_readableByteStreamInternalsReadableByteStreamControllerEnqueueCodeLength) \ - macro(readableByteStreamInternalsReadableByteStreamControllerEnqueueChunkCode, readableByteStreamControllerEnqueueChunk, ASCIILiteral(), s_readableByteStreamInternalsReadableByteStreamControllerEnqueueChunkCodeLength) \ - macro(readableByteStreamInternalsReadableByteStreamControllerRespondWithNewViewCode, readableByteStreamControllerRespondWithNewView, ASCIILiteral(), s_readableByteStreamInternalsReadableByteStreamControllerRespondWithNewViewCodeLength) \ - macro(readableByteStreamInternalsReadableByteStreamControllerRespondCode, readableByteStreamControllerRespond, ASCIILiteral(), s_readableByteStreamInternalsReadableByteStreamControllerRespondCodeLength) \ - macro(readableByteStreamInternalsReadableByteStreamControllerRespondInternalCode, readableByteStreamControllerRespondInternal, ASCIILiteral(), s_readableByteStreamInternalsReadableByteStreamControllerRespondInternalCodeLength) \ - macro(readableByteStreamInternalsReadableByteStreamControllerRespondInReadableStateCode, readableByteStreamControllerRespondInReadableState, ASCIILiteral(), s_readableByteStreamInternalsReadableByteStreamControllerRespondInReadableStateCodeLength) \ - macro(readableByteStreamInternalsReadableByteStreamControllerRespondInClosedStateCode, readableByteStreamControllerRespondInClosedState, ASCIILiteral(), s_readableByteStreamInternalsReadableByteStreamControllerRespondInClosedStateCodeLength) \ - macro(readableByteStreamInternalsReadableByteStreamControllerProcessPullDescriptorsCode, readableByteStreamControllerProcessPullDescriptors, ASCIILiteral(), s_readableByteStreamInternalsReadableByteStreamControllerProcessPullDescriptorsCodeLength) \ - macro(readableByteStreamInternalsReadableByteStreamControllerFillDescriptorFromQueueCode, readableByteStreamControllerFillDescriptorFromQueue, ASCIILiteral(), s_readableByteStreamInternalsReadableByteStreamControllerFillDescriptorFromQueueCodeLength) \ - macro(readableByteStreamInternalsReadableByteStreamControllerShiftPendingDescriptorCode, readableByteStreamControllerShiftPendingDescriptor, ASCIILiteral(), s_readableByteStreamInternalsReadableByteStreamControllerShiftPendingDescriptorCodeLength) \ - macro(readableByteStreamInternalsReadableByteStreamControllerInvalidateBYOBRequestCode, readableByteStreamControllerInvalidateBYOBRequest, ASCIILiteral(), s_readableByteStreamInternalsReadableByteStreamControllerInvalidateBYOBRequestCodeLength) \ - macro(readableByteStreamInternalsReadableByteStreamControllerCommitDescriptorCode, readableByteStreamControllerCommitDescriptor, ASCIILiteral(), s_readableByteStreamInternalsReadableByteStreamControllerCommitDescriptorCodeLength) \ - macro(readableByteStreamInternalsReadableByteStreamControllerConvertDescriptorCode, readableByteStreamControllerConvertDescriptor, ASCIILiteral(), s_readableByteStreamInternalsReadableByteStreamControllerConvertDescriptorCodeLength) \ - macro(readableByteStreamInternalsReadableStreamFulfillReadIntoRequestCode, readableStreamFulfillReadIntoRequest, ASCIILiteral(), s_readableByteStreamInternalsReadableStreamFulfillReadIntoRequestCodeLength) \ - macro(readableByteStreamInternalsReadableStreamBYOBReaderReadCode, readableStreamBYOBReaderRead, ASCIILiteral(), s_readableByteStreamInternalsReadableStreamBYOBReaderReadCodeLength) \ - macro(readableByteStreamInternalsReadableByteStreamControllerPullIntoCode, readableByteStreamControllerPullInto, ASCIILiteral(), s_readableByteStreamInternalsReadableByteStreamControllerPullIntoCodeLength) \ - macro(readableByteStreamInternalsReadableStreamAddReadIntoRequestCode, readableStreamAddReadIntoRequest, ASCIILiteral(), s_readableByteStreamInternalsReadableStreamAddReadIntoRequestCodeLength) \ +// stylizeWithNoColor +#define WEBCORE_BUILTIN_UTILINSPECT_STYLIZEWITHNOCOLOR 1 +extern const char* const s_utilInspectStylizeWithNoColorCode; +extern const int s_utilInspectStylizeWithNoColorCodeLength; +extern const JSC::ConstructAbility s_utilInspectStylizeWithNoColorCodeConstructAbility; +extern const JSC::ConstructorKind s_utilInspectStylizeWithNoColorCodeConstructorKind; +extern const JSC::ImplementationVisibility s_utilInspectStylizeWithNoColorCodeImplementationVisibility; -#define WEBCORE_FOREACH_READABLEBYTESTREAMINTERNALS_BUILTIN_FUNCTION_NAME(macro) \ - macro(privateInitializeReadableByteStreamController) \ - macro(readableStreamByteStreamControllerStart) \ - macro(privateInitializeReadableStreamBYOBRequest) \ - macro(isReadableByteStreamController) \ - macro(isReadableStreamBYOBRequest) \ - macro(isReadableStreamBYOBReader) \ - macro(readableByteStreamControllerCancel) \ - macro(readableByteStreamControllerError) \ - macro(readableByteStreamControllerClose) \ - macro(readableByteStreamControllerClearPendingPullIntos) \ - macro(readableByteStreamControllerGetDesiredSize) \ - macro(readableStreamHasBYOBReader) \ - macro(readableStreamHasDefaultReader) \ - macro(readableByteStreamControllerHandleQueueDrain) \ - macro(readableByteStreamControllerPull) \ - macro(readableByteStreamControllerShouldCallPull) \ - macro(readableByteStreamControllerCallPullIfNeeded) \ - macro(transferBufferToCurrentRealm) \ - macro(readableStreamReaderKind) \ - macro(readableByteStreamControllerEnqueue) \ - macro(readableByteStreamControllerEnqueueChunk) \ - macro(readableByteStreamControllerRespondWithNewView) \ - macro(readableByteStreamControllerRespond) \ - macro(readableByteStreamControllerRespondInternal) \ - macro(readableByteStreamControllerRespondInReadableState) \ - macro(readableByteStreamControllerRespondInClosedState) \ - macro(readableByteStreamControllerProcessPullDescriptors) \ - macro(readableByteStreamControllerFillDescriptorFromQueue) \ - macro(readableByteStreamControllerShiftPendingDescriptor) \ - macro(readableByteStreamControllerInvalidateBYOBRequest) \ - macro(readableByteStreamControllerCommitDescriptor) \ - macro(readableByteStreamControllerConvertDescriptor) \ - macro(readableStreamFulfillReadIntoRequest) \ - macro(readableStreamBYOBReaderRead) \ - macro(readableByteStreamControllerPullInto) \ - macro(readableStreamAddReadIntoRequest) \ +#define WEBCORE_FOREACH_UTILINSPECT_BUILTIN_DATA(macro) \ + macro(getStylizeWithColor, utilInspectGetStylizeWithColor, 1) \ + macro(stylizeWithNoColor, utilInspectStylizeWithNoColor, 1) \ + +#define WEBCORE_FOREACH_UTILINSPECT_BUILTIN_CODE(macro) \ + macro(utilInspectGetStylizeWithColorCode, getStylizeWithColor, ASCIILiteral(), s_utilInspectGetStylizeWithColorCodeLength) \ + macro(utilInspectStylizeWithNoColorCode, stylizeWithNoColor, ASCIILiteral(), s_utilInspectStylizeWithNoColorCodeLength) \ + +#define WEBCORE_FOREACH_UTILINSPECT_BUILTIN_FUNCTION_NAME(macro) \ + macro(getStylizeWithColor) \ + macro(stylizeWithNoColor) \ #define DECLARE_BUILTIN_GENERATOR(codeName, functionName, overriddenName, argumentCount) \ JSC::FunctionExecutable* codeName##Generator(JSC::VM&); -WEBCORE_FOREACH_READABLEBYTESTREAMINTERNALS_BUILTIN_CODE(DECLARE_BUILTIN_GENERATOR) +WEBCORE_FOREACH_UTILINSPECT_BUILTIN_CODE(DECLARE_BUILTIN_GENERATOR) #undef DECLARE_BUILTIN_GENERATOR -class ReadableByteStreamInternalsBuiltinsWrapper : private JSC::WeakHandleOwner { +class UtilInspectBuiltinsWrapper : private JSC::WeakHandleOwner { public: - explicit ReadableByteStreamInternalsBuiltinsWrapper(JSC::VM& vm) + explicit UtilInspectBuiltinsWrapper(JSC::VM& vm) : m_vm(vm) - WEBCORE_FOREACH_READABLEBYTESTREAMINTERNALS_BUILTIN_FUNCTION_NAME(INITIALIZE_BUILTIN_NAMES) + WEBCORE_FOREACH_UTILINSPECT_BUILTIN_FUNCTION_NAME(INITIALIZE_BUILTIN_NAMES) #define INITIALIZE_BUILTIN_SOURCE_MEMBERS(name, functionName, overriddenName, length) , m_##name##Source(JSC::makeSource(StringImpl::createWithoutCopying(s_##name, length), { }, JSC::SourceTaintedOrigin::Untainted)) - WEBCORE_FOREACH_READABLEBYTESTREAMINTERNALS_BUILTIN_CODE(INITIALIZE_BUILTIN_SOURCE_MEMBERS) + WEBCORE_FOREACH_UTILINSPECT_BUILTIN_CODE(INITIALIZE_BUILTIN_SOURCE_MEMBERS) #undef INITIALIZE_BUILTIN_SOURCE_MEMBERS { } @@ -5459,28 +5571,28 @@ public: #define EXPOSE_BUILTIN_EXECUTABLES(name, functionName, overriddenName, length) \ JSC::UnlinkedFunctionExecutable* name##Executable(); \ const JSC::SourceCode& name##Source() const { return m_##name##Source; } - WEBCORE_FOREACH_READABLEBYTESTREAMINTERNALS_BUILTIN_CODE(EXPOSE_BUILTIN_EXECUTABLES) + WEBCORE_FOREACH_UTILINSPECT_BUILTIN_CODE(EXPOSE_BUILTIN_EXECUTABLES) #undef EXPOSE_BUILTIN_EXECUTABLES - WEBCORE_FOREACH_READABLEBYTESTREAMINTERNALS_BUILTIN_FUNCTION_NAME(DECLARE_BUILTIN_IDENTIFIER_ACCESSOR) + WEBCORE_FOREACH_UTILINSPECT_BUILTIN_FUNCTION_NAME(DECLARE_BUILTIN_IDENTIFIER_ACCESSOR) void exportNames(); private: JSC::VM& m_vm; - WEBCORE_FOREACH_READABLEBYTESTREAMINTERNALS_BUILTIN_FUNCTION_NAME(DECLARE_BUILTIN_NAMES) + WEBCORE_FOREACH_UTILINSPECT_BUILTIN_FUNCTION_NAME(DECLARE_BUILTIN_NAMES) #define DECLARE_BUILTIN_SOURCE_MEMBERS(name, functionName, overriddenName, length) \ JSC::SourceCode m_##name##Source;\ JSC::Weak m_##name##Executable; - WEBCORE_FOREACH_READABLEBYTESTREAMINTERNALS_BUILTIN_CODE(DECLARE_BUILTIN_SOURCE_MEMBERS) + WEBCORE_FOREACH_UTILINSPECT_BUILTIN_CODE(DECLARE_BUILTIN_SOURCE_MEMBERS) #undef DECLARE_BUILTIN_SOURCE_MEMBERS }; #define DEFINE_BUILTIN_EXECUTABLES(name, functionName, overriddenName, length) \ -inline JSC::UnlinkedFunctionExecutable* ReadableByteStreamInternalsBuiltinsWrapper::name##Executable() \ +inline JSC::UnlinkedFunctionExecutable* UtilInspectBuiltinsWrapper::name##Executable() \ {\ if (!m_##name##Executable) {\ JSC::Identifier executableName = functionName##PublicName();\ @@ -5490,50 +5602,16 @@ inline JSC::UnlinkedFunctionExecutable* ReadableByteStreamInternalsBuiltinsWrapp }\ return m_##name##Executable.get();\ } -WEBCORE_FOREACH_READABLEBYTESTREAMINTERNALS_BUILTIN_CODE(DEFINE_BUILTIN_EXECUTABLES) +WEBCORE_FOREACH_UTILINSPECT_BUILTIN_CODE(DEFINE_BUILTIN_EXECUTABLES) #undef DEFINE_BUILTIN_EXECUTABLES -inline void ReadableByteStreamInternalsBuiltinsWrapper::exportNames() +inline void UtilInspectBuiltinsWrapper::exportNames() { #define EXPORT_FUNCTION_NAME(name) m_vm.propertyNames->appendExternalName(name##PublicName(), name##PrivateName()); - WEBCORE_FOREACH_READABLEBYTESTREAMINTERNALS_BUILTIN_FUNCTION_NAME(EXPORT_FUNCTION_NAME) + WEBCORE_FOREACH_UTILINSPECT_BUILTIN_FUNCTION_NAME(EXPORT_FUNCTION_NAME) #undef EXPORT_FUNCTION_NAME } -class ReadableByteStreamInternalsBuiltinFunctions { -public: - explicit ReadableByteStreamInternalsBuiltinFunctions(JSC::VM& vm) : m_vm(vm) { } - - void init(JSC::JSGlobalObject&); - template void visit(Visitor&); - -public: - JSC::VM& m_vm; - -#define DECLARE_BUILTIN_SOURCE_MEMBERS(functionName) \ - JSC::WriteBarrier m_##functionName##Function; - WEBCORE_FOREACH_READABLEBYTESTREAMINTERNALS_BUILTIN_FUNCTION_NAME(DECLARE_BUILTIN_SOURCE_MEMBERS) -#undef DECLARE_BUILTIN_SOURCE_MEMBERS -}; - -inline void ReadableByteStreamInternalsBuiltinFunctions::init(JSC::JSGlobalObject& globalObject) -{ -#define EXPORT_FUNCTION(codeName, functionName, overriddenName, length) \ - m_##functionName##Function.set(m_vm, &globalObject, JSC::JSFunction::create(m_vm, codeName##Generator(m_vm), &globalObject)); - WEBCORE_FOREACH_READABLEBYTESTREAMINTERNALS_BUILTIN_CODE(EXPORT_FUNCTION) -#undef EXPORT_FUNCTION -} - -template -inline void ReadableByteStreamInternalsBuiltinFunctions::visit(Visitor& visitor) -{ -#define VISIT_FUNCTION(name) visitor.append(m_##name##Function); - WEBCORE_FOREACH_READABLEBYTESTREAMINTERNALS_BUILTIN_FUNCTION_NAME(VISIT_FUNCTION) -#undef VISIT_FUNCTION -} - -template void ReadableByteStreamInternalsBuiltinFunctions::visit(JSC::AbstractSlotVisitor&); -template void ReadableByteStreamInternalsBuiltinFunctions::visit(JSC::SlotVisitor&); - /* WritableStreamDefaultController.ts */ +/* WritableStreamDefaultController.ts */ // initializeWritableStreamDefaultController #define WEBCORE_BUILTIN_WRITABLESTREAMDEFAULTCONTROLLER_INITIALIZEWRITABLESTREAMDEFAULTCONTROLLER 1 extern const char* const s_writableStreamDefaultControllerInitializeWritableStreamDefaultControllerCode; @@ -5622,177 +5700,99 @@ inline void WritableStreamDefaultControllerBuiltinsWrapper::exportNames() WEBCORE_FOREACH_WRITABLESTREAMDEFAULTCONTROLLER_BUILTIN_FUNCTION_NAME(EXPORT_FUNCTION_NAME) #undef EXPORT_FUNCTION_NAME } -/* EventSource.ts */ -// getEventSource -#define WEBCORE_BUILTIN_EVENTSOURCE_GETEVENTSOURCE 1 -extern const char* const s_eventSourceGetEventSourceCode; -extern const int s_eventSourceGetEventSourceCodeLength; -extern const JSC::ConstructAbility s_eventSourceGetEventSourceCodeConstructAbility; -extern const JSC::ConstructorKind s_eventSourceGetEventSourceCodeConstructorKind; -extern const JSC::ImplementationVisibility s_eventSourceGetEventSourceCodeImplementationVisibility; - -#define WEBCORE_FOREACH_EVENTSOURCE_BUILTIN_DATA(macro) \ - macro(getEventSource, eventSourceGetEventSource, 0) \ - -#define WEBCORE_FOREACH_EVENTSOURCE_BUILTIN_CODE(macro) \ - macro(eventSourceGetEventSourceCode, getEventSource, ASCIILiteral(), s_eventSourceGetEventSourceCodeLength) \ - -#define WEBCORE_FOREACH_EVENTSOURCE_BUILTIN_FUNCTION_NAME(macro) \ - macro(getEventSource) \ - -#define DECLARE_BUILTIN_GENERATOR(codeName, functionName, overriddenName, argumentCount) \ - JSC::FunctionExecutable* codeName##Generator(JSC::VM&); - -WEBCORE_FOREACH_EVENTSOURCE_BUILTIN_CODE(DECLARE_BUILTIN_GENERATOR) -#undef DECLARE_BUILTIN_GENERATOR - -class EventSourceBuiltinsWrapper : private JSC::WeakHandleOwner { -public: - explicit EventSourceBuiltinsWrapper(JSC::VM& vm) - : m_vm(vm) - WEBCORE_FOREACH_EVENTSOURCE_BUILTIN_FUNCTION_NAME(INITIALIZE_BUILTIN_NAMES) -#define INITIALIZE_BUILTIN_SOURCE_MEMBERS(name, functionName, overriddenName, length) , m_##name##Source(JSC::makeSource(StringImpl::createWithoutCopying(s_##name, length), { }, JSC::SourceTaintedOrigin::Untainted)) - WEBCORE_FOREACH_EVENTSOURCE_BUILTIN_CODE(INITIALIZE_BUILTIN_SOURCE_MEMBERS) -#undef INITIALIZE_BUILTIN_SOURCE_MEMBERS - { - } - -#define EXPOSE_BUILTIN_EXECUTABLES(name, functionName, overriddenName, length) \ - JSC::UnlinkedFunctionExecutable* name##Executable(); \ - const JSC::SourceCode& name##Source() const { return m_##name##Source; } - WEBCORE_FOREACH_EVENTSOURCE_BUILTIN_CODE(EXPOSE_BUILTIN_EXECUTABLES) -#undef EXPOSE_BUILTIN_EXECUTABLES - - WEBCORE_FOREACH_EVENTSOURCE_BUILTIN_FUNCTION_NAME(DECLARE_BUILTIN_IDENTIFIER_ACCESSOR) - - void exportNames(); - -private: - JSC::VM& m_vm; - - WEBCORE_FOREACH_EVENTSOURCE_BUILTIN_FUNCTION_NAME(DECLARE_BUILTIN_NAMES) - -#define DECLARE_BUILTIN_SOURCE_MEMBERS(name, functionName, overriddenName, length) \ - JSC::SourceCode m_##name##Source;\ - JSC::Weak m_##name##Executable; - WEBCORE_FOREACH_EVENTSOURCE_BUILTIN_CODE(DECLARE_BUILTIN_SOURCE_MEMBERS) -#undef DECLARE_BUILTIN_SOURCE_MEMBERS - -}; - -#define DEFINE_BUILTIN_EXECUTABLES(name, functionName, overriddenName, length) \ -inline JSC::UnlinkedFunctionExecutable* EventSourceBuiltinsWrapper::name##Executable() \ -{\ - if (!m_##name##Executable) {\ - JSC::Identifier executableName = functionName##PublicName();\ - if (overriddenName)\ - executableName = JSC::Identifier::fromString(m_vm, overriddenName);\ - m_##name##Executable = JSC::Weak(JSC::createBuiltinExecutable(m_vm, m_##name##Source, executableName, s_##name##ImplementationVisibility, s_##name##ConstructorKind, s_##name##ConstructAbility), this, &m_##name##Executable);\ - }\ - return m_##name##Executable.get();\ -} -WEBCORE_FOREACH_EVENTSOURCE_BUILTIN_CODE(DEFINE_BUILTIN_EXECUTABLES) -#undef DEFINE_BUILTIN_EXECUTABLES - -inline void EventSourceBuiltinsWrapper::exportNames() -{ -#define EXPORT_FUNCTION_NAME(name) m_vm.propertyNames->appendExternalName(name##PublicName(), name##PrivateName()); - WEBCORE_FOREACH_EVENTSOURCE_BUILTIN_FUNCTION_NAME(EXPORT_FUNCTION_NAME) -#undef EXPORT_FUNCTION_NAME -} class JSBuiltinFunctions { public: explicit JSBuiltinFunctions(JSC::VM& vm) : m_vm(vm) - , m_bundlerPluginBuiltins(m_vm) + , m_countQueuingStrategyBuiltins(m_vm) , m_byteLengthQueuingStrategyBuiltins(m_vm) + , m_writableStreamDefaultWriterBuiltins(m_vm) + , m_readableByteStreamInternalsBuiltins(m_vm) + , m_importMetaObjectBuiltins(m_vm) + , m_readableStreamDefaultReaderBuiltins(m_vm) + , m_readableStreamBYOBRequestBuiltins(m_vm) + , m_processObjectInternalsBuiltins(m_vm) , m_writableStreamInternalsBuiltins(m_vm) + , m_readableStreamBuiltins(m_vm) + , m_transformStreamDefaultControllerBuiltins(m_vm) , m_transformStreamInternalsBuiltins(m_vm) - , m_processObjectInternalsBuiltins(m_vm) - , m_transformStreamBuiltins(m_vm) + , m_eventSourceBuiltins(m_vm) + , m_consoleObjectBuiltins(m_vm) , m_moduleBuiltins(m_vm) + , m_jsBufferConstructorBuiltins(m_vm) , m_jsBufferPrototypeBuiltins(m_vm) , m_readableByteStreamControllerBuiltins(m_vm) - , m_utilInspectBuiltins(m_vm) - , m_consoleObjectBuiltins(m_vm) - , m_readableStreamInternalsBuiltins(m_vm) - , m_transformStreamDefaultControllerBuiltins(m_vm) - , m_readableStreamBYOBReaderBuiltins(m_vm) - , m_jsBufferConstructorBuiltins(m_vm) - , m_readableStreamDefaultReaderBuiltins(m_vm) , m_streamInternalsBuiltins(m_vm) - , m_importMetaObjectBuiltins(m_vm) - , m_countQueuingStrategyBuiltins(m_vm) - , m_readableStreamBYOBRequestBuiltins(m_vm) - , m_writableStreamDefaultWriterBuiltins(m_vm) - , m_readableStreamBuiltins(m_vm) , m_readableStreamDefaultControllerBuiltins(m_vm) - , m_readableByteStreamInternalsBuiltins(m_vm) + , m_bundlerPluginBuiltins(m_vm) + , m_transformStreamBuiltins(m_vm) + , m_readableStreamBYOBReaderBuiltins(m_vm) + , m_readableStreamInternalsBuiltins(m_vm) + , m_utilInspectBuiltins(m_vm) , m_writableStreamDefaultControllerBuiltins(m_vm) - , m_eventSourceBuiltins(m_vm) { + m_readableByteStreamInternalsBuiltins.exportNames(); m_writableStreamInternalsBuiltins.exportNames(); m_transformStreamInternalsBuiltins.exportNames(); - m_readableStreamInternalsBuiltins.exportNames(); m_streamInternalsBuiltins.exportNames(); - m_readableByteStreamInternalsBuiltins.exportNames(); + m_readableStreamInternalsBuiltins.exportNames(); } - BundlerPluginBuiltinsWrapper& bundlerPluginBuiltins() { return m_bundlerPluginBuiltins; } + CountQueuingStrategyBuiltinsWrapper& countQueuingStrategyBuiltins() { return m_countQueuingStrategyBuiltins; } ByteLengthQueuingStrategyBuiltinsWrapper& byteLengthQueuingStrategyBuiltins() { return m_byteLengthQueuingStrategyBuiltins; } + WritableStreamDefaultWriterBuiltinsWrapper& writableStreamDefaultWriterBuiltins() { return m_writableStreamDefaultWriterBuiltins; } + ReadableByteStreamInternalsBuiltinsWrapper& readableByteStreamInternalsBuiltins() { return m_readableByteStreamInternalsBuiltins; } + ImportMetaObjectBuiltinsWrapper& importMetaObjectBuiltins() { return m_importMetaObjectBuiltins; } + ReadableStreamDefaultReaderBuiltinsWrapper& readableStreamDefaultReaderBuiltins() { return m_readableStreamDefaultReaderBuiltins; } + ReadableStreamBYOBRequestBuiltinsWrapper& readableStreamBYOBRequestBuiltins() { return m_readableStreamBYOBRequestBuiltins; } + ProcessObjectInternalsBuiltinsWrapper& processObjectInternalsBuiltins() { return m_processObjectInternalsBuiltins; } WritableStreamInternalsBuiltinsWrapper& writableStreamInternalsBuiltins() { return m_writableStreamInternalsBuiltins; } + ReadableStreamBuiltinsWrapper& readableStreamBuiltins() { return m_readableStreamBuiltins; } + TransformStreamDefaultControllerBuiltinsWrapper& transformStreamDefaultControllerBuiltins() { return m_transformStreamDefaultControllerBuiltins; } TransformStreamInternalsBuiltinsWrapper& transformStreamInternalsBuiltins() { return m_transformStreamInternalsBuiltins; } - ProcessObjectInternalsBuiltinsWrapper& processObjectInternalsBuiltins() { return m_processObjectInternalsBuiltins; } - TransformStreamBuiltinsWrapper& transformStreamBuiltins() { return m_transformStreamBuiltins; } + EventSourceBuiltinsWrapper& eventSourceBuiltins() { return m_eventSourceBuiltins; } + ConsoleObjectBuiltinsWrapper& consoleObjectBuiltins() { return m_consoleObjectBuiltins; } ModuleBuiltinsWrapper& moduleBuiltins() { return m_moduleBuiltins; } + JSBufferConstructorBuiltinsWrapper& jsBufferConstructorBuiltins() { return m_jsBufferConstructorBuiltins; } JSBufferPrototypeBuiltinsWrapper& jsBufferPrototypeBuiltins() { return m_jsBufferPrototypeBuiltins; } ReadableByteStreamControllerBuiltinsWrapper& readableByteStreamControllerBuiltins() { return m_readableByteStreamControllerBuiltins; } - UtilInspectBuiltinsWrapper& utilInspectBuiltins() { return m_utilInspectBuiltins; } - ConsoleObjectBuiltinsWrapper& consoleObjectBuiltins() { return m_consoleObjectBuiltins; } - ReadableStreamInternalsBuiltinsWrapper& readableStreamInternalsBuiltins() { return m_readableStreamInternalsBuiltins; } - TransformStreamDefaultControllerBuiltinsWrapper& transformStreamDefaultControllerBuiltins() { return m_transformStreamDefaultControllerBuiltins; } - ReadableStreamBYOBReaderBuiltinsWrapper& readableStreamBYOBReaderBuiltins() { return m_readableStreamBYOBReaderBuiltins; } - JSBufferConstructorBuiltinsWrapper& jsBufferConstructorBuiltins() { return m_jsBufferConstructorBuiltins; } - ReadableStreamDefaultReaderBuiltinsWrapper& readableStreamDefaultReaderBuiltins() { return m_readableStreamDefaultReaderBuiltins; } StreamInternalsBuiltinsWrapper& streamInternalsBuiltins() { return m_streamInternalsBuiltins; } - ImportMetaObjectBuiltinsWrapper& importMetaObjectBuiltins() { return m_importMetaObjectBuiltins; } - CountQueuingStrategyBuiltinsWrapper& countQueuingStrategyBuiltins() { return m_countQueuingStrategyBuiltins; } - ReadableStreamBYOBRequestBuiltinsWrapper& readableStreamBYOBRequestBuiltins() { return m_readableStreamBYOBRequestBuiltins; } - WritableStreamDefaultWriterBuiltinsWrapper& writableStreamDefaultWriterBuiltins() { return m_writableStreamDefaultWriterBuiltins; } - ReadableStreamBuiltinsWrapper& readableStreamBuiltins() { return m_readableStreamBuiltins; } ReadableStreamDefaultControllerBuiltinsWrapper& readableStreamDefaultControllerBuiltins() { return m_readableStreamDefaultControllerBuiltins; } - ReadableByteStreamInternalsBuiltinsWrapper& readableByteStreamInternalsBuiltins() { return m_readableByteStreamInternalsBuiltins; } + BundlerPluginBuiltinsWrapper& bundlerPluginBuiltins() { return m_bundlerPluginBuiltins; } + TransformStreamBuiltinsWrapper& transformStreamBuiltins() { return m_transformStreamBuiltins; } + ReadableStreamBYOBReaderBuiltinsWrapper& readableStreamBYOBReaderBuiltins() { return m_readableStreamBYOBReaderBuiltins; } + ReadableStreamInternalsBuiltinsWrapper& readableStreamInternalsBuiltins() { return m_readableStreamInternalsBuiltins; } + UtilInspectBuiltinsWrapper& utilInspectBuiltins() { return m_utilInspectBuiltins; } WritableStreamDefaultControllerBuiltinsWrapper& writableStreamDefaultControllerBuiltins() { return m_writableStreamDefaultControllerBuiltins; } - EventSourceBuiltinsWrapper& eventSourceBuiltins() { return m_eventSourceBuiltins; } private: JSC::VM& m_vm; - BundlerPluginBuiltinsWrapper m_bundlerPluginBuiltins; + CountQueuingStrategyBuiltinsWrapper m_countQueuingStrategyBuiltins; ByteLengthQueuingStrategyBuiltinsWrapper m_byteLengthQueuingStrategyBuiltins; + WritableStreamDefaultWriterBuiltinsWrapper m_writableStreamDefaultWriterBuiltins; + ReadableByteStreamInternalsBuiltinsWrapper m_readableByteStreamInternalsBuiltins; + ImportMetaObjectBuiltinsWrapper m_importMetaObjectBuiltins; + ReadableStreamDefaultReaderBuiltinsWrapper m_readableStreamDefaultReaderBuiltins; + ReadableStreamBYOBRequestBuiltinsWrapper m_readableStreamBYOBRequestBuiltins; + ProcessObjectInternalsBuiltinsWrapper m_processObjectInternalsBuiltins; WritableStreamInternalsBuiltinsWrapper m_writableStreamInternalsBuiltins; + ReadableStreamBuiltinsWrapper m_readableStreamBuiltins; + TransformStreamDefaultControllerBuiltinsWrapper m_transformStreamDefaultControllerBuiltins; TransformStreamInternalsBuiltinsWrapper m_transformStreamInternalsBuiltins; - ProcessObjectInternalsBuiltinsWrapper m_processObjectInternalsBuiltins; - TransformStreamBuiltinsWrapper m_transformStreamBuiltins; + EventSourceBuiltinsWrapper m_eventSourceBuiltins; + ConsoleObjectBuiltinsWrapper m_consoleObjectBuiltins; ModuleBuiltinsWrapper m_moduleBuiltins; + JSBufferConstructorBuiltinsWrapper m_jsBufferConstructorBuiltins; JSBufferPrototypeBuiltinsWrapper m_jsBufferPrototypeBuiltins; ReadableByteStreamControllerBuiltinsWrapper m_readableByteStreamControllerBuiltins; - UtilInspectBuiltinsWrapper m_utilInspectBuiltins; - ConsoleObjectBuiltinsWrapper m_consoleObjectBuiltins; - ReadableStreamInternalsBuiltinsWrapper m_readableStreamInternalsBuiltins; - TransformStreamDefaultControllerBuiltinsWrapper m_transformStreamDefaultControllerBuiltins; - ReadableStreamBYOBReaderBuiltinsWrapper m_readableStreamBYOBReaderBuiltins; - JSBufferConstructorBuiltinsWrapper m_jsBufferConstructorBuiltins; - ReadableStreamDefaultReaderBuiltinsWrapper m_readableStreamDefaultReaderBuiltins; StreamInternalsBuiltinsWrapper m_streamInternalsBuiltins; - ImportMetaObjectBuiltinsWrapper m_importMetaObjectBuiltins; - CountQueuingStrategyBuiltinsWrapper m_countQueuingStrategyBuiltins; - ReadableStreamBYOBRequestBuiltinsWrapper m_readableStreamBYOBRequestBuiltins; - WritableStreamDefaultWriterBuiltinsWrapper m_writableStreamDefaultWriterBuiltins; - ReadableStreamBuiltinsWrapper m_readableStreamBuiltins; ReadableStreamDefaultControllerBuiltinsWrapper m_readableStreamDefaultControllerBuiltins; - ReadableByteStreamInternalsBuiltinsWrapper m_readableByteStreamInternalsBuiltins; + BundlerPluginBuiltinsWrapper m_bundlerPluginBuiltins; + TransformStreamBuiltinsWrapper m_transformStreamBuiltins; + ReadableStreamBYOBReaderBuiltinsWrapper m_readableStreamBYOBReaderBuiltins; + ReadableStreamInternalsBuiltinsWrapper m_readableStreamInternalsBuiltins; + UtilInspectBuiltinsWrapper m_utilInspectBuiltins; WritableStreamDefaultControllerBuiltinsWrapper m_writableStreamDefaultControllerBuiltins; - EventSourceBuiltinsWrapper m_eventSourceBuiltins; ; }; @@ -5802,19 +5802,19 @@ public: template void visit(Visitor&); void initialize(Zig::GlobalObject&); + ReadableByteStreamInternalsBuiltinFunctions& readableByteStreamInternals() { return m_readableByteStreamInternals; } WritableStreamInternalsBuiltinFunctions& writableStreamInternals() { return m_writableStreamInternals; } TransformStreamInternalsBuiltinFunctions& transformStreamInternals() { return m_transformStreamInternals; } - ReadableStreamInternalsBuiltinFunctions& readableStreamInternals() { return m_readableStreamInternals; } StreamInternalsBuiltinFunctions& streamInternals() { return m_streamInternals; } - ReadableByteStreamInternalsBuiltinFunctions& readableByteStreamInternals() { return m_readableByteStreamInternals; } + ReadableStreamInternalsBuiltinFunctions& readableStreamInternals() { return m_readableStreamInternals; } private: JSC::VM& m_vm; + ReadableByteStreamInternalsBuiltinFunctions m_readableByteStreamInternals; WritableStreamInternalsBuiltinFunctions m_writableStreamInternals; TransformStreamInternalsBuiltinFunctions m_transformStreamInternals; - ReadableStreamInternalsBuiltinFunctions m_readableStreamInternals; StreamInternalsBuiltinFunctions m_streamInternals; - ReadableByteStreamInternalsBuiltinFunctions m_readableByteStreamInternals; + ReadableStreamInternalsBuiltinFunctions m_readableStreamInternals; }; -- cgit v1.2.3