diff --git a/src/bun.js/bindings/CallSitePrototype.cpp b/src/bun.js/bindings/CallSitePrototype.cpp index 4b767656708bf6..1f0fc74e1414ce 100644 --- a/src/bun.js/bindings/CallSitePrototype.cpp +++ b/src/bun.js/bindings/CallSitePrototype.cpp @@ -178,6 +178,7 @@ JSC_DEFINE_HOST_FUNCTION(callSiteProtoFuncIsToplevel, (JSGlobalObject * globalOb return JSValue::encode(jsBoolean(executable->isProgramExecutable() || executable->isModuleProgramExecutable())); } } else if (auto* function = jsDynamicCast(functionValue)) { + (void)function; return JSC::JSValue::encode(JSC::jsBoolean(true)); } } diff --git a/src/bun.js/bindings/KeyObject.cpp b/src/bun.js/bindings/KeyObject.cpp index 6a9b816f3d62dd..9ee5fcbc1999f5 100644 --- a/src/bun.js/bindings/KeyObject.cpp +++ b/src/bun.js/bindings/KeyObject.cpp @@ -406,6 +406,7 @@ JSC_DEFINE_HOST_FUNCTION(KeyObject__createPrivateKey, (JSC::JSGlobalObject * glo } default: { if (auto* keyObj = jsDynamicCast(keyJSValue)) { + (void)keyObj; if (format != "jwk"_s) { JSC::throwTypeError(globalObject, scope, "format should be 'jwk' when key type is 'object'"_s); return {}; @@ -970,6 +971,7 @@ JSC_DEFINE_HOST_FUNCTION(KeyObject__createPublicKey, (JSC::JSGlobalObject * glob } default: { if (auto* keyObj = jsDynamicCast(keyJSValue)) { + (void)keyObj; if (format != "jwk"_s) { JSC::throwTypeError(globalObject, scope, "format should be 'jwk' when key type is 'object'"_s); return {}; diff --git a/src/bun.js/bindings/ModuleLoader.cpp b/src/bun.js/bindings/ModuleLoader.cpp index fef63d1cca579e..ab5beafd69e46d 100644 --- a/src/bun.js/bindings/ModuleLoader.cpp +++ b/src/bun.js/bindings/ModuleLoader.cpp @@ -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(objectValue)) { + (void)promise; OnLoadResult result = {}; result.type = OnLoadResultTypePromise; result.value.promise = objectValue; diff --git a/src/bun.js/bindings/UtilInspect.cpp b/src/bun.js/bindings/UtilInspect.cpp index 56724f8057a3dc..9700d0b0681ff2 100644 --- a/src/bun.js/bindings/UtilInspect.cpp +++ b/src/bun.js/bindings/UtilInspect.cpp @@ -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 {}; } diff --git a/src/bun.js/bindings/bindings.cpp b/src/bun.js/bindings/bindings.cpp index f123454b52193c..da08425181f6c7 100644 --- a/src/bun.js/bindings/bindings.cpp +++ b/src/bun.js/bindings/bindings.cpp @@ -330,6 +330,7 @@ AsymmetricMatcherResult matchAsymmetricMatcherAndGetFlags(JSGlobalObject* global AsymmetricMatcherConstructorType constructorType = AsymmetricMatcherConstructorType::none; if (auto* expectAnything = jsDynamicCast(matcherPropCell)) { + (void)expectAnything; if (!readFlagsAndProcessPromise(matcherProp, flags, globalObject, otherProp, constructorType)) return AsymmetricMatcherResult::FAIL; @@ -382,6 +383,7 @@ AsymmetricMatcherResult matchAsymmetricMatcherAndGetFlags(JSGlobalObject* global } if (auto* booleanObject = jsDynamicCast(otherProp)) { + (void)booleanObject; return AsymmetricMatcherResult::PASS; } @@ -394,6 +396,7 @@ AsymmetricMatcherResult matchAsymmetricMatcherAndGetFlags(JSGlobalObject* global } if (auto* numberObject = jsDynamicCast(otherProp)) { + (void)numberObject; return AsymmetricMatcherResult::PASS; } @@ -2165,6 +2168,7 @@ double JSC__JSValue__getLengthIfPropertyExistsInternal(JSC__JSValue value, JSC__ case WebCore::JSDOMWrapperType: { if (auto* headers = jsDynamicCast(cell)) + (void)headers; return static_cast(jsCast(cell)->wrapped().size()); if (auto* blob = jsDynamicCast(cell)) { @@ -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(cell)) { + (void)promise; handlePromise(promise, arg1, arg2, ArgFn3, ArgFn4); } else if (JSC::JSInternalPromise* promise = JSC::jsDynamicCast(cell)) { + (void)promise; RELEASE_ASSERT(false); } } diff --git a/src/bun.js/bindings/webcore/EventEmitter.cpp b/src/bun.js/bindings/webcore/EventEmitter.cpp index 8db15a8e5ba21a..5b05efb9a3a6eb 100644 --- a/src/bun.js/bindings/webcore/EventEmitter.cpp +++ b/src/bun.js/bindings/webcore/EventEmitter.cpp @@ -148,6 +148,7 @@ int EventEmitter::listenerCount(const Identifier& eventType) continue; if (JSC::JSObject* jsFunction = registeredListener->callback().jsFunction()) { + (void)jsFunction; result++; } } diff --git a/src/bun.js/bindings/webcore/WebSocket.cpp b/src/bun.js/bindings/webcore/WebSocket.cpp index c35bf6c3e90569..c32b805fd6d354 100644 --- a/src/bun.js/bindings/webcore/WebSocket.cpp +++ b/src/bun.js/bindings/webcore/WebSocket.cpp @@ -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 = {}; diff --git a/src/bun.js/bindings/webcore/Worker.cpp b/src/bun.js/bindings/webcore/Worker.cpp index f55eaf567a2e01..6504273cc46659 100644 --- a/src/bun.js/bindings/webcore/Worker.cpp +++ b/src/bun.js/bindings/webcore/Worker.cpp @@ -481,6 +481,7 @@ JSC_DEFINE_HOST_FUNCTION(jsReceiveMessageOnPort, (JSGlobalObject * lexicalGlobal return JSC::JSValue::encode(messagePort->wrapped().tryTakeMessage(lexicalGlobalObject)); } else if (auto* broadcastChannel = jsDynamicCast(port)) { // TODO: support broadcast channels + (void)broadcastChannel; return JSC::JSValue::encode(jsUndefined()); }