mirror of
https://github.com/oven-sh/bun
synced 2026-02-10 10:58:56 +00:00
cpp: always return empty JSValue value after throwing exception (#13935)
Co-authored-by: Dylan Conway <35280289+dylan-conway@users.noreply.github.com>
This commit is contained in:
@@ -888,13 +888,13 @@ BUN_DEFINE_HOST_FUNCTION(jsFunctionOnLoadObjectResultResolve, (JSC::JSGlobalObje
|
||||
scope.release();
|
||||
promise->resolve(globalObject, result);
|
||||
pendingModule->internalField(2).set(vm, pendingModule, JSC::jsUndefined());
|
||||
return JSValue::encode(jsUndefined());
|
||||
} else {
|
||||
throwException(globalObject, scope, result);
|
||||
auto retValue = JSValue::encode(promise->rejectWithCaughtException(globalObject, scope));
|
||||
pendingModule->internalField(2).set(vm, pendingModule, JSC::jsUndefined());
|
||||
return retValue;
|
||||
}
|
||||
return JSValue::encode(jsUndefined());
|
||||
}
|
||||
|
||||
BUN_DEFINE_HOST_FUNCTION(jsFunctionOnLoadObjectResultReject, (JSC::JSGlobalObject * globalObject, JSC::CallFrame* callFrame))
|
||||
|
||||
Reference in New Issue
Block a user