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:
Meghan Denny
2024-09-23 13:53:08 -07:00
committed by GitHub
parent ff9560c82a
commit 33075394a4
53 changed files with 899 additions and 898 deletions

View File

@@ -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))