Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 5 additions & 9 deletions quickjs-libc.c
Original file line number Diff line number Diff line change
Expand Up @@ -2931,17 +2931,13 @@ static JSValue make_obj_error(JSContext *ctx,
JSValue obj,
int err)
{
JSValue arr;
JSValue vals[2];

if (JS_IsException(obj))
return obj;
arr = JS_NewArray(ctx);
if (JS_IsException(arr))
return JS_EXCEPTION;
JS_DefinePropertyValueUint32(ctx, arr, 0, obj,
JS_PROP_C_W_E);
JS_DefinePropertyValueUint32(ctx, arr, 1, JS_NewInt32(ctx, err),
JS_PROP_C_W_E);
return arr;
vals[0] = obj;
vals[1] = JS_NewInt32(ctx, err);
return JS_NewArrayFrom(ctx, countof(vals), vals);
}

static JSValue make_string_error(JSContext *ctx,
Expand Down