Update jerry_run_all_enqueued_jobs() function and documentation (#4283)

Make sure it always returns an error or an undefined value.

JerryScript-DCO-1.0-Signed-off-by: Daniel Balla dballa@inf.u-szeged.hu
This commit is contained in:
Daniel Balla
2020-10-10 09:03:52 +02:00
committed by GitHub
parent e3481d431b
commit 596964ae0d
2 changed files with 32 additions and 3 deletions
+8 -2
View File
@@ -498,7 +498,7 @@ ecma_process_all_enqueued_jobs (void)
{
ecma_value_t ret = ECMA_VALUE_UNDEFINED;
while (JERRY_CONTEXT (job_queue_head_p) != NULL && !ECMA_IS_VALUE_ERROR (ret))
while (JERRY_CONTEXT (job_queue_head_p) != NULL)
{
ecma_job_queue_item_t *job_p = JERRY_CONTEXT (job_queue_head_p);
JERRY_CONTEXT (job_queue_head_p) = ecma_job_queue_get_next (job_p);
@@ -531,9 +531,15 @@ ecma_process_all_enqueued_jobs (void)
break;
}
}
if (ECMA_IS_VALUE_ERROR (ret))
{
return ret;
}
}
return ret;
ecma_free_value (ret);
return ECMA_VALUE_UNDEFINED;
} /* ecma_process_all_enqueued_jobs */
/**