diff --git a/cmake/tools/SetupWebKit.cmake b/cmake/tools/SetupWebKit.cmake index 7b6574a708..5467671fce 100644 --- a/cmake/tools/SetupWebKit.cmake +++ b/cmake/tools/SetupWebKit.cmake @@ -2,7 +2,7 @@ option(WEBKIT_VERSION "The version of WebKit to use") option(WEBKIT_LOCAL "If a local version of WebKit should be used instead of downloading") if(NOT WEBKIT_VERSION) - set(WEBKIT_VERSION 75f6499360f42d580c406f4969689a1e14b46447) + set(WEBKIT_VERSION 684d4551ce5f62683476409d7402424e0f6eafb5) endif() string(SUBSTRING ${WEBKIT_VERSION} 0 16 WEBKIT_VERSION_PREFIX) diff --git a/src/bun.js/bindings/BunProcess.cpp b/src/bun.js/bindings/BunProcess.cpp index 936935529a..37f02bd437 100644 --- a/src/bun.js/bindings/BunProcess.cpp +++ b/src/bun.js/bindings/BunProcess.cpp @@ -1109,9 +1109,10 @@ extern "C" bool Bun__promises__isErrorLike(JSC::JSGlobalObject* globalObject, JS // ObjectPrototypeHasOwnProperty(obj, 'stack'); auto& vm = globalObject->vm(); auto scope = DECLARE_THROW_SCOPE(vm); - if (!obj.isObject()) return false; + auto object = obj.getObject(); + if (!object) + return false; - auto* object = JSC::jsCast(obj); RELEASE_AND_RETURN(scope, JSC::objectPrototypeHasOwnProperty(globalObject, object, vm.propertyNames->stack)); } @@ -1120,7 +1121,11 @@ extern "C" JSC::EncodedJSValue Bun__noSideEffectsToString(JSC::VM& vm, JSC::JSGl auto scope = DECLARE_THROW_SCOPE(vm); auto decodedReason = JSValue::decode(reason); if (decodedReason.isSymbol()) { - RELEASE_AND_RETURN(scope, JSC::JSValue::encode(jsNontrivialString(globalObject->vm(), asSymbol(decodedReason)->descriptiveString()))); + auto result = asSymbol(decodedReason)->tryGetDescriptiveString(); + if (result.has_value()) { + RELEASE_AND_RETURN(scope, JSC::JSValue::encode(jsNontrivialString(globalObject->vm(), result.value()))); + } + RELEASE_AND_RETURN(scope, JSC::JSValue::encode(vm.smallStrings.symbolString())); } if (decodedReason.isInt32()) @@ -1151,7 +1156,7 @@ extern "C" void Bun__promises__emitUnhandledRejectionWarning(JSC::JSGlobalObject "or by rejecting a promise which was not handled with .catch(). " "To terminate the bun process on unhandled promise " "rejection, use the CLI flag `--unhandled-rejections=strict`."_s); - warning->putDirect(vm, Identifier::fromString(vm, "name"_s), jsString(vm, "UnhandledPromiseRejectionWarning"_str), JSC::PropertyAttribute::DontEnum | 0); + warning->putDirect(vm, vm.propertyNames->name, jsString(vm, "UnhandledPromiseRejectionWarning"_str), JSC::PropertyAttribute::DontEnum | 0); JSValue reasonStack {}; auto is_errorlike = Bun__promises__isErrorLike(globalObject, JSValue::decode(reason)); diff --git a/src/bun.js/bindings/ErrorCode.cpp b/src/bun.js/bindings/ErrorCode.cpp index bf8768a6af..45072ae714 100644 --- a/src/bun.js/bindings/ErrorCode.cpp +++ b/src/bun.js/bindings/ErrorCode.cpp @@ -303,11 +303,11 @@ void JSValueToStringSafe(JSC::JSGlobalObject* globalObject, WTF::StringBuilder& } case JSC::JSType::SymbolType: { auto symbol = jsCast(cell); - auto result = symbol->tryGetDescriptiveString(); - if (result.has_value()) { - builder.append(result.value()); + auto result = symbol->description(); + if (!result.isEmpty()) { + builder.append(symbol->tryGetDescriptiveString().value_or(String())); } else { - builder.append("Symbol"_s); + builder.append(globalObject->vm().smallStrings.symbolString()); } return; } diff --git a/src/bun.js/bindings/bindings.cpp b/src/bun.js/bindings/bindings.cpp index 47561da6ca..9205857e71 100644 --- a/src/bun.js/bindings/bindings.cpp +++ b/src/bun.js/bindings/bindings.cpp @@ -4193,9 +4193,13 @@ void JSC__JSValue__getSymbolDescription(JSC::EncodedJSValue symbolValue_, JSC::J return; JSC::Symbol* symbol = JSC::asSymbol(symbolValue); - WTF::String string = symbol->description(); - *arg2 = Zig::toZigString(string); + auto result = symbol->description(); + if (!result.isEmpty()) { + *arg2 = Zig::toZigString(result); + } else { + *arg2 = ZigStringEmpty; + } } JSC::EncodedJSValue JSC__JSValue__symbolFor(JSC::JSGlobalObject* globalObject, ZigString* arg2) @@ -5020,7 +5024,12 @@ void exceptionFromString(ZigException* except, JSC::JSValue value, JSC::JSGlobal switch (type) { case JSC::SymbolType: { - except->message = Bun::toStringRef(jsCast(cell)->descriptiveString()); + auto* symbol = asSymbol(cell); + if (symbol->description().isEmpty()) { + except->message = BunStringEmpty; + } else { + except->message = Bun::toStringRef(symbol->description()); + } return; } diff --git a/src/bun.js/bindings/webcore/JSWorker.cpp b/src/bun.js/bindings/webcore/JSWorker.cpp index dfef1c89ff..2dcff5555d 100644 --- a/src/bun.js/bindings/webcore/JSWorker.cpp +++ b/src/bun.js/bindings/webcore/JSWorker.cpp @@ -272,7 +272,7 @@ template<> JSC::EncodedJSValue JSC_HOST_CALL_ATTRIBUTES JSWorkerDOMConstructor:: // string for Symbols instead of throwing like JSValue::toString does. // may throw an exception! auto coerceToIsolatedString = [lexicalGlobalObject](JSValue v) -> String { - String original = v.isSymbol() ? asSymbol(v)->descriptiveString() : v.toWTFString(lexicalGlobalObject); + String original = v.isSymbol() ? asSymbol(v)->tryGetDescriptiveString().value_or(String()) : v.toWTFString(lexicalGlobalObject); return original.isolatedCopy(); }; diff --git a/test/integration/next-pages/test/dev-server-ssr-100.test.ts b/test/integration/next-pages/test/dev-server-ssr-100.test.ts index d4125397be..88e523c941 100644 --- a/test/integration/next-pages/test/dev-server-ssr-100.test.ts +++ b/test/integration/next-pages/test/dev-server-ssr-100.test.ts @@ -138,7 +138,8 @@ test( expect(lockfile).toMatchSnapshot(); const controller = new AbortController(); - const queue = new PQueue({ concurrency: 16 }); + // On an arm64 mac, it doesn't get faster if you increase it beyond 4 as of August, 2025. + const queue = new PQueue({ concurrency: 4 }); async function run(i: number) { const x = await fetch(`${baseUrl}/?i=${i}`, { diff --git a/test/js/third_party/next-auth/next-auth.test.ts b/test/js/third_party/next-auth/next-auth.test.ts index 9ba6204e06..bed77f2275 100644 --- a/test/js/third_party/next-auth/next-auth.test.ts +++ b/test/js/third_party/next-auth/next-auth.test.ts @@ -1,34 +1,39 @@ import { describe, expect, it } from "bun:test"; import { cpSync } from "fs"; -import { bunEnv, bunRun, runBunInstall, tmpdirSync } from "harness"; +import { bunEnv, bunRun, isCI, isWindows, runBunInstall, tmpdirSync } from "harness"; import { join } from "path"; describe("next-auth", () => { - it("should be able to call server action multiple times using auth middleware #18977", async () => { - const testDir = tmpdirSync("next-auth-" + Date.now()); + // This test OOMs on Windows. + it.todoIf(isCI && isWindows)( + "should be able to call server action multiple times using auth middleware #18977", + async () => { + const testDir = tmpdirSync("next-auth-" + Date.now()); - cpSync(join(import.meta.dir, "fixture"), testDir, { - recursive: true, - force: true, - filter: src => { - if (src.includes("node_modules")) { - return false; - } - if (src.startsWith(".next")) { - return false; - } - return true; - }, - }); + cpSync(join(import.meta.dir, "fixture"), testDir, { + recursive: true, + force: true, + filter: src => { + if (src.includes("node_modules")) { + return false; + } + if (src.startsWith(".next")) { + return false; + } + return true; + }, + }); - await runBunInstall(bunEnv, testDir, { savesLockfile: false }); + await runBunInstall(bunEnv, testDir, { savesLockfile: false }); - console.log(testDir); - const result = bunRun(join(testDir, "server.js"), { - AUTH_SECRET: "I7Jiq12TSMlPlAzyVAT+HxYX7OQb/TTqIbfTTpr1rg8=", - }); - expect(result.stderr).toBe(""); - expect(result.stdout).toBeDefined(); - const lines = result.stdout?.split("\n") ?? []; - expect(lines[lines.length - 1]).toMatch(/request sent/); - }, 90_000); + console.log(testDir); + const result = bunRun(join(testDir, "server.js"), { + AUTH_SECRET: "I7Jiq12TSMlPlAzyVAT+HxYX7OQb/TTqIbfTTpr1rg8=", + }); + expect(result.stderr).toBe(""); + expect(result.stdout).toBeDefined(); + const lines = result.stdout?.split("\n") ?? []; + expect(lines[lines.length - 1]).toMatch(/request sent/); + }, + 90_000, + ); });