Skip to content

Commit

Permalink
quick fix for building bun llvm 21
Browse files Browse the repository at this point in the history
  • Loading branch information
zimirza committed Feb 5, 2025
1 parent 1ccc13e commit 92eaab5
Show file tree
Hide file tree
Showing 8 changed files with 15 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/bun.js/bindings/CallSitePrototype.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,7 @@ JSC_DEFINE_HOST_FUNCTION(callSiteProtoFuncIsToplevel, (JSGlobalObject * globalOb
return JSValue::encode(jsBoolean(executable->isProgramExecutable() || executable->isModuleProgramExecutable()));
}
} else if (auto* function = jsDynamicCast<InternalFunction*>(functionValue)) {
(void)function;
return JSC::JSValue::encode(JSC::jsBoolean(true));
}
}
Expand Down
2 changes: 2 additions & 0 deletions src/bun.js/bindings/KeyObject.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -406,6 +406,7 @@ JSC_DEFINE_HOST_FUNCTION(KeyObject__createPrivateKey, (JSC::JSGlobalObject * glo
}
default: {
if (auto* keyObj = jsDynamicCast<JSC::JSObject*>(keyJSValue)) {
(void)keyObj;
if (format != "jwk"_s) {
JSC::throwTypeError(globalObject, scope, "format should be 'jwk' when key type is 'object'"_s);
return {};
Expand Down Expand Up @@ -970,6 +971,7 @@ JSC_DEFINE_HOST_FUNCTION(KeyObject__createPublicKey, (JSC::JSGlobalObject * glob
}
default: {
if (auto* keyObj = jsDynamicCast<JSC::JSObject*>(keyJSValue)) {
(void)keyObj;
if (format != "jwk"_s) {
JSC::throwTypeError(globalObject, scope, "format should be 'jwk' when key type is 'object'"_s);
return {};
Expand Down
1 change: 1 addition & 0 deletions src/bun.js/bindings/ModuleLoader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -286,6 +286,7 @@ OnLoadResult handleOnLoadResultNotPromise(Zig::GlobalObject* globalObject, JSC::
static OnLoadResult handleOnLoadResult(Zig::GlobalObject* globalObject, JSC::JSValue objectValue, BunString* specifier, bool wasModuleMock = false)
{
if (JSC::JSPromise* promise = JSC::jsDynamicCast<JSC::JSPromise*>(objectValue)) {
(void)promise;
OnLoadResult result = {};
result.type = OnLoadResultTypePromise;
result.value.promise = objectValue;
Expand Down
2 changes: 2 additions & 0 deletions src/bun.js/bindings/UtilInspect.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,9 @@ extern "C" JSC::EncodedJSValue JSC__JSValue__callCustomInspectFunction(
arguments.append(inspectFn);

auto inspectRet = JSC::profiledCall(globalObject, ProfilingReason::API, functionToCall, callData, thisValue, arguments);
(void)inspectRet;
if (auto exe = scope.exception()) {
(void)exe;
*is_exception = true;
return {};
}
Expand Down
6 changes: 6 additions & 0 deletions src/bun.js/bindings/bindings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -330,6 +330,7 @@ AsymmetricMatcherResult matchAsymmetricMatcherAndGetFlags(JSGlobalObject* global
AsymmetricMatcherConstructorType constructorType = AsymmetricMatcherConstructorType::none;

if (auto* expectAnything = jsDynamicCast<JSExpectAnything*>(matcherPropCell)) {
(void)expectAnything;
if (!readFlagsAndProcessPromise(matcherProp, flags, globalObject, otherProp, constructorType))
return AsymmetricMatcherResult::FAIL;

Expand Down Expand Up @@ -382,6 +383,7 @@ AsymmetricMatcherResult matchAsymmetricMatcherAndGetFlags(JSGlobalObject* global
}

if (auto* booleanObject = jsDynamicCast<BooleanObject*>(otherProp)) {
(void)booleanObject;
return AsymmetricMatcherResult::PASS;
}

Expand All @@ -394,6 +396,7 @@ AsymmetricMatcherResult matchAsymmetricMatcherAndGetFlags(JSGlobalObject* global
}

if (auto* numberObject = jsDynamicCast<NumberObject*>(otherProp)) {
(void)numberObject;
return AsymmetricMatcherResult::PASS;
}

Expand Down Expand Up @@ -2165,6 +2168,7 @@ double JSC__JSValue__getLengthIfPropertyExistsInternal(JSC__JSValue value, JSC__

case WebCore::JSDOMWrapperType: {
if (auto* headers = jsDynamicCast<WebCore::JSFetchHeaders*>(cell))
(void)headers;
return static_cast<double>(jsCast<WebCore::JSFetchHeaders*>(cell)->wrapped().size());

if (auto* blob = jsDynamicCast<WebCore::JSBlob*>(cell)) {
Expand Down Expand Up @@ -2363,8 +2367,10 @@ void JSC__JSValue___then(JSC__JSValue JSValue0, JSC__JSGlobalObject* arg1, JSC__
auto* cell = JSC::JSValue::decode(JSValue0).asCell();

if (JSC::JSPromise* promise = JSC::jsDynamicCast<JSC::JSPromise*>(cell)) {
(void)promise;
handlePromise<JSC::JSPromise, false>(promise, arg1, arg2, ArgFn3, ArgFn4);
} else if (JSC::JSInternalPromise* promise = JSC::jsDynamicCast<JSC::JSInternalPromise*>(cell)) {
(void)promise;
RELEASE_ASSERT(false);
}
}
Expand Down
1 change: 1 addition & 0 deletions src/bun.js/bindings/webcore/EventEmitter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,7 @@ int EventEmitter::listenerCount(const Identifier& eventType)
continue;

if (JSC::JSObject* jsFunction = registeredListener->callback().jsFunction()) {
(void)jsFunction;
result++;
}
}
Expand Down
1 change: 1 addition & 0 deletions src/bun.js/bindings/webcore/WebSocket.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1174,6 +1174,7 @@ void WebSocket::didReceiveClose(CleanStatus wasClean, unsigned short code, WTF::
const bool wasConnecting = m_state == CONNECTING;
m_state = CLOSED;
if (auto* context = scriptExecutionContext()) {
(void)context;
this->incPendingActivityCount();
if (wasConnecting && isConnectionError) {
ErrorEvent::Init eventInit = {};
Expand Down
1 change: 1 addition & 0 deletions src/bun.js/bindings/webcore/Worker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -481,6 +481,7 @@ JSC_DEFINE_HOST_FUNCTION(jsReceiveMessageOnPort, (JSGlobalObject * lexicalGlobal
return JSC::JSValue::encode(messagePort->wrapped().tryTakeMessage(lexicalGlobalObject));
} else if (auto* broadcastChannel = jsDynamicCast<JSBroadcastChannel*>(port)) {
// TODO: support broadcast channels
(void)broadcastChannel;
return JSC::JSValue::encode(jsUndefined());
}

Expand Down

0 comments on commit 92eaab5

Please sign in to comment.