Move the job queue from the ports into jerry-core (#1804)

* Move the job queue from the ports into jerry-core

JerryScript-DCO-1.0-Signed-off-by: Akos Kiss akiss@inf.u-szeged.hu

* Remove port notification and keep `jerry_run_all_enqueued_jobs` API only

JerryScript-DCO-1.0-Signed-off-by: Akos Kiss akiss@inf.u-szeged.hu
This commit is contained in:
Akos Kiss
2017-05-18 11:30:50 +02:00
committed by yichoi
parent 0806c16902
commit 23068bdf99
12 changed files with 155 additions and 175 deletions
+20
View File
@@ -432,6 +432,26 @@ jerry_eval (const jerry_char_t *source_p, /**< source code */
is_strict);
} /* jerry_eval */
/**
* Run enqueued Promise jobs until the first thrown error or until all get executed.
*
* Note:
* returned value must be freed with jerry_release_value, when it is no longer needed.
*
* @return result of last executed job, may be error value.
*/
jerry_value_t
jerry_run_all_enqueued_jobs (void)
{
jerry_assert_api_available ();
#ifndef CONFIG_DISABLE_ES2015_PROMISE_BUILTIN
return ecma_process_all_enqueued_jobs ();
#else /* CONFIG_DISABLE_ES2015_PROMISE_BUILTIN */
return ecma_make_simple_value (ECMA_SIMPLE_VALUE_UNDEFINED);
#endif /* CONFIG_DISABLE_ES2015_PROMISE_BUILTIN */
} /* jerry_run_all_enqueued_jobs */
/**
* Get global object
*