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

@@ -547,10 +547,9 @@ pub const String = extern struct {
) JSC.JSValue;
/// calls toJS on all elements of `array`.
pub fn toJSArray(globalObject: *bun.JSC.JSGlobalObject, array: []const bun.String) JSC.JSValue {
pub fn toJSArray(globalObject: *bun.JSC.JSGlobalObject, array: []const bun.String) bun.JSError!JSC.JSValue {
JSC.markBinding(@src());
return BunString__createArray(globalObject, array.ptr, array.len);
return bun.jsc.fromJSHostValue(BunString__createArray(globalObject, array.ptr, array.len));
}
pub fn toZigString(this: String) ZigString {