-
Notifications
You must be signed in to change notification settings - Fork 683
Introduce the Termination Port API #1015
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Introduce the Termination Port API #1015
Conversation
Related to #964 . Not a full implementation of the ideas suggested there, of course, but a first step towards it. In addition to introducing the Termination API (which seemed to be the one that everyone agreed on), the PR already exemplifies how a port implementation can have its own extension(s) to the core Jerry API. |
Note: also related to #957 |
/* | ||
* Termination Port API | ||
* | ||
* Note: It is questionable whether a library should be able to terminate an |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor style issue. The common style for note comments are that using newline and indent to colon.
/*
* Note:
* It is questionable whether...
147c98a
to
1880420
Compare
#ifdef __cplusplus | ||
extern "C" | ||
{ | ||
#endif /* !__cplusplus */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#endif /* __cplusplus */
I like the PR, but I'd like to hear the opinion of everyone who is involved in #964 before we merge. Let's give some time for everyone to check it. :) |
0b83ee5
to
2bf0b94
Compare
Should anyone be interested, a draft of the Date Port API is prototyped as some patches on top of this PR here: https://github.com/akiss77/jerryscript/tree/port-date (no PR, yet) Acknowledgement: it does have some overlap with #969 by @franc0is |
LGTM |
@akiss77, Date Port API patch also looks good for first sight. |
LGTM |
* Moved the error codes to jerry-port.h and declared port function `jerry_port_fatal`. * Moved "exit or abort on fail" functionality to the newly added jerry-port-default-fatal.c. * This implied that a default port-specific API had to be introduced: functions `jerry_port_default_set_abort_on_fail` and `jerry_port_default_is_abort_on_fail` declared in jerry-port-default.h control the fatal exit behaviour. * For the sake of clarity, renamed jerry-port.c to jerry-port-default-io.c. * Adapted CMakeLists to deal with port implementations consisting of more then one source file and exposing headers. This also required the renaming of `EXTERNAL_PORT_FILE` cmake option to `EXTERNAL_PORT_DIR`. * Adapted main sources to use the default port header for the abort-on-fail functionality, as that is not part of the core jerry API anymore. * Added default port implementation to the static source code checker tools. JerryScript-DCO-1.0-Signed-off-by: Akos Kiss akiss@inf.u-szeged.hu
2bf0b94
to
02ba19f
Compare
I'm just now catching up with these PRs, they are terrific! I'm thrilled to see the port model moving forward. |
jerry_port_fatal
.jerry-port-default-fatal.c.
functions
jerry_port_default_set_abort_on_fail
andjerry_port_default_is_abort_on_fail
declared in jerry-port-default.hcontrol the fatal exit behaviour.
jerry-port-default-io.c.
more then one source file and exposing headers. This also required
the renaming of
EXTERNAL_PORT_FILE
cmake option toEXTERNAL_PORT_DIR
.abort-on-fail functionality, as that is not part of the core jerry
API anymore.
tools.
JerryScript-DCO-1.0-Signed-off-by: Akos Kiss akiss@inf.u-szeged.hu