Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Remove unnecessary helper function
The only place where it was called was already calling fulfill_or_reject_promise in another code path, so inline it.
  • Loading branch information
saghul committed Apr 25, 2025
commit e799f2aba695d01e9b87b587550ef246f2deb16a
8 changes: 1 addition & 7 deletions quickjs.c
Original file line number Diff line number Diff line change
Expand Up @@ -50249,12 +50249,6 @@ static void fulfill_or_reject_promise(JSContext *ctx, JSValueConst promise,
}
}

static void reject_promise(JSContext *ctx, JSValueConst promise,
JSValueConst value)
{
fulfill_or_reject_promise(ctx, promise, value, true);
}

static JSValue js_promise_resolve_thenable_job(JSContext *ctx,
int argc, JSValueConst *argv)
{
Expand Down Expand Up @@ -50390,7 +50384,7 @@ static JSValue js_promise_resolve_function_call(JSContext *ctx,
JSValue error;
fail_reject:
error = JS_GetException(ctx);
reject_promise(ctx, s->promise, error);
fulfill_or_reject_promise(ctx, s->promise, error, true);
JS_FreeValue(ctx, error);
} else if (!JS_IsFunction(ctx, then)) {
JS_FreeValue(ctx, then);
Expand Down