mirror of
https://github.com/oven-sh/bun
synced 2026-02-14 21:01:52 +00:00
Support jsonb, idle_timeout, connection_timeout, max_lifetime timeouts in bun:sql. Add onopen and onclose callbacks. Fix missing "code" property appearing in errors. Add error codes for postgres. (#16045)
This commit is contained in:
@@ -90,6 +90,36 @@ extern "C" JSPropertyIterator* Bun__JSPropertyIterator__create(JSC::JSGlobalObje
|
||||
return JSPropertyIterator::create(vm, array.releaseData());
|
||||
}
|
||||
|
||||
// The only non-own property that we sometimes want to get is the code property.
|
||||
extern "C" EncodedJSValue Bun__JSPropertyIterator__getCodeProperty(JSPropertyIterator* iter, JSC::JSGlobalObject* globalObject, JSC::JSObject* object)
|
||||
{
|
||||
if (UNLIKELY(!iter)) {
|
||||
return {};
|
||||
}
|
||||
|
||||
auto& vm = iter->vm;
|
||||
auto scope = DECLARE_THROW_SCOPE(vm);
|
||||
RETURN_IF_EXCEPTION(scope, {});
|
||||
if (UNLIKELY(object->type() == JSC::ProxyObjectType)) {
|
||||
return {};
|
||||
}
|
||||
|
||||
auto& builtinNames = WebCore::builtinNames(vm);
|
||||
|
||||
PropertySlot slot(object, PropertySlot::InternalMethodType::VMInquiry, vm.ptr());
|
||||
if (!object->getNonIndexPropertySlot(globalObject, builtinNames.codePublicName(), slot)) {
|
||||
return {};
|
||||
}
|
||||
|
||||
if (slot.isAccessor() || slot.isCustom()) {
|
||||
return {};
|
||||
}
|
||||
|
||||
RETURN_IF_EXCEPTION(scope, {});
|
||||
|
||||
return JSValue::encode(slot.getPureResult());
|
||||
}
|
||||
|
||||
extern "C" size_t Bun__JSPropertyIterator__getLongestPropertyName(JSPropertyIterator* iter, JSC::JSGlobalObject* globalObject, JSC::JSObject* object)
|
||||
{
|
||||
size_t longest = 0;
|
||||
|
||||
Reference in New Issue
Block a user