Don't rely on being idle to do anything. Fixes JS job starvation on slow machines more.
Some checks are pending
Build Tilde Friends / Build-All (push) Waiting to run

This commit is contained in:
2024-08-21 12:53:38 -04:00
parent 6f487100cd
commit a15bb8e994
3 changed files with 18 additions and 37 deletions

View File

@ -211,6 +211,7 @@ static JSValue _util_print(JSContext* context, JSValueConst this_val, int argc,
bool tf_util_report_error(JSContext* context, JSValue value)
{
bool is_error = false;
tf_task_t* task = tf_task_get(context);
if (JS_IsError(context, value))
{
const char* string = JS_ToCString(context, value);
@ -226,13 +227,11 @@ bool tf_util_report_error(JSContext* context, JSValue value)
}
JS_FreeValue(context, stack);
tf_task_t* task = tf_task_get(context);
tf_task_send_error_to_parent(task, value);
is_error = true;
}
else if (JS_IsException(value))
{
tf_task_t* task = tf_task_get(context);
if (!tf_task_send_error_to_parent(task, value))
{
JSValue exception = JS_GetException(context);
@ -241,6 +240,7 @@ bool tf_util_report_error(JSContext* context, JSValue value)
}
is_error = true;
}
tf_task_check_jobs(task);
return is_error;
}