From 967ccb5d50b3ce163bb98fd125c56b039743de90 Mon Sep 17 00:00:00 2001 From: Jarred Sumner Date: Sun, 23 Jul 2023 22:37:48 -0700 Subject: [PATCH] Upgrade WebKit (#3777) * Upgrade to latest WebKit * Upgrade WebKit * hm * Fix failing tests * Delete utf8-encoding-fixture.bin.cmp --------- Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com> --- .github/workflows/bun-linux-aarch64.yml | 2 +- .github/workflows/bun-linux-build.yml | 4 +- .github/workflows/bun-mac-aarch64.yml | 16 +- .github/workflows/bun-mac-x64-baseline.yml | 16 +- .github/workflows/bun-mac-x64.yml | 16 +- Dockerfile | 2 +- bun.lockb | Bin 73628 -> 73269 bytes package.json | 2 +- src/bun.js/WebKit | 2 +- src/bun.js/bindings/URLDecomposition.cpp | 37 +- src/bun.js/bindings/ZigGlobalObject.cpp | 2 +- src/bun.js/bindings/bindings.cpp | 2 +- src/bun.js/bindings/sqlite/JSSQLStatement.cpp | 2 +- src/bun.js/bindings/webcore/FetchHeaders.cpp | 8 +- .../bindings/webcore/HTTPHeaderField.cpp | 20 +- src/bun.js/bindings/webcore/HTTPParsers.cpp | 389 +++++++----------- src/bun.js/bindings/webcore/HTTPParsers.h | 102 +++-- .../bindings/webcore/JSDOMConvertStrings.cpp | 2 +- src/bun.js/bindings/webcore/JSTextEncoder.cpp | 13 +- .../bindings/webcore/ParsedContentType.cpp | 10 +- .../bindings/webcore/ReadableStreamSink.cpp | 2 +- .../bindings/webcore/ReadableStreamSink.h | 7 +- .../webcore/SerializedScriptValue.cpp | 10 +- src/bun.js/bindings/webcore/SharedBuffer.cpp | 6 +- src/bun.js/bindings/webcore/SharedBuffer.h | 14 +- src/js/builtins/EventSource.ts | 4 +- src/js/builtins/ImportMetaObject.ts | 6 +- src/js/builtins/JSBufferPrototype.ts | 2 +- .../builtins/ReadableByteStreamInternals.ts | 4 +- src/js/builtins/ReadableStreamBYOBReader.ts | 2 +- .../builtins/ReadableStreamDefaultReader.ts | 2 +- src/js/builtins/ReadableStreamInternals.ts | 88 ++-- src/js/builtins/StreamInternals.ts | 4 +- src/js/builtins/TransformStream.ts | 8 +- src/js/builtins/TransformStreamInternals.ts | 30 +- .../builtins/WritableStreamDefaultWriter.ts | 4 +- src/js/builtins/WritableStreamInternals.ts | 72 ++-- src/js/builtins/codegen/replacements.ts | 1 - src/js/out/WebCoreJSBuiltins.cpp | 222 +++++----- 39 files changed, 509 insertions(+), 626 deletions(-) diff --git a/.github/workflows/bun-linux-aarch64.yml b/.github/workflows/bun-linux-aarch64.yml index 721e5d052c..aaeda6c4e1 100644 --- a/.github/workflows/bun-linux-aarch64.yml +++ b/.github/workflows/bun-linux-aarch64.yml @@ -36,7 +36,7 @@ jobs: arch: aarch64 build_arch: arm64 runner: linux-arm64 - webkit_url: "https://github.com/oven-sh/WebKit/releases/download/may20-6/bun-webkit-linux-arm64-lto.tar.gz" + webkit_url: "https://github.com/oven-sh/WebKit/releases/download/2023-july23/bun-webkit-linux-arm64-lto.tar.gz" webkit_basename: "bun-webkit-linux-arm64-lto" build_machine_arch: aarch64 diff --git a/.github/workflows/bun-linux-build.yml b/.github/workflows/bun-linux-build.yml index f69b165bdf..9ad92e6b19 100644 --- a/.github/workflows/bun-linux-build.yml +++ b/.github/workflows/bun-linux-build.yml @@ -46,7 +46,7 @@ jobs: arch: x86_64 build_arch: amd64 runner: big-ubuntu - webkit_url: "https://github.com/oven-sh/WebKit/releases/download/may20-6/bun-webkit-linux-amd64-lto.tar.gz" + webkit_url: "https://github.com/oven-sh/WebKit/releases/download/2023-july23/bun-webkit-linux-amd64-lto.tar.gz" webkit_basename: "bun-webkit-linux-amd64-lto" build_machine_arch: x86_64 - cpu: nehalem @@ -54,7 +54,7 @@ jobs: arch: x86_64 build_arch: amd64 runner: big-ubuntu - webkit_url: "https://github.com/oven-sh/WebKit/releases/download/may20-6/bun-webkit-linux-amd64-lto.tar.gz" + webkit_url: "https://github.com/oven-sh/WebKit/releases/download/2023-july23/bun-webkit-linux-amd64-lto.tar.gz" webkit_basename: "bun-webkit-linux-amd64-lto" build_machine_arch: x86_64 diff --git a/.github/workflows/bun-mac-aarch64.yml b/.github/workflows/bun-mac-aarch64.yml index db81f7d6bf..7fa73017c0 100644 --- a/.github/workflows/bun-mac-aarch64.yml +++ b/.github/workflows/bun-mac-aarch64.yml @@ -117,7 +117,7 @@ jobs: # obj: bun-obj-darwin-x64-baseline # runner: macos-11 # artifact: bun-obj-darwin-x64-baseline - # webkit_url: "https://github.com/oven-sh/WebKit/releases/download/may20-6/bun-webkit-macos-amd64-lto.tar.gz" + # webkit_url: "https://github.com/oven-sh/WebKit/releases/download/2023-july23/bun-webkit-macos-amd64-lto.tar.gz" # dependencies: true # compile_obj: false # - cpu: haswell @@ -126,7 +126,7 @@ jobs: # obj: bun-obj-darwin-x64 # runner: macos-11 # artifact: bun-obj-darwin-x64 - # webkit_url: "https://github.com/oven-sh/WebKit/releases/download/may20-6/bun-webkit-macos-amd64-lto.tar.gz" + # webkit_url: "https://github.com/oven-sh/WebKit/releases/download/2023-july23/bun-webkit-macos-amd64-lto.tar.gz" # dependencies: true # compile_obj: false # - cpu: nehalem @@ -135,7 +135,7 @@ jobs: # obj: bun-obj-darwin-x64-baseline # runner: macos-11 # artifact: bun-obj-darwin-x64-baseline - # webkit_url: "https://github.com/oven-sh/WebKit/releases/download/may20-6/bun-webkit-macos-amd64-lto.tar.gz" + # webkit_url: "https://github.com/oven-sh/WebKit/releases/download/2023-july23/bun-webkit-macos-amd64-lto.tar.gz" # dependencies: false # compile_obj: true # - cpu: haswell @@ -144,7 +144,7 @@ jobs: # obj: bun-obj-darwin-x64 # runner: macos-11 # artifact: bun-obj-darwin-x64 - # webkit_url: "https://github.com/oven-sh/WebKit/releases/download/may20-6/bun-webkit-macos-amd64-lto.tar.gz" + # webkit_url: "https://github.com/oven-sh/WebKit/releases/download/2023-july23/bun-webkit-macos-amd64-lto.tar.gz" # dependencies: false # compile_obj: true - cpu: native @@ -152,7 +152,7 @@ jobs: tag: bun-darwin-aarch64 obj: bun-obj-darwin-aarch64 artifact: bun-obj-darwin-aarch64 - webkit_url: "https://github.com/oven-sh/WebKit/releases/download/may20-6/bun-webkit-macos-arm64-lto.tar.gz" + webkit_url: "https://github.com/oven-sh/WebKit/releases/download/2023-july23/bun-webkit-macos-arm64-lto.tar.gz" runner: macos-arm64 dependencies: true compile_obj: true @@ -257,7 +257,7 @@ jobs: # package: bun-darwin-x64 # runner: macos-11 # artifact: bun-obj-darwin-x64-baseline - # webkit_url: "https://github.com/oven-sh/WebKit/releases/download/may20-6/bun-webkit-macos-amd64-lto.tar.gz" + # webkit_url: "https://github.com/oven-sh/WebKit/releases/download/2023-july23/bun-webkit-macos-amd64-lto.tar.gz" # - cpu: haswell # arch: x86_64 # tag: bun-darwin-x64 @@ -265,14 +265,14 @@ jobs: # package: bun-darwin-x64 # runner: macos-11 # artifact: bun-obj-darwin-x64 - # webkit_url: "https://github.com/oven-sh/WebKit/releases/download/may20-6/bun-webkit-macos-amd64-lto.tar.gz" + # webkit_url: "https://github.com/oven-sh/WebKit/releases/download/2023-july23/bun-webkit-macos-amd64-lto.tar.gz" - cpu: native arch: aarch64 tag: bun-darwin-aarch64 obj: bun-obj-darwin-aarch64 package: bun-darwin-aarch64 artifact: bun-obj-darwin-aarch64 - webkit_url: "https://github.com/oven-sh/WebKit/releases/download/may20-6/bun-webkit-macos-arm64-lto.tar.gz" + webkit_url: "https://github.com/oven-sh/WebKit/releases/download/2023-july23/bun-webkit-macos-arm64-lto.tar.gz" runner: macos-arm64 steps: - uses: actions/checkout@v3 diff --git a/.github/workflows/bun-mac-x64-baseline.yml b/.github/workflows/bun-mac-x64-baseline.yml index 80765d29ce..bd75ec2021 100644 --- a/.github/workflows/bun-mac-x64-baseline.yml +++ b/.github/workflows/bun-mac-x64-baseline.yml @@ -117,7 +117,7 @@ jobs: obj: bun-obj-darwin-x64-baseline runner: macos-11 artifact: bun-obj-darwin-x64-baseline - webkit_url: "https://github.com/oven-sh/WebKit/releases/download/may20-6/bun-webkit-macos-amd64-lto.tar.gz" + webkit_url: "https://github.com/oven-sh/WebKit/releases/download/2023-july23/bun-webkit-macos-amd64-lto.tar.gz" dependencies: true compile_obj: false # - cpu: haswell @@ -126,7 +126,7 @@ jobs: # obj: bun-obj-darwin-x64 # runner: macos-11 # artifact: bun-obj-darwin-x64 - # webkit_url: "https://github.com/oven-sh/WebKit/releases/download/may20-6/bun-webkit-macos-amd64-lto.tar.gz" + # webkit_url: "https://github.com/oven-sh/WebKit/releases/download/2023-july23/bun-webkit-macos-amd64-lto.tar.gz" # dependencies: true # compile_obj: false - cpu: nehalem @@ -135,7 +135,7 @@ jobs: obj: bun-obj-darwin-x64-baseline runner: macos-11 artifact: bun-obj-darwin-x64-baseline - webkit_url: "https://github.com/oven-sh/WebKit/releases/download/may20-6/bun-webkit-macos-amd64-lto.tar.gz" + webkit_url: "https://github.com/oven-sh/WebKit/releases/download/2023-july23/bun-webkit-macos-amd64-lto.tar.gz" dependencies: false compile_obj: true # - cpu: haswell @@ -144,7 +144,7 @@ jobs: # obj: bun-obj-darwin-x64 # runner: macos-11 # artifact: bun-obj-darwin-x64 - # webkit_url: "https://github.com/oven-sh/WebKit/releases/download/may20-6/bun-webkit-macos-amd64-lto.tar.gz" + # webkit_url: "https://github.com/oven-sh/WebKit/releases/download/2023-july23/bun-webkit-macos-amd64-lto.tar.gz" # dependencies: false # compile_obj: true # - cpu: native @@ -152,7 +152,7 @@ jobs: # tag: bun-darwin-aarch64 # obj: bun-obj-darwin-aarch64 # artifact: bun-obj-darwin-aarch64 - # webkit_url: "https://github.com/oven-sh/WebKit/releases/download/may20-6/bun-webkit-macos-amd64-lto.tar.gz" + # webkit_url: "https://github.com/oven-sh/WebKit/releases/download/2023-july23/bun-webkit-macos-amd64-lto.tar.gz" # runner: macos-arm64 # dependencies: true # compile_obj: true @@ -258,7 +258,7 @@ jobs: package: bun-darwin-x64 runner: macos-11 artifact: bun-obj-darwin-x64-baseline - webkit_url: "https://github.com/oven-sh/WebKit/releases/download/may20-6/bun-webkit-macos-amd64-lto.tar.gz" + webkit_url: "https://github.com/oven-sh/WebKit/releases/download/2023-july23/bun-webkit-macos-amd64-lto.tar.gz" # - cpu: haswell # arch: x86_64 # tag: bun-darwin-x64 @@ -266,14 +266,14 @@ jobs: # package: bun-darwin-x64 # runner: macos-11 # artifact: bun-obj-darwin-x64 - # webkit_url: "https://github.com/oven-sh/WebKit/releases/download/may20-6/bun-webkit-macos-amd64-lto.tar.gz" + # webkit_url: "https://github.com/oven-sh/WebKit/releases/download/2023-july23/bun-webkit-macos-amd64-lto.tar.gz" # - cpu: native # arch: aarch64 # tag: bun-darwin-aarch64 # obj: bun-obj-darwin-aarch64 # package: bun-darwin-aarch64 # artifact: bun-obj-darwin-aarch64 - # webkit_url: "https://github.com/oven-sh/WebKit/releases/download/may20-6/bun-webkit-macos-amd64-lto.tar.gz" + # webkit_url: "https://github.com/oven-sh/WebKit/releases/download/2023-july23/bun-webkit-macos-amd64-lto.tar.gz" # runner: macos-arm64 steps: - uses: actions/checkout@v3 diff --git a/.github/workflows/bun-mac-x64.yml b/.github/workflows/bun-mac-x64.yml index 0f1e00b441..371486effe 100644 --- a/.github/workflows/bun-mac-x64.yml +++ b/.github/workflows/bun-mac-x64.yml @@ -117,7 +117,7 @@ jobs: # obj: bun-obj-darwin-x64-baseline # runner: macos-11 # artifact: bun-obj-darwin-x64-baseline - # webkit_url: "https://github.com/oven-sh/WebKit/releases/download/may20-6/bun-webkit-macos-amd64-lto.tar.gz" + # webkit_url: "https://github.com/oven-sh/WebKit/releases/download/2023-july23/bun-webkit-macos-amd64-lto.tar.gz" # dependencies: true # compile_obj: false - cpu: haswell @@ -126,7 +126,7 @@ jobs: obj: bun-obj-darwin-x64 runner: macos-11 artifact: bun-obj-darwin-x64 - webkit_url: "https://github.com/oven-sh/WebKit/releases/download/may20-6/bun-webkit-macos-amd64-lto.tar.gz" + webkit_url: "https://github.com/oven-sh/WebKit/releases/download/2023-july23/bun-webkit-macos-amd64-lto.tar.gz" dependencies: true compile_obj: false # - cpu: nehalem @@ -135,7 +135,7 @@ jobs: # obj: bun-obj-darwin-x64-baseline # runner: macos-11 # artifact: bun-obj-darwin-x64-baseline - # webkit_url: "https://github.com/oven-sh/WebKit/releases/download/may20-6/bun-webkit-macos-amd64-lto.tar.gz" + # webkit_url: "https://github.com/oven-sh/WebKit/releases/download/2023-july23/bun-webkit-macos-amd64-lto.tar.gz" # dependencies: false # compile_obj: true - cpu: haswell @@ -144,7 +144,7 @@ jobs: obj: bun-obj-darwin-x64 runner: macos-11 artifact: bun-obj-darwin-x64 - webkit_url: "https://github.com/oven-sh/WebKit/releases/download/may20-6/bun-webkit-macos-amd64-lto.tar.gz" + webkit_url: "https://github.com/oven-sh/WebKit/releases/download/2023-july23/bun-webkit-macos-amd64-lto.tar.gz" dependencies: false compile_obj: true # - cpu: native @@ -152,7 +152,7 @@ jobs: # tag: bun-darwin-aarch64 # obj: bun-obj-darwin-aarch64 # artifact: bun-obj-darwin-aarch64 - # webkit_url: "https://github.com/oven-sh/WebKit/releases/download/may20-6/bun-webkit-macos-arm64-lto.tar.gz" + # webkit_url: "https://github.com/oven-sh/WebKit/releases/download/2023-july23/bun-webkit-macos-arm64-lto.tar.gz" # runner: macos-arm64 # dependencies: true # compile_obj: true @@ -260,7 +260,7 @@ jobs: # package: bun-darwin-x64 # runner: macos-11 # artifact: bun-obj-darwin-x64-baseline - # webkit_url: "https://github.com/oven-sh/WebKit/releases/download/may20-6/bun-webkit-macos-amd64-lto.tar.gz" + # webkit_url: "https://github.com/oven-sh/WebKit/releases/download/2023-july23/bun-webkit-macos-amd64-lto.tar.gz" - cpu: haswell arch: x86_64 tag: bun-darwin-x64 @@ -268,14 +268,14 @@ jobs: package: bun-darwin-x64 runner: macos-11 artifact: bun-obj-darwin-x64 - webkit_url: "https://github.com/oven-sh/WebKit/releases/download/may20-6/bun-webkit-macos-amd64-lto.tar.gz" + webkit_url: "https://github.com/oven-sh/WebKit/releases/download/2023-july23/bun-webkit-macos-amd64-lto.tar.gz" # - cpu: native # arch: aarch64 # tag: bun-darwin-aarch64 # obj: bun-obj-darwin-aarch64 # package: bun-darwin-aarch64 # artifact: bun-obj-darwin-aarch64 - # webkit_url: "https://github.com/oven-sh/WebKit/releases/download/may20-6/bun-webkit-macos-arm64-lto.tar.gz" + # webkit_url: "https://github.com/oven-sh/WebKit/releases/download/2023-july23/bun-webkit-macos-arm64-lto.tar.gz" # runner: macos-arm64 steps: - uses: actions/checkout@v3 diff --git a/Dockerfile b/Dockerfile index c7fa8d523a..304bf680d9 100644 --- a/Dockerfile +++ b/Dockerfile @@ -10,7 +10,7 @@ ARG ARCH=x86_64 ARG BUILD_MACHINE_ARCH=x86_64 ARG TRIPLET=${ARCH}-linux-gnu ARG BUILDARCH=amd64 -ARG WEBKIT_TAG=may20-6 +ARG WEBKIT_TAG=2023-july23 ARG ZIG_TAG=jul1 ARG ZIG_VERSION="0.11.0-dev.4006+bf827d0b5" ARG WEBKIT_BASENAME="bun-webkit-linux-$BUILDARCH" diff --git a/bun.lockb b/bun.lockb index a2c13a9227fd5c6bd14f55179def4423f7b3a35d..ac7b5dac53b0627de1768be173a377000caae9a2 100755 GIT binary patch delta 18048 zcmeHPcU+Xm*4}reEwUngmktV|2+|isir8Jjir965MOILdqN3tr*BBKYZ&0JyTM}Zy z28xOrd%-St#fAkni3MZ%p7ZXmdUJF0rQGEHbLZ!?XU>_KGiT13nfGOP#znjJw(Qi) z_intyEh}#GB+)r<|Ju5%bGAEmN?tW+;MG-rbDgV)8g;#VeU$?zptNgFoKtAqoqYb2 zk8uDM%re%30 zC^D79(s&{;)z`@FQ7%UP0`T=gEx=PJMxdnU9rRJ>KWOz{0;Nvxf>OH#Lrr;wrk*-) zs47d5r4R^~qjPIiP{NR5Ft<6hkRl%~-KnMSTAG61$beMkh+$|dP=KfU;ab`rR0=*( zsZ94$WeRLiXbQd_C>fjrYfJ@dLEcGZs9`y1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%($mj7 zKpDeMUmNJ+OES0?c>?ZE1;l+=bhPv>$PnDy^d|U z?(%!$d)FO)N36Bv^K%WWf3;L_#T+pi@$>rMX;s?xMih@%f=}tP7E~JZ zF3jQX1GCJG>|FPRY-LUoGrTv@HYYb*m5KirBO~2CE+Z{XnVy@&hTKama53WBv2*tp zT6$4)oGeHk5U+Gk%_*II--CA?l#w0pJ}5gTv#ER24`p|HYx$HudhpO-eWDTX%$Ht% z(#cqOJ9)jnhU1}G&uX$ucZ^xkuQhnj(&%49#5i3FVZla2-o*f4GYb}r`C0{sjCsp~ zS;o8_CUM#0n(N^@GyUWg6_i==bqiKm@^(!=HLF5^9$53$3q)2t`{bTj*GFyz{jGTG zg8No{oxj}7tYEk`Z(fjL&Aa`*wk8EPt^Y#51tXmhn9Gj5q#(hDx8*$xw#s-}0kh!? zb>;QpwtOJZd#|5h$M@q6y|Mn+-?8T}i&*BfS_OqpyfHPmmgFGo^nYLExZ|brn>tBB zm<%(ss=B0LK1A9c0<9AfullURL(); - if (fullURL.host().isEmpty() || fullURL.cannotBeABaseURL() || fullURL.protocolIs("file"_s)) + if (fullURL.host().isEmpty() || fullURL.protocolIsFile()) return; fullURL.setUser(user); setFullURL(fullURL); @@ -76,7 +76,7 @@ String URLDecomposition::password() const void URLDecomposition::setPassword(StringView password) { auto fullURL = this->fullURL(); - if (fullURL.host().isEmpty() || fullURL.cannotBeABaseURL() || fullURL.protocolIs("file"_s)) + if (fullURL.host().isEmpty() || fullURL.protocolIsFile()) return; fullURL.setPassword(password); setFullURL(fullURL); @@ -100,14 +100,14 @@ static unsigned countASCIIDigits(StringView string) void URLDecomposition::setHost(StringView value) { auto fullURL = this->fullURL(); - if (value.isEmpty() && !fullURL.protocolIs("file"_s) && fullURL.hasSpecialScheme()) + if (value.isEmpty() && !fullURL.protocolIsFile() && fullURL.hasSpecialScheme()) return; size_t separator = value.reverseFind(':'); if (!separator) return; - if (fullURL.cannotBeABaseURL() || !fullURL.canSetHostOrPort()) + if (fullURL.hasOpaquePath()) return; // No port if no colon or rightmost colon is within the IPv6 section. @@ -120,13 +120,13 @@ void URLDecomposition::setHost(StringView value) return; unsigned portLength = countASCIIDigits(value.substring(separator + 1)); if (!portLength) { - fullURL.setHost(value.substring(0, separator)); + fullURL.setHost(value.left(separator)); } else { auto portNumber = parseInteger(value.substring(separator + 1, portLength)); if (portNumber && WTF::isDefaultPortForProtocol(*portNumber, fullURL.protocol())) - fullURL.setHostAndPort(value.substring(0, separator)); + fullURL.setHostAndPort(value.left(separator)); else - fullURL.setHostAndPort(value.substring(0, separator + 1 + portLength)); + fullURL.setHostAndPort(value.left(separator + 1 + portLength)); } } if (fullURL.isValid()) @@ -138,24 +138,12 @@ String URLDecomposition::hostname() const return fullURL().host().toString(); } -static StringView removeAllLeadingSolidusCharacters(StringView string) -{ - unsigned i; - unsigned length = string.length(); - for (i = 0; i < length; ++i) { - if (string[i] != '/') - break; - } - return string.substring(i); -} - -void URLDecomposition::setHostname(StringView value) +void URLDecomposition::setHostname(StringView host) { auto fullURL = this->fullURL(); - auto host = removeAllLeadingSolidusCharacters(value); - if (host.isEmpty() && !fullURL.protocolIs("file"_s) && fullURL.hasSpecialScheme()) + if (host.isEmpty() && !fullURL.protocolIsFile() && fullURL.hasSpecialScheme()) return; - if (fullURL.cannotBeABaseURL() || !fullURL.canSetHostOrPort()) + if (fullURL.hasOpaquePath()) return; fullURL.setHost(host); if (fullURL.isValid()) @@ -200,7 +188,7 @@ static std::optional> parsePort(StringView string, Strin void URLDecomposition::setPort(StringView value) { auto fullURL = this->fullURL(); - if (fullURL.host().isEmpty() || fullURL.cannotBeABaseURL() || fullURL.protocolIs("file"_s) || !fullURL.canSetHostOrPort()) + if (fullURL.host().isEmpty() || fullURL.protocolIsFile()) return; auto port = parsePort(value, fullURL.protocol()); if (!port) @@ -217,7 +205,7 @@ String URLDecomposition::pathname() const void URLDecomposition::setPathname(StringView value) { auto fullURL = this->fullURL(); - if (fullURL.cannotBeABaseURL() || !fullURL.canSetPathname()) + if (fullURL.hasOpaquePath()) return; fullURL.setPath(value); setFullURL(fullURL); @@ -236,7 +224,6 @@ void URLDecomposition::setSearch(const String& value) // If the given value is the empty string, set url's query to null. fullURL.setQuery({}); } else { - String newSearch = value; // Make sure that '#' in the query does not leak to the hash. fullURL.setQuery(makeStringByReplacingAll(value, '#', "%23"_s)); } diff --git a/src/bun.js/bindings/ZigGlobalObject.cpp b/src/bun.js/bindings/ZigGlobalObject.cpp index 52f633f3dc..759217ed14 100644 --- a/src/bun.js/bindings/ZigGlobalObject.cpp +++ b/src/bun.js/bindings/ZigGlobalObject.cpp @@ -1312,7 +1312,7 @@ JSC_DEFINE_HOST_FUNCTION(functionBTOA, return JSC::JSValue::encode(JSC::jsEmptyString(vm)); } - if (!encodedString.isAllLatin1()) { + if (!encodedString.containsOnlyLatin1()) { throwException(globalObject, throwScope, createDOMException(globalObject, InvalidCharacterError)); return JSC::JSValue::encode(JSC::JSValue {}); } diff --git a/src/bun.js/bindings/bindings.cpp b/src/bun.js/bindings/bindings.cpp index 9fb0c18d5d..981a475a36 100644 --- a/src/bun.js/bindings/bindings.cpp +++ b/src/bun.js/bindings/bindings.cpp @@ -1256,7 +1256,7 @@ void WebCore__DOMURL__pathname_(WebCore__DOMURL* domURL, ZigString* arg1) BunString WebCore__DOMURL__fileSystemPath(WebCore__DOMURL* arg0) { const WTF::URL& url = arg0->href(); - if (url.isLocalFile()) { + if (url.protocolIsFile()) { return Bun::toString(url.fileSystemPath()); } diff --git a/src/bun.js/bindings/sqlite/JSSQLStatement.cpp b/src/bun.js/bindings/sqlite/JSSQLStatement.cpp index 61ac91ba72..0e5fa18d82 100644 --- a/src/bun.js/bindings/sqlite/JSSQLStatement.cpp +++ b/src/bun.js/bindings/sqlite/JSSQLStatement.cpp @@ -358,7 +358,7 @@ static inline bool rebindValue(JSC::JSGlobalObject* lexicalGlobalObject, sqlite3 return false; } - if (roped.is8Bit() && roped.isAllASCII()) { + if (roped.is8Bit() && roped.containsOnlyASCII()) { CHECK_BIND(sqlite3_bind_text(stmt, i, reinterpret_cast(roped.characters8()), roped.length(), transientOrStatic)); } else if (!roped.is8Bit()) { CHECK_BIND(sqlite3_bind_text16(stmt, i, roped.characters16(), roped.length() * 2, transientOrStatic)); diff --git a/src/bun.js/bindings/webcore/FetchHeaders.cpp b/src/bun.js/bindings/webcore/FetchHeaders.cpp index 9d8572faf0..02a3c8b3a6 100644 --- a/src/bun.js/bindings/webcore/FetchHeaders.cpp +++ b/src/bun.js/bindings/webcore/FetchHeaders.cpp @@ -63,7 +63,7 @@ static ExceptionOr canWriteHeader(const String& name, const String& value, static ExceptionOr appendToHeaderMap(const String& name, const String& value, HTTPHeaderMap& headers, FetchHeaders::Guard guard) { - String normalizedValue = stripLeadingAndTrailingHTTPSpaces(value); + String normalizedValue = value.trim(isHTTPSpace); String combinedValue = normalizedValue; HTTPHeaderName headerName; if (findHTTPHeaderName(name, headerName)) { @@ -107,7 +107,7 @@ static ExceptionOr appendToHeaderMap(const String& name, const String& val static ExceptionOr appendToHeaderMap(const HTTPHeaderMap::HTTPHeaderMapConstIterator::KeyValue& header, HTTPHeaderMap& headers, FetchHeaders::Guard guard) { - String normalizedValue = stripLeadingAndTrailingHTTPSpaces(header.value); + String normalizedValue = header.value.trim(isHTTPSpace); auto canWriteResult = canWriteHeader(header.key, normalizedValue, header.value, guard); if (canWriteResult.hasException()) return canWriteResult.releaseException(); @@ -229,7 +229,7 @@ ExceptionOr FetchHeaders::has(const String& name) const ExceptionOr FetchHeaders::set(const String& name, const String& value) { - String normalizedValue = stripLeadingAndTrailingHTTPSpaces(value); + String normalizedValue = value.trim(isHTTPSpace); auto canWriteResult = canWriteHeader(name, normalizedValue, normalizedValue, m_guard); if (canWriteResult.hasException()) return canWriteResult.releaseException(); @@ -248,7 +248,7 @@ ExceptionOr FetchHeaders::set(const String& name, const String& value) void FetchHeaders::filterAndFill(const HTTPHeaderMap& headers, Guard guard) { for (auto& header : headers) { - String normalizedValue = stripLeadingAndTrailingHTTPSpaces(header.value); + String normalizedValue = header.value.trim(isHTTPSpace); auto canWriteResult = canWriteHeader(header.key, normalizedValue, header.value, guard); if (canWriteResult.hasException()) continue; diff --git a/src/bun.js/bindings/webcore/HTTPHeaderField.cpp b/src/bun.js/bindings/webcore/HTTPHeaderField.cpp index a4d101bdd1..bdcd3e3be7 100644 --- a/src/bun.js/bindings/webcore/HTTPHeaderField.cpp +++ b/src/bun.js/bindings/webcore/HTTPHeaderField.cpp @@ -29,7 +29,7 @@ namespace WebCore { namespace RFC7230 { - + bool isTokenCharacter(UChar c) { return isASCIIAlpha(c) || isASCIIDigit(c) @@ -118,7 +118,7 @@ static bool isValidValue(StringView value) State state = State::OptionalWhitespace; size_t commentDepth = 0; bool hadNonWhitespace = false; - + for (size_t i = 0; i < value.length(); ++i) { UChar c = value[i]; switch (state) { @@ -141,7 +141,7 @@ static bool isValidValue(StringView value) continue; } return false; - + case State::Token: if (isTokenCharacter(c)) continue; @@ -187,7 +187,7 @@ static bool isValidValue(StringView value) continue; } } - + switch (state) { case State::OptionalWhitespace: case State::Token: @@ -204,14 +204,14 @@ static bool isValidValue(StringView value) std::optional HTTPHeaderField::create(String&& unparsedName, String&& unparsedValue) { - StringView strippedName = StringView(unparsedName).stripLeadingAndTrailingMatchedCharacters(RFC7230::isWhitespace); - StringView strippedValue = StringView(unparsedValue).stripLeadingAndTrailingMatchedCharacters(RFC7230::isWhitespace); - if (!RFC7230::isValidName(strippedName) || !RFC7230::isValidValue(strippedValue)) + auto trimmedName = StringView(unparsedName).trim(isTabOrSpace); + auto trimmedValue = StringView(unparsedValue).trim(isTabOrSpace); + if (!RFC7230::isValidName(trimmedName) || !RFC7230::isValidValue(trimmedValue)) return std::nullopt; - String name = strippedName.length() == unparsedName.length() ? WTFMove(unparsedName) : strippedName.toString(); - String value = strippedValue.length() == unparsedValue.length() ? WTFMove(unparsedValue) : strippedValue.toString(); - return {{ WTFMove(name), WTFMove(value) }}; + auto name = trimmedName.length() == unparsedName.length() ? WTFMove(unparsedName) : trimmedName.toString(); + auto value = trimmedValue.length() == unparsedValue.length() ? WTFMove(unparsedValue) : trimmedValue.toString(); + return { { WTFMove(name), WTFMove(value) } }; } } diff --git a/src/bun.js/bindings/webcore/HTTPParsers.cpp b/src/bun.js/bindings/webcore/HTTPParsers.cpp index a696be94c4..f2c4ff989c 100644 --- a/src/bun.js/bindings/webcore/HTTPParsers.cpp +++ b/src/bun.js/bindings/webcore/HTTPParsers.cpp @@ -62,7 +62,7 @@ static inline bool skipWhile(const String& str, unsigned& pos, const Function); return pos < str.length(); } @@ -100,7 +100,7 @@ static inline bool skipValue(const String& str, unsigned& pos) unsigned start = pos; unsigned len = str.length(); while (pos < len) { - if (str[pos] == ' ' || str[pos] == '\t' || str[pos] == ';') + if (isTabOrSpace(str[pos]) || str[pos] == ';') break; ++pos; } @@ -122,20 +122,28 @@ bool isValidReasonPhrase(const String& value) bool isValidHTTPHeaderValue(const String& value) { UChar c = value[0]; - if (c == ' ' || c == '\t') + if (isTabOrSpace(c)) return false; c = value[value.length() - 1]; - if (c == ' ' || c == '\t') + if (isTabOrSpace(c)) return false; - for (unsigned i = 0; i < value.length(); ++i) { - c = value[i]; - if (c == 0x00 || c == 0x0A || c == 0x0D) - return false; - - //NOTE: The spec doesn't require ASCII or Latin1 but common - // implementations, including Node, disallow codepoints > 255 - if (c > 255) return false; + if (value.is8Bit()) { + const LChar* end = value.characters8() + value.length(); + for (const LChar* p = value.characters8(); p != end; ++p) { + if (UNLIKELY(*p <= 13)) { + LChar c = *p; + if (c == 0x00 || c == 0x0A || c == 0x0D) + return false; + } + } + } else { + for (unsigned i = 0; i < value.length(); ++i) { + c = value[i]; + if (c == 0x00 || c == 0x0A || c == 0x0D || c > 0x7F) + return false; + } } + return true; } @@ -342,12 +350,12 @@ StringView filenameFromHTTPContentDisposition(StringView value) if (valueStartPos == notFound) continue; - auto key = keyValuePair.left(valueStartPos).stripWhiteSpace(); + auto key = keyValuePair.left(valueStartPos).trim(isUnicodeCompatibleASCIIWhitespace); if (key.isEmpty() || key != "filename"_s) continue; - auto value = keyValuePair.substring(valueStartPos + 1).stripWhiteSpace(); + auto value = keyValuePair.substring(valueStartPos + 1).trim(isUnicodeCompatibleASCIIWhitespace); // Remove quotes if there are any if (value.length() > 1 && value[0] == '\"') @@ -366,7 +374,7 @@ String extractMIMETypeFromMediaType(const String& mediaType) for (; position < length; ++position) { UChar c = mediaType[position]; - if (c != '\t' && c != ' ') + if (!isTabOrSpace(c)) break; } @@ -388,7 +396,7 @@ String extractMIMETypeFromMediaType(const String& mediaType) if (c == ',') break; - if (c == '\t' || c == ' ' || c == ';') + if (isTabOrSpace(c) || c == ';') break; typeEnd = position + 1; @@ -535,7 +543,7 @@ XSSProtectionDisposition parseXSSProtectionHeader(const String& header, String& ContentTypeOptionsDisposition parseContentTypeOptionsHeader(StringView header) { StringView leftToken = header.left(header.find(',')); - if (equalLettersIgnoringASCIICase(stripLeadingAndTrailingHTTPSpaces(leftToken), "nosniff"_s)) + if (equalLettersIgnoringASCIICase(leftToken.trim(isJSONOrHTTPWhitespace), "nosniff"_s)) return ContentTypeOptionsDisposition::Nosniff; return ContentTypeOptionsDisposition::None; } @@ -562,8 +570,8 @@ XFrameOptionsDisposition parseXFrameOptionsHeader(StringView header) if (header.isEmpty()) return result; - for (auto currentHeader : header.split(',')) { - currentHeader = currentHeader.stripWhiteSpace(); + for (auto currentHeader : header.splitAllowingEmptyEntries(',')) { + currentHeader = currentHeader.trim(isUnicodeCompatibleASCIIWhitespace); XFrameOptionsDisposition currentValue = XFrameOptionsDisposition::None; if (equalLettersIgnoringASCIICase(currentHeader, "deny"_s)) currentValue = XFrameOptionsDisposition::Deny; @@ -582,108 +590,54 @@ XFrameOptionsDisposition parseXFrameOptionsHeader(StringView header) return result; } -// https://fetch.spec.whatwg.org/#concept-header-list-get-structured-header -// FIXME: For now, this assumes the type is "item". -std::optional>> parseStructuredFieldValue(StringView header) +// OptionSet parseClearSiteDataHeader(const ResourceResponse& response) +// { +// OptionSet result; + +// auto headerValue = response.httpHeaderField(HTTPHeaderName::ClearSiteData); +// if (headerValue.isEmpty()) +// return result; + +// if (!WebCore::shouldTreatAsPotentiallyTrustworthy(response.url())) +// return result; + +// for (auto value : StringView(headerValue).split(',')) { +// auto trimmedValue = value.trim(isJSONOrHTTPWhitespace); +// if (trimmedValue == "\"cache\""_s) +// result.add(ClearSiteDataValue::Cache); +// else if (trimmedValue == "\"cookies\""_s) +// result.add(ClearSiteDataValue::Cookies); +// else if (trimmedValue == "\"executionContexts\""_s) +// result.add(ClearSiteDataValue::ExecutionContexts); +// else if (trimmedValue == "\"storage\""_s) +// result.add(ClearSiteDataValue::Storage); +// else if (trimmedValue == "\"*\""_s) +// result.add({ ClearSiteDataValue::Cache, ClearSiteDataValue::Cookies, ClearSiteDataValue::ExecutionContexts, ClearSiteDataValue::Storage }); +// } +// return result; +// } + +// Implements . +// FIXME: this whole function could be more efficient by walking through the range value once. +bool parseRange(StringView range, RangeAllowWhitespace allowWhitespace, long long& rangeStart, long long& rangeEnd) { - header = stripLeadingAndTrailingHTTPSpaces(header); - if (header.isEmpty()) - return std::nullopt; + rangeStart = rangeEnd = -1; - // Parse a token (https://datatracker.ietf.org/doc/html/rfc8941#section-4.2.6). - if (!isASCIIAlpha(header[0]) && header[0] != '*') - return std::nullopt; - size_t index = 1; - while (index < header.length()) { - UChar c = header[index]; - if (!RFC7230::isTokenCharacter(c) && c != ':' && c != '/') - break; - ++index; - } - StringView bareItem = header.left(index); - - // Parse parameters (https://datatracker.ietf.org/doc/html/rfc8941#section-4.2.3.2). - HashMap parameters; - while (index < header.length()) { - if (header[index] != ';') - break; - ++index; // Consume ';'. - while (index < header.length() && header[index] == ' ') - ++index; - if (index == header.length()) - return std::nullopt; - // Parse a key (https://datatracker.ietf.org/doc/html/rfc8941#section-4.2.3.3) - if (!isASCIILower(header[index])) - return std::nullopt; - size_t keyStart = index++; - while (index < header.length()) { - UChar c = header[index]; - if (!isASCIILower(c) && !isASCIIDigit(c) && c != '_' && c != '-' && c != '.' && c != '*') - break; - ++index; - } - StringView key = header.substring(keyStart, index - keyStart); - String value = trueAtom(); - if (index < header.length() && header[index] == '=') { - ++index; // Consume '='. - if (isASCIIAlpha(header[index]) || header[index] == '*') { - // https://datatracker.ietf.org/doc/html/rfc8941#section-4.2.6 - size_t valueStart = index++; - while (index < header.length()) { - UChar c = header[index]; - if (!RFC7230::isTokenCharacter(c) && c != ':' && c != '/') - break; - ++index; - } - value = header.substring(valueStart, index - valueStart).toString(); - } else if (header[index] == '"') { - // https://datatracker.ietf.org/doc/html/rfc8941#section-4.2.5 - StringBuilder valueBuilder; - ++index; // Skip DQUOTE. - while (index < header.length()) { - if (header[index] == '\\') { - ++index; - if (index == header.length()) - return std::nullopt; - if (header[index] != '\\' && header[index] != '"') - return std::nullopt; - valueBuilder.append(header[index]); - } else if (header[index] == '\"') { - value = valueBuilder.toString(); - break; - } else if (header[index] <= 0x1F || (header[index] >= 0x7F && header[index] <= 0xFF)) // Not in VCHAR or SP. - return std::nullopt; - else - valueBuilder.append(header[index]); - ++index; - } - if (index == header.length()) - return std::nullopt; - ++index; // Skip DQUOTE. - } else - return std::nullopt; - } - parameters.set(key.toString(), WTFMove(value)); - } - if (index != header.length()) - return std::nullopt; - return std::make_pair(bareItem, parameters); -} - -bool parseRange(StringView range, long long& rangeOffset, long long& rangeEnd, long long& rangeSuffixLength) -{ - // The format of "Range" header is defined in RFC 2616 Section 14.35.1. - // http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.35.1 - // We don't support multiple range requests. - - rangeOffset = rangeEnd = rangeSuffixLength = -1; - - // The "bytes" unit identifier should be present. - static const unsigned bytesLength = 6; - if (!startsWithLettersIgnoringASCIICase(range, "bytes="_s)) + // Only 0x20 and 0x09 matter as newlines are already gone by the time we parse a header value. + if (allowWhitespace == RangeAllowWhitespace::No && range.find(isTabOrSpace) != notFound) return false; - StringView byteRange = range.substring(bytesLength); + // The "bytes" unit identifier should be present. + static const unsigned bytesLength = 5; + if (!startsWithLettersIgnoringASCIICase(range, "bytes"_s)) + return false; + + auto byteRange = range.substring(bytesLength).trim(isJSONOrHTTPWhitespace); + + if (!byteRange.startsWith('=')) + return false; + + byteRange = byteRange.substring(1); // The '-' character needs to be present. int index = byteRange.find('-'); @@ -694,8 +648,10 @@ bool parseRange(StringView range, long long& rangeOffset, long long& rangeEnd, l // Example: // -500 if (!index) { - if (auto value = parseInteger(byteRange.substring(index + 1))) - rangeSuffixLength = *value; + auto value = parseInteger(byteRange.substring(index + 1)); + if (!value) + return false; + rangeEnd = *value; return true; } @@ -707,7 +663,7 @@ bool parseRange(StringView range, long long& rangeOffset, long long& rangeEnd, l if (!firstBytePos) return false; - auto lastBytePosStr = stripLeadingAndTrailingHTTPSpaces(byteRange.substring(index + 1)); + auto lastBytePosStr = byteRange.substring(index + 1); long long lastBytePos = -1; if (!lastBytePosStr.isEmpty()) { auto value = parseInteger(lastBytePosStr); @@ -719,7 +675,7 @@ bool parseRange(StringView range, long long& rangeOffset, long long& rangeEnd, l if (*firstBytePos < 0 || !(lastBytePos == -1 || lastBytePos >= *firstBytePos)) return false; - rangeOffset = *firstBytePos; + rangeStart = *firstBytePos; rangeEnd = lastBytePos; return true; } @@ -854,35 +810,11 @@ size_t parseHTTPRequestBody(const uint8_t* data, size_t length, Vector& bool isForbiddenHeaderName(const String& name) { return false; - // HTTPHeaderName headerName; - // if (findHTTPHeaderName(name, headerName)) { - // switch (headerName) { - // case HTTPHeaderName::AcceptCharset: - // case HTTPHeaderName::AcceptEncoding: - // case HTTPHeaderName::AccessControlRequestHeaders: - // case HTTPHeaderName::AccessControlRequestMethod: - // case HTTPHeaderName::Connection: - // case HTTPHeaderName::ContentLength: - // case HTTPHeaderName::Cookie: - // case HTTPHeaderName::Cookie2: - // case HTTPHeaderName::Date: - // case HTTPHeaderName::DNT: - // case HTTPHeaderName::Expect: - // case HTTPHeaderName::Host: - // case HTTPHeaderName::KeepAlive: - // case HTTPHeaderName::Origin: - // case HTTPHeaderName::Referer: - // case HTTPHeaderName::TE: - // case HTTPHeaderName::Trailer: - // case HTTPHeaderName::TransferEncoding: - // case HTTPHeaderName::Upgrade: - // case HTTPHeaderName::Via: - // return true; - // default: - // break; - // } - // } - // return startsWithLettersIgnoringASCIICase(name, "sec-"_s) || startsWithLettersIgnoringASCIICase(name, "proxy-"_s); +} + +bool isForbiddenHeader(const String& name, StringView value) +{ + return false; } // Implements . @@ -906,99 +838,65 @@ bool isNoCORSSafelistedRequestHeaderName(const String& name) // Implements . bool isPriviledgedNoCORSRequestHeaderName(const String& name) { - return equalLettersIgnoringASCIICase(name, "range"_s); + return false; + // return equalLettersIgnoringASCIICase(name, "range"_s); } // Implements . bool isForbiddenResponseHeaderName(const String& name) { - return equalLettersIgnoringASCIICase(name, "set-cookie"_s) || equalLettersIgnoringASCIICase(name, "set-cookie2"_s); + return false; + // return equalLettersIgnoringASCIICase(name, "set-cookie"_s) || equalLettersIgnoringASCIICase(name, "set-cookie2"_s); } // Implements . -bool isForbiddenMethod(const String& name) +bool isForbiddenMethod(StringView name) { - return equalLettersIgnoringASCIICase(name, "connect"_s) || equalLettersIgnoringASCIICase(name, "trace"_s) || equalLettersIgnoringASCIICase(name, "track"_s); + // return equalLettersIgnoringASCIICase(name, "connect"_s) || equalLettersIgnoringASCIICase(name, "trace"_s) || equalLettersIgnoringASCIICase(name, "track"_s); + return false; } bool isSimpleHeader(const String& name, const String& value) { HTTPHeaderName headerName; - if (!findHTTPHeaderName(name, headerName)) - return false; - return isCrossOriginSafeRequestHeader(headerName, value); + return !findHTTPHeaderName(name, headerName); } -bool isCrossOriginSafeHeader(HTTPHeaderName name, const HTTPHeaderSet& accessControlExposeHeaderSet) -{ - switch (name) { - case HTTPHeaderName::CacheControl: - case HTTPHeaderName::ContentLanguage: - case HTTPHeaderName::ContentLength: - case HTTPHeaderName::ContentType: - case HTTPHeaderName::Expires: - case HTTPHeaderName::LastModified: - case HTTPHeaderName::Pragma: - case HTTPHeaderName::Accept: - return true; - case HTTPHeaderName::SetCookie: - case HTTPHeaderName::SetCookie2: - return false; - default: - break; - } - return accessControlExposeHeaderSet.contains(httpHeaderNameString(name)); -} +// bool isCrossOriginSafeHeader(HTTPHeaderName name, const HTTPHeaderSet& accessControlExposeHeaderSet) +// { +// // switch (name) { +// // case HTTPHeaderName::CacheControl: +// // case HTTPHeaderName::ContentLanguage: +// // case HTTPHeaderName::ContentLength: +// // case HTTPHeaderName::ContentType: +// // case HTTPHeaderName::Expires: +// // case HTTPHeaderName::LastModified: +// // case HTTPHeaderName::Pragma: +// // case HTTPHeaderName::Accept: +// // return true; +// // case HTTPHeaderName::SetCookie: +// // case HTTPHeaderName::SetCookie2: +// // return false; +// // default: +// // break; +// // } +// // return accessControlExposeHeaderSet.contains(httpHeaderNameString(name)); +// } -bool isCrossOriginSafeHeader(const String& name, const HTTPHeaderSet& accessControlExposeHeaderSet) -{ -#if ASSERT_ENABLED - HTTPHeaderName headerName; - ASSERT(!findHTTPHeaderName(name, headerName)); -#endif - return accessControlExposeHeaderSet.contains(name); -} - -static bool isSimpleRangeHeaderValue(const String& value) -{ - if (!value.startsWith("bytes="_s)) - return false; - - unsigned start = 0; - unsigned end = 0; - bool hasHyphen = false; - - for (size_t cptr = 6; cptr < value.length(); ++cptr) { - auto character = value[cptr]; - if (character >= '0' && character <= '9') { - if (productOverflows(hasHyphen ? end : start, 10)) - return false; - auto newDecimal = (hasHyphen ? end : start) * 10; - auto sum = Checked(newDecimal) + Checked(character - '0'); - if (sum.hasOverflowed()) - return false; - - if (hasHyphen) - end = sum.value(); - else - start = sum.value(); - continue; - } - if (character == '-' && !hasHyphen) { - hasHyphen = true; - continue; - } - return false; - } - - return hasHyphen && (!end || start < end); -} +// bool isCrossOriginSafeHeader(const String& name, const HTTPHeaderSet& accessControlExposeHeaderSet) +// { +// #if ASSERT_ENABLED +// HTTPHeaderName headerName; +// ASSERT(!findHTTPHeaderName(name, headerName)); +// #endif +// return accessControlExposeHeaderSet.contains(name); +// } // Implements https://fetch.spec.whatwg.org/#cors-safelisted-request-header bool isCrossOriginSafeRequestHeader(HTTPHeaderName name, const String& value) { - if (value.length() > 128) - return false; + // if (value.length() > 128) + // return false; // switch (name) { // case HTTPHeaderName::Accept: @@ -1023,11 +921,14 @@ bool isCrossOriginSafeRequestHeader(HTTPHeaderName name, const String& value) // break; // } // case HTTPHeaderName::Range: - // if (!isSimpleRangeHeaderValue(value)) + // long long start; + // long long end; + // if (!parseRange(value, RangeAllowWhitespace::No, start, end)) + // return false; + // if (start == -1) // return false; // break; // default: - // // FIXME: Should we also make safe other headers (DPR, Downlink, Save-Data...)? That would require validating their values. // return false; // } return true; @@ -1036,43 +937,43 @@ bool isCrossOriginSafeRequestHeader(HTTPHeaderName name, const String& value) // Implements . String normalizeHTTPMethod(const String& method) { - const ASCIILiteral methods[] = { "DELETE"_s, "GET"_s, "HEAD"_s, "OPTIONS"_s, "POST"_s, "PUT"_s }; - for (auto value : methods) { - if (equalIgnoringASCIICase(method, value)) { - // Don't bother allocating a new string if it's already all uppercase. - if (method == value) - break; - return value; - } - } + // static constexpr ASCIILiteral methods[] = { "DELETE"_s, "GET"_s, "HEAD"_s, "OPTIONS"_s, "POST"_s, "PUT"_s }; + // for (auto value : methods) { + // if (equalIgnoringASCIICase(method, value)) { + // // Don't bother allocating a new string if it's already all uppercase. + // if (method == value) + // break; + // return value; + // } + // } return method; } // Defined by https://tools.ietf.org/html/rfc7231#section-4.2.1 bool isSafeMethod(const String& method) { - const ASCIILiteral safeMethods[] = { "GET"_s, "HEAD"_s, "OPTIONS"_s, "TRACE"_s }; - for (auto value : safeMethods) { - if (equalIgnoringASCIICase(method, value)) - return true; - } - return false; + // const ASCIILiteral safeMethods[] = { "GET"_s, "HEAD"_s, "OPTIONS"_s, "TRACE"_s }; + // for (auto value : safeMethods) { + // if (equalIgnoringASCIICase(method, value)) + // return true; + // } + return true; } CrossOriginResourcePolicy parseCrossOriginResourcePolicyHeader(StringView header) { - auto strippedHeader = stripLeadingAndTrailingHTTPSpaces(header); + auto trimmedHeader = header.trim(isJSONOrHTTPWhitespace); - if (strippedHeader.isEmpty()) + if (trimmedHeader.isEmpty()) return CrossOriginResourcePolicy::None; - if (strippedHeader == "same-origin"_s) + if (trimmedHeader == "same-origin"_s) return CrossOriginResourcePolicy::SameOrigin; - if (strippedHeader == "same-site"_s) + if (trimmedHeader == "same-site"_s) return CrossOriginResourcePolicy::SameSite; - if (strippedHeader == "cross-origin"_s) + if (trimmedHeader == "cross-origin"_s) return CrossOriginResourcePolicy::CrossOrigin; return CrossOriginResourcePolicy::Invalid; diff --git a/src/bun.js/bindings/webcore/HTTPParsers.h b/src/bun.js/bindings/webcore/HTTPParsers.h index 0bc922a047..bf56caccb1 100644 --- a/src/bun.js/bindings/webcore/HTTPParsers.h +++ b/src/bun.js/bindings/webcore/HTTPParsers.h @@ -30,6 +30,7 @@ #pragma once +#include #include #include #include @@ -69,6 +70,9 @@ enum class CrossOriginResourcePolicy : uint8_t { Invalid }; +enum class RangeAllowWhitespace : bool { No, + Yes }; + bool isValidReasonPhrase(const String&); bool isValidHTTPHeaderValue(const String&); bool isValidAcceptHeaderValue(const String&); @@ -103,8 +107,8 @@ bool isPriviledgedNoCORSRequestHeaderName(const String&); bool isForbiddenResponseHeaderName(const String&); bool isForbiddenMethod(const String&); bool isSimpleHeader(const String& name, const String& value); -bool isCrossOriginSafeHeader(HTTPHeaderName, const HTTPHeaderSet&); -bool isCrossOriginSafeHeader(const String&, const HTTPHeaderSet&); +// bool isCrossOriginSafeHeader(HTTPHeaderName, const HTTPHeaderSet&); +// bool isCrossOriginSafeHeader(const String&, const HTTPHeaderSet&); bool isCrossOriginSafeRequestHeader(HTTPHeaderName, const String&); String normalizeHTTPMethod(const String&); @@ -112,67 +116,59 @@ bool isSafeMethod(const String&); WEBCORE_EXPORT CrossOriginResourcePolicy parseCrossOriginResourcePolicyHeader(StringView); +// -1 could be set to one of the return parameters to indicate the value is not specified. +WEBCORE_EXPORT bool parseRange(StringView, RangeAllowWhitespace, long long& rangeStart, long long& rangeEnd); + inline bool isHTTPSpace(UChar character) { return character <= ' ' && (character == ' ' || character == '\n' || character == '\t' || character == '\r'); } -// Strip leading and trailing whitespace as defined in https://fetch.spec.whatwg.org/#concept-header-value-normalize. -inline String stripLeadingAndTrailingHTTPSpaces(const String& string) -{ - return string.stripLeadingAndTrailingCharacters(isHTTPSpace); -} +// template +// bool addToAccessControlAllowList(const String& string, unsigned start, unsigned end, HashSet& set) +// { +// StringImpl* stringImpl = string.impl(); +// if (!stringImpl) +// return true; -inline StringView stripLeadingAndTrailingHTTPSpaces(StringView string) -{ - return string.stripLeadingAndTrailingMatchedCharacters(isHTTPSpace); -} +// // Skip white space from start. +// while (start <= end && isJSONOrHTTPWhitespace((*stringImpl)[start])) +// ++start; -template -bool addToAccessControlAllowList(const String& string, unsigned start, unsigned end, HashSet& set) -{ - StringImpl* stringImpl = string.impl(); - if (!stringImpl) - return true; +// // only white space +// if (start > end) +// return true; - // Skip white space from start. - while (start <= end && isHTTPSpace((*stringImpl)[start])) - ++start; +// // Skip white space from end. +// while (end && isJSONOrHTTPWhitespace((*stringImpl)[end])) +// --end; - // only white space - if (start > end) - return true; +// auto token = string.substring(start, end - start + 1); +// if (!isValidHTTPToken(token)) +// return false; - // Skip white space from end. - while (end && isHTTPSpace((*stringImpl)[end])) - --end; +// set.add(WTFMove(token)); +// return true; +// } - auto token = string.substring(start, end - start + 1); - if (!isValidHTTPToken(token)) - return false; - - set.add(WTFMove(token)); - return true; -} - -template> -std::optional> parseAccessControlAllowList(const String& string) -{ - HashSet set; - unsigned start = 0; - size_t end; - while ((end = string.find(',', start)) != notFound) { - if (start != end) { - if (!addToAccessControlAllowList(string, start, end - 1, set)) - return {}; - } - start = end + 1; - } - if (start != string.length()) { - if (!addToAccessControlAllowList(string, start, string.length() - 1, set)) - return {}; - } - return set; -} +// template> +// std::optional> parseAccessControlAllowList(const String& string) +// { +// HashSet set; +// unsigned start = 0; +// size_t end; +// while ((end = string.find(',', start)) != notFound) { +// if (start != end) { +// if (!addToAccessControlAllowList(string, start, end - 1, set)) +// return {}; +// } +// start = end + 1; +// } +// if (start != string.length()) { +// if (!addToAccessControlAllowList(string, start, string.length() - 1, set)) +// return {}; +// } +// return set; +// } } diff --git a/src/bun.js/bindings/webcore/JSDOMConvertStrings.cpp b/src/bun.js/bindings/webcore/JSDOMConvertStrings.cpp index 00f385e07f..d5ae213042 100644 --- a/src/bun.js/bindings/webcore/JSDOMConvertStrings.cpp +++ b/src/bun.js/bindings/webcore/JSDOMConvertStrings.cpp @@ -44,7 +44,7 @@ String identifierToString(JSGlobalObject& lexicalGlobalObject, const Identifier& static inline bool throwIfInvalidByteString(JSGlobalObject& lexicalGlobalObject, JSC::ThrowScope& scope, const String& string) { - if (UNLIKELY(!string.isAllLatin1())) { + if (UNLIKELY(!string.containsOnlyLatin1())) { throwTypeError(&lexicalGlobalObject, scope); return true; } diff --git a/src/bun.js/bindings/webcore/JSTextEncoder.cpp b/src/bun.js/bindings/webcore/JSTextEncoder.cpp index 5d764619bd..3029028fec 100644 --- a/src/bun.js/bindings/webcore/JSTextEncoder.cpp +++ b/src/bun.js/bindings/webcore/JSTextEncoder.cpp @@ -216,9 +216,9 @@ template<> void JSTextEncoderDOMConstructor::initializeProperties(VM& vm, JSDOMG constexpr JSC::DFG::AbstractHeapKind heapKinds[4] = { JSC::DFG::HeapObjectCount }; -// This is the equivalent of DataView.set -constexpr JSC::DFG::AbstractHeapKind encodeIntoRead[4] = { JSC::DFG::MiscFields, JSC::DFG::TypedArrayProperties, JSC::DFG::Absolute }; -constexpr JSC::DFG::AbstractHeapKind encodeIntoWrite[4] = { JSC::DFG::TypedArrayProperties, JSC::DFG::Absolute }; +// TODO: figure out why the test fails after JSC upgrade and re-enable this! +// constexpr JSC::DFG::AbstractHeapKind encodeIntoRead[4] = { JSC::DFG::Heap, JSC::DFG::MiscFields, JSC::DFG::TypedArrayProperties, JSC::DFG::Absolute }; +// constexpr JSC::DFG::AbstractHeapKind encodeIntoWrite[4] = { JSC::DFG::SideState, JSC::DFG::Absolute, JSC::DFG::JSCell_structureID, JSC::DFG::HeapObjectCount }; static const JSC::DOMJIT::Signature DOMJITSignatureForJSTextEncoderEncodeWithoutTypeCheck( jsTextEncoderEncodeWithoutTypeCheck, @@ -230,10 +230,9 @@ static const JSC::DOMJIT::Signature DOMJITSignatureForJSTextEncoderEncodeWithout static const JSC::DOMJIT::Signature DOMJITSignatureForJSTextEncoderEncodeIntoWithoutTypeCheck( jsTextEncoderPrototypeFunction_encodeIntoWithoutTypeCheck, JSTextEncoder::info(), - // this is slightly incorrect - // there could be cases where the object returned by encodeInto will appear to be reused - // it impacts HeapObjectCount - JSC::DOMJIT::Effect::forReadWriteKinds(encodeIntoRead, encodeIntoWrite), + + JSC::DOMJIT::Effect {}, + // JSC::DOMJIT::Effect::forReadWriteKinds(encodeIntoRead, encodeIntoWrite), DOMJIT::IDLResultTypeFilter::value, DOMJIT::IDLArgumentTypeFilter::value, DOMJIT::IDLArgumentTypeFilter::value); diff --git a/src/bun.js/bindings/webcore/ParsedContentType.cpp b/src/bun.js/bindings/webcore/ParsedContentType.cpp index 04b30cf9b2..c4773b3ee9 100644 --- a/src/bun.js/bindings/webcore/ParsedContentType.cpp +++ b/src/bun.js/bindings/webcore/ParsedContentType.cpp @@ -40,7 +40,7 @@ namespace WebCore { static void skipSpaces(StringView input, unsigned& startIndex) { - while (startIndex < input.length() && isHTTPSpace(input[startIndex])) + while (startIndex < input.length() && isJSONOrHTTPWhitespace(input[startIndex])) ++startIndex; } @@ -78,7 +78,7 @@ static StringView parseToken(StringView input, unsigned& startIndex, CharacterMe while (input[tokenEnd - 1] == ' ') --tokenEnd; } else { - while (isHTTPSpace(input[tokenEnd - 1])) + while (isJSONOrHTTPWhitespace(input[tokenEnd - 1])) --tokenEnd; } } @@ -328,7 +328,7 @@ bool ParsedContentType::parseContentType(Mode mode) std::optional ParsedContentType::create(const String& contentType, Mode mode) { - ParsedContentType parsedContentType(mode == Mode::Rfc2045 ? contentType : stripLeadingAndTrailingHTTPSpaces(contentType)); + ParsedContentType parsedContentType(mode == Mode::Rfc2045 ? contentType : contentType.trim(isJSONOrHTTPWhitespace)); if (!parsedContentType.parseContentType(mode)) return std::nullopt; return { WTFMove(parsedContentType) }; @@ -368,9 +368,9 @@ void ParsedContentType::setContentType(String&& contentRange, Mode mode) { m_mimeType = WTFMove(contentRange); if (mode == Mode::MimeSniff) - m_mimeType = stripLeadingAndTrailingHTTPSpaces(StringView(m_mimeType)).convertToASCIILowercase(); + m_mimeType = StringView(m_mimeType).trim(isJSONOrHTTPWhitespace).convertToASCIILowercase(); else - m_mimeType = m_mimeType.stripWhiteSpace(); + m_mimeType = m_mimeType.trim(deprecatedIsSpaceOrNewline); } static bool containsNonQuoteStringTokenCharacters(const String& input) diff --git a/src/bun.js/bindings/webcore/ReadableStreamSink.cpp b/src/bun.js/bindings/webcore/ReadableStreamSink.cpp index ff2f1ebe35..d79e7d3581 100644 --- a/src/bun.js/bindings/webcore/ReadableStreamSink.cpp +++ b/src/bun.js/bindings/webcore/ReadableStreamSink.cpp @@ -48,7 +48,7 @@ void ReadableStreamToSharedBufferSink::enqueue(const BufferSource& buffer) return; if (m_callback) { - Span chunk { buffer.data(), buffer.length() }; + std::span chunk { buffer.data(), buffer.length() }; m_callback(&chunk); } } diff --git a/src/bun.js/bindings/webcore/ReadableStreamSink.h b/src/bun.js/bindings/webcore/ReadableStreamSink.h index fee9884221..7db31e38ab 100644 --- a/src/bun.js/bindings/webcore/ReadableStreamSink.h +++ b/src/bun.js/bindings/webcore/ReadableStreamSink.h @@ -23,13 +23,12 @@ * THE POSSIBILITY OF SUCH DAMAGE. */ - #pragma once #include "ExceptionOr.h" #include #include -#include +#include namespace WebCore { @@ -47,10 +46,10 @@ public: class ReadableStreamToSharedBufferSink final : public ReadableStreamSink { public: - using Callback = Function*>&&)>; + using Callback = Function*>&&)>; static Ref create(Callback&& callback) { return adoptRef(*new ReadableStreamToSharedBufferSink(WTFMove(callback))); } void pipeFrom(ReadableStream&); - void clearCallback() { m_callback = { }; } + void clearCallback() { m_callback = {}; } private: explicit ReadableStreamToSharedBufferSink(Callback&&); diff --git a/src/bun.js/bindings/webcore/SerializedScriptValue.cpp b/src/bun.js/bindings/webcore/SerializedScriptValue.cpp index 176e805b82..e80bc94936 100644 --- a/src/bun.js/bindings/webcore/SerializedScriptValue.cpp +++ b/src/bun.js/bindings/webcore/SerializedScriptValue.cpp @@ -2528,7 +2528,7 @@ public: Vector>&& detachedRTCDataChannels #endif , - ArrayBufferContentsArray* arrayBufferContentsArray, const Span& buffer, const Vector& blobURLs, const Vector blobFilePaths, ArrayBufferContentsArray* sharedBuffers + ArrayBufferContentsArray* arrayBufferContentsArray, const std::span& buffer, const Vector& blobURLs, const Vector blobFilePaths, ArrayBufferContentsArray* sharedBuffers #if ENABLE(WEBASSEMBLY) , WasmModuleArray* wasmModules, WasmMemoryHandleArray* wasmMemoryHandles @@ -2541,7 +2541,7 @@ public: { if (!buffer.size()) return std::make_pair(jsNull(), SerializationReturnCode::UnspecifiedError); - CloneDeserializer deserializer(lexicalGlobalObject, globalObject, arrayBufferContentsArray, Span { buffer.begin(), buffer.end() }, blobURLs, blobFilePaths, sharedBuffers + CloneDeserializer deserializer(lexicalGlobalObject, globalObject, arrayBufferContentsArray, std::span { buffer.begin(), buffer.end() }, blobURLs, blobFilePaths, sharedBuffers #if ENABLE(OFFSCREEN_CANVAS_IN_WORKERS) , WTFMove(detachedOffscreenCanvases) @@ -2675,7 +2675,7 @@ private: // m_version = 0xFFFFFFFF; // } - CloneDeserializer(JSGlobalObject* lexicalGlobalObject, JSGlobalObject* globalObject, ArrayBufferContentsArray* arrayBufferContents, const Span& buffer + CloneDeserializer(JSGlobalObject* lexicalGlobalObject, JSGlobalObject* globalObject, ArrayBufferContentsArray* arrayBufferContents, const std::span& buffer #if ENABLE(OFFSCREEN_CANVAS_IN_WORKERS) , Vector>&& detachedOffscreenCanvases = {} @@ -2781,7 +2781,7 @@ private: // m_version = 0xFFFFFFFF; // } - CloneDeserializer(JSGlobalObject* lexicalGlobalObject, JSGlobalObject* globalObject, ArrayBufferContentsArray* arrayBufferContents, const Span& buffer, const Vector& blobURLs, const Vector blobFilePaths, ArrayBufferContentsArray* sharedBuffers + CloneDeserializer(JSGlobalObject* lexicalGlobalObject, JSGlobalObject* globalObject, ArrayBufferContentsArray* arrayBufferContents, const std::span& buffer, const Vector& blobURLs, const Vector blobFilePaths, ArrayBufferContentsArray* sharedBuffers #if ENABLE(OFFSCREEN_CANVAS_IN_WORKERS) , Vector>&& detachedOffscreenCanvases @@ -5406,7 +5406,7 @@ JSC::JSValue SerializedScriptValue::fromArrayBuffer(JSC::JSGlobalObject& domGlob auto* data = static_cast(arrayBuffer->data()) + byteOffset; auto size = std::min(arrayBuffer->byteLength(), maxByteLength); - auto span = Span { data, size }; + auto span = std::span { data, size }; auto result = CloneDeserializer::deserialize(&domGlobal, globalObject, nullptr, span, blobURLs, blobFiles, nullptr #if ENABLE(WEBASSEMBLY) diff --git a/src/bun.js/bindings/webcore/SharedBuffer.cpp b/src/bun.js/bindings/webcore/SharedBuffer.cpp index 6ade267de9..32b19626be 100644 --- a/src/bun.js/bindings/webcore/SharedBuffer.cpp +++ b/src/bun.js/bindings/webcore/SharedBuffer.cpp @@ -261,14 +261,14 @@ Ref FragmentedSharedBuffer::copy() const return clone; } -void FragmentedSharedBuffer::forEachSegment(const Function&)>& apply) const +void FragmentedSharedBuffer::forEachSegment(const Function&)>& apply) const { auto segments = m_segments; for (auto& segment : segments) segment.segment->iterate(apply); } -void DataSegment::iterate(const Function&)>& apply) const +void DataSegment::iterate(const Function&)>& apply) const { #if USE(FOUNDATION) if (auto* data = std::get_if>(&m_immutableData)) @@ -284,7 +284,7 @@ void FragmentedSharedBuffer::forEachSegmentAsSharedBuffer(const Function& prefix) const +bool FragmentedSharedBuffer::startsWith(const std::span& prefix) const { if (prefix.empty()) return true; diff --git a/src/bun.js/bindings/webcore/SharedBuffer.h b/src/bun.js/bindings/webcore/SharedBuffer.h index 5c2e70486c..9cffa0badd 100644 --- a/src/bun.js/bindings/webcore/SharedBuffer.h +++ b/src/bun.js/bindings/webcore/SharedBuffer.h @@ -32,7 +32,7 @@ #include #include #include -#include +#include #include #include #include @@ -102,9 +102,9 @@ public: WEBCORE_EXPORT bool containsMappedFileData() const; private: - void iterate(const Function &)> &apply) const; + void iterate(const Function &)> &apply) const; #if USE(FOUNDATION) - void iterate(CFDataRef, const Function &)> &apply) const; + void iterate(CFDataRef, const Function &)> &apply) const; #endif explicit DataSegment(Vector &&data) @@ -197,8 +197,8 @@ public: WEBCORE_EXPORT void copyTo(void *destination, size_t length) const; WEBCORE_EXPORT void copyTo(void *destination, size_t offset, size_t length) const; - WEBCORE_EXPORT void forEachSegment(const Function &)> &) const; - WEBCORE_EXPORT bool startsWith(const Span &prefix) const; + WEBCORE_EXPORT void forEachSegment(const Function &)> &) const; + WEBCORE_EXPORT bool startsWith(const std::span &prefix) const; WEBCORE_EXPORT void forEachSegmentAsSharedBuffer(const Function &&)> &) const; using DataSegment = WebCore::DataSegment; // To keep backward compatibility when using FragmentedSharedBuffer::DataSegment @@ -253,7 +253,7 @@ private: friend class SharedBufferBuilder; WEBCORE_EXPORT void append(const FragmentedSharedBuffer &); WEBCORE_EXPORT void append(const uint8_t *, size_t); - void append(Span value) { append(value.data(), value.size()); } + void append(std::span value) { append(value.data(), value.size()); } void append(const char *data, size_t length) { append(reinterpret_cast(data), length); } WEBCORE_EXPORT void append(Vector &&); #if USE(FOUNDATION) @@ -296,7 +296,7 @@ public: WEBCORE_EXPORT const uint8_t *data() const; const char *dataAsCharPtr() const { return reinterpret_cast(data()); } - Span dataAsSpanForContiguousData() const { return Span(data(), isContiguous() ? size() : 0); } + std::span dataAsSpanForContiguousData() const { return std::span(data(), isContiguous() ? size() : 0); } WTF::Persistence::Decoder decoder() const; enum class MayUseFileMapping : bool { No, diff --git a/src/js/builtins/EventSource.ts b/src/js/builtins/EventSource.ts index 64179bc0df..a26c8d4ce2 100644 --- a/src/js/builtins/EventSource.ts +++ b/src/js/builtins/EventSource.ts @@ -135,7 +135,7 @@ export function getEventSource() { id = line.substring(3).trim(); } else if (line.startsWith("retry:")) { retry = parseInt(line.substring(6).trim(), 10); - if (isNaN(retry)) { + if (retry !== retry) { retry = -1; } } @@ -278,7 +278,7 @@ export function getEventSource() { header_name.localeCompare("content-length", undefined, { sensitivity: "accent" }) === 0; if (is_content_length) { content_length = parseInt(header.substring(header_name_idx + 1).trim(), 10); - if (isNaN(content_length) || content_length <= 0) { + if (content_length !== content_length || content_length <= 0) { self.dispatchEvent( new ErrorEvent("error", { error: new Error(`EventSource's Content-Length is invalid. Aborting the connection.`), diff --git a/src/js/builtins/ImportMetaObject.ts b/src/js/builtins/ImportMetaObject.ts index 934a378817..1f26695fcc 100644 --- a/src/js/builtins/ImportMetaObject.ts +++ b/src/js/builtins/ImportMetaObject.ts @@ -70,8 +70,10 @@ export function loadCJS2ESM(this: ImportMetaObject, resolvedSpecifier: string) { entry.dependencies = dependencies; // All dependencies resolved, set instantiate and satisfy field directly. - entry.instantiate = Promise.resolve(entry); - entry.satisfy = Promise.resolve(entry); + entry.instantiate = Promise.$resolve(entry); + entry.satisfy = Promise.$resolve(entry); + entry.isSatisfied = true; + key = queue.shift(); while (key && (loader.registry.$get(key)?.state ?? $ModuleFetch) >= $ModuleLink) { key = queue.shift(); diff --git a/src/js/builtins/JSBufferPrototype.ts b/src/js/builtins/JSBufferPrototype.ts index f5d6a7bfbf..a77d6be678 100644 --- a/src/js/builtins/JSBufferPrototype.ts +++ b/src/js/builtins/JSBufferPrototype.ts @@ -465,7 +465,7 @@ export function slice(this: BufferExt, start, end) { // Use Math.trunc() to convert offset to an integer value that can be larger // than an Int32. Hence, don't use offset | 0 or similar techniques. offset = $trunc(offset); - if (offset === 0 || isNaN(offset)) { + if (offset === 0 || offset !== offset) { return 0; } else if (offset < 0) { offset += length; diff --git a/src/js/builtins/ReadableByteStreamInternals.ts b/src/js/builtins/ReadableByteStreamInternals.ts index f44c385b45..1f1853ef4b 100644 --- a/src/js/builtins/ReadableByteStreamInternals.ts +++ b/src/js/builtins/ReadableByteStreamInternals.ts @@ -41,7 +41,7 @@ export function privateInitializeReadableByteStreamController(this, stream, unde $putByIdDirectPrivate(this, "closeRequested", false); let hwm = $toNumber(highWaterMark); - if (isNaN(hwm) || hwm < 0) throw new RangeError("highWaterMark value is negative or not a number"); + if (hwm !== hwm || hwm < 0) throw new RangeError("highWaterMark value is negative or not a number"); $putByIdDirectPrivate(this, "strategyHWM", hwm); let autoAllocateChunkSize = underlyingByteSource.autoAllocateChunkSize; @@ -372,7 +372,7 @@ export function readableByteStreamControllerRespondWithNewView(controller, view) export function readableByteStreamControllerRespond(controller, bytesWritten) { bytesWritten = $toNumber(bytesWritten); - if (isNaN(bytesWritten) || bytesWritten === Infinity || bytesWritten < 0) + if (bytesWritten !== bytesWritten || bytesWritten === Infinity || bytesWritten < 0) throw new RangeError("bytesWritten has an incorrect value"); $assert($getByIdDirectPrivate(controller, "pendingPullIntos").isNotEmpty()); diff --git a/src/js/builtins/ReadableStreamBYOBReader.ts b/src/js/builtins/ReadableStreamBYOBReader.ts index 5ebfddb19b..62a04d8a3d 100644 --- a/src/js/builtins/ReadableStreamBYOBReader.ts +++ b/src/js/builtins/ReadableStreamBYOBReader.ts @@ -76,5 +76,5 @@ export function closed(this) { if (!$isReadableStreamBYOBReader(this)) return Promise.$reject($makeGetterTypeError("ReadableStreamBYOBReader", "closed")); - return $getByIdDirectPrivate(this, "closedPromiseCapability").$promise; + return $getByIdDirectPrivate(this, "closedPromiseCapability").promise; } diff --git a/src/js/builtins/ReadableStreamDefaultReader.ts b/src/js/builtins/ReadableStreamDefaultReader.ts index a5654d834a..b4e0c2bd32 100644 --- a/src/js/builtins/ReadableStreamDefaultReader.ts +++ b/src/js/builtins/ReadableStreamDefaultReader.ts @@ -181,5 +181,5 @@ export function closed(this) { if (!$isReadableStreamDefaultReader(this)) return Promise.$reject($makeGetterTypeError("ReadableStreamDefaultReader", "closed")); - return $getByIdDirectPrivate(this, "closedPromiseCapability").$promise; + return $getByIdDirectPrivate(this, "closedPromiseCapability").promise; } diff --git a/src/js/builtins/ReadableStreamInternals.ts b/src/js/builtins/ReadableStreamInternals.ts index 3bcf4f3995..58fa4524a9 100644 --- a/src/js/builtins/ReadableStreamInternals.ts +++ b/src/js/builtins/ReadableStreamInternals.ts @@ -34,12 +34,12 @@ export function readableStreamReaderGenericInitialize(reader, stream) { $putByIdDirectPrivate(reader, "closedPromiseCapability", $newPromiseCapability(Promise)); else if ($getByIdDirectPrivate(stream, "state") === $streamClosed) $putByIdDirectPrivate(reader, "closedPromiseCapability", { - $promise: Promise.$resolve(), + promise: Promise.$resolve(), }); else { $assert($getByIdDirectPrivate(stream, "state") === $streamErrored); $putByIdDirectPrivate(reader, "closedPromiseCapability", { - $promise: $newHandledRejectedPromise($getByIdDirectPrivate(stream, "storedError")), + promise: $newHandledRejectedPromise($getByIdDirectPrivate(stream, "storedError")), }); } } @@ -76,7 +76,7 @@ export function readableStreamPipeTo(stream, sink) { const reader = new ReadableStreamDefaultReader(stream); - $getByIdDirectPrivate(reader, "closedPromiseCapability").$promise.$then( + $getByIdDirectPrivate(reader, "closedPromiseCapability").promise.$then( () => {}, e => { sink.error(e); @@ -249,7 +249,7 @@ export function readableStreamPipeToWritableStream( pipeState.shuttingDown = false; pipeState.promiseCapability = $newPromiseCapability(Promise); pipeState.pendingReadPromiseCapability = $newPromiseCapability(Promise); - pipeState.pendingReadPromiseCapability.$resolve.$call(); + pipeState.pendingReadPromiseCapability.resolve.$call(); pipeState.pendingWritePromise = Promise.$resolve(); if (signal !== undefined) { @@ -278,19 +278,19 @@ export function readableStreamPipeToWritableStream( shouldWait = false; return; } - promiseCapability.$resolve.$call(); + promiseCapability.resolve.$call(); }; let handleRejectedPromise = e => { - promiseCapability.$reject.$call(undefined, e); + promiseCapability.reject.$call(undefined, e); }; promiseDestination.$then(handleResolvedPromise, handleRejectedPromise); promiseSource.$then(handleResolvedPromise, handleRejectedPromise); - return promiseCapability.$promise; + return promiseCapability.promise; }, reason, ); }; - if ($whenSignalAborted(signal, algorithm)) return pipeState.promiseCapability.$promise; + if ($whenSignalAborted(signal, algorithm)) return pipeState.promiseCapability.promise; } $pipeToErrorsMustBePropagatedForward(pipeState); @@ -300,7 +300,7 @@ export function readableStreamPipeToWritableStream( $pipeToLoop(pipeState); - return pipeState.promiseCapability.$promise; + return pipeState.promiseCapability.promise; } export function pipeToLoop(pipeState) { @@ -315,36 +315,36 @@ export function pipeToDoReadWrite(pipeState) { $assert(!pipeState.shuttingDown); pipeState.pendingReadPromiseCapability = $newPromiseCapability(Promise); - $getByIdDirectPrivate(pipeState.writer, "readyPromise").$promise.$then( + $getByIdDirectPrivate(pipeState.writer, "readyPromise").promise.$then( () => { if (pipeState.shuttingDown) { - pipeState.pendingReadPromiseCapability.$resolve.$call(undefined, false); + pipeState.pendingReadPromiseCapability.resolve.$call(undefined, false); return; } $readableStreamDefaultReaderRead(pipeState.reader).$then( result => { const canWrite = !result.done && $getByIdDirectPrivate(pipeState.writer, "stream") !== undefined; - pipeState.pendingReadPromiseCapability.$resolve.$call(undefined, canWrite); + pipeState.pendingReadPromiseCapability.resolve.$call(undefined, canWrite); if (!canWrite) return; pipeState.pendingWritePromise = $writableStreamDefaultWriterWrite(pipeState.writer, result.value); }, e => { - pipeState.pendingReadPromiseCapability.$resolve.$call(undefined, false); + pipeState.pendingReadPromiseCapability.resolve.$call(undefined, false); }, ); }, e => { - pipeState.pendingReadPromiseCapability.$resolve.$call(undefined, false); + pipeState.pendingReadPromiseCapability.resolve.$call(undefined, false); }, ); - return pipeState.pendingReadPromiseCapability.$promise; + return pipeState.pendingReadPromiseCapability.promise; } export function pipeToErrorsMustBePropagatedForward(pipeState) { const action = () => { - pipeState.pendingReadPromiseCapability.$resolve.$call(undefined, false); + pipeState.pendingReadPromiseCapability.resolve.$call(undefined, false); const error = $getByIdDirectPrivate(pipeState.source, "storedError"); if (!pipeState.preventAbort) { $pipeToShutdownWithAction(pipeState, () => $writableStreamAbort(pipeState.destination, error), error); @@ -358,7 +358,7 @@ export function pipeToErrorsMustBePropagatedForward(pipeState) { return; } - $getByIdDirectPrivate(pipeState.reader, "closedPromiseCapability").$promise.$then(undefined, action); + $getByIdDirectPrivate(pipeState.reader, "closedPromiseCapability").promise.$then(undefined, action); } export function pipeToErrorsMustBePropagatedBackward(pipeState) { @@ -374,12 +374,12 @@ export function pipeToErrorsMustBePropagatedBackward(pipeState) { action(); return; } - $getByIdDirectPrivate(pipeState.writer, "closedPromise").$promise.$then(undefined, action); + $getByIdDirectPrivate(pipeState.writer, "closedPromise").promise.$then(undefined, action); } export function pipeToClosingMustBePropagatedForward(pipeState) { const action = () => { - pipeState.pendingReadPromiseCapability.$resolve.$call(undefined, false); + pipeState.pendingReadPromiseCapability.resolve.$call(undefined, false); // const error = $getByIdDirectPrivate(pipeState.source, "storedError"); if (!pipeState.preventClose) { $pipeToShutdownWithAction(pipeState, () => @@ -393,7 +393,7 @@ export function pipeToClosingMustBePropagatedForward(pipeState) { action(); return; } - $getByIdDirectPrivate(pipeState.reader, "closedPromiseCapability").$promise.$then(action, undefined); + $getByIdDirectPrivate(pipeState.reader, "closedPromiseCapability").promise.$then(action, undefined); } export function pipeToClosingMustBePropagatedBackward(pipeState) { @@ -437,7 +437,7 @@ export function pipeToShutdownWithAction(pipeState, action) { $getByIdDirectPrivate(pipeState.destination, "state") === "writable" && !$writableStreamCloseQueuedOrInFlight(pipeState.destination) ) { - pipeState.pendingReadPromiseCapability.$promise.$then( + pipeState.pendingReadPromiseCapability.promise.$then( () => { pipeState.pendingWritePromise.$then(finalize, finalize); }, @@ -465,7 +465,7 @@ export function pipeToShutdown(pipeState) { $getByIdDirectPrivate(pipeState.destination, "state") === "writable" && !$writableStreamCloseQueuedOrInFlight(pipeState.destination) ) { - pipeState.pendingReadPromiseCapability.$promise.$then( + pipeState.pendingReadPromiseCapability.promise.$then( () => { pipeState.pendingWritePromise.$then(finalize, finalize); }, @@ -483,8 +483,8 @@ export function pipeToFinalize(pipeState) { // Instead of removing the abort algorithm as per spec, we make it a no-op which is equivalent. pipeState.finalized = true; - if (arguments.length > 1) pipeState.promiseCapability.$reject.$call(undefined, arguments[1]); - else pipeState.promiseCapability.$resolve.$call(); + if (arguments.length > 1) pipeState.promiseCapability.reject.$call(undefined, arguments[1]); + else pipeState.promiseCapability.resolve.$call(); } export function readableStreamTee(stream, shouldClone) { @@ -522,12 +522,12 @@ export function readableStreamTee(stream, shouldClone) { const branch1 = new $ReadableStream(branch1Source); const branch2 = new $ReadableStream(branch2Source); - $getByIdDirectPrivate(reader, "closedPromiseCapability").$promise.$then(undefined, function (e) { + $getByIdDirectPrivate(reader, "closedPromiseCapability").promise.$then(undefined, function (e) { if (teeState.closedOrErrored) return; $readableStreamDefaultControllerError(branch1.$readableStreamController, e); $readableStreamDefaultControllerError(branch2.$readableStreamController, e); teeState.closedOrErrored = true; - if (!teeState.canceled1 || !teeState.canceled2) teeState.cancelPromiseCapability.$resolve.$call(); + if (!teeState.canceled1 || !teeState.canceled2) teeState.cancelPromiseCapability.resolve.$call(); }); // Additional fields compared to the spec, as they are needed within pull/cancel functions. @@ -546,7 +546,7 @@ export function readableStreamTeePullFunction(teeState, reader, shouldClone) { if (!teeState.canceled1) $readableStreamDefaultControllerClose(teeState.branch1.$readableStreamController); if (!teeState.canceled2) $readableStreamDefaultControllerClose(teeState.branch2.$readableStreamController); teeState.closedOrErrored = true; - if (!teeState.canceled1 || !teeState.canceled2) teeState.cancelPromiseCapability.$resolve.$call(); + if (!teeState.canceled1 || !teeState.canceled2) teeState.cancelPromiseCapability.resolve.$call(); } if (teeState.closedOrErrored) return; if (!teeState.canceled1) @@ -570,7 +570,7 @@ export function readableStreamTeeBranch1CancelFunction(teeState, stream) { teeState.cancelPromiseCapability.$reject, ); } - return teeState.cancelPromiseCapability.$promise; + return teeState.cancelPromiseCapability.promise; }; } @@ -584,7 +584,7 @@ export function readableStreamTeeBranch2CancelFunction(teeState, stream) { teeState.cancelPromiseCapability.$reject, ); } - return teeState.cancelPromiseCapability.$promise; + return teeState.cancelPromiseCapability.promise; }; } @@ -1059,7 +1059,7 @@ export function createTextStream(highWaterMark) { calledDone = true; const result = sink.finishInternal(); - $fulfillPromise(capability.$promise, result); + $fulfillPromise(capability.promise, result); return result; }, @@ -1143,7 +1143,7 @@ export function initializeArrayStream(underlyingSource, highWaterMark) { function fulfill() { calledDone = true; - closingPromise.$resolve.$call(undefined, array); + closingPromise.resolve.$call(undefined, array); return array; } @@ -1252,8 +1252,8 @@ export function readableStreamError(stream, error) { for (var request = requests.shift(); request; request = requests.shift()) $rejectPromise(request, error); } - $getByIdDirectPrivate(reader, "closedPromiseCapability").$reject.$call(undefined, error); - const promise = $getByIdDirectPrivate(reader, "closedPromiseCapability").$promise; + $getByIdDirectPrivate(reader, "closedPromiseCapability").reject.$call(undefined, error); + const promise = $getByIdDirectPrivate(reader, "closedPromiseCapability").promise; $markPromiseAsHandled(promise); } @@ -1395,7 +1395,7 @@ export function readableStreamClose(stream) { } } - $getByIdDirectPrivate($getByIdDirectPrivate(stream, "reader"), "closedPromiseCapability").$resolve.$call(); + $getByIdDirectPrivate($getByIdDirectPrivate(stream, "reader"), "closedPromiseCapability").resolve.$call(); } export function readableStreamFulfillReadRequest(stream, chunk, done) { @@ -1465,16 +1465,16 @@ export function readableStreamReaderGenericRelease(reader) { $assert($getByIdDirectPrivate($getByIdDirectPrivate(reader, "ownerReadableStream"), "reader") === reader); if ($getByIdDirectPrivate($getByIdDirectPrivate(reader, "ownerReadableStream"), "state") === $streamReadable) - $getByIdDirectPrivate(reader, "closedPromiseCapability").$reject.$call( + $getByIdDirectPrivate(reader, "closedPromiseCapability").reject.$call( undefined, $makeTypeError("releasing lock of reader whose stream is still in readable state"), ); else $putByIdDirectPrivate(reader, "closedPromiseCapability", { - $promise: $newHandledRejectedPromise($makeTypeError("reader released lock")), + promise: $newHandledRejectedPromise($makeTypeError("reader released lock")), }); - const promise = $getByIdDirectPrivate(reader, "closedPromiseCapability").$promise; + const promise = $getByIdDirectPrivate(reader, "closedPromiseCapability").promise; $markPromiseAsHandled(promise); $putByIdDirectPrivate($getByIdDirectPrivate(reader, "ownerReadableStream"), "reader", undefined); $putByIdDirectPrivate(reader, "ownerReadableStream", undefined); @@ -1668,9 +1668,9 @@ export function readableStreamIntoText(stream) { const [textStream, closer] = $createTextStream($getByIdDirectPrivate(stream, "highWaterMark")); const prom = $readStreamIntoSink(stream, textStream, false); if (prom && $isPromise(prom)) { - return Promise.$resolve(prom).$then(closer.$promise); + return Promise.$resolve(prom).$then(closer.promise); } - return closer.$promise; + return closer.promise; } export function readableStreamToArrayBufferDirect(stream, underlyingSource) { @@ -1692,7 +1692,7 @@ export function readableStreamToArrayBufferDirect(stream, underlyingSource) { close(); } - $fulfillPromise(capability.$promise, sink.end()); + $fulfillPromise(capability.promise, sink.end()); } }, end() { @@ -1701,7 +1701,7 @@ export function readableStreamToArrayBufferDirect(stream, underlyingSource) { if (close) { close(); } - $fulfillPromise(capability.$promise, sink.end()); + $fulfillPromise(capability.promise, sink.end()); } }, flush() { @@ -1722,7 +1722,7 @@ export function readableStreamToArrayBufferDirect(stream, underlyingSource) { })(controller, promise, pull); } - return capability.$promise; + return capability.promise; } catch (e) { didError = true; $readableStreamError(stream, e); @@ -1750,7 +1750,7 @@ export async function readableStreamToTextDirect(stream, underlyingSource) { reader = undefined; stream = undefined; - return capability.$promise; + return capability.promise; } export async function readableStreamToArrayDirect(stream, underlyingSource) { @@ -1770,7 +1770,7 @@ export async function readableStreamToArrayDirect(stream, underlyingSource) { } catch (e) {} reader = undefined; - return Promise.$resolve(capability.$promise); + return Promise.$resolve(capability.promise); } catch (e) { throw e; } finally { diff --git a/src/js/builtins/StreamInternals.ts b/src/js/builtins/StreamInternals.ts index 7bb2629517..34b681f1e7 100644 --- a/src/js/builtins/StreamInternals.ts +++ b/src/js/builtins/StreamInternals.ts @@ -81,7 +81,7 @@ export function validateAndNormalizeQueuingStrategy(size, highWaterMark) { const newHighWaterMark = $toNumber(highWaterMark); - if (isNaN(newHighWaterMark) || newHighWaterMark < 0) + if (newHighWaterMark !== newHighWaterMark || newHighWaterMark < 0) throw new RangeError("highWaterMark value is negative or not a number"); return { size: size, highWaterMark: newHighWaterMark }; @@ -241,7 +241,7 @@ export function extractHighWaterMark(strategy, defaultHWM) { if (highWaterMark === undefined) return defaultHWM; - if (isNaN(highWaterMark) || highWaterMark < 0) + if (highWaterMark !== highWaterMark || highWaterMark < 0) throw new RangeError("highWaterMark value is negative or not a number"); return $toNumber(highWaterMark); diff --git a/src/js/builtins/TransformStream.ts b/src/js/builtins/TransformStream.ts index 2a124d4e16..f9d80b7cbd 100644 --- a/src/js/builtins/TransformStream.ts +++ b/src/js/builtins/TransformStream.ts @@ -68,7 +68,7 @@ export function initializeTransformStream(this) { const startPromiseCapability = $newPromiseCapability(Promise); $initializeTransformStream( this, - startPromiseCapability.$promise, + startPromiseCapability.promise, writableHighWaterMark, writableSizeAlgorithm, readableHighWaterMark, @@ -82,13 +82,13 @@ export function initializeTransformStream(this) { startAlgorithm().$then( () => { // FIXME: We probably need to resolve start promise with the result of the start algorithm. - startPromiseCapability.$resolve.$call(); + startPromiseCapability.resolve.$call(); }, error => { - startPromiseCapability.$reject.$call(undefined, error); + startPromiseCapability.reject.$call(undefined, error); }, ); - } else startPromiseCapability.$resolve.$call(); + } else startPromiseCapability.resolve.$call(); return this; } diff --git a/src/js/builtins/TransformStreamInternals.ts b/src/js/builtins/TransformStreamInternals.ts index 9da403e715..103b0651f4 100644 --- a/src/js/builtins/TransformStreamInternals.ts +++ b/src/js/builtins/TransformStreamInternals.ts @@ -57,7 +57,7 @@ export function createTransformStream( const startPromiseCapability = $newPromiseCapability(Promise); $initializeTransformStream( stream, - startPromiseCapability.$promise, + startPromiseCapability.promise, writableHighWaterMark, writableSizeAlgorithm, readableHighWaterMark, @@ -69,10 +69,10 @@ export function createTransformStream( startAlgorithm().$then( () => { - startPromiseCapability.$resolve.$call(); + startPromiseCapability.resolve.$call(); }, error => { - startPromiseCapability.$reject.$call(undefined, error); + startPromiseCapability.reject.$call(undefined, error); }, ); @@ -158,7 +158,7 @@ export function transformStreamSetBackpressure(stream, backpressure) { $assert($getByIdDirectPrivate(stream, "backpressure") !== backpressure); const backpressureChangePromise = $getByIdDirectPrivate(stream, "backpressureChangePromise"); - if (backpressureChangePromise !== undefined) backpressureChangePromise.$resolve.$call(); + if (backpressureChangePromise !== undefined) backpressureChangePromise.resolve.$call(); $putByIdDirectPrivate(stream, "backpressureChangePromise", $newPromiseCapability(Promise)); $putByIdDirectPrivate(stream, "backpressure", backpressure); @@ -245,10 +245,10 @@ export function transformStreamDefaultControllerPerformTransform(controller, chu }, r => { $transformStreamError($getByIdDirectPrivate(controller, "stream"), r); - promiseCapability.$reject.$call(undefined, r); + promiseCapability.reject.$call(undefined, r); }, ); - return promiseCapability.$promise; + return promiseCapability.promise; } export function transformStreamDefaultControllerTerminate(controller) { @@ -275,11 +275,11 @@ export function transformStreamDefaultSinkWriteAlgorithm(stream, chunk) { const backpressureChangePromise = $getByIdDirectPrivate(stream, "backpressureChangePromise"); $assert(backpressureChangePromise !== undefined); - backpressureChangePromise.$promise.$then( + backpressureChangePromise.promise.$then( () => { const state = $getByIdDirectPrivate(writable, "state"); if (state === "erroring") { - promiseCapability.$reject.$call(undefined, $getByIdDirectPrivate(writable, "storedError")); + promiseCapability.reject.$call(undefined, $getByIdDirectPrivate(writable, "storedError")); return; } @@ -289,16 +289,16 @@ export function transformStreamDefaultSinkWriteAlgorithm(stream, chunk) { promiseCapability.$resolve(); }, e => { - promiseCapability.$reject.$call(undefined, e); + promiseCapability.reject.$call(undefined, e); }, ); }, e => { - promiseCapability.$reject.$call(undefined, e); + promiseCapability.reject.$call(undefined, e); }, ); - return promiseCapability.$promise; + return promiseCapability.promise; } return $transformStreamDefaultControllerPerformTransform(controller, chunk); } @@ -322,7 +322,7 @@ export function transformStreamDefaultSinkCloseAlgorithm(stream) { flushPromise.$then( () => { if ($getByIdDirectPrivate(readable, "state") === $streamErrored) { - promiseCapability.$reject.$call(undefined, $getByIdDirectPrivate(readable, "storedError")); + promiseCapability.reject.$call(undefined, $getByIdDirectPrivate(readable, "storedError")); return; } @@ -333,10 +333,10 @@ export function transformStreamDefaultSinkCloseAlgorithm(stream) { }, r => { $transformStreamError($getByIdDirectPrivate(controller, "stream"), r); - promiseCapability.$reject.$call(undefined, $getByIdDirectPrivate(readable, "storedError")); + promiseCapability.reject.$call(undefined, $getByIdDirectPrivate(readable, "storedError")); }, ); - return promiseCapability.$promise; + return promiseCapability.promise; } export function transformStreamDefaultSourcePullAlgorithm(stream) { @@ -345,5 +345,5 @@ export function transformStreamDefaultSourcePullAlgorithm(stream) { $transformStreamSetBackpressure(stream, false); - return $getByIdDirectPrivate(stream, "backpressureChangePromise").$promise; + return $getByIdDirectPrivate(stream, "backpressureChangePromise").promise; } diff --git a/src/js/builtins/WritableStreamDefaultWriter.ts b/src/js/builtins/WritableStreamDefaultWriter.ts index 50b2cd13fc..ff3f38f006 100644 --- a/src/js/builtins/WritableStreamDefaultWriter.ts +++ b/src/js/builtins/WritableStreamDefaultWriter.ts @@ -41,7 +41,7 @@ export function closed() { if (!$isWritableStreamDefaultWriter(this)) return Promise.$reject($makeGetterTypeError("WritableStreamDefaultWriter", "closed")); - return $getByIdDirectPrivate(this, "closedPromise").$promise; + return $getByIdDirectPrivate(this, "closedPromise").promise; } $getter; @@ -58,7 +58,7 @@ export function ready() { if (!$isWritableStreamDefaultWriter(this)) return Promise.$reject($makeThisTypeError("WritableStreamDefaultWriter", "ready")); - return $getByIdDirectPrivate(this, "readyPromise").$promise; + return $getByIdDirectPrivate(this, "readyPromise").promise; } export function abort(reason) { diff --git a/src/js/builtins/WritableStreamInternals.ts b/src/js/builtins/WritableStreamInternals.ts index 2008dab1c5..e14c5dee35 100644 --- a/src/js/builtins/WritableStreamInternals.ts +++ b/src/js/builtins/WritableStreamInternals.ts @@ -47,7 +47,7 @@ export function createWritableStream( highWaterMark, sizeAlgorithm, ) { - $assert(typeof highWaterMark === "number" && !isNaN(highWaterMark) && highWaterMark >= 0); + $assert(typeof highWaterMark === "number" && highWaterMark === highWaterMark && highWaterMark >= 0); const internalStream = {}; $initializeWritableStreamSlots(internalStream, {}); @@ -162,20 +162,20 @@ export function setUpWritableStreamDefaultWriter(writer, stream) { const state = $getByIdDirectPrivate(stream, "state"); if (state === "writable") { if ($writableStreamCloseQueuedOrInFlight(stream) || !$getByIdDirectPrivate(stream, "backpressure")) - readyPromiseCapability.$resolve.$call(); + readyPromiseCapability.resolve.$call(); } else if (state === "erroring") { - readyPromiseCapability.$reject.$call(undefined, $getByIdDirectPrivate(stream, "storedError")); - $markPromiseAsHandled(readyPromiseCapability.$promise); + readyPromiseCapability.reject.$call(undefined, $getByIdDirectPrivate(stream, "storedError")); + $markPromiseAsHandled(readyPromiseCapability.promise); } else if (state === "closed") { - readyPromiseCapability.$resolve.$call(); - closedPromiseCapability.$resolve.$call(); + readyPromiseCapability.resolve.$call(); + closedPromiseCapability.resolve.$call(); } else { $assert(state === "errored"); const storedError = $getByIdDirectPrivate(stream, "storedError"); - readyPromiseCapability.$reject.$call(undefined, storedError); - $markPromiseAsHandled(readyPromiseCapability.$promise); - closedPromiseCapability.$reject.$call(undefined, storedError); - $markPromiseAsHandled(closedPromiseCapability.$promise); + readyPromiseCapability.reject.$call(undefined, storedError); + $markPromiseAsHandled(readyPromiseCapability.promise); + closedPromiseCapability.reject.$call(undefined, storedError); + $markPromiseAsHandled(closedPromiseCapability.promise); } } @@ -184,7 +184,7 @@ export function writableStreamAbort(stream, reason) { if (state === "closed" || state === "errored") return Promise.$resolve(); const pendingAbortRequest = $getByIdDirectPrivate(stream, "pendingAbortRequest"); - if (pendingAbortRequest !== undefined) return pendingAbortRequest.promise.$promise; + if (pendingAbortRequest !== undefined) return pendingAbortRequest.promise.promise; $assert(state === "writable" || state === "erroring"); let wasAlreadyErroring = false; @@ -201,7 +201,7 @@ export function writableStreamAbort(stream, reason) { }); if (!wasAlreadyErroring) $writableStreamStartErroring(stream, reason); - return abortPromiseCapability.$promise; + return abortPromiseCapability.promise; } export function writableStreamClose(stream) { @@ -217,11 +217,11 @@ export function writableStreamClose(stream) { const writer = $getByIdDirectPrivate(stream, "writer"); if (writer !== undefined && $getByIdDirectPrivate(stream, "backpressure") && state === "writable") - $getByIdDirectPrivate(writer, "readyPromise").$resolve.$call(); + $getByIdDirectPrivate(writer, "readyPromise").resolve.$call(); $writableStreamDefaultControllerClose($getByIdDirectPrivate(stream, "controller")); - return closePromiseCapability.$promise; + return closePromiseCapability.promise; } export function writableStreamAddWriteRequest(stream) { @@ -231,7 +231,7 @@ export function writableStreamAddWriteRequest(stream) { const writePromiseCapability = $newPromiseCapability(Promise); const writeRequests = $getByIdDirectPrivate(stream, "writeRequests"); writeRequests.push(writePromiseCapability); - return writePromiseCapability.$promise; + return writePromiseCapability.promise; } export function writableStreamCloseQueuedOrInFlight(stream) { @@ -264,7 +264,7 @@ export function writableStreamFinishErroring(stream) { const storedError = $getByIdDirectPrivate(stream, "storedError"); const requests = $getByIdDirectPrivate(stream, "writeRequests"); for (var request = requests.shift(); request; request = requests.shift()) - request.$reject.$call(undefined, storedError); + request.reject.$call(undefined, storedError); // TODO: is this still necessary? $putByIdDirectPrivate(stream, "writeRequests", $createFIFO()); @@ -277,7 +277,7 @@ export function writableStreamFinishErroring(stream) { $putByIdDirectPrivate(stream, "pendingAbortRequest", undefined); if (abortRequest.wasAlreadyErroring) { - abortRequest.promise.$reject.$call(undefined, storedError); + abortRequest.promise.reject.$call(undefined, storedError); $writableStreamRejectCloseAndClosedPromiseIfNeeded(stream); return; } @@ -286,11 +286,11 @@ export function writableStreamFinishErroring(stream) { .$call(undefined, abortRequest.reason) .$then( () => { - abortRequest.promise.$resolve.$call(); + abortRequest.promise.resolve.$call(); $writableStreamRejectCloseAndClosedPromiseIfNeeded(stream); }, reason => { - abortRequest.promise.$reject.$call(undefined, reason); + abortRequest.promise.reject.$call(undefined, reason); $writableStreamRejectCloseAndClosedPromiseIfNeeded(stream); }, ); @@ -298,7 +298,7 @@ export function writableStreamFinishErroring(stream) { export function writableStreamFinishInFlightClose(stream) { const inFlightCloseRequest = $getByIdDirectPrivate(stream, "inFlightCloseRequest"); - inFlightCloseRequest.$resolve.$call(); + inFlightCloseRequest.resolve.$call(); $putByIdDirectPrivate(stream, "inFlightCloseRequest", undefined); @@ -309,7 +309,7 @@ export function writableStreamFinishInFlightClose(stream) { $putByIdDirectPrivate(stream, "storedError", undefined); const abortRequest = $getByIdDirectPrivate(stream, "pendingAbortRequest"); if (abortRequest !== undefined) { - abortRequest.promise.$resolve.$call(); + abortRequest.promise.resolve.$call(); $putByIdDirectPrivate(stream, "pendingAbortRequest", undefined); } } @@ -317,7 +317,7 @@ export function writableStreamFinishInFlightClose(stream) { $putByIdDirectPrivate(stream, "state", "closed"); const writer = $getByIdDirectPrivate(stream, "writer"); - if (writer !== undefined) $getByIdDirectPrivate(writer, "closedPromise").$resolve.$call(); + if (writer !== undefined) $getByIdDirectPrivate(writer, "closedPromise").resolve.$call(); $assert($getByIdDirectPrivate(stream, "pendingAbortRequest") === undefined); $assert($getByIdDirectPrivate(stream, "storedError") === undefined); @@ -326,7 +326,7 @@ export function writableStreamFinishInFlightClose(stream) { export function writableStreamFinishInFlightCloseWithError(stream, error) { const inFlightCloseRequest = $getByIdDirectPrivate(stream, "inFlightCloseRequest"); $assert(inFlightCloseRequest !== undefined); - inFlightCloseRequest.$reject.$call(undefined, error); + inFlightCloseRequest.reject.$call(undefined, error); $putByIdDirectPrivate(stream, "inFlightCloseRequest", undefined); @@ -335,7 +335,7 @@ export function writableStreamFinishInFlightCloseWithError(stream, error) { const abortRequest = $getByIdDirectPrivate(stream, "pendingAbortRequest"); if (abortRequest !== undefined) { - abortRequest.promise.$reject.$call(undefined, error); + abortRequest.promise.reject.$call(undefined, error); $putByIdDirectPrivate(stream, "pendingAbortRequest", undefined); } @@ -345,7 +345,7 @@ export function writableStreamFinishInFlightCloseWithError(stream, error) { export function writableStreamFinishInFlightWrite(stream) { const inFlightWriteRequest = $getByIdDirectPrivate(stream, "inFlightWriteRequest"); $assert(inFlightWriteRequest !== undefined); - inFlightWriteRequest.$resolve.$call(); + inFlightWriteRequest.resolve.$call(); $putByIdDirectPrivate(stream, "inFlightWriteRequest", undefined); } @@ -353,7 +353,7 @@ export function writableStreamFinishInFlightWrite(stream) { export function writableStreamFinishInFlightWriteWithError(stream, error) { const inFlightWriteRequest = $getByIdDirectPrivate(stream, "inFlightWriteRequest"); $assert(inFlightWriteRequest !== undefined); - inFlightWriteRequest.$reject.$call(undefined, error); + inFlightWriteRequest.reject.$call(undefined, error); $putByIdDirectPrivate(stream, "inFlightWriteRequest", undefined); @@ -396,15 +396,15 @@ export function writableStreamRejectCloseAndClosedPromiseIfNeeded(stream) { const closeRequest = $getByIdDirectPrivate(stream, "closeRequest"); if (closeRequest !== undefined) { $assert($getByIdDirectPrivate(stream, "inFlightCloseRequest") === undefined); - closeRequest.$reject.$call(undefined, storedError); + closeRequest.reject.$call(undefined, storedError); $putByIdDirectPrivate(stream, "closeRequest", undefined); } const writer = $getByIdDirectPrivate(stream, "writer"); if (writer !== undefined) { const closedPromise = $getByIdDirectPrivate(writer, "closedPromise"); - closedPromise.$reject.$call(undefined, storedError); - $markPromiseAsHandled(closedPromise.$promise); + closedPromise.reject.$call(undefined, storedError); + $markPromiseAsHandled(closedPromise.promise); } } @@ -432,7 +432,7 @@ export function writableStreamUpdateBackpressure(stream, backpressure) { const writer = $getByIdDirectPrivate(stream, "writer"); if (writer !== undefined && backpressure !== $getByIdDirectPrivate(stream, "backpressure")) { if (backpressure) $putByIdDirectPrivate(writer, "readyPromise", $newPromiseCapability(Promise)); - else $getByIdDirectPrivate(writer, "readyPromise").$resolve.$call(); + else $getByIdDirectPrivate(writer, "readyPromise").resolve.$call(); } $putByIdDirectPrivate(stream, "backpressure", backpressure); } @@ -465,29 +465,29 @@ export function writableStreamDefaultWriterCloseWithErrorPropagation(writer) { export function writableStreamDefaultWriterEnsureClosedPromiseRejected(writer, error) { let closedPromiseCapability = $getByIdDirectPrivate(writer, "closedPromise"); - let closedPromise = closedPromiseCapability.$promise; + let closedPromise = closedPromiseCapability.promise; if (($getPromiseInternalField(closedPromise, $promiseFieldFlags) & $promiseStateMask) !== $promiseStatePending) { closedPromiseCapability = $newPromiseCapability(Promise); - closedPromise = closedPromiseCapability.$promise; + closedPromise = closedPromiseCapability.promise; $putByIdDirectPrivate(writer, "closedPromise", closedPromiseCapability); } - closedPromiseCapability.$reject.$call(undefined, error); + closedPromiseCapability.reject.$call(undefined, error); $markPromiseAsHandled(closedPromise); } export function writableStreamDefaultWriterEnsureReadyPromiseRejected(writer, error) { let readyPromiseCapability = $getByIdDirectPrivate(writer, "readyPromise"); - let readyPromise = readyPromiseCapability.$promise; + let readyPromise = readyPromiseCapability.promise; if (($getPromiseInternalField(readyPromise, $promiseFieldFlags) & $promiseStateMask) !== $promiseStatePending) { readyPromiseCapability = $newPromiseCapability(Promise); - readyPromise = readyPromiseCapability.$promise; + readyPromise = readyPromiseCapability.promise; $putByIdDirectPrivate(writer, "readyPromise", readyPromiseCapability); } - readyPromiseCapability.$reject.$call(undefined, error); + readyPromiseCapability.reject.$call(undefined, error); $markPromiseAsHandled(readyPromise); } diff --git a/src/js/builtins/codegen/replacements.ts b/src/js/builtins/codegen/replacements.ts index 05c81b901a..87157a587d 100644 --- a/src/js/builtins/codegen/replacements.ts +++ b/src/js/builtins/codegen/replacements.ts @@ -45,7 +45,6 @@ export const globalsToPrefix = [ "WritableStreamDefaultController", "WritableStreamDefaultWriter", "isFinite", - "isNaN", "undefined", ]; diff --git a/src/js/out/WebCoreJSBuiltins.cpp b/src/js/out/WebCoreJSBuiltins.cpp index 395d2d8bd9..76a242bf7d 100644 --- a/src/js/out/WebCoreJSBuiltins.cpp +++ b/src/js/out/WebCoreJSBuiltins.cpp @@ -16,7 +16,7 @@ const JSC::ConstructorKind s_bundlerPluginRunSetupFunctionCodeConstructorKind = const JSC::ImplementationVisibility s_bundlerPluginRunSetupFunctionCodeImplementationVisibility = JSC::ImplementationVisibility::Public; const int s_bundlerPluginRunSetupFunctionCodeLength = 2165; static const JSC::Intrinsic s_bundlerPluginRunSetupFunctionCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_bundlerPluginRunSetupFunctionCode = "(function (J,_){\"use strict\";var D=new Map,F=new Map;function H(q,h,E){if(!q||!@isObject(q))@throwTypeError('Expected an object with \"filter\" RegExp');if(!h||!@isCallable(h))@throwTypeError(\"callback must be a function\");var{filter:w,namespace:z=\"file\"}=q;if(!w)@throwTypeError('Expected an object with \"filter\" RegExp');if(!@isRegExpObject(w))@throwTypeError(\"filter must be a RegExp\");if(z&&typeof z!==\"string\")@throwTypeError(\"namespace must be a string\");if((z\?.length\?\?0)===0)z=\"file\";if(!/^([/@a-zA-Z0-9_\\\\-]+)$/.test(z))@throwTypeError(\"namespace can only contain $a-zA-Z0-9_\\\\-\");var A=E.@get(z);if(!A)E.@set(z,[[w,h]]);else @arrayPush(A,[w,h])}function K(q,h){H(q,h,D)}function M(q,h){H(q,h,F)}const I=()=>{var q=!1,h=!1;for(var[E,w]of D.entries())for(var[z]of w)this.addFilter(z,E,1),q=!0;for(var[E,w]of F.entries())for(var[z]of w)this.addFilter(z,E,0),h=!0;if(h){var A=this.onResolve;if(!A)this.onResolve=F;else for(var[E,w]of F.entries()){var C=A.@get(E);if(!C)A.@set(E,w);else A.@set(E,C.concat(w))}}if(q){var G=this.onLoad;if(!G)this.onLoad=D;else for(var[E,w]of D.entries()){var C=G.@get(E);if(!C)G.@set(E,w);else G.@set(E,C.concat(w))}}return q||h};var B=J({config:_,onDispose:()=>@throwTypeError(`@{@2} is not implemented yet. See https://github.com/oven-sh/bun/issues/@1`),onEnd:()=>@throwTypeError(`@{@2} is not implemented yet. See https://github.com/oven-sh/bun/issues/@1`),onLoad:K,onResolve:M,onStart:()=>@throwTypeError(`@{@2} is not implemented yet. See https://github.com/oven-sh/bun/issues/@1`),resolve:()=>@throwTypeError(`@{@2} is not implemented yet. See https://github.com/oven-sh/bun/issues/@1`),initialOptions:{..._,bundle:!0,entryPoints:_.entrypoints\?\?_.entryPoints\?\?[],minify:typeof _.minify===\"boolean\"\?_.minify:!1,minifyIdentifiers:_.minify===!0||_.minify\?.identifiers,minifyWhitespace:_.minify===!0||_.minify\?.whitespace,minifySyntax:_.minify===!0||_.minify\?.syntax,outbase:_.root,platform:_.target===\"bun\"\?\"node\":_.target},esbuild:{}});if(B&&@isPromise(B))if(@getPromiseInternalField(B,@promiseFieldFlags)&@promiseStateFulfilled)B=@getPromiseInternalField(B,@promiseFieldReactionsOrResult);else return B.@then(I);return I()})\n"; +const char* const s_bundlerPluginRunSetupFunctionCode = "(function (J,_){\"use strict\";var D=new Map,F=new Map;function H(q,h,E){if(!q||!@isObject(q))@throwTypeError('Expected an object with \"filter\" RegExp');if(!h||!@isCallable(h))@throwTypeError(\"callback must be a function\");var{filter:w,namespace:z=\"file\"}=q;if(!w)@throwTypeError('Expected an object with \"filter\" RegExp');if(!@isRegExpObject(w))@throwTypeError(\"filter must be a RegExp\");if(z&&typeof z!==\"string\")@throwTypeError(\"namespace must be a string\");if((z\?.length\?\?0)===0)z=\"file\";if(!/^([/@a-zA-Z0-9_\\\\-]+)$/.test(z))@throwTypeError(\"namespace can only contain $a-zA-Z0-9_\\\\-\");var A=E.@get(z);if(!A)E.@set(z,[[w,h]]);else @arrayPush(A,[w,h])}function K(q,h){H(q,h,D)}function M(q,h){H(q,h,F)}const I=()=>{var q=!1,h=!1;for(var[E,w]of D.entries())for(var[z]of w)this.addFilter(z,E,1),q=!0;for(var[E,w]of F.entries())for(var[z]of w)this.addFilter(z,E,0),h=!0;if(h){var A=this.onResolve;if(!A)this.onResolve=F;else for(var[E,w]of F.entries()){var C=A.@get(E);if(!C)A.@set(E,w);else A.@set(E,C.concat(w))}}if(q){var G=this.onLoad;if(!G)this.onLoad=D;else for(var[E,w]of D.entries()){var C=G.@get(E);if(!C)G.@set(E,w);else G.@set(E,C.concat(w))}}return q||h};var B=J({config:_,onDispose:()=>@throwTypeError(\"@{@2} is not implemented yet. See https://github.com/oven-sh/bun/issues/@1\"),onEnd:()=>@throwTypeError(\"@{@2} is not implemented yet. See https://github.com/oven-sh/bun/issues/@1\"),onLoad:K,onResolve:M,onStart:()=>@throwTypeError(\"@{@2} is not implemented yet. See https://github.com/oven-sh/bun/issues/@1\"),resolve:()=>@throwTypeError(\"@{@2} is not implemented yet. See https://github.com/oven-sh/bun/issues/@1\"),initialOptions:{..._,bundle:!0,entryPoints:_.entrypoints\?\?_.entryPoints\?\?[],minify:typeof _.minify===\"boolean\"\?_.minify:!1,minifyIdentifiers:_.minify===!0||_.minify\?.identifiers,minifyWhitespace:_.minify===!0||_.minify\?.whitespace,minifySyntax:_.minify===!0||_.minify\?.syntax,outbase:_.root,platform:_.target===\"bun\"\?\"node\":_.target},esbuild:{}});if(B&&@isPromise(B))if(@getPromiseInternalField(B,@promiseFieldFlags)&@promiseStateFulfilled)B=@getPromiseInternalField(B,@promiseFieldReactionsOrResult);else return B.@then(I);return I()})\n"; // runOnResolvePlugins const JSC::ConstructAbility s_bundlerPluginRunOnResolvePluginsCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; @@ -106,9 +106,9 @@ const char* const s_writableStreamInternalsAcquireWritableStreamDefaultWriterCod 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 = 278; +const int s_writableStreamInternalsCreateWritableStreamCodeLength = 273; static const JSC::Intrinsic s_writableStreamInternalsCreateWritableStreamCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_writableStreamInternalsCreateWritableStreamCode = "(function (p,N,_,f,u,j){\"use strict\";@assert(typeof u===\"number\"&&!@isNaN(u)&&u>=0);const d={};@initializeWritableStreamSlots(d,{});const q=new @WritableStreamDefaultController;return @setUpWritableStreamDefaultController(d,q,p,N,_,f,u,j),@createWritableStreamFromInternal(d)})\n"; +const char* const s_writableStreamInternalsCreateWritableStreamCode = "(function (j,p,q,u,d,v){\"use strict\";@assert(typeof d===\"number\"&&d===d&&d>=0);const f={};@initializeWritableStreamSlots(f,{});const x=new @WritableStreamDefaultController;return @setUpWritableStreamDefaultController(f,x,j,p,q,u,d,v),@createWritableStreamFromInternal(f)})\n"; // createInternalWritableStreamFromUnderlyingSink const JSC::ConstructAbility s_writableStreamInternalsCreateInternalWritableStreamFromUnderlyingSinkCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; @@ -154,33 +154,33 @@ const char* const s_writableStreamInternalsIsWritableStreamLockedCode = "(functi 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 = 887; +const int s_writableStreamInternalsSetUpWritableStreamDefaultWriterCodeLength = 878; static const JSC::Intrinsic s_writableStreamInternalsSetUpWritableStreamDefaultWriterCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_writableStreamInternalsSetUpWritableStreamDefaultWriterCode = "(function (g,n){\"use strict\";if(@isWritableStreamLocked(n))@throwTypeError(\"WritableStream is locked\");@putByIdDirectPrivate(g,\"stream\",n),@putByIdDirectPrivate(n,\"writer\",g);const v=@newPromiseCapability(@Promise),h=@newPromiseCapability(@Promise);@putByIdDirectPrivate(g,\"readyPromise\",v),@putByIdDirectPrivate(g,\"closedPromise\",h);const B=@getByIdDirectPrivate(n,\"state\");if(B===\"writable\"){if(@writableStreamCloseQueuedOrInFlight(n)||!@getByIdDirectPrivate(n,\"backpressure\"))v.@resolve.@call()}else if(B===\"erroring\")v.@reject.@call(@undefined,@getByIdDirectPrivate(n,\"storedError\")),@markPromiseAsHandled(v.@promise);else if(B===\"closed\")v.@resolve.@call(),h.@resolve.@call();else{@assert(B===\"errored\");const _=@getByIdDirectPrivate(n,\"storedError\");v.@reject.@call(@undefined,_),@markPromiseAsHandled(v.@promise),h.@reject.@call(@undefined,_),@markPromiseAsHandled(h.@promise)}})\n"; +const char* const s_writableStreamInternalsSetUpWritableStreamDefaultWriterCode = "(function (g,n){\"use strict\";if(@isWritableStreamLocked(n))@throwTypeError(\"WritableStream is locked\");@putByIdDirectPrivate(g,\"stream\",n),@putByIdDirectPrivate(n,\"writer\",g);const B=@newPromiseCapability(@Promise),h=@newPromiseCapability(@Promise);@putByIdDirectPrivate(g,\"readyPromise\",B),@putByIdDirectPrivate(g,\"closedPromise\",h);const k=@getByIdDirectPrivate(n,\"state\");if(k===\"writable\"){if(@writableStreamCloseQueuedOrInFlight(n)||!@getByIdDirectPrivate(n,\"backpressure\"))B.resolve.@call()}else if(k===\"erroring\")B.reject.@call(@undefined,@getByIdDirectPrivate(n,\"storedError\")),@markPromiseAsHandled(B.promise);else if(k===\"closed\")B.resolve.@call(),h.resolve.@call();else{@assert(k===\"errored\");const u=@getByIdDirectPrivate(n,\"storedError\");B.reject.@call(@undefined,u),@markPromiseAsHandled(B.promise),h.reject.@call(@undefined,u),@markPromiseAsHandled(h.promise)}})\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 = 501; +const int s_writableStreamInternalsWritableStreamAbortCodeLength = 499; static const JSC::Intrinsic s_writableStreamInternalsWritableStreamAbortCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_writableStreamInternalsWritableStreamAbortCode = "(function (h,B){\"use strict\";const c=@getByIdDirectPrivate(h,\"state\");if(c===\"closed\"||c===\"errored\")return @Promise.@resolve();const f=@getByIdDirectPrivate(h,\"pendingAbortRequest\");if(f!==@undefined)return f.promise.@promise;@assert(c===\"writable\"||c===\"erroring\");let _=!1;if(c===\"erroring\")_=!0,B=@undefined;const j=@newPromiseCapability(@Promise);if(@putByIdDirectPrivate(h,\"pendingAbortRequest\",{promise:j,reason:B,wasAlreadyErroring:_}),!_)@writableStreamStartErroring(h,B);return j.@promise})\n"; +const char* const s_writableStreamInternalsWritableStreamAbortCode = "(function (h,B){\"use strict\";const c=@getByIdDirectPrivate(h,\"state\");if(c===\"closed\"||c===\"errored\")return @Promise.@resolve();const f=@getByIdDirectPrivate(h,\"pendingAbortRequest\");if(f!==@undefined)return f.promise.promise;@assert(c===\"writable\"||c===\"erroring\");let _=!1;if(c===\"erroring\")_=!0,B=@undefined;const j=@newPromiseCapability(@Promise);if(@putByIdDirectPrivate(h,\"pendingAbortRequest\",{promise:j,reason:B,wasAlreadyErroring:_}),!_)@writableStreamStartErroring(h,B);return j.promise})\n"; // 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 = 642; +const int s_writableStreamInternalsWritableStreamCloseCodeLength = 640; static const JSC::Intrinsic s_writableStreamInternalsWritableStreamCloseCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_writableStreamInternalsWritableStreamCloseCode = "(function (n){\"use strict\";const _=@getByIdDirectPrivate(n,\"state\");if(_===\"closed\"||_===\"errored\")return @Promise.@reject(@makeTypeError(\"Cannot close a writable stream that is closed or errored\"));@assert(_===\"writable\"||_===\"erroring\"),@assert(!@writableStreamCloseQueuedOrInFlight(n));const u=@newPromiseCapability(@Promise);@putByIdDirectPrivate(n,\"closeRequest\",u);const d=@getByIdDirectPrivate(n,\"writer\");if(d!==@undefined&&@getByIdDirectPrivate(n,\"backpressure\")&&_===\"writable\")@getByIdDirectPrivate(d,\"readyPromise\").@resolve.@call();return @writableStreamDefaultControllerClose(@getByIdDirectPrivate(n,\"controller\")),u.@promise})\n"; +const char* const s_writableStreamInternalsWritableStreamCloseCode = "(function (n){\"use strict\";const _=@getByIdDirectPrivate(n,\"state\");if(_===\"closed\"||_===\"errored\")return @Promise.@reject(@makeTypeError(\"Cannot close a writable stream that is closed or errored\"));@assert(_===\"writable\"||_===\"erroring\"),@assert(!@writableStreamCloseQueuedOrInFlight(n));const d=@newPromiseCapability(@Promise);@putByIdDirectPrivate(n,\"closeRequest\",d);const h=@getByIdDirectPrivate(n,\"writer\");if(h!==@undefined&&@getByIdDirectPrivate(n,\"backpressure\")&&_===\"writable\")@getByIdDirectPrivate(h,\"readyPromise\").resolve.@call();return @writableStreamDefaultControllerClose(@getByIdDirectPrivate(n,\"controller\")),d.promise})\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 = 227; +const int s_writableStreamInternalsWritableStreamAddWriteRequestCodeLength = 226; static const JSC::Intrinsic s_writableStreamInternalsWritableStreamAddWriteRequestCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_writableStreamInternalsWritableStreamAddWriteRequestCode = "(function (c){\"use strict\";@assert(@isWritableStreamLocked(c)),@assert(@getByIdDirectPrivate(c,\"state\")===\"writable\");const d=@newPromiseCapability(@Promise);return @getByIdDirectPrivate(c,\"writeRequests\").push(d),d.@promise})\n"; +const char* const s_writableStreamInternalsWritableStreamAddWriteRequestCode = "(function (c){\"use strict\";@assert(@isWritableStreamLocked(c)),@assert(@getByIdDirectPrivate(c,\"state\")===\"writable\");const _=@newPromiseCapability(@Promise);return @getByIdDirectPrivate(c,\"writeRequests\").push(_),_.promise})\n"; // writableStreamCloseQueuedOrInFlight const JSC::ConstructAbility s_writableStreamInternalsWritableStreamCloseQueuedOrInFlightCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; @@ -202,41 +202,41 @@ const char* const s_writableStreamInternalsWritableStreamDealWithRejectionCode = 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 = 1058; +const int s_writableStreamInternalsWritableStreamFinishErroringCodeLength = 1054; static const JSC::Intrinsic s_writableStreamInternalsWritableStreamFinishErroringCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_writableStreamInternalsWritableStreamFinishErroringCode = "(function (i){\"use strict\";@assert(@getByIdDirectPrivate(i,\"state\")===\"erroring\"),@assert(!@writableStreamHasOperationMarkedInFlight(i)),@putByIdDirectPrivate(i,\"state\",\"errored\");const h=@getByIdDirectPrivate(i,\"controller\");@getByIdDirectPrivate(h,\"errorSteps\").@call();const A=@getByIdDirectPrivate(i,\"storedError\"),B=@getByIdDirectPrivate(i,\"writeRequests\");for(var p=B.shift();p;p=B.shift())p.@reject.@call(@undefined,A);@putByIdDirectPrivate(i,\"writeRequests\",@createFIFO());const _=@getByIdDirectPrivate(i,\"pendingAbortRequest\");if(_===@undefined){@writableStreamRejectCloseAndClosedPromiseIfNeeded(i);return}if(@putByIdDirectPrivate(i,\"pendingAbortRequest\",@undefined),_.wasAlreadyErroring){_.promise.@reject.@call(@undefined,A),@writableStreamRejectCloseAndClosedPromiseIfNeeded(i);return}@getByIdDirectPrivate(h,\"abortSteps\").@call(@undefined,_.reason).@then(()=>{_.promise.@resolve.@call(),@writableStreamRejectCloseAndClosedPromiseIfNeeded(i)},(I)=>{_.promise.@reject.@call(@undefined,I),@writableStreamRejectCloseAndClosedPromiseIfNeeded(i)})})\n"; +const char* const s_writableStreamInternalsWritableStreamFinishErroringCode = "(function (i){\"use strict\";@assert(@getByIdDirectPrivate(i,\"state\")===\"erroring\"),@assert(!@writableStreamHasOperationMarkedInFlight(i)),@putByIdDirectPrivate(i,\"state\",\"errored\");const d=@getByIdDirectPrivate(i,\"controller\");@getByIdDirectPrivate(d,\"errorSteps\").@call();const h=@getByIdDirectPrivate(i,\"storedError\"),j=@getByIdDirectPrivate(i,\"writeRequests\");for(var f=j.shift();f;f=j.shift())f.reject.@call(@undefined,h);@putByIdDirectPrivate(i,\"writeRequests\",@createFIFO());const _=@getByIdDirectPrivate(i,\"pendingAbortRequest\");if(_===@undefined){@writableStreamRejectCloseAndClosedPromiseIfNeeded(i);return}if(@putByIdDirectPrivate(i,\"pendingAbortRequest\",@undefined),_.wasAlreadyErroring){_.promise.reject.@call(@undefined,h),@writableStreamRejectCloseAndClosedPromiseIfNeeded(i);return}@getByIdDirectPrivate(d,\"abortSteps\").@call(@undefined,_.reason).@then(()=>{_.promise.resolve.@call(),@writableStreamRejectCloseAndClosedPromiseIfNeeded(i)},(v)=>{_.promise.reject.@call(@undefined,v),@writableStreamRejectCloseAndClosedPromiseIfNeeded(i)})})\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 = 751; +const int s_writableStreamInternalsWritableStreamFinishInFlightCloseCodeLength = 748; static const JSC::Intrinsic s_writableStreamInternalsWritableStreamFinishInFlightCloseCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_writableStreamInternalsWritableStreamFinishInFlightCloseCode = "(function (d){\"use strict\";@getByIdDirectPrivate(d,\"inFlightCloseRequest\").@resolve.@call(),@putByIdDirectPrivate(d,\"inFlightCloseRequest\",@undefined);const i=@getByIdDirectPrivate(d,\"state\");if(@assert(i===\"writable\"||i===\"erroring\"),i===\"erroring\"){@putByIdDirectPrivate(d,\"storedError\",@undefined);const _=@getByIdDirectPrivate(d,\"pendingAbortRequest\");if(_!==@undefined)_.promise.@resolve.@call(),@putByIdDirectPrivate(d,\"pendingAbortRequest\",@undefined)}@putByIdDirectPrivate(d,\"state\",\"closed\");const n=@getByIdDirectPrivate(d,\"writer\");if(n!==@undefined)@getByIdDirectPrivate(n,\"closedPromise\").@resolve.@call();@assert(@getByIdDirectPrivate(d,\"pendingAbortRequest\")===@undefined),@assert(@getByIdDirectPrivate(d,\"storedError\")===@undefined)})\n"; +const char* const s_writableStreamInternalsWritableStreamFinishInFlightCloseCode = "(function (_){\"use strict\";@getByIdDirectPrivate(_,\"inFlightCloseRequest\").resolve.@call(),@putByIdDirectPrivate(_,\"inFlightCloseRequest\",@undefined);const d=@getByIdDirectPrivate(_,\"state\");if(@assert(d===\"writable\"||d===\"erroring\"),d===\"erroring\"){@putByIdDirectPrivate(_,\"storedError\",@undefined);const n=@getByIdDirectPrivate(_,\"pendingAbortRequest\");if(n!==@undefined)n.promise.resolve.@call(),@putByIdDirectPrivate(_,\"pendingAbortRequest\",@undefined)}@putByIdDirectPrivate(_,\"state\",\"closed\");const i=@getByIdDirectPrivate(_,\"writer\");if(i!==@undefined)@getByIdDirectPrivate(i,\"closedPromise\").resolve.@call();@assert(@getByIdDirectPrivate(_,\"pendingAbortRequest\")===@undefined),@assert(@getByIdDirectPrivate(_,\"storedError\")===@undefined)})\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 = 488; +const int s_writableStreamInternalsWritableStreamFinishInFlightCloseWithErrorCodeLength = 486; static const JSC::Intrinsic s_writableStreamInternalsWritableStreamFinishInFlightCloseWithErrorCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_writableStreamInternalsWritableStreamFinishInFlightCloseWithErrorCode = "(function (_,c){\"use strict\";const d=@getByIdDirectPrivate(_,\"inFlightCloseRequest\");@assert(d!==@undefined),d.@reject.@call(@undefined,c),@putByIdDirectPrivate(_,\"inFlightCloseRequest\",@undefined);const n=@getByIdDirectPrivate(_,\"state\");@assert(n===\"writable\"||n===\"erroring\");const p=@getByIdDirectPrivate(_,\"pendingAbortRequest\");if(p!==@undefined)p.promise.@reject.@call(@undefined,c),@putByIdDirectPrivate(_,\"pendingAbortRequest\",@undefined);@writableStreamDealWithRejection(_,c)})\n"; +const char* const s_writableStreamInternalsWritableStreamFinishInFlightCloseWithErrorCode = "(function (c,d){\"use strict\";const p=@getByIdDirectPrivate(c,\"inFlightCloseRequest\");@assert(p!==@undefined),p.reject.@call(@undefined,d),@putByIdDirectPrivate(c,\"inFlightCloseRequest\",@undefined);const _=@getByIdDirectPrivate(c,\"state\");@assert(_===\"writable\"||_===\"erroring\");const f=@getByIdDirectPrivate(c,\"pendingAbortRequest\");if(f!==@undefined)f.promise.reject.@call(@undefined,d),@putByIdDirectPrivate(c,\"pendingAbortRequest\",@undefined);@writableStreamDealWithRejection(c,d)})\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 = 187; +const int s_writableStreamInternalsWritableStreamFinishInFlightWriteCodeLength = 186; static const JSC::Intrinsic s_writableStreamInternalsWritableStreamFinishInFlightWriteCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_writableStreamInternalsWritableStreamFinishInFlightWriteCode = "(function (d){\"use strict\";const c=@getByIdDirectPrivate(d,\"inFlightWriteRequest\");@assert(c!==@undefined),c.@resolve.@call(),@putByIdDirectPrivate(d,\"inFlightWriteRequest\",@undefined)})\n"; +const char* const s_writableStreamInternalsWritableStreamFinishInFlightWriteCode = "(function (d){\"use strict\";const b=@getByIdDirectPrivate(d,\"inFlightWriteRequest\");@assert(b!==@undefined),b.resolve.@call(),@putByIdDirectPrivate(d,\"inFlightWriteRequest\",@undefined)})\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 = 319; +const int s_writableStreamInternalsWritableStreamFinishInFlightWriteWithErrorCodeLength = 318; static const JSC::Intrinsic s_writableStreamInternalsWritableStreamFinishInFlightWriteWithErrorCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_writableStreamInternalsWritableStreamFinishInFlightWriteWithErrorCode = "(function (_,c){\"use strict\";const d=@getByIdDirectPrivate(_,\"inFlightWriteRequest\");@assert(d!==@undefined),d.@reject.@call(@undefined,c),@putByIdDirectPrivate(_,\"inFlightWriteRequest\",@undefined);const p=@getByIdDirectPrivate(_,\"state\");@assert(p===\"writable\"||p===\"erroring\"),@writableStreamDealWithRejection(_,c)})\n"; +const char* const s_writableStreamInternalsWritableStreamFinishInFlightWriteWithErrorCode = "(function (c,b){\"use strict\";const d=@getByIdDirectPrivate(c,\"inFlightWriteRequest\");@assert(d!==@undefined),d.reject.@call(@undefined,b),@putByIdDirectPrivate(c,\"inFlightWriteRequest\",@undefined);const f=@getByIdDirectPrivate(c,\"state\");@assert(f===\"writable\"||f===\"erroring\"),@writableStreamDealWithRejection(c,b)})\n"; // writableStreamHasOperationMarkedInFlight const JSC::ConstructAbility s_writableStreamInternalsWritableStreamHasOperationMarkedInFlightCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; @@ -266,9 +266,9 @@ const char* const s_writableStreamInternalsWritableStreamMarkFirstWriteRequestIn 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 = 516; +const int s_writableStreamInternalsWritableStreamRejectCloseAndClosedPromiseIfNeededCodeLength = 513; static const JSC::Intrinsic s_writableStreamInternalsWritableStreamRejectCloseAndClosedPromiseIfNeededCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_writableStreamInternalsWritableStreamRejectCloseAndClosedPromiseIfNeededCode = "(function (i){\"use strict\";@assert(@getByIdDirectPrivate(i,\"state\")===\"errored\");const h=@getByIdDirectPrivate(i,\"storedError\"),n=@getByIdDirectPrivate(i,\"closeRequest\");if(n!==@undefined)@assert(@getByIdDirectPrivate(i,\"inFlightCloseRequest\")===@undefined),n.@reject.@call(@undefined,h),@putByIdDirectPrivate(i,\"closeRequest\",@undefined);const B=@getByIdDirectPrivate(i,\"writer\");if(B!==@undefined){const b=@getByIdDirectPrivate(B,\"closedPromise\");b.@reject.@call(@undefined,h),@markPromiseAsHandled(b.@promise)}})\n"; +const char* const s_writableStreamInternalsWritableStreamRejectCloseAndClosedPromiseIfNeededCode = "(function (n){\"use strict\";@assert(@getByIdDirectPrivate(n,\"state\")===\"errored\");const _=@getByIdDirectPrivate(n,\"storedError\"),h=@getByIdDirectPrivate(n,\"closeRequest\");if(h!==@undefined)@assert(@getByIdDirectPrivate(n,\"inFlightCloseRequest\")===@undefined),h.reject.@call(@undefined,_),@putByIdDirectPrivate(n,\"closeRequest\",@undefined);const i=@getByIdDirectPrivate(n,\"writer\");if(i!==@undefined){const p=@getByIdDirectPrivate(i,\"closedPromise\");p.reject.@call(@undefined,_),@markPromiseAsHandled(p.promise)}})\n"; // writableStreamStartErroring const JSC::ConstructAbility s_writableStreamInternalsWritableStreamStartErroringCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; @@ -282,9 +282,9 @@ const char* const s_writableStreamInternalsWritableStreamStartErroringCode = "(f 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 = 422; +const int s_writableStreamInternalsWritableStreamUpdateBackpressureCodeLength = 421; static const JSC::Intrinsic s_writableStreamInternalsWritableStreamUpdateBackpressureCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_writableStreamInternalsWritableStreamUpdateBackpressureCode = "(function (n,d){\"use strict\";@assert(@getByIdDirectPrivate(n,\"state\")===\"writable\"),@assert(!@writableStreamCloseQueuedOrInFlight(n));const h=@getByIdDirectPrivate(n,\"writer\");if(h!==@undefined&&d!==@getByIdDirectPrivate(n,\"backpressure\"))if(d)@putByIdDirectPrivate(h,\"readyPromise\",@newPromiseCapability(@Promise));else @getByIdDirectPrivate(h,\"readyPromise\").@resolve.@call();@putByIdDirectPrivate(n,\"backpressure\",d)})\n"; +const char* const s_writableStreamInternalsWritableStreamUpdateBackpressureCode = "(function (n,_){\"use strict\";@assert(@getByIdDirectPrivate(n,\"state\")===\"writable\"),@assert(!@writableStreamCloseQueuedOrInFlight(n));const d=@getByIdDirectPrivate(n,\"writer\");if(d!==@undefined&&_!==@getByIdDirectPrivate(n,\"backpressure\"))if(_)@putByIdDirectPrivate(d,\"readyPromise\",@newPromiseCapability(@Promise));else @getByIdDirectPrivate(d,\"readyPromise\").resolve.@call();@putByIdDirectPrivate(n,\"backpressure\",_)})\n"; // writableStreamDefaultWriterAbort const JSC::ConstructAbility s_writableStreamInternalsWritableStreamDefaultWriterAbortCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; @@ -314,17 +314,17 @@ const char* const s_writableStreamInternalsWritableStreamDefaultWriterCloseWithE 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 = 329; +const int s_writableStreamInternalsWritableStreamDefaultWriterEnsureClosedPromiseRejectedCodeLength = 326; static const JSC::Intrinsic s_writableStreamInternalsWritableStreamDefaultWriterEnsureClosedPromiseRejectedCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_writableStreamInternalsWritableStreamDefaultWriterEnsureClosedPromiseRejectedCode = "(function (h,u){\"use strict\";let _=@getByIdDirectPrivate(h,\"closedPromise\"),n=_.@promise;if((@getPromiseInternalField(n,@promiseFieldFlags)&@promiseStateMask)!==@promiseStatePending)_=@newPromiseCapability(@Promise),n=_.@promise,@putByIdDirectPrivate(h,\"closedPromise\",_);_.@reject.@call(@undefined,u),@markPromiseAsHandled(n)})\n"; +const char* const s_writableStreamInternalsWritableStreamDefaultWriterEnsureClosedPromiseRejectedCode = "(function (h,n){\"use strict\";let _=@getByIdDirectPrivate(h,\"closedPromise\"),f=_.promise;if((@getPromiseInternalField(f,@promiseFieldFlags)&@promiseStateMask)!==@promiseStatePending)_=@newPromiseCapability(@Promise),f=_.promise,@putByIdDirectPrivate(h,\"closedPromise\",_);_.reject.@call(@undefined,n),@markPromiseAsHandled(f)})\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 = 327; +const int s_writableStreamInternalsWritableStreamDefaultWriterEnsureReadyPromiseRejectedCodeLength = 324; static const JSC::Intrinsic s_writableStreamInternalsWritableStreamDefaultWriterEnsureReadyPromiseRejectedCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_writableStreamInternalsWritableStreamDefaultWriterEnsureReadyPromiseRejectedCode = "(function (h,n){\"use strict\";let c=@getByIdDirectPrivate(h,\"readyPromise\"),g=c.@promise;if((@getPromiseInternalField(g,@promiseFieldFlags)&@promiseStateMask)!==@promiseStatePending)c=@newPromiseCapability(@Promise),g=c.@promise,@putByIdDirectPrivate(h,\"readyPromise\",c);c.@reject.@call(@undefined,n),@markPromiseAsHandled(g)})\n"; +const char* const s_writableStreamInternalsWritableStreamDefaultWriterEnsureReadyPromiseRejectedCode = "(function (h,n){\"use strict\";let _=@getByIdDirectPrivate(h,\"readyPromise\"),g=_.promise;if((@getPromiseInternalField(g,@promiseFieldFlags)&@promiseStateMask)!==@promiseStatePending)_=@newPromiseCapability(@Promise),g=_.promise,@putByIdDirectPrivate(h,\"readyPromise\",_);_.reject.@call(@undefined,n),@markPromiseAsHandled(g)})\n"; // writableStreamDefaultWriterGetDesiredSize const JSC::ConstructAbility s_writableStreamInternalsWritableStreamDefaultWriterGetDesiredSizeCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; @@ -500,9 +500,9 @@ const char* const s_transformStreamInternalsIsTransformStreamDefaultControllerCo 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 = 513; +const int s_transformStreamInternalsCreateTransformStreamCodeLength = 510; static const JSC::Intrinsic s_transformStreamInternalsCreateTransformStreamCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_transformStreamInternalsCreateTransformStreamCode = "(function (D,E,F,_,j,c,q){\"use strict\";if(_===@undefined)_=1;if(j===@undefined)j=()=>1;if(c===@undefined)c=0;if(q===@undefined)q=()=>1;@assert(_>=0),@assert(c>=0);const B={};@putByIdDirectPrivate(B,\"TransformStream\",!0);const v=new @TransformStream(B),x=@newPromiseCapability(@Promise);@initializeTransformStream(v,x.@promise,_,j,c,q);const G=new @TransformStreamDefaultController;return @setUpTransformStreamDefaultController(v,G,E,F),D().@then(()=>{x.@resolve.@call()},(I)=>{x.@reject.@call(@undefined,I)}),v})\n"; +const char* const s_transformStreamInternalsCreateTransformStreamCode = "(function (D,E,F,_,j,c,q){\"use strict\";if(_===@undefined)_=1;if(j===@undefined)j=()=>1;if(c===@undefined)c=0;if(q===@undefined)q=()=>1;@assert(_>=0),@assert(c>=0);const B={};@putByIdDirectPrivate(B,\"TransformStream\",!0);const v=new @TransformStream(B),x=@newPromiseCapability(@Promise);@initializeTransformStream(v,x.promise,_,j,c,q);const G=new @TransformStreamDefaultController;return @setUpTransformStreamDefaultController(v,G,E,F),D().@then(()=>{x.resolve.@call()},(I)=>{x.reject.@call(@undefined,I)}),v})\n"; // initializeTransformStream const JSC::ConstructAbility s_transformStreamInternalsInitializeTransformStreamCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; @@ -532,9 +532,9 @@ const char* const s_transformStreamInternalsTransformStreamErrorWritableAndUnblo 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 = 309; +const int s_transformStreamInternalsTransformStreamSetBackpressureCodeLength = 308; static const JSC::Intrinsic s_transformStreamInternalsTransformStreamSetBackpressureCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_transformStreamInternalsTransformStreamSetBackpressureCode = "(function (_,d){\"use strict\";@assert(@getByIdDirectPrivate(_,\"backpressure\")!==d);const f=@getByIdDirectPrivate(_,\"backpressureChangePromise\");if(f!==@undefined)f.@resolve.@call();@putByIdDirectPrivate(_,\"backpressureChangePromise\",@newPromiseCapability(@Promise)),@putByIdDirectPrivate(_,\"backpressure\",d)})\n"; +const char* const s_transformStreamInternalsTransformStreamSetBackpressureCode = "(function (_,d){\"use strict\";@assert(@getByIdDirectPrivate(_,\"backpressure\")!==d);const i=@getByIdDirectPrivate(_,\"backpressureChangePromise\");if(i!==@undefined)i.resolve.@call();@putByIdDirectPrivate(_,\"backpressureChangePromise\",@newPromiseCapability(@Promise)),@putByIdDirectPrivate(_,\"backpressure\",d)})\n"; // setUpTransformStreamDefaultController const JSC::ConstructAbility s_transformStreamInternalsSetUpTransformStreamDefaultControllerCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; @@ -580,9 +580,9 @@ const char* const s_transformStreamInternalsTransformStreamDefaultControllerErro 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 = 277; +const int s_transformStreamInternalsTransformStreamDefaultControllerPerformTransformCodeLength = 275; static const JSC::Intrinsic s_transformStreamInternalsTransformStreamDefaultControllerPerformTransformCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_transformStreamInternalsTransformStreamDefaultControllerPerformTransformCode = "(function (d,g){\"use strict\";const _=@newPromiseCapability(@Promise);return @getByIdDirectPrivate(d,\"transformAlgorithm\").@call(@undefined,g).@then(()=>{_.@resolve()},(f)=>{@transformStreamError(@getByIdDirectPrivate(d,\"stream\"),f),_.@reject.@call(@undefined,f)}),_.@promise})\n"; +const char* const s_transformStreamInternalsTransformStreamDefaultControllerPerformTransformCode = "(function (d,g){\"use strict\";const _=@newPromiseCapability(@Promise);return @getByIdDirectPrivate(d,\"transformAlgorithm\").@call(@undefined,g).@then(()=>{_.@resolve()},(f)=>{@transformStreamError(@getByIdDirectPrivate(d,\"stream\"),f),_.reject.@call(@undefined,f)}),_.promise})\n"; // transformStreamDefaultControllerTerminate const JSC::ConstructAbility s_transformStreamInternalsTransformStreamDefaultControllerTerminateCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; @@ -596,9 +596,9 @@ const char* const s_transformStreamInternalsTransformStreamDefaultControllerTerm 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 = 764; +const int s_transformStreamInternalsTransformStreamDefaultSinkWriteAlgorithmCodeLength = 759; static const JSC::Intrinsic s_transformStreamInternalsTransformStreamDefaultSinkWriteAlgorithmCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_transformStreamInternalsTransformStreamDefaultSinkWriteAlgorithmCode = "(function (d,j){\"use strict\";const f=@getByIdDirectPrivate(d,\"internalWritable\");@assert(@getByIdDirectPrivate(f,\"state\")===\"writable\");const q=@getByIdDirectPrivate(d,\"controller\");if(@getByIdDirectPrivate(d,\"backpressure\")){const _=@newPromiseCapability(@Promise),x=@getByIdDirectPrivate(d,\"backpressureChangePromise\");return @assert(x!==@undefined),x.@promise.@then(()=>{const v=@getByIdDirectPrivate(f,\"state\");if(v===\"erroring\"){_.@reject.@call(@undefined,@getByIdDirectPrivate(f,\"storedError\"));return}@assert(v===\"writable\"),@transformStreamDefaultControllerPerformTransform(q,j).@then(()=>{_.@resolve()},(z)=>{_.@reject.@call(@undefined,z)})},(v)=>{_.@reject.@call(@undefined,v)}),_.@promise}return @transformStreamDefaultControllerPerformTransform(q,j)})\n"; +const char* const s_transformStreamInternalsTransformStreamDefaultSinkWriteAlgorithmCode = "(function (d,q){\"use strict\";const j=@getByIdDirectPrivate(d,\"internalWritable\");@assert(@getByIdDirectPrivate(j,\"state\")===\"writable\");const v=@getByIdDirectPrivate(d,\"controller\");if(@getByIdDirectPrivate(d,\"backpressure\")){const _=@newPromiseCapability(@Promise),x=@getByIdDirectPrivate(d,\"backpressureChangePromise\");return @assert(x!==@undefined),x.promise.@then(()=>{const f=@getByIdDirectPrivate(j,\"state\");if(f===\"erroring\"){_.reject.@call(@undefined,@getByIdDirectPrivate(j,\"storedError\"));return}@assert(f===\"writable\"),@transformStreamDefaultControllerPerformTransform(v,q).@then(()=>{_.@resolve()},(z)=>{_.reject.@call(@undefined,z)})},(f)=>{_.reject.@call(@undefined,f)}),_.promise}return @transformStreamDefaultControllerPerformTransform(v,q)})\n"; // transformStreamDefaultSinkAbortAlgorithm const JSC::ConstructAbility s_transformStreamInternalsTransformStreamDefaultSinkAbortAlgorithmCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; @@ -612,17 +612,17 @@ const char* const s_transformStreamInternalsTransformStreamDefaultSinkAbortAlgor 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 = 789; +const int s_transformStreamInternalsTransformStreamDefaultSinkCloseAlgorithmCodeLength = 786; static const JSC::Intrinsic s_transformStreamInternalsTransformStreamDefaultSinkCloseAlgorithmCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_transformStreamInternalsTransformStreamDefaultSinkCloseAlgorithmCode = "(function (f){\"use strict\";const _=@getByIdDirectPrivate(f,\"readable\"),q=@getByIdDirectPrivate(f,\"controller\"),j=@getByIdDirectPrivate(_,\"readableStreamController\"),k=@getByIdDirectPrivate(q,\"flushAlgorithm\");@assert(k!==@undefined);const u=@getByIdDirectPrivate(q,\"flushAlgorithm\").@call();@transformStreamDefaultControllerClearAlgorithms(q);const I=@newPromiseCapability(@Promise);return u.@then(()=>{if(@getByIdDirectPrivate(_,\"state\")===@streamErrored){I.@reject.@call(@undefined,@getByIdDirectPrivate(_,\"storedError\"));return}if(@readableStreamDefaultControllerCanCloseOrEnqueue(j))@readableStreamDefaultControllerClose(j);I.@resolve()},(v)=>{@transformStreamError(@getByIdDirectPrivate(q,\"stream\"),v),I.@reject.@call(@undefined,@getByIdDirectPrivate(_,\"storedError\"))}),I.@promise})\n"; +const char* const s_transformStreamInternalsTransformStreamDefaultSinkCloseAlgorithmCode = "(function (j){\"use strict\";const _=@getByIdDirectPrivate(j,\"readable\"),I=@getByIdDirectPrivate(j,\"controller\"),k=@getByIdDirectPrivate(_,\"readableStreamController\"),q=@getByIdDirectPrivate(I,\"flushAlgorithm\");@assert(q!==@undefined);const u=@getByIdDirectPrivate(I,\"flushAlgorithm\").@call();@transformStreamDefaultControllerClearAlgorithms(I);const S=@newPromiseCapability(@Promise);return u.@then(()=>{if(@getByIdDirectPrivate(_,\"state\")===@streamErrored){S.reject.@call(@undefined,@getByIdDirectPrivate(_,\"storedError\"));return}if(@readableStreamDefaultControllerCanCloseOrEnqueue(k))@readableStreamDefaultControllerClose(k);S.@resolve()},(v)=>{@transformStreamError(@getByIdDirectPrivate(I,\"stream\"),v),S.reject.@call(@undefined,@getByIdDirectPrivate(_,\"storedError\"))}),S.promise})\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 = 260; +const int s_transformStreamInternalsTransformStreamDefaultSourcePullAlgorithmCodeLength = 259; static const JSC::Intrinsic s_transformStreamInternalsTransformStreamDefaultSourcePullAlgorithmCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_transformStreamInternalsTransformStreamDefaultSourcePullAlgorithmCode = "(function (i){\"use strict\";return @assert(@getByIdDirectPrivate(i,\"backpressure\")),@assert(@getByIdDirectPrivate(i,\"backpressureChangePromise\")!==@undefined),@transformStreamSetBackpressure(i,!1),@getByIdDirectPrivate(i,\"backpressureChangePromise\").@promise})\n"; +const char* const s_transformStreamInternalsTransformStreamDefaultSourcePullAlgorithmCode = "(function (i){\"use strict\";return @assert(@getByIdDirectPrivate(i,\"backpressure\")),@assert(@getByIdDirectPrivate(i,\"backpressureChangePromise\")!==@undefined),@transformStreamSetBackpressure(i,!1),@getByIdDirectPrivate(i,\"backpressureChangePromise\").promise})\n"; #define DEFINE_BUILTIN_GENERATOR(codeName, functionName, overriddenName, argumentCount) \ JSC::FunctionExecutable* codeName##Generator(JSC::VM& vm) \ @@ -672,9 +672,9 @@ WEBCORE_FOREACH_PROCESSOBJECTINTERNALS_BUILTIN_CODE(DEFINE_BUILTIN_GENERATOR) 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 = 1304; +const int s_transformStreamInitializeTransformStreamCodeLength = 1300; static const JSC::Intrinsic s_transformStreamInitializeTransformStreamCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_transformStreamInitializeTransformStreamCode = "(function (){\"use strict\";let _=arguments[0];if(@isObject(_)&&@getByIdDirectPrivate(_,\"TransformStream\"))return this;let j=arguments[1],q=arguments[2];if(_===@undefined)_=null;if(q===@undefined)q={};if(j===@undefined)j={};let u={};if(_!==null){if(\"start\"in _){if(u.start=_.start,typeof u.start!==\"function\")@throwTypeError(\"transformer.start should be a function\")}if(\"transform\"in _){if(u.transform=_.transform,typeof u.transform!==\"function\")@throwTypeError(\"transformer.transform should be a function\")}if(\"flush\"in _){if(u.flush=_.flush,typeof u.flush!==\"function\")@throwTypeError(\"transformer.flush should be a function\")}if(\"readableType\"in _)@throwRangeError(\"TransformStream transformer has a readableType\");if(\"writableType\"in _)@throwRangeError(\"TransformStream transformer has a writableType\")}const x=@extractHighWaterMark(q,0),B=@extractSizeAlgorithm(q),E=@extractHighWaterMark(j,1),F=@extractSizeAlgorithm(j),v=@newPromiseCapability(@Promise);if(@initializeTransformStream(this,v.@promise,E,F,x,B),@setUpTransformStreamDefaultControllerFromTransformer(this,_,u),(\"start\"in u)){const G=@getByIdDirectPrivate(this,\"controller\");(()=>@promiseInvokeOrNoopMethodNoCatch(_,u.start,[G]))().@then(()=>{v.@resolve.@call()},(I)=>{v.@reject.@call(@undefined,I)})}else v.@resolve.@call();return this})\n"; +const char* const s_transformStreamInitializeTransformStreamCode = "(function (){\"use strict\";let _=arguments[0];if(@isObject(_)&&@getByIdDirectPrivate(_,\"TransformStream\"))return this;let u=arguments[1],U=arguments[2];if(_===@undefined)_=null;if(U===@undefined)U={};if(u===@undefined)u={};let j={};if(_!==null){if(\"start\"in _){if(j.start=_.start,typeof j.start!==\"function\")@throwTypeError(\"transformer.start should be a function\")}if(\"transform\"in _){if(j.transform=_.transform,typeof j.transform!==\"function\")@throwTypeError(\"transformer.transform should be a function\")}if(\"flush\"in _){if(j.flush=_.flush,typeof j.flush!==\"function\")@throwTypeError(\"transformer.flush should be a function\")}if(\"readableType\"in _)@throwRangeError(\"TransformStream transformer has a readableType\");if(\"writableType\"in _)@throwRangeError(\"TransformStream transformer has a writableType\")}const v=@extractHighWaterMark(U,0),x=@extractSizeAlgorithm(U),B=@extractHighWaterMark(u,1),E=@extractSizeAlgorithm(u),q=@newPromiseCapability(@Promise);if(@initializeTransformStream(this,q.promise,B,E,v,x),@setUpTransformStreamDefaultControllerFromTransformer(this,_,j),(\"start\"in j)){const F=@getByIdDirectPrivate(this,\"controller\");(()=>@promiseInvokeOrNoopMethodNoCatch(_,j.start,[F]))().@then(()=>{q.resolve.@call()},(G)=>{q.reject.@call(@undefined,G)})}else q.resolve.@call();return this})\n"; // readable const JSC::ConstructAbility s_transformStreamReadableCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; @@ -1236,9 +1236,9 @@ const char* const s_jsBufferPrototypeToJSONCode = "(function (){\"use strict\";r 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 = 260; +const int s_jsBufferPrototypeSliceCodeLength = 256; static const JSC::Intrinsic s_jsBufferPrototypeSliceCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_jsBufferPrototypeSliceCode = "(function (w,m){\"use strict\";var{buffer:x,byteOffset:z,byteLength:p}=this;function q(c,k){if(c=@trunc(c),c===0||@isNaN(c))return 0;else if(c<0)return c+=k,c>0\?c:0;else return ci\?v-i:0)})\n"; +const char* const s_jsBufferPrototypeSliceCode = "(function (v,m){\"use strict\";var{buffer:w,byteOffset:x,byteLength:p}=this;function q(c,k){if(c=@trunc(c),c===0||c!==c)return 0;else if(c<0)return c+=k,c>0\?c:0;else return ci\?u-i:0)})\n"; // parent const JSC::ConstructAbility s_jsBufferPrototypeParentCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; @@ -1362,9 +1362,9 @@ WEBCORE_FOREACH_CONSOLEOBJECT_BUILTIN_CODE(DEFINE_BUILTIN_GENERATOR) 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 = 585; +const int s_readableStreamInternalsReadableStreamReaderGenericInitializeCodeLength = 583; static const JSC::Intrinsic s_readableStreamInternalsReadableStreamReaderGenericInitializeCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_readableStreamInternalsReadableStreamReaderGenericInitializeCode = "(function (_,i){\"use strict\";if(@putByIdDirectPrivate(_,\"ownerReadableStream\",i),@putByIdDirectPrivate(i,\"reader\",_),@getByIdDirectPrivate(i,\"state\")===@streamReadable)@putByIdDirectPrivate(_,\"closedPromiseCapability\",@newPromiseCapability(@Promise));else if(@getByIdDirectPrivate(i,\"state\")===@streamClosed)@putByIdDirectPrivate(_,\"closedPromiseCapability\",{@promise:@Promise.@resolve()});else @assert(@getByIdDirectPrivate(i,\"state\")===@streamErrored),@putByIdDirectPrivate(_,\"closedPromiseCapability\",{@promise:@newHandledRejectedPromise(@getByIdDirectPrivate(i,\"storedError\"))})})\n"; +const char* const s_readableStreamInternalsReadableStreamReaderGenericInitializeCode = "(function (l,i){\"use strict\";if(@putByIdDirectPrivate(l,\"ownerReadableStream\",i),@putByIdDirectPrivate(i,\"reader\",l),@getByIdDirectPrivate(i,\"state\")===@streamReadable)@putByIdDirectPrivate(l,\"closedPromiseCapability\",@newPromiseCapability(@Promise));else if(@getByIdDirectPrivate(i,\"state\")===@streamClosed)@putByIdDirectPrivate(l,\"closedPromiseCapability\",{promise:@Promise.@resolve()});else @assert(@getByIdDirectPrivate(i,\"state\")===@streamErrored),@putByIdDirectPrivate(l,\"closedPromiseCapability\",{promise:@newHandledRejectedPromise(@getByIdDirectPrivate(i,\"storedError\"))})})\n"; // privateInitializeReadableStreamDefaultController const JSC::ConstructAbility s_readableStreamInternalsPrivateInitializeReadableStreamDefaultControllerCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; @@ -1386,9 +1386,9 @@ const char* const s_readableStreamInternalsReadableStreamDefaultControllerErrorC 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 = 427; +const int s_readableStreamInternalsReadableStreamPipeToCodeLength = 426; static const JSC::Intrinsic s_readableStreamInternalsReadableStreamPipeToCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_readableStreamInternalsReadableStreamPipeToCode = "(function (g,c){\"use strict\";@assert(@isReadableStream(g));const h=new @ReadableStreamDefaultReader(g);@getByIdDirectPrivate(h,\"closedPromiseCapability\").@promise.@then(()=>{},(_)=>{c.error(_)});function y(){@readableStreamDefaultReaderRead(h).@then(function(_){if(_.done){c.close();return}try{c.enqueue(_.value)}catch(S){c.error(\"ReadableStream chunk enqueueing in the sink failed\");return}y()},function(_){c.error(_)})}y()})\n"; +const char* const s_readableStreamInternalsReadableStreamPipeToCode = "(function (S,y){\"use strict\";@assert(@isReadableStream(S));const _=new @ReadableStreamDefaultReader(S);@getByIdDirectPrivate(_,\"closedPromiseCapability\").promise.@then(()=>{},(h)=>{y.error(h)});function b(){@readableStreamDefaultReaderRead(_).@then(function(h){if(h.done){y.close();return}try{y.enqueue(h.value)}catch(c){y.error(\"ReadableStream chunk enqueueing in the sink failed\");return}b()},function(h){y.error(h)})}b()})\n"; // acquireReadableStreamDefaultReader const JSC::ConstructAbility s_readableStreamInternalsAcquireReadableStreamDefaultReaderCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; @@ -1426,9 +1426,9 @@ const char* const s_readableStreamInternalsReadableStreamDefaultControllerStartC 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 = 1631; +const int s_readableStreamInternalsReadableStreamPipeToWritableStreamCodeLength = 1625; static const JSC::Intrinsic s_readableStreamInternalsReadableStreamPipeToWritableStreamCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_readableStreamInternalsReadableStreamPipeToWritableStreamCode = "(function (f,E,z,B,F,D){\"use strict\";if(@assert(@isReadableStream(f)),@assert(@isWritableStream(E)),@assert(!@isReadableStreamLocked(f)),@assert(!@isWritableStreamLocked(E)),@assert(D===@undefined||@isAbortSignal(D)),@getByIdDirectPrivate(f,\"underlyingByteSource\")!==@undefined)return @Promise.@reject(\"Piping to a readable bytestream is not supported\");let _={source:f,destination:E,preventAbort:B,preventCancel:F,preventClose:z,signal:D};if(_.reader=@acquireReadableStreamDefaultReader(f),_.writer=@acquireWritableStreamDefaultWriter(E),@putByIdDirectPrivate(f,\"disturbed\",!0),_.finalized=!1,_.shuttingDown=!1,_.promiseCapability=@newPromiseCapability(@Promise),_.pendingReadPromiseCapability=@newPromiseCapability(@Promise),_.pendingReadPromiseCapability.@resolve.@call(),_.pendingWritePromise=@Promise.@resolve(),D!==@undefined){const G=(T)=>{if(_.finalized)return;@pipeToShutdownWithAction(_,()=>{const H=!_.preventAbort&&@getByIdDirectPrivate(_.destination,\"state\")===\"writable\"\?@writableStreamAbort(_.destination,T):@Promise.@resolve(),I=!_.preventCancel&&@getByIdDirectPrivate(_.source,\"state\")===@streamReadable\?@readableStreamCancel(_.source,T):@Promise.@resolve();let k=@newPromiseCapability(@Promise),q=!0,w=()=>{if(q){q=!1;return}k.@resolve.@call()},x=(J)=>{k.@reject.@call(@undefined,J)};return H.@then(w,x),I.@then(w,x),k.@promise},T)};if(@whenSignalAborted(D,G))return _.promiseCapability.@promise}return @pipeToErrorsMustBePropagatedForward(_),@pipeToErrorsMustBePropagatedBackward(_),@pipeToClosingMustBePropagatedForward(_),@pipeToClosingMustBePropagatedBackward(_),@pipeToLoop(_),_.promiseCapability.@promise})\n"; +const char* const s_readableStreamInternalsReadableStreamPipeToWritableStreamCode = "(function (E,k,F,G,H,f){\"use strict\";if(@assert(@isReadableStream(E)),@assert(@isWritableStream(k)),@assert(!@isReadableStreamLocked(E)),@assert(!@isWritableStreamLocked(k)),@assert(f===@undefined||@isAbortSignal(f)),@getByIdDirectPrivate(E,\"underlyingByteSource\")!==@undefined)return @Promise.@reject(\"Piping to a readable bytestream is not supported\");let _={source:E,destination:k,preventAbort:G,preventCancel:H,preventClose:F,signal:f};if(_.reader=@acquireReadableStreamDefaultReader(E),_.writer=@acquireWritableStreamDefaultWriter(k),@putByIdDirectPrivate(E,\"disturbed\",!0),_.finalized=!1,_.shuttingDown=!1,_.promiseCapability=@newPromiseCapability(@Promise),_.pendingReadPromiseCapability=@newPromiseCapability(@Promise),_.pendingReadPromiseCapability.resolve.@call(),_.pendingWritePromise=@Promise.@resolve(),f!==@undefined){const I=(q)=>{if(_.finalized)return;@pipeToShutdownWithAction(_,()=>{const J=!_.preventAbort&&@getByIdDirectPrivate(_.destination,\"state\")===\"writable\"\?@writableStreamAbort(_.destination,q):@Promise.@resolve(),K=!_.preventCancel&&@getByIdDirectPrivate(_.source,\"state\")===@streamReadable\?@readableStreamCancel(_.source,q):@Promise.@resolve();let w=@newPromiseCapability(@Promise),x=!0,z=()=>{if(x){x=!1;return}w.resolve.@call()},B=(L)=>{w.reject.@call(@undefined,L)};return J.@then(z,B),K.@then(z,B),w.promise},q)};if(@whenSignalAborted(f,I))return _.promiseCapability.promise}return @pipeToErrorsMustBePropagatedForward(_),@pipeToErrorsMustBePropagatedBackward(_),@pipeToClosingMustBePropagatedForward(_),@pipeToClosingMustBePropagatedBackward(_),@pipeToLoop(_),_.promiseCapability.promise})\n"; // pipeToLoop const JSC::ConstructAbility s_readableStreamInternalsPipeToLoopCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; @@ -1442,33 +1442,33 @@ const char* const s_readableStreamInternalsPipeToLoopCode = "(function (c){\"use 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 = 731; +const int s_readableStreamInternalsPipeToDoReadWriteCodeLength = 725; static const JSC::Intrinsic s_readableStreamInternalsPipeToDoReadWriteCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_readableStreamInternalsPipeToDoReadWriteCode = "(function (_){\"use strict\";return @assert(!_.shuttingDown),_.pendingReadPromiseCapability=@newPromiseCapability(@Promise),@getByIdDirectPrivate(_.writer,\"readyPromise\").@promise.@then(()=>{if(_.shuttingDown){_.pendingReadPromiseCapability.@resolve.@call(@undefined,!1);return}@readableStreamDefaultReaderRead(_.reader).@then((m)=>{const d=!m.done&&@getByIdDirectPrivate(_.writer,\"stream\")!==@undefined;if(_.pendingReadPromiseCapability.@resolve.@call(@undefined,d),!d)return;_.pendingWritePromise=@writableStreamDefaultWriterWrite(_.writer,m.value)},(m)=>{_.pendingReadPromiseCapability.@resolve.@call(@undefined,!1)})},(m)=>{_.pendingReadPromiseCapability.@resolve.@call(@undefined,!1)}),_.pendingReadPromiseCapability.@promise})\n"; +const char* const s_readableStreamInternalsPipeToDoReadWriteCode = "(function (d){\"use strict\";return @assert(!d.shuttingDown),d.pendingReadPromiseCapability=@newPromiseCapability(@Promise),@getByIdDirectPrivate(d.writer,\"readyPromise\").promise.@then(()=>{if(d.shuttingDown){d.pendingReadPromiseCapability.resolve.@call(@undefined,!1);return}@readableStreamDefaultReaderRead(d.reader).@then((m)=>{const g=!m.done&&@getByIdDirectPrivate(d.writer,\"stream\")!==@undefined;if(d.pendingReadPromiseCapability.resolve.@call(@undefined,g),!g)return;d.pendingWritePromise=@writableStreamDefaultWriterWrite(d.writer,m.value)},(m)=>{d.pendingReadPromiseCapability.resolve.@call(@undefined,!1)})},(m)=>{d.pendingReadPromiseCapability.resolve.@call(@undefined,!1)}),d.pendingReadPromiseCapability.promise})\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 = 438; +const int s_readableStreamInternalsPipeToErrorsMustBePropagatedForwardCodeLength = 436; static const JSC::Intrinsic s_readableStreamInternalsPipeToErrorsMustBePropagatedForwardCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_readableStreamInternalsPipeToErrorsMustBePropagatedForwardCode = "(function (_){\"use strict\";const d=()=>{_.pendingReadPromiseCapability.@resolve.@call(@undefined,!1);const b=@getByIdDirectPrivate(_.source,\"storedError\");if(!_.preventAbort){@pipeToShutdownWithAction(_,()=>@writableStreamAbort(_.destination,b),b);return}@pipeToShutdown(_,b)};if(@getByIdDirectPrivate(_.source,\"state\")===@streamErrored){d();return}@getByIdDirectPrivate(_.reader,\"closedPromiseCapability\").@promise.@then(@undefined,d)})\n"; +const char* const s_readableStreamInternalsPipeToErrorsMustBePropagatedForwardCode = "(function (s){\"use strict\";const _=()=>{s.pendingReadPromiseCapability.resolve.@call(@undefined,!1);const g=@getByIdDirectPrivate(s.source,\"storedError\");if(!s.preventAbort){@pipeToShutdownWithAction(s,()=>@writableStreamAbort(s.destination,g),g);return}@pipeToShutdown(s,g)};if(@getByIdDirectPrivate(s.source,\"state\")===@streamErrored){_();return}@getByIdDirectPrivate(s.reader,\"closedPromiseCapability\").promise.@then(@undefined,_)})\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 = 369; +const int s_readableStreamInternalsPipeToErrorsMustBePropagatedBackwardCodeLength = 368; static const JSC::Intrinsic s_readableStreamInternalsPipeToErrorsMustBePropagatedBackwardCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_readableStreamInternalsPipeToErrorsMustBePropagatedBackwardCode = "(function (m){\"use strict\";const y=()=>{const h=@getByIdDirectPrivate(m.destination,\"storedError\");if(!m.preventCancel){@pipeToShutdownWithAction(m,()=>@readableStreamCancel(m.source,h),h);return}@pipeToShutdown(m,h)};if(@getByIdDirectPrivate(m.destination,\"state\")===\"errored\"){y();return}@getByIdDirectPrivate(m.writer,\"closedPromise\").@promise.@then(@undefined,y)})\n"; +const char* const s_readableStreamInternalsPipeToErrorsMustBePropagatedBackwardCode = "(function (m){\"use strict\";const h=()=>{const d=@getByIdDirectPrivate(m.destination,\"storedError\");if(!m.preventCancel){@pipeToShutdownWithAction(m,()=>@readableStreamCancel(m.source,d),d);return}@pipeToShutdown(m,d)};if(@getByIdDirectPrivate(m.destination,\"state\")===\"errored\"){h();return}@getByIdDirectPrivate(m.writer,\"closedPromise\").promise.@then(@undefined,h)})\n"; // pipeToClosingMustBePropagatedForward const JSC::ConstructAbility s_readableStreamInternalsPipeToClosingMustBePropagatedForwardCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; const JSC::ConstructorKind s_readableStreamInternalsPipeToClosingMustBePropagatedForwardCodeConstructorKind = JSC::ConstructorKind::None; const JSC::ImplementationVisibility s_readableStreamInternalsPipeToClosingMustBePropagatedForwardCodeImplementationVisibility = JSC::ImplementationVisibility::Public; -const int s_readableStreamInternalsPipeToClosingMustBePropagatedForwardCodeLength = 405; +const int s_readableStreamInternalsPipeToClosingMustBePropagatedForwardCodeLength = 403; static const JSC::Intrinsic s_readableStreamInternalsPipeToClosingMustBePropagatedForwardCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_readableStreamInternalsPipeToClosingMustBePropagatedForwardCode = "(function (d){\"use strict\";const m=()=>{if(d.pendingReadPromiseCapability.@resolve.@call(@undefined,!1),!d.preventClose){@pipeToShutdownWithAction(d,()=>@writableStreamDefaultWriterCloseWithErrorPropagation(d.writer));return}@pipeToShutdown(d)};if(@getByIdDirectPrivate(d.source,\"state\")===@streamClosed){m();return}@getByIdDirectPrivate(d.reader,\"closedPromiseCapability\").@promise.@then(m,@undefined)})\n"; +const char* const s_readableStreamInternalsPipeToClosingMustBePropagatedForwardCode = "(function (_){\"use strict\";const r=()=>{if(_.pendingReadPromiseCapability.resolve.@call(@undefined,!1),!_.preventClose){@pipeToShutdownWithAction(_,()=>@writableStreamDefaultWriterCloseWithErrorPropagation(_.writer));return}@pipeToShutdown(_)};if(@getByIdDirectPrivate(_.source,\"state\")===@streamClosed){r();return}@getByIdDirectPrivate(_.reader,\"closedPromiseCapability\").promise.@then(r,@undefined)})\n"; // pipeToClosingMustBePropagatedBackward const JSC::ConstructAbility s_readableStreamInternalsPipeToClosingMustBePropagatedBackwardCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; @@ -1482,57 +1482,57 @@ const char* const s_readableStreamInternalsPipeToClosingMustBePropagatedBackward 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 = 458; +const int s_readableStreamInternalsPipeToShutdownWithActionCodeLength = 457; static const JSC::Intrinsic s_readableStreamInternalsPipeToShutdownWithActionCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_readableStreamInternalsPipeToShutdownWithActionCode = "(function (_,d){\"use strict\";if(_.shuttingDown)return;_.shuttingDown=!0;const g=arguments.length>2,h=arguments[2],m=()=>{d().@then(()=>{if(g)@pipeToFinalize(_,h);else @pipeToFinalize(_)},(j)=>{@pipeToFinalize(_,j)})};if(@getByIdDirectPrivate(_.destination,\"state\")===\"writable\"&&!@writableStreamCloseQueuedOrInFlight(_.destination)){_.pendingReadPromiseCapability.@promise.@then(()=>{_.pendingWritePromise.@then(m,m)},(b)=>@pipeToFinalize(_,b));return}m()})\n"; +const char* const s_readableStreamInternalsPipeToShutdownWithActionCode = "(function (_,u){\"use strict\";if(_.shuttingDown)return;_.shuttingDown=!0;const b=arguments.length>2,g=arguments[2],d=()=>{u().@then(()=>{if(b)@pipeToFinalize(_,g);else @pipeToFinalize(_)},(h)=>{@pipeToFinalize(_,h)})};if(@getByIdDirectPrivate(_.destination,\"state\")===\"writable\"&&!@writableStreamCloseQueuedOrInFlight(_.destination)){_.pendingReadPromiseCapability.promise.@then(()=>{_.pendingWritePromise.@then(d,d)},(m)=>@pipeToFinalize(_,m));return}d()})\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 = 411; +const int s_readableStreamInternalsPipeToShutdownCodeLength = 410; static const JSC::Intrinsic s_readableStreamInternalsPipeToShutdownCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_readableStreamInternalsPipeToShutdownCode = "(function (_){\"use strict\";if(_.shuttingDown)return;_.shuttingDown=!0;const m=arguments.length>1,u=arguments[1],d=()=>{if(m)@pipeToFinalize(_,u);else @pipeToFinalize(_)};if(@getByIdDirectPrivate(_.destination,\"state\")===\"writable\"&&!@writableStreamCloseQueuedOrInFlight(_.destination)){_.pendingReadPromiseCapability.@promise.@then(()=>{_.pendingWritePromise.@then(d,d)},(I)=>@pipeToFinalize(_,I));return}d()})\n"; +const char* const s_readableStreamInternalsPipeToShutdownCode = "(function (_){\"use strict\";if(_.shuttingDown)return;_.shuttingDown=!0;const d=arguments.length>1,m=arguments[1],c=()=>{if(d)@pipeToFinalize(_,m);else @pipeToFinalize(_)};if(@getByIdDirectPrivate(_.destination,\"state\")===\"writable\"&&!@writableStreamCloseQueuedOrInFlight(_.destination)){_.pendingReadPromiseCapability.promise.@then(()=>{_.pendingWritePromise.@then(c,c)},(u)=>@pipeToFinalize(_,u));return}c()})\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 = 259; +const int s_readableStreamInternalsPipeToFinalizeCodeLength = 257; static const JSC::Intrinsic s_readableStreamInternalsPipeToFinalizeCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_readableStreamInternalsPipeToFinalizeCode = "(function (s){\"use strict\";if(@writableStreamDefaultWriterRelease(s.writer),@readableStreamReaderGenericRelease(s.reader),s.finalized=!0,arguments.length>1)s.promiseCapability.@reject.@call(@undefined,arguments[1]);else s.promiseCapability.@resolve.@call()})\n"; +const char* const s_readableStreamInternalsPipeToFinalizeCode = "(function (l){\"use strict\";if(@writableStreamDefaultWriterRelease(l.writer),@readableStreamReaderGenericRelease(l.reader),l.finalized=!0,arguments.length>1)l.promiseCapability.reject.@call(@undefined,arguments[1]);else l.promiseCapability.resolve.@call()})\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 = 1104; +const int s_readableStreamInternalsReadableStreamTeeCodeLength = 1102; static const JSC::Intrinsic s_readableStreamInternalsReadableStreamTeeCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_readableStreamInternalsReadableStreamTeeCode = "(function (_,q){\"use strict\";@assert(@isReadableStream(_)),@assert(typeof q===\"boolean\");var v=@getByIdDirectPrivate(_,\"start\");if(v)@putByIdDirectPrivate(_,\"start\",@undefined),v();const w=new @ReadableStreamDefaultReader(_),i={closedOrErrored:!1,canceled1:!1,canceled2:!1,reason1:@undefined,reason2:@undefined};i.cancelPromiseCapability=@newPromiseCapability(@Promise);const x=@readableStreamTeePullFunction(i,w,q),f={};@putByIdDirectPrivate(f,\"pull\",x),@putByIdDirectPrivate(f,\"cancel\",@readableStreamTeeBranch1CancelFunction(i,_));const g={};@putByIdDirectPrivate(g,\"pull\",x),@putByIdDirectPrivate(g,\"cancel\",@readableStreamTeeBranch2CancelFunction(i,_));const j=new @ReadableStream(f),k=new @ReadableStream(g);return @getByIdDirectPrivate(w,\"closedPromiseCapability\").@promise.@then(@undefined,function(y){if(i.closedOrErrored)return;if(@readableStreamDefaultControllerError(j.@readableStreamController,y),@readableStreamDefaultControllerError(k.@readableStreamController,y),i.closedOrErrored=!0,!i.canceled1||!i.canceled2)i.cancelPromiseCapability.@resolve.@call()}),i.branch1=j,i.branch2=k,[j,k]})\n"; +const char* const s_readableStreamInternalsReadableStreamTeeCode = "(function (i,q){\"use strict\";@assert(@isReadableStream(i)),@assert(typeof q===\"boolean\");var v=@getByIdDirectPrivate(i,\"start\");if(v)@putByIdDirectPrivate(i,\"start\",@undefined),v();const w=new @ReadableStreamDefaultReader(i),_={closedOrErrored:!1,canceled1:!1,canceled2:!1,reason1:@undefined,reason2:@undefined};_.cancelPromiseCapability=@newPromiseCapability(@Promise);const x=@readableStreamTeePullFunction(_,w,q),f={};@putByIdDirectPrivate(f,\"pull\",x),@putByIdDirectPrivate(f,\"cancel\",@readableStreamTeeBranch1CancelFunction(_,i));const g={};@putByIdDirectPrivate(g,\"pull\",x),@putByIdDirectPrivate(g,\"cancel\",@readableStreamTeeBranch2CancelFunction(_,i));const j=new @ReadableStream(f),k=new @ReadableStream(g);return @getByIdDirectPrivate(w,\"closedPromiseCapability\").promise.@then(@undefined,function(y){if(_.closedOrErrored)return;if(@readableStreamDefaultControllerError(j.@readableStreamController,y),@readableStreamDefaultControllerError(k.@readableStreamController,y),_.closedOrErrored=!0,!_.canceled1||!_.canceled2)_.cancelPromiseCapability.resolve.@call()}),_.branch1=j,_.branch2=k,[j,k]})\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 = 764; +const int s_readableStreamInternalsReadableStreamTeePullFunctionCodeLength = 763; static const JSC::Intrinsic s_readableStreamInternalsReadableStreamTeePullFunctionCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_readableStreamInternalsReadableStreamTeePullFunctionCode = "(function (i,f,m){\"use strict\";return function(){@Promise.prototype.@then.@call(@readableStreamDefaultReaderRead(f),function(_){if(@assert(@isObject(_)),@assert(typeof _.done===\"boolean\"),_.done&&!i.closedOrErrored){if(!i.canceled1)@readableStreamDefaultControllerClose(i.branch1.@readableStreamController);if(!i.canceled2)@readableStreamDefaultControllerClose(i.branch2.@readableStreamController);if(i.closedOrErrored=!0,!i.canceled1||!i.canceled2)i.cancelPromiseCapability.@resolve.@call()}if(i.closedOrErrored)return;if(!i.canceled1)@readableStreamDefaultControllerEnqueue(i.branch1.@readableStreamController,_.value);if(!i.canceled2)@readableStreamDefaultControllerEnqueue(i.branch2.@readableStreamController,m\?@structuredCloneForStream(_.value):_.value)})}})\n"; +const char* const s_readableStreamInternalsReadableStreamTeePullFunctionCode = "(function (_,c,f){\"use strict\";return function(){@Promise.prototype.@then.@call(@readableStreamDefaultReaderRead(c),function(i){if(@assert(@isObject(i)),@assert(typeof i.done===\"boolean\"),i.done&&!_.closedOrErrored){if(!_.canceled1)@readableStreamDefaultControllerClose(_.branch1.@readableStreamController);if(!_.canceled2)@readableStreamDefaultControllerClose(_.branch2.@readableStreamController);if(_.closedOrErrored=!0,!_.canceled1||!_.canceled2)_.cancelPromiseCapability.resolve.@call()}if(_.closedOrErrored)return;if(!_.canceled1)@readableStreamDefaultControllerEnqueue(_.branch1.@readableStreamController,i.value);if(!_.canceled2)@readableStreamDefaultControllerEnqueue(_.branch2.@readableStreamController,f\?@structuredCloneForStream(i.value):i.value)})}})\n"; // readableStreamTeeBranch1CancelFunction const JSC::ConstructAbility s_readableStreamInternalsReadableStreamTeeBranch1CancelFunctionCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; const JSC::ConstructorKind s_readableStreamInternalsReadableStreamTeeBranch1CancelFunctionCodeConstructorKind = JSC::ConstructorKind::None; const JSC::ImplementationVisibility s_readableStreamInternalsReadableStreamTeeBranch1CancelFunctionCodeImplementationVisibility = JSC::ImplementationVisibility::Public; -const int s_readableStreamInternalsReadableStreamTeeBranch1CancelFunctionCodeLength = 258; +const int s_readableStreamInternalsReadableStreamTeeBranch1CancelFunctionCodeLength = 257; static const JSC::Intrinsic s_readableStreamInternalsReadableStreamTeeBranch1CancelFunctionCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_readableStreamInternalsReadableStreamTeeBranch1CancelFunctionCode = "(function (c,d){\"use strict\";return function(i){if(c.canceled1=!0,c.reason1=i,c.canceled2)@readableStreamCancel(d,[c.reason1,c.reason2]).@then(c.cancelPromiseCapability.@resolve,c.cancelPromiseCapability.@reject);return c.cancelPromiseCapability.@promise}})\n"; +const char* const s_readableStreamInternalsReadableStreamTeeBranch1CancelFunctionCode = "(function (d,i){\"use strict\";return function(n){if(d.canceled1=!0,d.reason1=n,d.canceled2)@readableStreamCancel(i,[d.reason1,d.reason2]).@then(d.cancelPromiseCapability.@resolve,d.cancelPromiseCapability.@reject);return d.cancelPromiseCapability.promise}})\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 = 258; +const int s_readableStreamInternalsReadableStreamTeeBranch2CancelFunctionCodeLength = 257; static const JSC::Intrinsic s_readableStreamInternalsReadableStreamTeeBranch2CancelFunctionCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_readableStreamInternalsReadableStreamTeeBranch2CancelFunctionCode = "(function (c,d){\"use strict\";return function(i){if(c.canceled2=!0,c.reason2=i,c.canceled1)@readableStreamCancel(d,[c.reason1,c.reason2]).@then(c.cancelPromiseCapability.@resolve,c.cancelPromiseCapability.@reject);return c.cancelPromiseCapability.@promise}})\n"; +const char* const s_readableStreamInternalsReadableStreamTeeBranch2CancelFunctionCode = "(function (d,i){\"use strict\";return function(n){if(d.canceled2=!0,d.reason2=n,d.canceled1)@readableStreamCancel(i,[d.reason1,d.reason2]).@then(d.cancelPromiseCapability.@resolve,d.cancelPromiseCapability.@reject);return d.cancelPromiseCapability.promise}})\n"; // isReadableStream const JSC::ConstructAbility s_readableStreamInternalsIsReadableStreamCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; @@ -1642,9 +1642,9 @@ const char* const s_readableStreamInternalsOnFlushDirectStreamCode = "(function 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 = 984; +const int s_readableStreamInternalsCreateTextStreamCodeLength = 983; static const JSC::Intrinsic s_readableStreamInternalsCreateTextStreamCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_readableStreamInternalsCreateTextStreamCode = "(function (G){\"use strict\";var q,v=[],x=!1,z=!1,j=\"\",C=@toLength(0),F=@newPromiseCapability(@Promise),A=!1;return q={start(){},write(_){if(typeof _===\"string\"){var w=@toLength(_.length);if(w>0)j+=_,x=!0,C+=w;return w}if(!_||!(@ArrayBuffer.@isView(_)||_ instanceof @ArrayBuffer))@throwTypeError(\"Expected text, ArrayBuffer or ArrayBufferView\");const E=@toLength(_.byteLength);if(E>0)if(z=!0,j.length>0)@arrayPush(v,j,_),j=\"\";else @arrayPush(v,_);return C+=E,E},flush(){return 0},end(){if(A)return\"\";return q.fulfill()},fulfill(){A=!0;const _=q.finishInternal();return @fulfillPromise(F.@promise,_),_},finishInternal(){if(!x&&!z)return\"\";if(x&&!z)return j;if(z&&!x)return new globalThis.TextDecoder().decode(@Bun.concatArrayBuffers(v));var _=new @Bun.ArrayBufferSink;_.start({highWaterMark:C,asUint8Array:!0});for(let w of v)_.write(w);if(v.length=0,j.length>0)_.write(j),j=\"\";return new globalThis.TextDecoder().decode(_.end())},close(){try{if(!A)A=!0,q.fulfill()}catch(_){}}},[q,F]})\n"; +const char* const s_readableStreamInternalsCreateTextStreamCode = "(function (G){\"use strict\";var q,v=[],x=!1,z=!1,j=\"\",C=@toLength(0),F=@newPromiseCapability(@Promise),A=!1;return q={start(){},write(_){if(typeof _===\"string\"){var w=@toLength(_.length);if(w>0)j+=_,x=!0,C+=w;return w}if(!_||!(@ArrayBuffer.@isView(_)||_ instanceof @ArrayBuffer))@throwTypeError(\"Expected text, ArrayBuffer or ArrayBufferView\");const E=@toLength(_.byteLength);if(E>0)if(z=!0,j.length>0)@arrayPush(v,j,_),j=\"\";else @arrayPush(v,_);return C+=E,E},flush(){return 0},end(){if(A)return\"\";return q.fulfill()},fulfill(){A=!0;const _=q.finishInternal();return @fulfillPromise(F.promise,_),_},finishInternal(){if(!x&&!z)return\"\";if(x&&!z)return j;if(z&&!x)return new globalThis.TextDecoder().decode(@Bun.concatArrayBuffers(v));var _=new @Bun.ArrayBufferSink;_.start({highWaterMark:C,asUint8Array:!0});for(let w of v)_.write(w);if(v.length=0,j.length>0)_.write(j),j=\"\";return new globalThis.TextDecoder().decode(_.end())},close(){try{if(!A)A=!0,q.fulfill()}catch(_){}}},[q,F]})\n"; // initializeTextStream const JSC::ConstructAbility s_readableStreamInternalsInitializeTextStreamCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; @@ -1658,9 +1658,9 @@ const char* const s_readableStreamInternalsInitializeTextStreamCode = "(function 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 = 797; +const int s_readableStreamInternalsInitializeArrayStreamCodeLength = 796; static const JSC::Intrinsic s_readableStreamInternalsInitializeArrayStreamCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_readableStreamInternalsInitializeArrayStreamCode = "(function (m,v){\"use strict\";var _=[],b=@newPromiseCapability(@Promise),t=!1;function d(){return t=!0,b.@resolve.@call(@undefined,_),_}var j={start(){},write(p){return @arrayPush(_,p),p.byteLength||p.length},flush(){return 0},end(){if(t)return[];return d()},close(){if(!t)d()}},q={@underlyingSource:m,@pull:@onPullDirectStream,@controlledReadableStream:this,@sink:j,close:@onCloseDirectStream,write:j.write,error:@handleDirectStreamError,end:@onCloseDirectStream,@close:@onCloseDirectStream,flush:@onFlushDirectStream,_pendingRead:@undefined,_deferClose:0,_deferFlush:0,_deferCloseReason:@undefined,_handleError:@undefined};return @putByIdDirectPrivate(this,\"readableStreamController\",q),@putByIdDirectPrivate(this,\"underlyingSource\",@undefined),@putByIdDirectPrivate(this,\"start\",@undefined),b})\n"; +const char* const s_readableStreamInternalsInitializeArrayStreamCode = "(function (v,x){\"use strict\";var _=[],b=@newPromiseCapability(@Promise),p=!1;function j(){return p=!0,b.resolve.@call(@undefined,_),_}var q={start(){},write(t){return @arrayPush(_,t),t.byteLength||t.length},flush(){return 0},end(){if(p)return[];return j()},close(){if(!p)j()}},w={@underlyingSource:v,@pull:@onPullDirectStream,@controlledReadableStream:this,@sink:q,close:@onCloseDirectStream,write:q.write,error:@handleDirectStreamError,end:@onCloseDirectStream,@close:@onCloseDirectStream,flush:@onFlushDirectStream,_pendingRead:@undefined,_deferClose:0,_deferFlush:0,_deferCloseReason:@undefined,_handleError:@undefined};return @putByIdDirectPrivate(this,\"readableStreamController\",w),@putByIdDirectPrivate(this,\"underlyingSource\",@undefined),@putByIdDirectPrivate(this,\"start\",@undefined),b})\n"; // initializeArrayBufferStream const JSC::ConstructAbility s_readableStreamInternalsInitializeArrayBufferStreamCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; @@ -1674,9 +1674,9 @@ const char* const s_readableStreamInternalsInitializeArrayBufferStreamCode = "(f 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 = 840; +const int s_readableStreamInternalsReadableStreamErrorCodeLength = 838; static const JSC::Intrinsic s_readableStreamInternalsReadableStreamErrorCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_readableStreamInternalsReadableStreamErrorCode = "(function (c,f){\"use strict\";@assert(@isReadableStream(c)),@assert(@getByIdDirectPrivate(c,\"state\")===@streamReadable),@putByIdDirectPrivate(c,\"state\",@streamErrored),@putByIdDirectPrivate(c,\"storedError\",f);const _=@getByIdDirectPrivate(c,\"reader\");if(!_)return;if(@isReadableStreamDefaultReader(_)){const n=@getByIdDirectPrivate(_,\"readRequests\");@putByIdDirectPrivate(_,\"readRequests\",@createFIFO());for(var i=n.shift();i;i=n.shift())@rejectPromise(i,f)}else{@assert(@isReadableStreamBYOBReader(_));const n=@getByIdDirectPrivate(_,\"readIntoRequests\");@putByIdDirectPrivate(_,\"readIntoRequests\",@createFIFO());for(var i=n.shift();i;i=n.shift())@rejectPromise(i,f)}@getByIdDirectPrivate(_,\"closedPromiseCapability\").@reject.@call(@undefined,f);const h=@getByIdDirectPrivate(_,\"closedPromiseCapability\").@promise;@markPromiseAsHandled(h)})\n"; +const char* const s_readableStreamInternalsReadableStreamErrorCode = "(function (n,f){\"use strict\";@assert(@isReadableStream(n)),@assert(@getByIdDirectPrivate(n,\"state\")===@streamReadable),@putByIdDirectPrivate(n,\"state\",@streamErrored),@putByIdDirectPrivate(n,\"storedError\",f);const _=@getByIdDirectPrivate(n,\"reader\");if(!_)return;if(@isReadableStreamDefaultReader(_)){const c=@getByIdDirectPrivate(_,\"readRequests\");@putByIdDirectPrivate(_,\"readRequests\",@createFIFO());for(var i=c.shift();i;i=c.shift())@rejectPromise(i,f)}else{@assert(@isReadableStreamBYOBReader(_));const c=@getByIdDirectPrivate(_,\"readIntoRequests\");@putByIdDirectPrivate(_,\"readIntoRequests\",@createFIFO());for(var i=c.shift();i;i=c.shift())@rejectPromise(i,f)}@getByIdDirectPrivate(_,\"closedPromiseCapability\").reject.@call(@undefined,f);const h=@getByIdDirectPrivate(_,\"closedPromiseCapability\").promise;@markPromiseAsHandled(h)})\n"; // readableStreamDefaultControllerShouldCallPull const JSC::ConstructAbility s_readableStreamInternalsReadableStreamDefaultControllerShouldCallPullCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; @@ -1754,9 +1754,9 @@ const char* const s_readableStreamInternalsReadableStreamDefaultControllerCloseC 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 = 617; +const int s_readableStreamInternalsReadableStreamCloseCodeLength = 616; static const JSC::Intrinsic s_readableStreamInternalsReadableStreamCloseCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_readableStreamInternalsReadableStreamCloseCode = "(function (_){\"use strict\";if(@assert(@getByIdDirectPrivate(_,\"state\")===@streamReadable),@putByIdDirectPrivate(_,\"state\",@streamClosed),!@getByIdDirectPrivate(_,\"reader\"))return;if(@isReadableStreamDefaultReader(@getByIdDirectPrivate(_,\"reader\"))){const i=@getByIdDirectPrivate(@getByIdDirectPrivate(_,\"reader\"),\"readRequests\");if(i.isNotEmpty()){@putByIdDirectPrivate(@getByIdDirectPrivate(_,\"reader\"),\"readRequests\",@createFIFO());for(var d=i.shift();d;d=i.shift())@fulfillPromise(d,{value:@undefined,done:!0})}}@getByIdDirectPrivate(@getByIdDirectPrivate(_,\"reader\"),\"closedPromiseCapability\").@resolve.@call()})\n"; +const char* const s_readableStreamInternalsReadableStreamCloseCode = "(function (d){\"use strict\";if(@assert(@getByIdDirectPrivate(d,\"state\")===@streamReadable),@putByIdDirectPrivate(d,\"state\",@streamClosed),!@getByIdDirectPrivate(d,\"reader\"))return;if(@isReadableStreamDefaultReader(@getByIdDirectPrivate(d,\"reader\"))){const _=@getByIdDirectPrivate(@getByIdDirectPrivate(d,\"reader\"),\"readRequests\");if(_.isNotEmpty()){@putByIdDirectPrivate(@getByIdDirectPrivate(d,\"reader\"),\"readRequests\",@createFIFO());for(var i=_.shift();i;i=_.shift())@fulfillPromise(i,{value:@undefined,done:!0})}}@getByIdDirectPrivate(@getByIdDirectPrivate(d,\"reader\"),\"closedPromiseCapability\").resolve.@call()})\n"; // readableStreamFulfillReadRequest const JSC::ConstructAbility s_readableStreamInternalsReadableStreamFulfillReadRequestCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; @@ -1802,9 +1802,9 @@ const char* const s_readableStreamInternalsIsReadableStreamDisturbedCode = "(fun 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 = 813; +const int s_readableStreamInternalsReadableStreamReaderGenericReleaseCodeLength = 810; static const JSC::Intrinsic s_readableStreamInternalsReadableStreamReaderGenericReleaseCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_readableStreamInternalsReadableStreamReaderGenericReleaseCode = "(function (_){\"use strict\";if(@assert(!!@getByIdDirectPrivate(_,\"ownerReadableStream\")),@assert(@getByIdDirectPrivate(@getByIdDirectPrivate(_,\"ownerReadableStream\"),\"reader\")===_),@getByIdDirectPrivate(@getByIdDirectPrivate(_,\"ownerReadableStream\"),\"state\")===@streamReadable)@getByIdDirectPrivate(_,\"closedPromiseCapability\").@reject.@call(@undefined,@makeTypeError(\"releasing lock of reader whose stream is still in readable state\"));else @putByIdDirectPrivate(_,\"closedPromiseCapability\",{@promise:@newHandledRejectedPromise(@makeTypeError(\"reader released lock\"))});const c=@getByIdDirectPrivate(_,\"closedPromiseCapability\").@promise;@markPromiseAsHandled(c),@putByIdDirectPrivate(@getByIdDirectPrivate(_,\"ownerReadableStream\"),\"reader\",@undefined),@putByIdDirectPrivate(_,\"ownerReadableStream\",@undefined)})\n"; +const char* const s_readableStreamInternalsReadableStreamReaderGenericReleaseCode = "(function (s){\"use strict\";if(@assert(!!@getByIdDirectPrivate(s,\"ownerReadableStream\")),@assert(@getByIdDirectPrivate(@getByIdDirectPrivate(s,\"ownerReadableStream\"),\"reader\")===s),@getByIdDirectPrivate(@getByIdDirectPrivate(s,\"ownerReadableStream\"),\"state\")===@streamReadable)@getByIdDirectPrivate(s,\"closedPromiseCapability\").reject.@call(@undefined,@makeTypeError(\"releasing lock of reader whose stream is still in readable state\"));else @putByIdDirectPrivate(s,\"closedPromiseCapability\",{promise:@newHandledRejectedPromise(@makeTypeError(\"reader released lock\"))});const t=@getByIdDirectPrivate(s,\"closedPromiseCapability\").promise;@markPromiseAsHandled(t),@putByIdDirectPrivate(@getByIdDirectPrivate(s,\"ownerReadableStream\"),\"reader\",@undefined),@putByIdDirectPrivate(s,\"ownerReadableStream\",@undefined)})\n"; // readableStreamDefaultControllerCanCloseOrEnqueue const JSC::ConstructAbility s_readableStreamInternalsReadableStreamDefaultControllerCanCloseOrEnqueueCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; @@ -1834,33 +1834,33 @@ const char* const s_readableStreamInternalsReadableStreamIntoArrayCode = "(funct 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 = 214; +const int s_readableStreamInternalsReadableStreamIntoTextCodeLength = 212; static const JSC::Intrinsic s_readableStreamInternalsReadableStreamIntoTextCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_readableStreamInternalsReadableStreamIntoTextCode = "(function (_){\"use strict\";const[h,d]=@createTextStream(@getByIdDirectPrivate(_,\"highWaterMark\")),i=@readStreamIntoSink(_,h,!1);if(i&&@isPromise(i))return @Promise.@resolve(i).@then(d.@promise);return d.@promise})\n"; +const char* const s_readableStreamInternalsReadableStreamIntoTextCode = "(function (h){\"use strict\";const[_,T]=@createTextStream(@getByIdDirectPrivate(h,\"highWaterMark\")),i=@readStreamIntoSink(h,_,!1);if(i&&@isPromise(i))return @Promise.@resolve(i).@then(T.promise);return T.promise})\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 = 727; +const int s_readableStreamInternalsReadableStreamToArrayBufferDirectCodeLength = 724; static const JSC::Intrinsic s_readableStreamInternalsReadableStreamToArrayBufferDirectCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_readableStreamInternalsReadableStreamToArrayBufferDirectCode = "(function (O,A){\"use strict\";var j=new @Bun.ArrayBufferSink;@putByIdDirectPrivate(O,\"underlyingSource\",@undefined);var B=@getByIdDirectPrivate(O,\"highWaterMark\");j.start(B\?{highWaterMark:B}:{});var w=@newPromiseCapability(@Promise),q=!1,x=A.pull,v=A.close,z={start(){},close(_){if(!q){if(q=!0,v)v();@fulfillPromise(w.@promise,j.end())}},end(){if(!q){if(q=!0,v)v();@fulfillPromise(w.@promise,j.end())}},flush(){return 0},write:j.write.bind(j)},C=!1;try{const _=x(z);if(_&&@isObject(_)&&@isPromise(_))return async function(D,F,G){while(!q)await G(D);return await F}(z,promise,x);return w.@promise}catch(_){return C=!0,@readableStreamError(O,_),@Promise.@reject(_)}finally{if(!C&&O)@readableStreamClose(O);z=v=j=x=O=@undefined}})\n"; +const char* const s_readableStreamInternalsReadableStreamToArrayBufferDirectCode = "(function (j,B){\"use strict\";var q=new @Bun.ArrayBufferSink;@putByIdDirectPrivate(j,\"underlyingSource\",@undefined);var C=@getByIdDirectPrivate(j,\"highWaterMark\");q.start(C\?{highWaterMark:C}:{});var x=@newPromiseCapability(@Promise),v=!1,z=B.pull,w=B.close,A={start(){},close(_){if(!v){if(v=!0,w)w();@fulfillPromise(x.promise,q.end())}},end(){if(!v){if(v=!0,w)w();@fulfillPromise(x.promise,q.end())}},flush(){return 0},write:q.write.bind(q)},D=!1;try{const _=z(A);if(_&&@isObject(_)&&@isPromise(_))return async function(F,G,H){while(!v)await H(F);return await G}(A,promise,z);return x.promise}catch(_){return D=!0,@readableStreamError(j,_),@Promise.@reject(_)}finally{if(!D&&j)@readableStreamClose(j);A=w=q=z=j=@undefined}})\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 = 278; +const int s_readableStreamInternalsReadableStreamToTextDirectCodeLength = 277; static const JSC::Intrinsic s_readableStreamInternalsReadableStreamToTextDirectCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_readableStreamInternalsReadableStreamToTextDirectCode = "(async function (_,h){\"use strict\";const j=@initializeTextStream.@call(_,h,@undefined);var f=_.getReader();while(@getByIdDirectPrivate(_,\"state\")===@streamReadable){var k=await f.read();if(k.done)break}try{f.releaseLock()}catch(p){}return f=@undefined,_=@undefined,j.@promise})\n"; +const char* const s_readableStreamInternalsReadableStreamToTextDirectCode = "(async function (f,j){\"use strict\";const k=@initializeTextStream.@call(f,j,@undefined);var h=f.getReader();while(@getByIdDirectPrivate(f,\"state\")===@streamReadable){var q=await h.read();if(q.done)break}try{h.releaseLock()}catch(v){}return h=@undefined,f=@undefined,k.promise})\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 = 354; +const int s_readableStreamInternalsReadableStreamToArrayDirectCodeLength = 353; static const JSC::Intrinsic s_readableStreamInternalsReadableStreamToArrayDirectCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_readableStreamInternalsReadableStreamToArrayDirectCode = "(async function (f,j){\"use strict\";const p=@initializeArrayStream.@call(f,j,@undefined);j=@undefined;var _=f.getReader();try{while(@getByIdDirectPrivate(f,\"state\")===@streamReadable){var q=await _.read();if(q.done)break}try{_.releaseLock()}catch(k){}return _=@undefined,@Promise.@resolve(p.@promise)}catch(k){throw k}finally{f=@undefined,_=@undefined}})\n"; +const char* const s_readableStreamInternalsReadableStreamToArrayDirectCode = "(async function (_,j){\"use strict\";const q=@initializeArrayStream.@call(_,j,@undefined);j=@undefined;var f=_.getReader();try{while(@getByIdDirectPrivate(_,\"state\")===@streamReadable){var v=await f.read();if(v.done)break}try{f.releaseLock()}catch(k){}return f=@undefined,@Promise.@resolve(q.promise)}catch(k){throw k}finally{_=@undefined,f=@undefined}})\n"; // readableStreamDefineLazyIterators const JSC::ConstructAbility s_readableStreamInternalsReadableStreamDefineLazyIteratorsCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; @@ -1992,9 +1992,9 @@ const char* const s_readableStreamBYOBReaderReleaseLockCode = "(function (){\"us 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 = 219; +const int s_readableStreamBYOBReaderClosedCodeLength = 218; static const JSC::Intrinsic s_readableStreamBYOBReaderClosedCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_readableStreamBYOBReaderClosedCode = "(function (){\"use strict\";if(!@isReadableStreamBYOBReader(this))return @Promise.@reject(@makeGetterTypeError(\"ReadableStreamBYOBReader\",\"closed\"));return @getByIdDirectPrivate(this,\"closedPromiseCapability\").@promise})\n"; +const char* const s_readableStreamBYOBReaderClosedCode = "(function (){\"use strict\";if(!@isReadableStreamBYOBReader(this))return @Promise.@reject(@makeGetterTypeError(\"ReadableStreamBYOBReader\",\"closed\"));return @getByIdDirectPrivate(this,\"closedPromiseCapability\").promise})\n"; #define DEFINE_BUILTIN_GENERATOR(codeName, functionName, overriddenName, argumentCount) \ JSC::FunctionExecutable* codeName##Generator(JSC::VM& vm) \ @@ -2076,9 +2076,9 @@ const char* const s_readableStreamDefaultReaderReleaseLockCode = "(function (){\ 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 = 225; +const int s_readableStreamDefaultReaderClosedCodeLength = 224; static const JSC::Intrinsic s_readableStreamDefaultReaderClosedCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_readableStreamDefaultReaderClosedCode = "(function (){\"use strict\";if(!@isReadableStreamDefaultReader(this))return @Promise.@reject(@makeGetterTypeError(\"ReadableStreamDefaultReader\",\"closed\"));return @getByIdDirectPrivate(this,\"closedPromiseCapability\").@promise})\n"; +const char* const s_readableStreamDefaultReaderClosedCode = "(function (){\"use strict\";if(!@isReadableStreamDefaultReader(this))return @Promise.@reject(@makeGetterTypeError(\"ReadableStreamDefaultReader\",\"closed\"));return @getByIdDirectPrivate(this,\"closedPromiseCapability\").promise})\n"; #define DEFINE_BUILTIN_GENERATOR(codeName, functionName, overriddenName, argumentCount) \ JSC::FunctionExecutable* codeName##Generator(JSC::VM& vm) \ @@ -2150,9 +2150,9 @@ const char* const s_streamInternalsPromiseInvokeOrFallbackOrNoopCode = "(functio const JSC::ConstructAbility s_streamInternalsValidateAndNormalizeQueuingStrategyCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; const JSC::ConstructorKind s_streamInternalsValidateAndNormalizeQueuingStrategyCodeConstructorKind = JSC::ConstructorKind::None; const JSC::ImplementationVisibility s_streamInternalsValidateAndNormalizeQueuingStrategyCodeImplementationVisibility = JSC::ImplementationVisibility::Public; -const int s_streamInternalsValidateAndNormalizeQueuingStrategyCodeLength = 263; +const int s_streamInternalsValidateAndNormalizeQueuingStrategyCodeLength = 259; static const JSC::Intrinsic s_streamInternalsValidateAndNormalizeQueuingStrategyCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_streamInternalsValidateAndNormalizeQueuingStrategyCode = "(function (d,l){\"use strict\";if(d!==@undefined&&typeof d!==\"function\")@throwTypeError(\"size parameter must be a function\");const f=@toNumber(l);if(@isNaN(f)||f<0)@throwRangeError(\"highWaterMark value is negative or not a number\");return{size:d,highWaterMark:f}})\n"; +const char* const s_streamInternalsValidateAndNormalizeQueuingStrategyCode = "(function (c,d){\"use strict\";if(c!==@undefined&&typeof c!==\"function\")@throwTypeError(\"size parameter must be a function\");const u=@toNumber(d);if(u!==u||u<0)@throwRangeError(\"highWaterMark value is negative or not a number\");return{size:c,highWaterMark:u}})\n"; // createFIFO const JSC::ConstructAbility s_streamInternalsCreateFIFOCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; @@ -2214,9 +2214,9 @@ const char* const s_streamInternalsExtractSizeAlgorithmCode = "(function (p){\"u const JSC::ConstructAbility s_streamInternalsExtractHighWaterMarkCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; const JSC::ConstructorKind s_streamInternalsExtractHighWaterMarkCodeConstructorKind = JSC::ConstructorKind::None; const JSC::ImplementationVisibility s_streamInternalsExtractHighWaterMarkCodeImplementationVisibility = JSC::ImplementationVisibility::Public; -const int s_streamInternalsExtractHighWaterMarkCodeLength = 188; +const int s_streamInternalsExtractHighWaterMarkCodeLength = 184; static const JSC::Intrinsic s_streamInternalsExtractHighWaterMarkCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_streamInternalsExtractHighWaterMarkCode = "(function (b,c){\"use strict\";const o=b.highWaterMark;if(o===@undefined)return c;if(@isNaN(o)||o<0)@throwRangeError(\"highWaterMark value is negative or not a number\");return @toNumber(o)})\n"; +const char* const s_streamInternalsExtractHighWaterMarkCode = "(function (n,p){\"use strict\";const c=n.highWaterMark;if(c===@undefined)return p;if(c!==c||c<0)@throwRangeError(\"highWaterMark value is negative or not a number\");return @toNumber(c)})\n"; // extractHighWaterMarkFromQueuingStrategyInit const JSC::ConstructAbility s_streamInternalsExtractHighWaterMarkFromQueuingStrategyInitCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; @@ -2256,9 +2256,9 @@ WEBCORE_FOREACH_STREAMINTERNALS_BUILTIN_CODE(DEFINE_BUILTIN_GENERATOR) 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 = 1387; +const int s_importMetaObjectLoadCJS2ESMCodeLength = 1406; static const JSC::Intrinsic s_importMetaObjectLoadCJS2ESMCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_importMetaObjectLoadCJS2ESMCode = "(function (B){\"use strict\";var D=@Loader,H=@createFIFO(),_=B;while(_){var w=D.registry.@get(_);if((w\?.state\?\?0)<=@ModuleFetch)@fulfillModuleSync(_),w=D.registry.@get(_);var W=@getPromiseInternalField(w.fetch,@promiseFieldReactionsOrResult),x=D.parseModule(_,W),z=w.module;if(x&&@isPromise(x)){var J=@getPromiseInternalField(x,@promiseFieldReactionsOrResult),X=@getPromiseInternalField(x,@promiseFieldFlags),Q=X&@promiseStateMask;if(Q===@promiseStatePending||J&&@isPromise(J))@throwTypeError(`require() async module \"${_}\" is unsupported. use \"await import()\" instead.`);else if(Q===@promiseStateRejected){if(!J\?.message)@throwTypeError(`${J+\"\"\?J:\"An error occurred\"} occurred while parsing module \\\"${_}\\\"`);throw J}w.module=z=J}else if(x&&!z)w.module=z=x;@setStateToMax(w,@ModuleLink);var Y=z.dependenciesMap,I=D.requestedModules(z),T=@newArrayWithSize(I.length);for(var F=0,Z=I.length;F=@ModuleLink)_=H.shift()}var V=D.linkAndEvaluateModule(B,@undefined);if(V&&@isPromise(V))@throwTypeError(`require() async module \\\"${B}\\\" is unsupported. use \"await import()\" instead.`);return D.registry.@get(B)})\n"; +const char* const s_importMetaObjectLoadCJS2ESMCode = "(function (z){\"use strict\";var J=@Loader,G=@createFIFO(),D=z;while(D){var _=J.registry.@get(D);if((_\?.state\?\?0)<=@ModuleFetch)@fulfillModuleSync(D),_=J.registry.@get(D);var V=@getPromiseInternalField(_.fetch,@promiseFieldReactionsOrResult),w=J.parseModule(D,V),x=_.module;if(w&&@isPromise(w)){var h=@getPromiseInternalField(w,@promiseFieldReactionsOrResult),W=@getPromiseInternalField(w,@promiseFieldFlags),L=W&@promiseStateMask;if(L===@promiseStatePending||h&&@isPromise(h))@throwTypeError(`require() async module \"${D}\" is unsupported. use \"await import()\" instead.`);else if(L===@promiseStateRejected){if(!h\?.message)@throwTypeError(`${h+\"\"\?h:\"An error occurred\"} occurred while parsing module \\\"${D}\\\"`);throw h}_.module=x=h}else if(w&&!x)_.module=x=w;@setStateToMax(_,@ModuleLink);var X=x.dependenciesMap,H=J.requestedModules(x),Q=@newArrayWithSize(H.length);for(var B=0,Y=H.length;B=@ModuleLink)D=G.shift()}var U=J.linkAndEvaluateModule(z,@undefined);if(U&&@isPromise(U))@throwTypeError(`require() async module \\\"${z}\\\" is unsupported. use \"await import()\" instead.`);return J.registry.@get(z)})\n"; // requireESM const JSC::ConstructAbility s_importMetaObjectRequireESMCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; @@ -2398,9 +2398,9 @@ const char* const s_writableStreamDefaultWriterInitializeWritableStreamDefaultWr 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 = 215; +const int s_writableStreamDefaultWriterClosedCodeLength = 214; static const JSC::Intrinsic s_writableStreamDefaultWriterClosedCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_writableStreamDefaultWriterClosedCode = "(function (){\"use strict\";if(!@isWritableStreamDefaultWriter(this))return @Promise.@reject(@makeGetterTypeError(\"WritableStreamDefaultWriter\",\"closed\"));return @getByIdDirectPrivate(this,\"closedPromise\").@promise})\n"; +const char* const s_writableStreamDefaultWriterClosedCode = "(function (){\"use strict\";if(!@isWritableStreamDefaultWriter(this))return @Promise.@reject(@makeGetterTypeError(\"WritableStreamDefaultWriter\",\"closed\"));return @getByIdDirectPrivate(this,\"closedPromise\").promise})\n"; // desiredSize const JSC::ConstructAbility s_writableStreamDefaultWriterDesiredSizeCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; @@ -2414,9 +2414,9 @@ const char* const s_writableStreamDefaultWriterDesiredSizeCode = "(function (){\ 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 = 211; +const int s_writableStreamDefaultWriterReadyCodeLength = 210; static const JSC::Intrinsic s_writableStreamDefaultWriterReadyCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_writableStreamDefaultWriterReadyCode = "(function (){\"use strict\";if(!@isWritableStreamDefaultWriter(this))return @Promise.@reject(@makeThisTypeError(\"WritableStreamDefaultWriter\",\"ready\"));return @getByIdDirectPrivate(this,\"readyPromise\").@promise})\n"; +const char* const s_writableStreamDefaultWriterReadyCode = "(function (){\"use strict\";if(!@isWritableStreamDefaultWriter(this))return @Promise.@reject(@makeThisTypeError(\"WritableStreamDefaultWriter\",\"ready\"));return @getByIdDirectPrivate(this,\"readyPromise\").promise})\n"; // abort const JSC::ConstructAbility s_writableStreamDefaultWriterAbortCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; @@ -2668,9 +2668,9 @@ WEBCORE_FOREACH_READABLESTREAMDEFAULTCONTROLLER_BUILTIN_CODE(DEFINE_BUILTIN_GENE 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 = 1654; +const int s_readableByteStreamInternalsPrivateInitializeReadableByteStreamControllerCodeLength = 1650; static const JSC::Intrinsic s_readableByteStreamInternalsPrivateInitializeReadableByteStreamControllerCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_readableByteStreamInternalsPrivateInitializeReadableByteStreamControllerCode = "(function (b,p,R){\"use strict\";if(!@isReadableStream(b))@throwTypeError(\"ReadableByteStreamController needs a ReadableStream\");if(@getByIdDirectPrivate(b,\"readableStreamController\")!==null)@throwTypeError(\"ReadableStream already has a controller\");@putByIdDirectPrivate(this,\"controlledReadableStream\",b),@putByIdDirectPrivate(this,\"underlyingByteSource\",p),@putByIdDirectPrivate(this,\"pullAgain\",!1),@putByIdDirectPrivate(this,\"pulling\",!1),@readableByteStreamControllerClearPendingPullIntos(this),@putByIdDirectPrivate(this,\"queue\",@newQueue()),@putByIdDirectPrivate(this,\"started\",0),@putByIdDirectPrivate(this,\"closeRequested\",!1);let f=@toNumber(R);if(@isNaN(f)||f<0)@throwRangeError(\"highWaterMark value is negative or not a number\");@putByIdDirectPrivate(this,\"strategyHWM\",f);let _=p.autoAllocateChunkSize;if(_!==@undefined){if(_=@toNumber(_),_<=0||_===@Infinity||_===-@Infinity)@throwRangeError(\"autoAllocateChunkSize value is negative or equal to positive or negative infinity\")}@putByIdDirectPrivate(this,\"autoAllocateChunkSize\",_),@putByIdDirectPrivate(this,\"pendingPullIntos\",@createFIFO());const v=this;return @promiseInvokeOrNoopNoCatch(@getByIdDirectPrivate(v,\"underlyingByteSource\"),\"start\",[v]).@then(()=>{@putByIdDirectPrivate(v,\"started\",1),@assert(!@getByIdDirectPrivate(v,\"pulling\")),@assert(!@getByIdDirectPrivate(v,\"pullAgain\")),@readableByteStreamControllerCallPullIfNeeded(v)},(d)=>{if(@getByIdDirectPrivate(b,\"state\")===@streamReadable)@readableByteStreamControllerError(v,d)}),@putByIdDirectPrivate(this,\"cancel\",@readableByteStreamControllerCancel),@putByIdDirectPrivate(this,\"pull\",@readableByteStreamControllerPull),this})\n"; +const char* const s_readableByteStreamInternalsPrivateInitializeReadableByteStreamControllerCode = "(function (R,D,E){\"use strict\";if(!@isReadableStream(R))@throwTypeError(\"ReadableByteStreamController needs a ReadableStream\");if(@getByIdDirectPrivate(R,\"readableStreamController\")!==null)@throwTypeError(\"ReadableStream already has a controller\");@putByIdDirectPrivate(this,\"controlledReadableStream\",R),@putByIdDirectPrivate(this,\"underlyingByteSource\",D),@putByIdDirectPrivate(this,\"pullAgain\",!1),@putByIdDirectPrivate(this,\"pulling\",!1),@readableByteStreamControllerClearPendingPullIntos(this),@putByIdDirectPrivate(this,\"queue\",@newQueue()),@putByIdDirectPrivate(this,\"started\",0),@putByIdDirectPrivate(this,\"closeRequested\",!1);let v=@toNumber(E);if(v!==v||v<0)@throwRangeError(\"highWaterMark value is negative or not a number\");@putByIdDirectPrivate(this,\"strategyHWM\",v);let _=D.autoAllocateChunkSize;if(_!==@undefined){if(_=@toNumber(_),_<=0||_===@Infinity||_===-@Infinity)@throwRangeError(\"autoAllocateChunkSize value is negative or equal to positive or negative infinity\")}@putByIdDirectPrivate(this,\"autoAllocateChunkSize\",_),@putByIdDirectPrivate(this,\"pendingPullIntos\",@createFIFO());const p=this;return @promiseInvokeOrNoopNoCatch(@getByIdDirectPrivate(p,\"underlyingByteSource\"),\"start\",[p]).@then(()=>{@putByIdDirectPrivate(p,\"started\",1),@assert(!@getByIdDirectPrivate(p,\"pulling\")),@assert(!@getByIdDirectPrivate(p,\"pullAgain\")),@readableByteStreamControllerCallPullIfNeeded(p)},(I)=>{if(@getByIdDirectPrivate(R,\"state\")===@streamReadable)@readableByteStreamControllerError(p,I)}),@putByIdDirectPrivate(this,\"cancel\",@readableByteStreamControllerCancel),@putByIdDirectPrivate(this,\"pull\",@readableByteStreamControllerPull),this})\n"; // readableStreamByteStreamControllerStart const JSC::ConstructAbility s_readableByteStreamInternalsReadableStreamByteStreamControllerStartCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; @@ -2844,9 +2844,9 @@ const char* const s_readableByteStreamInternalsReadableByteStreamControllerRespo 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 = 251; +const int s_readableByteStreamInternalsReadableByteStreamControllerRespondCodeLength = 247; static const JSC::Intrinsic s_readableByteStreamInternalsReadableByteStreamControllerRespondCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_readableByteStreamInternalsReadableByteStreamControllerRespondCode = "(function (I,u){\"use strict\";if(u=@toNumber(u),@isNaN(u)||u===@Infinity||u<0)@throwRangeError(\"bytesWritten has an incorrect value\");@assert(@getByIdDirectPrivate(I,\"pendingPullIntos\").isNotEmpty()),@readableByteStreamControllerRespondInternal(I,u)})\n"; +const char* const s_readableByteStreamInternalsReadableByteStreamControllerRespondCode = "(function (u,_){\"use strict\";if(_=@toNumber(_),_!==_||_===@Infinity||_<0)@throwRangeError(\"bytesWritten has an incorrect value\");@assert(@getByIdDirectPrivate(u,\"pendingPullIntos\").isNotEmpty()),@readableByteStreamControllerRespondInternal(u,_)})\n"; // readableByteStreamControllerRespondInternal const JSC::ConstructAbility s_readableByteStreamInternalsReadableByteStreamControllerRespondInternalCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; @@ -2992,9 +2992,9 @@ WEBCORE_FOREACH_WRITABLESTREAMDEFAULTCONTROLLER_BUILTIN_CODE(DEFINE_BUILTIN_GENE 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 = 5477; +const int s_eventSourceGetEventSourceCodeLength = 5469; static const JSC::Intrinsic s_eventSourceGetEventSourceCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_eventSourceGetEventSourceCode = "(function (){\"use strict\";class F extends EventTarget{#B;#$;#J;#K;#L;#M=!1;#A=null;#j=\"\";#O=\"\";#Q=\"\";#U=!0;#F=0;#G=0;#X=0;#w=null;static#V(j){j.#H()}static#Y(j,A){const w=j.data,B=w.#Q\?`Last-Event-ID: ${w.#Q}\\r\\n`:\"\",K=`GET ${A.pathname}${A.search} HTTP/1.1\\r\\nHost: bun\\r\\nContent-type: text/event-stream\\r\\nContent-length: 0\\r\\n${B}\\r\\n`,G=j.write(K);if(G!==K.length)w.#O=K.substring(G)}static#Z(j,A,w){for(;;){if(w>=A.length)return;let B=-1,K=A.indexOf(\"\\r\\n\",w);const G=K+2;if(K>0)if(j.#F===0){const J=parseInt(A.substring(w,K),16);if(J===0){j.#$=2,j.#A\?.end();return}B=G+J}else B=A.length;else{if(j.#j.length===0){j.#j+=A.substring(w);return}B=A.length}let M=A.substring(G,B);w=B+2;let Z=0,L=M.indexOf(\"\\n\\n\");if(L==-1){j.#j+=A.substring(G);return}if(j.#j.length)j.#j+=M,M=j.#j,j.#j=\"\";let X=!0;while(X){const J=M.substring(Z,L);let Y,O=\"\",Q,W=0,V=-1;for(;;){let z=J.indexOf(\"\\n\",W);if(z===-1){if(W>=J.length)break;z=J.length}const U=J.substring(W,z);if(U.startsWith(\"data:\"))if(O.length)O+=`\\n${U.substring(5).trim()}`;else O=U.substring(5).trim();else if(U.startsWith(\"event:\"))Y=U.substring(6).trim();else if(U.startsWith(\"id:\"))Q=U.substring(3).trim();else if(U.startsWith(\"retry:\")){if(V=parseInt(U.substring(6).trim(),10),@isNaN(V))V=-1}W=z+1}if(j.#Q=Q||\"\",V>=0)j.#X=V;if(O||Q||Y)j.dispatchEvent(new MessageEvent(Y||\"message\",{data:O||\"\",origin:j.#B.origin,source:j,lastEventId:Q}));if(M.length===L+2){X=!1;break}const H=M.indexOf(\"\\n\\n\",L+1);if(H===-1)break;Z=L,L=H}}}static#z={open(j){const A=j.data;if(A.#A=j,!A.#M)F.#Y(j,A.#B)},handshake(j,A,w){const B=j.data;if(A)F.#Y(j,B.#B);else B.#$=2,B.dispatchEvent(new ErrorEvent(\"error\",{error:w})),j.end()},data(j,A){const w=j.data;switch(w.#$){case 0:{let B=A.toString();const K=B.indexOf(\"\\r\\n\\r\\n\");if(K===-1){w.#j+=B;return}if(w.#j.length)w.#j+=B,B=w.#j,w.#j=\"\";const G=B.substring(0,K),M=G.indexOf(\"\\r\\n\");if(M===-1){w.#$=2,w.dispatchEvent(new ErrorEvent(\"error\",{error:new Error(\"Invalid HTTP request\")})),j.end();return}const Z=G.substring(0,M);if(Z!==\"HTTP/1.1 200 OK\"){w.#$=2,w.dispatchEvent(new ErrorEvent(\"error\",{error:new Error(Z)})),j.end();return}let L=M+1,X=!1,J=-1;for(;;){let O=G.indexOf(\"\\r\\n\",L);if(O===-1){if(L>=G.length){if(!X)w.#$=2,w.dispatchEvent(new ErrorEvent(\"error\",{error:new Error(`EventSource's response has no MIME type and \"text/event-stream\" is required. Aborting the connection.`)})),j.end();return}O=G.length}const Q=G.substring(L+1,O),W=Q.indexOf(\":\"),V=Q.substring(0,W),H=V.localeCompare(\"content-type\",@undefined,{sensitivity:\"accent\"})===0;if(L=O+1,H)if(Q.endsWith(\" text/event-stream\"))X=!0;else{w.#$=2,w.dispatchEvent(new ErrorEvent(\"error\",{error:new Error(`EventSource's response has a MIME type that is not \"text/event-stream\". Aborting the connection.`)})),j.end();return}else if(V.localeCompare(\"content-length\",@undefined,{sensitivity:\"accent\"})===0){if(J=parseInt(Q.substring(W+1).trim(),10),@isNaN(J)||J<=0){w.dispatchEvent(new ErrorEvent(\"error\",{error:new Error(`EventSource's Content-Length is invalid. Aborting the connection.`)})),j.end();return}if(X)break}else if(V.localeCompare(\"transfer-encoding\",@undefined,{sensitivity:\"accent\"})===0){if(Q.substring(W+1).trim()!==\"chunked\"){w.dispatchEvent(new ErrorEvent(\"error\",{error:new Error(`EventSource's Transfer-Encoding is invalid. Aborting the connection.`)})),j.end();return}if(J=0,X)break}}w.#F=J,w.#$=1,w.dispatchEvent(new Event(\"open\"));const Y=B.substring(K+4);if(F.#Z(w,Y,0),w.#F>0){if(w.#G+=Y.length,w.#G>=w.#F)w.#$=2,j.end()}return}case 1:if(F.#Z(w,A.toString(),2),w.#F>0){if(w.#G+=A.byteLength,w.#G>=w.#F)w.#$=2,j.end()}return;default:break}},drain(j){const A=j.data;if(A.#$===0){const w=A.#j;if(w.length){const B=j.write(w);if(B!==w.length)j.data.#O=w.substring(B);else j.data.#O=\"\"}}},close:F.#W,end(j){F.#W(j).dispatchEvent(new ErrorEvent(\"error\",{error:new Error(\"Connection closed by server\")}))},timeout(j){F.#W(j).dispatchEvent(new ErrorEvent(\"error\",{error:new Error(\"Timeout\")}))},binaryType:\"buffer\"};static#W(j){const A=j.data;if(A.#A=null,A.#G=0,A.#$=2,A.#U){if(A.#w)clearTimeout(A.#w);A.#w=setTimeout(F.#V,A.#X,A)}return A}constructor(j,A=@undefined){super();const w=new URL(j);this.#M=w.protocol===\"https:\",this.#B=w,this.#$=2,process.nextTick(F.#V,this)}ref(){this.#w\?.ref(),this.#A\?.ref()}unref(){this.#w\?.unref(),this.#A\?.unref()}#H(){if(this.#$!==2)return;const j=this.#B,A=this.#M;this.#$=0,@Bun.connect({data:this,socket:F.#z,hostname:j.hostname,port:parseInt(j.port||(A\?\"443\":\"80\"),10),tls:A\?{requestCert:!0,rejectUnauthorized:!1}:!1}).catch((w)=>{if(super.dispatchEvent(new ErrorEvent(\"error\",{error:w})),this.#U){if(this.#w)this.#w.unref\?.();this.#w=setTimeout(F.#V,1000,this)}})}get url(){return this.#B.href}get readyState(){return this.#$}close(){this.#U=!1,this.#$=2,this.#A\?.unref(),this.#A\?.end()}get onopen(){return this.#L}get onerror(){return this.#J}get onmessage(){return this.#K}set onopen(j){if(this.#L)super.removeEventListener(\"close\",this.#L);super.addEventListener(\"open\",j),this.#L=j}set onerror(j){if(this.#J)super.removeEventListener(\"error\",this.#J);super.addEventListener(\"error\",j),this.#J=j}set onmessage(j){if(this.#K)super.removeEventListener(\"message\",this.#K);super.addEventListener(\"message\",j),this.#K=j}}return Object.defineProperty(F.prototype,\"CONNECTING\",{enumerable:!0,value:0}),Object.defineProperty(F.prototype,\"OPEN\",{enumerable:!0,value:1}),Object.defineProperty(F.prototype,\"CLOSED\",{enumerable:!0,value:2}),F[Symbol.for(\"CommonJS\")]=0,F})\n"; +const char* const s_eventSourceGetEventSourceCode = "(function (){\"use strict\";class A extends EventTarget{#j;#$;#F;#G;#J;#K=!1;#U=null;#w=\"\";#M=\"\";#O=\"\";#Q=!0;#A=0;#B=0;#X=0;#L=null;static#V(w){w.#H()}static#Y(w,U){const L=w.data,j=L.#O\?`Last-Event-ID: ${L.#O}\\r\\n`:\"\",G=`GET ${U.pathname}${U.search} HTTP/1.1\\r\\nHost: bun\\r\\nContent-type: text/event-stream\\r\\nContent-length: 0\\r\\n${j}\\r\\n`,F=w.write(G);if(F!==G.length)L.#M=G.substring(F)}static#Z(w,U,L){for(;;){if(L>=U.length)return;let j=-1,G=U.indexOf(\"\\r\\n\",L);const F=G+2;if(G>0)if(w.#A===0){const B=parseInt(U.substring(L,G),16);if(B===0){w.#$=2,w.#U\?.end();return}j=F+B}else j=U.length;else{if(w.#w.length===0){w.#w+=U.substring(L);return}j=U.length}let K=U.substring(F,j);L=j+2;let Z=0,J=K.indexOf(\"\\n\\n\");if(J==-1){w.#w+=U.substring(F);return}if(w.#w.length)w.#w+=K,K=w.#w,w.#w=\"\";let X=!0;while(X){const B=K.substring(Z,J);let Y,M=\"\",O,W=0,Q=-1;for(;;){let z=B.indexOf(\"\\n\",W);if(z===-1){if(W>=B.length)break;z=B.length}const V=B.substring(W,z);if(V.startsWith(\"data:\"))if(M.length)M+=`\\n${V.substring(5).trim()}`;else M=V.substring(5).trim();else if(V.startsWith(\"event:\"))Y=V.substring(6).trim();else if(V.startsWith(\"id:\"))O=V.substring(3).trim();else if(V.startsWith(\"retry:\")){if(Q=parseInt(V.substring(6).trim(),10),Q!==Q)Q=-1}W=z+1}if(w.#O=O||\"\",Q>=0)w.#X=Q;if(M||O||Y)w.dispatchEvent(new MessageEvent(Y||\"message\",{data:M||\"\",origin:w.#j.origin,source:w,lastEventId:O}));if(K.length===J+2){X=!1;break}const H=K.indexOf(\"\\n\\n\",J+1);if(H===-1)break;Z=J,J=H}}}static#z={open(w){const U=w.data;if(U.#U=w,!U.#K)A.#Y(w,U.#j)},handshake(w,U,L){const j=w.data;if(U)A.#Y(w,j.#j);else j.#$=2,j.dispatchEvent(new ErrorEvent(\"error\",{error:L})),w.end()},data(w,U){const L=w.data;switch(L.#$){case 0:{let j=U.toString();const G=j.indexOf(\"\\r\\n\\r\\n\");if(G===-1){L.#w+=j;return}if(L.#w.length)L.#w+=j,j=L.#w,L.#w=\"\";const F=j.substring(0,G),K=F.indexOf(\"\\r\\n\");if(K===-1){L.#$=2,L.dispatchEvent(new ErrorEvent(\"error\",{error:new Error(\"Invalid HTTP request\")})),w.end();return}const Z=F.substring(0,K);if(Z!==\"HTTP/1.1 200 OK\"){L.#$=2,L.dispatchEvent(new ErrorEvent(\"error\",{error:new Error(Z)})),w.end();return}let J=K+1,X=!1,B=-1;for(;;){let M=F.indexOf(\"\\r\\n\",J);if(M===-1){if(J>=F.length){if(!X)L.#$=2,L.dispatchEvent(new ErrorEvent(\"error\",{error:new Error(`EventSource's response has no MIME type and \"text/event-stream\" is required. Aborting the connection.`)})),w.end();return}M=F.length}const O=F.substring(J+1,M),W=O.indexOf(\":\"),Q=O.substring(0,W),H=Q.localeCompare(\"content-type\",@undefined,{sensitivity:\"accent\"})===0;if(J=M+1,H)if(O.endsWith(\" text/event-stream\"))X=!0;else{L.#$=2,L.dispatchEvent(new ErrorEvent(\"error\",{error:new Error(`EventSource's response has a MIME type that is not \"text/event-stream\". Aborting the connection.`)})),w.end();return}else if(Q.localeCompare(\"content-length\",@undefined,{sensitivity:\"accent\"})===0){if(B=parseInt(O.substring(W+1).trim(),10),B!==B||B<=0){L.dispatchEvent(new ErrorEvent(\"error\",{error:new Error(\"EventSource's Content-Length is invalid. Aborting the connection.\")})),w.end();return}if(X)break}else if(Q.localeCompare(\"transfer-encoding\",@undefined,{sensitivity:\"accent\"})===0){if(O.substring(W+1).trim()!==\"chunked\"){L.dispatchEvent(new ErrorEvent(\"error\",{error:new Error(\"EventSource's Transfer-Encoding is invalid. Aborting the connection.\")})),w.end();return}if(B=0,X)break}}L.#A=B,L.#$=1,L.dispatchEvent(new Event(\"open\"));const Y=j.substring(G+4);if(A.#Z(L,Y,0),L.#A>0){if(L.#B+=Y.length,L.#B>=L.#A)L.#$=2,w.end()}return}case 1:if(A.#Z(L,U.toString(),2),L.#A>0){if(L.#B+=U.byteLength,L.#B>=L.#A)L.#$=2,w.end()}return;default:break}},drain(w){const U=w.data;if(U.#$===0){const L=U.#w;if(L.length){const j=w.write(L);if(j!==L.length)w.data.#M=L.substring(j);else w.data.#M=\"\"}}},close:A.#W,end(w){A.#W(w).dispatchEvent(new ErrorEvent(\"error\",{error:new Error(\"Connection closed by server\")}))},timeout(w){A.#W(w).dispatchEvent(new ErrorEvent(\"error\",{error:new Error(\"Timeout\")}))},binaryType:\"buffer\"};static#W(w){const U=w.data;if(U.#U=null,U.#B=0,U.#$=2,U.#Q){if(U.#L)clearTimeout(U.#L);U.#L=setTimeout(A.#V,U.#X,U)}return U}constructor(w,U=@undefined){super();const L=new URL(w);this.#K=L.protocol===\"https:\",this.#j=L,this.#$=2,process.nextTick(A.#V,this)}ref(){this.#L\?.ref(),this.#U\?.ref()}unref(){this.#L\?.unref(),this.#U\?.unref()}#H(){if(this.#$!==2)return;const w=this.#j,U=this.#K;this.#$=0,@Bun.connect({data:this,socket:A.#z,hostname:w.hostname,port:parseInt(w.port||(U\?\"443\":\"80\"),10),tls:U\?{requestCert:!0,rejectUnauthorized:!1}:!1}).catch((L)=>{if(super.dispatchEvent(new ErrorEvent(\"error\",{error:L})),this.#Q){if(this.#L)this.#L.unref\?.();this.#L=setTimeout(A.#V,1000,this)}})}get url(){return this.#j.href}get readyState(){return this.#$}close(){this.#Q=!1,this.#$=2,this.#U\?.unref(),this.#U\?.end()}get onopen(){return this.#J}get onerror(){return this.#F}get onmessage(){return this.#G}set onopen(w){if(this.#J)super.removeEventListener(\"close\",this.#J);super.addEventListener(\"open\",w),this.#J=w}set onerror(w){if(this.#F)super.removeEventListener(\"error\",this.#F);super.addEventListener(\"error\",w),this.#F=w}set onmessage(w){if(this.#G)super.removeEventListener(\"message\",this.#G);super.addEventListener(\"message\",w),this.#G=w}}return Object.defineProperty(A.prototype,\"CONNECTING\",{enumerable:!0,value:0}),Object.defineProperty(A.prototype,\"OPEN\",{enumerable:!0,value:1}),Object.defineProperty(A.prototype,\"CLOSED\",{enumerable:!0,value:2}),A[Symbol.for(\"CommonJS\")]=0,A})\n"; #define DEFINE_BUILTIN_GENERATOR(codeName, functionName, overriddenName, argumentCount) \ JSC::FunctionExecutable* codeName##Generator(JSC::VM& vm) \