aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Jarred Sumner <jarred@jarredsumner.com> 2023-05-21 00:20:04 -0700
committerGravatar GitHub <noreply@github.com> 2023-05-21 00:20:04 -0700
commitdef8824bc283ecea4932fb173ba4cd8f191345bc (patch)
tree63fb26bd52bbcc46aeddb06ff85e9cae53f49370
parent5a38c4bc0a166464d9b1ccf8368f9259ab4b16a5 (diff)
downloadbun-def8824bc283ecea4932fb173ba4cd8f191345bc.tar.gz
bun-def8824bc283ecea4932fb173ba4cd8f191345bc.tar.zst
bun-def8824bc283ecea4932fb173ba4cd8f191345bc.zip
Upgrade WebKit (#2980)
* [internal] Show the file path to the calling function from JS * [internal] Make `JSC.NewFunction` more type safe * Upgrade WebKit * Finish --------- Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
-rw-r--r--.github/workflows/bun-linux-aarch64.yml2
-rw-r--r--.github/workflows/bun-linux-build.yml4
-rw-r--r--.github/workflows/bun-mac-aarch64.yml16
-rw-r--r--.github/workflows/bun-mac-x64-baseline.yml16
-rw-r--r--.github/workflows/bun-mac-x64.yml16
-rw-r--r--Dockerfile2
-rw-r--r--Makefile4
-rwxr-xr-xbun.lockbbin63917 -> 63917 bytes
-rw-r--r--package.json2
m---------src/bun.js/WebKit0
-rw-r--r--src/bun.js/bindings/webcore/HTTPHeaderMap.h3
-rw-r--r--src/bun.js/bindings/webcore/HTTPHeaderNames.h4
-rw-r--r--src/bun.js/bindings/webcore/JSFetchHeaders.cpp2
-rw-r--r--src/bun.js/bindings/webcore/WebSocket.cpp56
-rw-r--r--src/bun.js/bindings/webcore/WebSocket.h2
-rw-r--r--src/bun.js/bindings/webcrypto/CryptoKeyOKPOpenSSL.cpp4
16 files changed, 67 insertions, 66 deletions
diff --git a/.github/workflows/bun-linux-aarch64.yml b/.github/workflows/bun-linux-aarch64.yml
index 1d7ef3860..451fcac06 100644
--- a/.github/workflows/bun-linux-aarch64.yml
+++ b/.github/workflows/bun-linux-aarch64.yml
@@ -30,7 +30,7 @@ jobs:
arch: aarch64
build_arch: arm64
runner: linux-arm64
- webkit_url: "https://github.com/oven-sh/WebKit/releases/download/may17/bun-webkit-linux-arm64-lto.tar.gz"
+ webkit_url: "https://github.com/oven-sh/WebKit/releases/download/may20/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 2a4af92e2..4e300b6df 100644
--- a/.github/workflows/bun-linux-build.yml
+++ b/.github/workflows/bun-linux-build.yml
@@ -40,7 +40,7 @@ jobs:
arch: x86_64
build_arch: amd64
runner: big-ubuntu
- webkit_url: "https://github.com/oven-sh/WebKit/releases/download/may17/bun-webkit-linux-amd64-lto.tar.gz"
+ webkit_url: "https://github.com/oven-sh/WebKit/releases/download/may20/bun-webkit-linux-amd64-lto.tar.gz"
webkit_basename: "bun-webkit-linux-amd64-lto"
build_machine_arch: x86_64
- cpu: nehalem
@@ -48,7 +48,7 @@ jobs:
arch: x86_64
build_arch: amd64
runner: big-ubuntu
- webkit_url: "https://github.com/oven-sh/WebKit/releases/download/may17/bun-webkit-linux-amd64-lto.tar.gz"
+ webkit_url: "https://github.com/oven-sh/WebKit/releases/download/may20/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 8e4bc9a0a..fea8b274c 100644
--- a/.github/workflows/bun-mac-aarch64.yml
+++ b/.github/workflows/bun-mac-aarch64.yml
@@ -110,7 +110,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/may17/bun-webkit-macos-amd64-lto.tar.gz"
+ # webkit_url: "https://github.com/oven-sh/WebKit/releases/download/may20/bun-webkit-macos-amd64-lto.tar.gz"
# dependencies: true
# compile_obj: false
# - cpu: haswell
@@ -119,7 +119,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/may17/bun-webkit-macos-amd64-lto.tar.gz"
+ # webkit_url: "https://github.com/oven-sh/WebKit/releases/download/may20/bun-webkit-macos-amd64-lto.tar.gz"
# dependencies: true
# compile_obj: false
# - cpu: nehalem
@@ -128,7 +128,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/may17/bun-webkit-macos-amd64-lto.tar.gz"
+ # webkit_url: "https://github.com/oven-sh/WebKit/releases/download/may20/bun-webkit-macos-amd64-lto.tar.gz"
# dependencies: false
# compile_obj: true
# - cpu: haswell
@@ -137,7 +137,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/may17/bun-webkit-macos-amd64-lto.tar.gz"
+ # webkit_url: "https://github.com/oven-sh/WebKit/releases/download/may20/bun-webkit-macos-amd64-lto.tar.gz"
# dependencies: false
# compile_obj: true
- cpu: native
@@ -145,7 +145,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/may17/bun-webkit-macos-arm64-lto.tar.gz"
+ webkit_url: "https://github.com/oven-sh/WebKit/releases/download/may20/bun-webkit-macos-arm64-lto.tar.gz"
runner: macos-arm64
dependencies: true
compile_obj: true
@@ -249,7 +249,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/may17/bun-webkit-macos-amd64-lto.tar.gz"
+ # webkit_url: "https://github.com/oven-sh/WebKit/releases/download/may20/bun-webkit-macos-amd64-lto.tar.gz"
# - cpu: haswell
# arch: x86_64
# tag: bun-darwin-x64
@@ -257,14 +257,14 @@ jobs:
# package: bun-darwin-x64
# runner: macos-11
# artifact: bun-obj-darwin-x64
- # webkit_url: "https://github.com/oven-sh/WebKit/releases/download/may17/bun-webkit-macos-amd64-lto.tar.gz"
+ # webkit_url: "https://github.com/oven-sh/WebKit/releases/download/may20/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/may17/bun-webkit-macos-arm64-lto.tar.gz"
+ webkit_url: "https://github.com/oven-sh/WebKit/releases/download/may20/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 06cf1eb0c..ff5099627 100644
--- a/.github/workflows/bun-mac-x64-baseline.yml
+++ b/.github/workflows/bun-mac-x64-baseline.yml
@@ -110,7 +110,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/may17/bun-webkit-macos-amd64-lto.tar.gz"
+ webkit_url: "https://github.com/oven-sh/WebKit/releases/download/may20/bun-webkit-macos-amd64-lto.tar.gz"
dependencies: true
compile_obj: false
# - cpu: haswell
@@ -119,7 +119,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/may17/bun-webkit-macos-amd64-lto.tar.gz"
+ # webkit_url: "https://github.com/oven-sh/WebKit/releases/download/may20/bun-webkit-macos-amd64-lto.tar.gz"
# dependencies: true
# compile_obj: false
- cpu: nehalem
@@ -128,7 +128,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/may17/bun-webkit-macos-amd64-lto.tar.gz"
+ webkit_url: "https://github.com/oven-sh/WebKit/releases/download/may20/bun-webkit-macos-amd64-lto.tar.gz"
dependencies: false
compile_obj: true
# - cpu: haswell
@@ -137,7 +137,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/may17/bun-webkit-macos-amd64-lto.tar.gz"
+ # webkit_url: "https://github.com/oven-sh/WebKit/releases/download/may20/bun-webkit-macos-amd64-lto.tar.gz"
# dependencies: false
# compile_obj: true
# - cpu: native
@@ -145,7 +145,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/may17/bun-webkit-macos-amd64-lto.tar.gz"
+ # webkit_url: "https://github.com/oven-sh/WebKit/releases/download/may20/bun-webkit-macos-amd64-lto.tar.gz"
# runner: macos-arm64
# dependencies: true
# compile_obj: true
@@ -250,7 +250,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/may17/bun-webkit-macos-amd64-lto.tar.gz"
+ webkit_url: "https://github.com/oven-sh/WebKit/releases/download/may20/bun-webkit-macos-amd64-lto.tar.gz"
# - cpu: haswell
# arch: x86_64
# tag: bun-darwin-x64
@@ -258,14 +258,14 @@ jobs:
# package: bun-darwin-x64
# runner: macos-11
# artifact: bun-obj-darwin-x64
- # webkit_url: "https://github.com/oven-sh/WebKit/releases/download/may17/bun-webkit-macos-amd64-lto.tar.gz"
+ # webkit_url: "https://github.com/oven-sh/WebKit/releases/download/may20/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/may17/bun-webkit-macos-amd64-lto.tar.gz"
+ # webkit_url: "https://github.com/oven-sh/WebKit/releases/download/may20/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 ffae5dc15..567c13d73 100644
--- a/.github/workflows/bun-mac-x64.yml
+++ b/.github/workflows/bun-mac-x64.yml
@@ -110,7 +110,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/may17/bun-webkit-macos-amd64-lto.tar.gz"
+ # webkit_url: "https://github.com/oven-sh/WebKit/releases/download/may20/bun-webkit-macos-amd64-lto.tar.gz"
# dependencies: true
# compile_obj: false
- cpu: haswell
@@ -119,7 +119,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/may17/bun-webkit-macos-amd64-lto.tar.gz"
+ webkit_url: "https://github.com/oven-sh/WebKit/releases/download/may20/bun-webkit-macos-amd64-lto.tar.gz"
dependencies: true
compile_obj: false
# - cpu: nehalem
@@ -128,7 +128,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/may17/bun-webkit-macos-amd64-lto.tar.gz"
+ # webkit_url: "https://github.com/oven-sh/WebKit/releases/download/may20/bun-webkit-macos-amd64-lto.tar.gz"
# dependencies: false
# compile_obj: true
- cpu: haswell
@@ -137,7 +137,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/may17/bun-webkit-macos-amd64-lto.tar.gz"
+ webkit_url: "https://github.com/oven-sh/WebKit/releases/download/may20/bun-webkit-macos-amd64-lto.tar.gz"
dependencies: false
compile_obj: true
# - cpu: native
@@ -145,7 +145,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/may17/bun-webkit-macos-arm64-lto.tar.gz"
+ # webkit_url: "https://github.com/oven-sh/WebKit/releases/download/may20/bun-webkit-macos-arm64-lto.tar.gz"
# runner: macos-arm64
# dependencies: true
# compile_obj: true
@@ -252,7 +252,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/may17/bun-webkit-macos-amd64-lto.tar.gz"
+ # webkit_url: "https://github.com/oven-sh/WebKit/releases/download/may20/bun-webkit-macos-amd64-lto.tar.gz"
- cpu: haswell
arch: x86_64
tag: bun-darwin-x64
@@ -260,14 +260,14 @@ jobs:
package: bun-darwin-x64
runner: macos-11
artifact: bun-obj-darwin-x64
- webkit_url: "https://github.com/oven-sh/WebKit/releases/download/may17/bun-webkit-macos-amd64-lto.tar.gz"
+ webkit_url: "https://github.com/oven-sh/WebKit/releases/download/may20/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/may17/bun-webkit-macos-arm64-lto.tar.gz"
+ # webkit_url: "https://github.com/oven-sh/WebKit/releases/download/may20/bun-webkit-macos-arm64-lto.tar.gz"
# runner: macos-arm64
steps:
- uses: actions/checkout@v3
diff --git a/Dockerfile b/Dockerfile
index 4ecee3b3d..f76cc7811 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=may17
+ARG WEBKIT_TAG=may20
ARG ZIG_TAG=jul1
ARG ZIG_VERSION="0.11.0-dev.2571+31738de28"
ARG WEBKIT_BASENAME="bun-webkit-linux-$BUILDARCH"
diff --git a/Makefile b/Makefile
index ddefa754e..a479fb82b 100644
--- a/Makefile
+++ b/Makefile
@@ -1122,7 +1122,6 @@ jsc-copy-headers:
cp $(WEBKIT_DIR)/Source/JavaScriptCore/bytecode/ObjectPropertyConditionSet.h $(WEBKIT_RELEASE_DIR)/JavaScriptCore/PrivateHeaders/JavaScriptCore/ObjectPropertyConditionSet.h
cp $(WEBKIT_DIR)/Source/JavaScriptCore/bytecode/PolyProtoAccessChain.h $(WEBKIT_RELEASE_DIR)/JavaScriptCore/PrivateHeaders/JavaScriptCore/PolyProtoAccessChain.h
cp $(WEBKIT_DIR)/Source/JavaScriptCore/bytecode/InlineCacheCompiler.h $(WEBKIT_RELEASE_DIR)/JavaScriptCore/PrivateHeaders/JavaScriptCore/InlineCacheCompiler.h
- cp $(WEBKIT_DIR)/Source/JavaScriptCore/bytecode/PutKind.h $(WEBKIT_RELEASE_DIR)/JavaScriptCore/PrivateHeaders/JavaScriptCore/PutKind.h
cp $(WEBKIT_DIR)/Source/JavaScriptCore/bytecode/StructureStubClearingWatchpoint.h $(WEBKIT_RELEASE_DIR)/JavaScriptCore/PrivateHeaders/JavaScriptCore/StructureStubClearingWatchpoint.h
cp $(WEBKIT_DIR)/Source/JavaScriptCore/bytecode/AdaptiveInferredPropertyValueWatchpointBase.h $(WEBKIT_RELEASE_DIR)/JavaScriptCore/PrivateHeaders/JavaScriptCore/AdaptiveInferredPropertyValueWatchpointBase.h
cp $(WEBKIT_DIR)/Source/JavaScriptCore/bytecode/StubInfoSummary.h $(WEBKIT_RELEASE_DIR)/JavaScriptCore/PrivateHeaders/JavaScriptCore/StubInfoSummary.h
@@ -1156,6 +1155,9 @@ jsc-copy-headers:
cp $(WEBKIT_DIR)/Source/JavaScriptCore/runtime/AsyncFunctionPrototype.h $(WEBKIT_RELEASE_DIR)/JavaScriptCore/PrivateHeaders/JavaScriptCore/AsyncFunctionPrototype.h
cp $(WEBKIT_DIR)/Source/JavaScriptCore/runtime/SymbolObject.h $(WEBKIT_RELEASE_DIR)/JavaScriptCore/PrivateHeaders/JavaScriptCore/SymbolObject.h
cp $(WEBKIT_DIR)/Source/JavaScriptCore/runtime/JSGenerator.h $(WEBKIT_RELEASE_DIR)/JavaScriptCore/PrivateHeaders/JavaScriptCore/JSGenerator.h
+ cp $(WEBKIT_DIR)/Source/JavaScriptCore/bytecode/UnlinkedFunctionCodeBlock.h $(WEBKIT_RELEASE_DIR)/JavaScriptCore/PrivateHeaders/JavaScriptCore/UnlinkedFunctionCodeBlock.h
+ cp $(WEBKIT_DIR)/Source/JavaScriptCore/runtime/AggregateError.h $(WEBKIT_RELEASE_DIR)/JavaScriptCore/PrivateHeaders/JavaScriptCore/AggregateError.h
+ cp $(WEBKIT_DIR)/Source/JavaScriptCore/API/JSWeakValue.h $(WEBKIT_RELEASE_DIR)/JavaScriptCore/PrivateHeaders/JavaScriptCore/JSWeakValue.h
find $(WEBKIT_RELEASE_DIR)/JavaScriptCore/Headers/JavaScriptCore/ -name "*.h" -exec cp {} $(WEBKIT_RELEASE_DIR)/JavaScriptCore/PrivateHeaders/JavaScriptCore/ \;
# This is a workaround for a JSC bug that impacts aarch64
diff --git a/bun.lockb b/bun.lockb
index 26e672ec2..8e51bf3e4 100755
--- a/bun.lockb
+++ b/bun.lockb
Binary files differ
diff --git a/package.json b/package.json
index dedc399a4..a5cc3ee64 100644
--- a/package.json
+++ b/package.json
@@ -24,7 +24,7 @@
"@types/react": "^18.0.25",
"@typescript-eslint/eslint-plugin": "^5.31.0",
"@typescript-eslint/parser": "^5.31.0",
- "bun-webkit": "0.0.1-eb1570290ba3e8555feb53b2a0feb68d2df65569"
+ "bun-webkit": "0.0.1-b2f1006a06f81bc860c89dd4c7cec3e7117c4c4c"
},
"version": "0.0.0",
"prettier": "./.prettierrc.cjs"
diff --git a/src/bun.js/WebKit b/src/bun.js/WebKit
-Subproject eb1570290ba3e8555feb53b2a0feb68d2df6556
+Subproject 14b2943d99284c42993fa9ce27af0c8dd16c243
diff --git a/src/bun.js/bindings/webcore/HTTPHeaderMap.h b/src/bun.js/bindings/webcore/HTTPHeaderMap.h
index e96e31f86..13fc806cb 100644
--- a/src/bun.js/bindings/webcore/HTTPHeaderMap.h
+++ b/src/bun.js/bindings/webcore/HTTPHeaderMap.h
@@ -86,8 +86,7 @@ public:
String asciiLowerCaseName() const
{
if (keyAsHTTPHeaderName) {
- auto view = WTF::httpHeaderNameStringImpl(keyAsHTTPHeaderName.value());
- return String(view);
+ return WTF::httpHeaderNameStringImpl(keyAsHTTPHeaderName.value());
}
return key.convertToASCIILowercase();
diff --git a/src/bun.js/bindings/webcore/HTTPHeaderNames.h b/src/bun.js/bindings/webcore/HTTPHeaderNames.h
index 870c4980f..bee82e54e 100644
--- a/src/bun.js/bindings/webcore/HTTPHeaderNames.h
+++ b/src/bun.js/bindings/webcore/HTTPHeaderNames.h
@@ -238,7 +238,7 @@ template<> struct EnumTraits<WebCore::HTTPHeaderName> {
WebCore::HTTPHeaderName::XXSSProtection>;
};
-static StaticStringImpl* staticHeaderNames[] = {
+static const NeverDestroyed<String> staticHeaderNames[] = {
MAKE_STATIC_STRING_IMPL("accept"),
MAKE_STATIC_STRING_IMPL("accept-charset"),
MAKE_STATIC_STRING_IMPL("accept-encoding"),
@@ -334,7 +334,7 @@ static StaticStringImpl* staticHeaderNames[] = {
MAKE_STATIC_STRING_IMPL("x-xss-protection"),
};
-static WTF::StaticStringImpl* httpHeaderNameStringImpl(WebCore::HTTPHeaderName headerName)
+static const WTF::String& httpHeaderNameStringImpl(WebCore::HTTPHeaderName headerName)
{
return staticHeaderNames[static_cast<size_t>(headerName)];
}
diff --git a/src/bun.js/bindings/webcore/JSFetchHeaders.cpp b/src/bun.js/bindings/webcore/JSFetchHeaders.cpp
index 3d1b6dbef..2e75cdc86 100644
--- a/src/bun.js/bindings/webcore/JSFetchHeaders.cpp
+++ b/src/bun.js/bindings/webcore/JSFetchHeaders.cpp
@@ -406,7 +406,7 @@ static inline JSC::EncodedJSValue jsFetchHeadersPrototypeFunction_toJSONBody(JSC
for (auto it = vec.begin(); it != vec.end(); ++it) {
auto& name = it->key;
auto& value = it->value;
- obj->putDirect(vm, Identifier::fromString(vm, String(WTF::httpHeaderNameStringImpl(name))), jsString(vm, value), 0);
+ obj->putDirect(vm, Identifier::fromString(vm, WTF::httpHeaderNameStringImpl(name)), jsString(vm, value), 0);
}
}
diff --git a/src/bun.js/bindings/webcore/WebSocket.cpp b/src/bun.js/bindings/webcore/WebSocket.cpp
index c2acb0b98..404336050 100644
--- a/src/bun.js/bindings/webcore/WebSocket.cpp
+++ b/src/bun.js/bindings/webcore/WebSocket.cpp
@@ -864,7 +864,7 @@ void WebSocket::didReceiveBinaryData(Vector<uint8_t>&& binaryData)
// });
}
-void WebSocket::didReceiveMessageError(unsigned short code, WTF::StringImpl::StaticStringImpl* reason)
+void WebSocket::didReceiveMessageError(unsigned short code, WTF::String reason)
{
LOG(Network, "WebSocket %p didReceiveErrorMessage()", this);
// queueTaskKeepingObjectAlive(*this, TaskSource::WebSocket, [this, reason = WTFMove(reason)] {
@@ -874,7 +874,7 @@ void WebSocket::didReceiveMessageError(unsigned short code, WTF::StringImpl::Sta
if (auto* context = scriptExecutionContext()) {
this->incPendingActivityCount();
// https://html.spec.whatwg.org/multipage/web-sockets.html#feedback-from-the-protocol:concept-websocket-closed, we should synchronously fire a close event.
- dispatchEvent(CloseEvent::create(code < 1002, code, WTF::String(reason)));
+ dispatchEvent(CloseEvent::create(code < 1002, code, reason));
this->decPendingActivityCount();
}
}
@@ -1000,158 +1000,158 @@ void WebSocket::didFailWithErrorCode(int32_t code)
}
// invalid_response
case 1: {
- auto message = MAKE_STATIC_STRING_IMPL("Invalid response");
+ static NeverDestroyed<String> message = MAKE_STATIC_STRING_IMPL("Invalid response");
didReceiveMessageError(1002, message);
break;
}
// expected_101_status_code
case 2: {
- auto message = MAKE_STATIC_STRING_IMPL("Expected 101 status code");
+ static NeverDestroyed<String> message = MAKE_STATIC_STRING_IMPL("Expected 101 status code");
didReceiveMessageError(1002, message);
break;
}
// missing_upgrade_header
case 3: {
- auto message = MAKE_STATIC_STRING_IMPL("Missing upgrade header");
+ static NeverDestroyed<String> message = MAKE_STATIC_STRING_IMPL("Missing upgrade header");
didReceiveMessageError(1002, message);
break;
}
// missing_connection_header
case 4: {
- auto message = MAKE_STATIC_STRING_IMPL("Missing connection header");
+ static NeverDestroyed<String> message = MAKE_STATIC_STRING_IMPL("Missing connection header");
didReceiveMessageError(1002, message);
break;
}
// missing_websocket_accept_header
case 5: {
- auto message = MAKE_STATIC_STRING_IMPL("Missing websocket accept header");
+ static NeverDestroyed<String> message = MAKE_STATIC_STRING_IMPL("Missing websocket accept header");
didReceiveMessageError(1002, message);
break;
}
// invalid_upgrade_header
case 6: {
- auto message = MAKE_STATIC_STRING_IMPL("Invalid upgrade header");
+ static NeverDestroyed<String> message = MAKE_STATIC_STRING_IMPL("Invalid upgrade header");
didReceiveMessageError(1002, message);
break;
}
// invalid_connection_header
case 7: {
- auto message = MAKE_STATIC_STRING_IMPL("Invalid connection header");
+ static NeverDestroyed<String> message = MAKE_STATIC_STRING_IMPL("Invalid connection header");
didReceiveMessageError(1002, message);
break;
}
// invalid_websocket_version
case 8: {
- auto message = MAKE_STATIC_STRING_IMPL("Invalid websocket version");
+ static NeverDestroyed<String> message = MAKE_STATIC_STRING_IMPL("Invalid websocket version");
didReceiveMessageError(1002, message);
break;
}
// mismatch_websocket_accept_header
case 9: {
- auto message = MAKE_STATIC_STRING_IMPL("Mismatch websocket accept header");
+ static NeverDestroyed<String> message = MAKE_STATIC_STRING_IMPL("Mismatch websocket accept header");
didReceiveMessageError(1002, message);
break;
}
// missing_client_protocol
case 10: {
- auto message = MAKE_STATIC_STRING_IMPL("Missing client protocol");
+ static NeverDestroyed<String> message = MAKE_STATIC_STRING_IMPL("Missing client protocol");
didReceiveMessageError(1002, message);
break;
}
// mismatch_client_protocol
case 11: {
- auto message = MAKE_STATIC_STRING_IMPL("Mismatch client protocol");
+ static NeverDestroyed<String> message = MAKE_STATIC_STRING_IMPL("Mismatch client protocol");
didReceiveMessageError(1002, message);
break;
}
// timeout
case 12: {
- auto message = MAKE_STATIC_STRING_IMPL("Timeout");
+ static NeverDestroyed<String> message = MAKE_STATIC_STRING_IMPL("Timeout");
didReceiveMessageError(1013, message);
break;
}
// closed
case 13: {
- auto message = MAKE_STATIC_STRING_IMPL("Closed by client");
+ static NeverDestroyed<String> message = MAKE_STATIC_STRING_IMPL("Closed by client");
didReceiveMessageError(1000, message);
break;
}
// failed_to_write
case 14: {
- auto message = MAKE_STATIC_STRING_IMPL("Failed to write");
+ static NeverDestroyed<String> message = MAKE_STATIC_STRING_IMPL("Failed to write");
didReceiveMessageError(1006, message);
break;
}
// failed_to_connect
case 15: {
- auto message = MAKE_STATIC_STRING_IMPL("Failed to connect");
+ static NeverDestroyed<String> message = MAKE_STATIC_STRING_IMPL("Failed to connect");
didReceiveMessageError(1006, message);
break;
}
// headers_too_large
case 16: {
- auto message = MAKE_STATIC_STRING_IMPL("Headers too large");
+ static NeverDestroyed<String> message = MAKE_STATIC_STRING_IMPL("Headers too large");
didReceiveMessageError(1007, message);
break;
}
// ended
case 17: {
- auto message = MAKE_STATIC_STRING_IMPL("Closed by server");
+ static NeverDestroyed<String> message = MAKE_STATIC_STRING_IMPL("Closed by server");
didReceiveMessageError(1001, message);
break;
}
// failed_to_allocate_memory
case 18: {
- auto message = MAKE_STATIC_STRING_IMPL("Failed to allocate memory");
+ static NeverDestroyed<String> message = MAKE_STATIC_STRING_IMPL("Failed to allocate memory");
didReceiveMessageError(1001, message);
break;
}
// control_frame_is_fragmented
case 19: {
- auto message = MAKE_STATIC_STRING_IMPL("Protocol error - control frame is fragmented");
+ static NeverDestroyed<String> message = MAKE_STATIC_STRING_IMPL("Protocol error - control frame is fragmented");
didReceiveMessageError(1002, message);
break;
}
// invalid_control_frame
case 20: {
- auto message = MAKE_STATIC_STRING_IMPL("Protocol error - invalid control frame");
+ static NeverDestroyed<String> message = MAKE_STATIC_STRING_IMPL("Protocol error - invalid control frame");
didReceiveMessageError(1002, message);
break;
}
// compression_unsupported
case 21: {
- auto message = MAKE_STATIC_STRING_IMPL("Compression not implemented yet");
+ static NeverDestroyed<String> message = MAKE_STATIC_STRING_IMPL("Compression not implemented yet");
didReceiveMessageError(1011, message);
break;
}
// unexpected_mask_from_server
case 22: {
- auto message = MAKE_STATIC_STRING_IMPL("Protocol error - unexpected mask from server");
+ static NeverDestroyed<String> message = MAKE_STATIC_STRING_IMPL("Protocol error - unexpected mask from server");
didReceiveMessageError(1002, message);
break;
}
// expected_control_frame
case 23: {
- auto message = MAKE_STATIC_STRING_IMPL("Protocol error - expected control frame");
+ static NeverDestroyed<String> message = MAKE_STATIC_STRING_IMPL("Protocol error - expected control frame");
didReceiveMessageError(1002, message);
break;
}
// unsupported_control_frame
case 24: {
- auto message = MAKE_STATIC_STRING_IMPL("Protocol error - unsupported control frame");
+ static NeverDestroyed<String> message = MAKE_STATIC_STRING_IMPL("Protocol error - unsupported control frame");
didReceiveMessageError(1002, message);
break;
}
// unexpected_opcode
case 25: {
- auto message = MAKE_STATIC_STRING_IMPL("Protocol error - unexpected opcode");
+ static NeverDestroyed<String> message = MAKE_STATIC_STRING_IMPL("Protocol error - unexpected opcode");
didReceiveMessageError(1002, message);
break;
}
// invalid_utf8
case 26: {
- auto message = MAKE_STATIC_STRING_IMPL("Server sent invalid UTF8");
+ static NeverDestroyed<String> message = MAKE_STATIC_STRING_IMPL("Server sent invalid UTF8");
didReceiveMessageError(1003, message);
break;
}
diff --git a/src/bun.js/bindings/webcore/WebSocket.h b/src/bun.js/bindings/webcore/WebSocket.h
index 59b551ea0..2c1bc3524 100644
--- a/src/bun.js/bindings/webcore/WebSocket.h
+++ b/src/bun.js/bindings/webcore/WebSocket.h
@@ -140,7 +140,7 @@ private:
void refEventTarget() final { ref(); }
void derefEventTarget() final { deref(); }
- void didReceiveMessageError(unsigned short code, WTF::StringImpl::StaticStringImpl* reason);
+ void didReceiveMessageError(unsigned short code, WTF::String reason);
void didUpdateBufferedAmount(unsigned bufferedAmount);
void didStartClosingHandshake();
diff --git a/src/bun.js/bindings/webcrypto/CryptoKeyOKPOpenSSL.cpp b/src/bun.js/bindings/webcrypto/CryptoKeyOKPOpenSSL.cpp
index 8c6a25f19..ea3a4d498 100644
--- a/src/bun.js/bindings/webcrypto/CryptoKeyOKPOpenSSL.cpp
+++ b/src/bun.js/bindings/webcrypto/CryptoKeyOKPOpenSSL.cpp
@@ -127,7 +127,7 @@ RefPtr<CryptoKeyOKP> CryptoKeyOKP::importSpki(CryptoAlgorithmIdentifier identifi
return nullptr;
++index;
- return create(identifier, namedCurve, CryptoKeyType::Public, Span<const uint8_t> { keyData.data() + index, keyData.size() - index }, extractable, usages);
+ return create(identifier, namedCurve, CryptoKeyType::Public, std::span<const uint8_t> { keyData.data() + index, keyData.size() - index }, extractable, usages);
}
constexpr uint8_t OKPOIDFirstByte = 6;
@@ -254,7 +254,7 @@ RefPtr<CryptoKeyOKP> CryptoKeyOKP::importPkcs8(CryptoAlgorithmIdentifier identif
if (keyData.size() < index + 1)
return nullptr;
- return create(identifier, namedCurve, CryptoKeyType::Private, Span<const uint8_t> { keyData.data() + index, keyData.size() - index }, extractable, usages);
+ return create(identifier, namedCurve, CryptoKeyType::Private, std::span<const uint8_t> { keyData.data() + index, keyData.size() - index }, extractable, usages);
}
ExceptionOr<Vector<uint8_t>> CryptoKeyOKP::exportPkcs8() const