mirror of
https://github.com/oven-sh/bun
synced 2026-02-15 05:12:29 +00:00
safety: audit and add missing exception checks to JSC::constructArray+constructEmptyArray (#20119)
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user