safety: audit and add missing exception checks to JSC::constructArray+constructEmptyArray (#20119)

This commit is contained in:
Meghan Denny
2025-05-31 19:05:02 -08:00
committed by GitHub
parent 5a025abddf
commit 284de53f26
72 changed files with 341 additions and 329 deletions

View File

@@ -1394,12 +1394,12 @@ pub const PostgresSQLConnection = struct {
this.globalObject.bunVM().timer.insert(&this.timer);
}
pub fn getQueries(_: *PostgresSQLConnection, thisValue: JSC.JSValue, globalObject: *JSC.JSGlobalObject) JSC.JSValue {
pub fn getQueries(_: *PostgresSQLConnection, thisValue: JSC.JSValue, globalObject: *JSC.JSGlobalObject) bun.JSError!JSC.JSValue {
if (js.queriesGetCached(thisValue)) |value| {
return value;
}
const array = JSC.JSValue.createEmptyArray(globalObject, 0);
const array = try JSC.JSValue.createEmptyArray(globalObject, 0);
js.queriesSetCached(thisValue, globalObject, array);
return array;