diff --git a/scripts/build/deps/webkit.ts b/scripts/build/deps/webkit.ts index b8784dc33e7..5cfbcef2a61 100644 --- a/scripts/build/deps/webkit.ts +++ b/scripts/build/deps/webkit.ts @@ -3,7 +3,7 @@ * for local mode. Override via `--webkit-version=` to test a branch. * From https://github.com/oven-sh/WebKit releases. */ -export const WEBKIT_VERSION = "c2010c47d12c525d36adabe3a17b2eb6ec850960"; +export const WEBKIT_VERSION = "42f80a684c5df57121a97e20825a3bcab7a0741b"; /** * WebKit (JavaScriptCore) — the JS engine. diff --git a/src/bun.js/bindings/BunHeapProfiler.cpp b/src/bun.js/bindings/BunHeapProfiler.cpp index 07be7232e27..2eadd8070e8 100644 --- a/src/bun.js/bindings/BunHeapProfiler.cpp +++ b/src/bun.js/bindings/BunHeapProfiler.cpp @@ -285,7 +285,7 @@ WTF::String generateHeapProfile(JSC::VM& vm) // DFS using explicit stack WTF::Vector stackNodes(nodeCount); WTF::Vector stackEdgeIdx(nodeCount); - WTF::Vector visited(nodeCount, 0); + WTF::Vector visited(WTF::FillWith {}, nodeCount, static_cast(0)); uint32_t postOrderIndex = 0; int stackTop = 0; @@ -364,9 +364,9 @@ WTF::String generateHeapProfile(JSC::VM& vm) uint32_t rootPostOrderIndex = nodeCount - 1; uint32_t noEntry = nodeCount; - WTF::Vector affected(nodeCount, 0); - WTF::Vector dominators(nodeCount, noEntry); - WTF::Vector nodeOrdinalToDominator(nodeCount, 0); + WTF::Vector affected(WTF::FillWith {}, nodeCount, static_cast(0)); + WTF::Vector dominators(WTF::FillWith {}, nodeCount, noEntry); + WTF::Vector nodeOrdinalToDominator(WTF::FillWith {}, nodeCount, 0u); // Root dominates itself dominators[rootPostOrderIndex] = rootPostOrderIndex; diff --git a/src/bun.js/bindings/JSBundlerPlugin.cpp b/src/bun.js/bindings/JSBundlerPlugin.cpp index 15d8e849741..c51a2ea4058 100644 --- a/src/bun.js/bindings/JSBundlerPlugin.cpp +++ b/src/bun.js/bindings/JSBundlerPlugin.cpp @@ -673,7 +673,7 @@ extern "C" void JSBundlerPlugin__drainDeferred(Bun::JSBundlerPlugin* pluginObjec auto& vm = pluginObject->vm(); auto scope = DECLARE_THROW_SCOPE(vm); for (auto promiseValue : arguments) { - JSPromise* promise = jsCast(JSValue::decode(promiseValue)); + JSPromise* promise = jsCast(promiseValue); if (rejected) { promise->reject(vm, globalObject, JSC::jsUndefined()); } else { diff --git a/src/bun.js/bindings/bindings.cpp b/src/bun.js/bindings/bindings.cpp index c957153cafc..b45d83a50d3 100644 --- a/src/bun.js/bindings/bindings.cpp +++ b/src/bun.js/bindings/bindings.cpp @@ -4359,7 +4359,7 @@ JSC::EncodedJSValue JSC__JSValue__getIfPropertyExistsFromPath(JSC::EncodedJSValu uint32_t j = 0; // if "." is the only character, it will search for an empty string twice. - if (pathString.characterAt(0) == '.') { + if (pathString.codeUnitAt(0) == '.') { auto* currPropObject = currProp.toObject(globalObject); RETURN_IF_EXCEPTION(scope, {}); currProp = currPropObject->getIfPropertyExists(globalObject, vm.propertyNames->emptyIdentifier); @@ -4370,7 +4370,7 @@ JSC::EncodedJSValue JSC__JSValue__getIfPropertyExistsFromPath(JSC::EncodedJSValu } while (i < length) { - char16_t ic = pathString.characterAt(i); + char16_t ic = pathString.codeUnitAt(i); while (ic == '[' || ic == ']' || ic == '.') { i += 1; if (i == length) { @@ -4392,7 +4392,7 @@ JSC::EncodedJSValue JSC__JSValue__getIfPropertyExistsFromPath(JSC::EncodedJSValu } char16_t previous = ic; - ic = pathString.characterAt(i); + ic = pathString.codeUnitAt(i); if (previous == '.' && ic == '.') { auto* currPropObject = currProp.toObject(globalObject); RETURN_IF_EXCEPTION(scope, {}); @@ -4406,14 +4406,14 @@ JSC::EncodedJSValue JSC__JSValue__getIfPropertyExistsFromPath(JSC::EncodedJSValu } j = i; - char16_t jc = pathString.characterAt(j); + char16_t jc = pathString.codeUnitAt(j); while (!(jc == '[' || jc == ']' || jc == '.')) { j += 1; if (j == length) { // break and search for property break; } - jc = pathString.characterAt(j); + jc = pathString.codeUnitAt(j); } String propNameStr = pathString.substring(i, j - i); diff --git a/src/bun.js/bindings/node/http/NodeHTTPParser.cpp b/src/bun.js/bindings/node/http/NodeHTTPParser.cpp index a49e47648af..2b9cb0ad126 100644 --- a/src/bun.js/bindings/node/http/NodeHTTPParser.cpp +++ b/src/bun.js/bindings/node/http/NodeHTTPParser.cpp @@ -494,9 +494,9 @@ int HTTPParser::onHeadersComplete() } else { auto headers = createHeaders(globalObject); RETURN_IF_EXCEPTION(scope, -1); - args.set(A_HEADERS, headers); + args.at(A_HEADERS) = headers; if (m_parserData.type == HTTP_REQUEST) { - args.set(A_URL, m_url.toString(globalObject)); + args.at(A_URL) = m_url.toString(globalObject); } } @@ -504,21 +504,21 @@ int HTTPParser::onHeadersComplete() m_numValues = 0; if (m_parserData.type == HTTP_REQUEST) { - args.set(A_METHOD, jsNumber(m_parserData.method)); + args.at(A_METHOD) = jsNumber(m_parserData.method); } if (m_parserData.type == HTTP_RESPONSE) { - args.set(A_STATUS_CODE, jsNumber(m_parserData.status_code)); - args.set(A_STATUS_MESSAGE, m_statusMessage.toString(globalObject)); + args.at(A_STATUS_CODE) = jsNumber(m_parserData.status_code); + args.at(A_STATUS_MESSAGE) = m_statusMessage.toString(globalObject); } - args.set(A_VERSION_MAJOR, jsNumber(m_parserData.http_major)); - args.set(A_VERSION_MINOR, jsNumber(m_parserData.http_minor)); + args.at(A_VERSION_MAJOR) = jsNumber(m_parserData.http_major); + args.at(A_VERSION_MINOR) = jsNumber(m_parserData.http_minor); bool shouldKeepAlive = llhttp_should_keep_alive(&m_parserData); - args.set(A_SHOULD_KEEP_ALIVE, jsBoolean(shouldKeepAlive)); - args.set(A_UPGRADE, jsBoolean(m_parserData.upgrade)); + args.at(A_SHOULD_KEEP_ALIVE) = jsBoolean(shouldKeepAlive); + args.at(A_UPGRADE) = jsBoolean(m_parserData.upgrade); CallData callData = getCallData(onHeadersCompleteCallback); diff --git a/src/bun.js/bindings/v8/shim/InternalFieldObject.h b/src/bun.js/bindings/v8/shim/InternalFieldObject.h index 1453c9448ef..a5da47cca70 100644 --- a/src/bun.js/bindings/v8/shim/InternalFieldObject.h +++ b/src/bun.js/bindings/v8/shim/InternalFieldObject.h @@ -38,7 +38,7 @@ class InternalFieldObject : public JSC::JSDestructibleObject { protected: InternalFieldObject(JSC::VM& vm, JSC::Structure* structure, int internalFieldCount) : Base(vm, structure) - , m_fields(internalFieldCount, JSC::WriteBarrier(vm, this, JSC::jsUndefined())) + , m_fields(WTF::FillWith {}, internalFieldCount, JSC::WriteBarrier(vm, this, JSC::jsUndefined())) { } diff --git a/src/bun.js/bindings/webcore/WebSocket.cpp b/src/bun.js/bindings/webcore/WebSocket.cpp index b7393f61f68..f1b019655ff 100644 --- a/src/bun.js/bindings/webcore/WebSocket.cpp +++ b/src/bun.js/bindings/webcore/WebSocket.cpp @@ -378,7 +378,7 @@ ExceptionOr> WebSocket::create(ScriptExecutionContext& context, c ExceptionOr> WebSocket::create(ScriptExecutionContext& context, const String& url, const String& protocol) { - return create(context, url, Vector { 1, protocol }); + return create(context, url, Vector { protocol }); } ExceptionOr WebSocket::connect(const String& url) @@ -388,7 +388,7 @@ ExceptionOr WebSocket::connect(const String& url) ExceptionOr WebSocket::connect(const String& url, const String& protocol) { - return connect(url, Vector { 1, protocol }, std::nullopt); + return connect(url, Vector { protocol }, std::nullopt); } static String resourceName(const URL& url) diff --git a/src/bun.js/modules/NodeModuleModule.cpp b/src/bun.js/modules/NodeModuleModule.cpp index fd49baf2f3e..c03a9561563 100644 --- a/src/bun.js/modules/NodeModuleModule.cpp +++ b/src/bun.js/modules/NodeModuleModule.cpp @@ -517,9 +517,9 @@ JSC::JSValue resolveLookupPaths(JSC::JSGlobalObject* globalObject, String reques auto scope = DECLARE_THROW_SCOPE(vm); // Check for node modules paths. - if (request.characterAt(0) != '.' || (request.length() > 1 && request.characterAt(1) != '.' && request.characterAt(1) != '/' && + if (request.codeUnitAt(0) != '.' || (request.length() > 1 && request.codeUnitAt(1) != '.' && request.codeUnitAt(1) != '/' && #if OS(WINDOWS) - request.characterAt(1) != '\\' + request.codeUnitAt(1) != '\\' #else true #endif