Merge pull request #9285 from Lydrin/master
pkg/jerryscript: update to latest commit
This commit is contained in:
commit
4b7f85de75
@ -31,30 +31,34 @@
|
|||||||
|
|
||||||
int js_run(const jerry_char_t *script, size_t script_size)
|
int js_run(const jerry_char_t *script, size_t script_size)
|
||||||
{
|
{
|
||||||
jerry_value_t ret_value;
|
|
||||||
|
|
||||||
/* Initialize engine */
|
jerry_value_t parsed_code, ret_value;
|
||||||
|
int res = 0;
|
||||||
|
|
||||||
|
/* Initialize engine, no flags, default configuration */
|
||||||
|
|
||||||
jerry_init(JERRY_INIT_EMPTY);
|
jerry_init(JERRY_INIT_EMPTY);
|
||||||
|
|
||||||
/* Register the print function in the global object. */
|
/* Register the print function in the global object. */
|
||||||
jerryx_handler_register_global((const jerry_char_t *) "print", jerryx_handler_print);
|
|
||||||
|
jerryx_handler_register_global((const jerry_char_t *) "print",
|
||||||
|
jerryx_handler_print);
|
||||||
|
|
||||||
/* Setup Global scope code */
|
/* Setup Global scope code */
|
||||||
ret_value = jerry_parse(script, script_size, false);
|
|
||||||
|
|
||||||
if (!jerry_value_has_error_flag(ret_value)) {
|
parsed_code = jerry_parse(NULL, 0, script, script_size, JERRY_PARSE_NO_OPTS);
|
||||||
|
|
||||||
|
if (!jerry_value_is_error(parsed_code)) {
|
||||||
/* Execute the parsed source code in the Global scope */
|
/* Execute the parsed source code in the Global scope */
|
||||||
ret_value = jerry_run(ret_value);
|
ret_value = jerry_run(parsed_code);
|
||||||
}
|
if (jerry_value_is_error(ret_value)) {
|
||||||
|
|
||||||
int res = 0;
|
|
||||||
|
|
||||||
if (jerry_value_has_error_flag(ret_value)) {
|
|
||||||
printf("js_run(): Script Error!");
|
printf("js_run(): Script Error!");
|
||||||
res = -1;
|
res = -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
jerry_release_value(ret_value);
|
jerry_release_value(ret_value);
|
||||||
|
}
|
||||||
|
|
||||||
|
jerry_release_value(parsed_code);
|
||||||
|
|
||||||
/* Cleanup engine */
|
/* Cleanup engine */
|
||||||
jerry_cleanup();
|
jerry_cleanup();
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
PKG_NAME=jerryscript
|
PKG_NAME=jerryscript
|
||||||
PKG_URL=https://github.com/jerryscript-project/jerryscript.git
|
PKG_URL=https://github.com/jerryscript-project/jerryscript.git
|
||||||
PKG_VERSION=bd574956e3702bc5b0512ad835b1df896cf00626
|
PKG_VERSION=e1af56586cf9beeafbc67172b05cad28eca289cb
|
||||||
PKG_LICENSE=Apache-2.0
|
PKG_LICENSE=Apache-2.0
|
||||||
|
|
||||||
.PHONY: all
|
.PHONY: all
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user