-
Notifications
You must be signed in to change notification settings - Fork 683
Print unhandled errors in REPL mode #1004
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
Print unhandled errors in REPL mode #1004
Conversation
@@ -560,19 +560,12 @@ main (int argc, | |||
jerry_api_value_t ret_val; | |||
ret_code = jerry_api_eval (buffer, len, false, false, &ret_val); | |||
|
|||
if (ret_code == JERRY_COMPLETION_CODE_OK) | |||
// print return value |
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.
I thins comment should be fixed.
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.
Done.
493cd75
to
6eaeb9a
Compare
@@ -527,17 +527,14 @@ jerry_api_convert_eval_completion_to_retval (jerry_api_value_t *retval_p, /**< [ | |||
* code execution */ | |||
{ | |||
jerry_completion_code_t ret_code; | |||
jerry_api_convert_ecma_value_to_api_value (retval_p, completion); |
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.
Now that this function is being touched, it would be nice to update its doc comment. The "Note:" part could better be referring to jerry_api_release_value
.
Another stylistic suggestion: the below 10 lines could be written in a single line...
return !ecma_is_value_error (completion) ? JERRY_COMPLETION_CODE_OK : JERRY_COMPLETION_CODE_UNHANDLED_EXCEPTION;
Much cleaner. (And still within the 120 chars-per-line limit.)
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.
@akiss77, +1
If it is too long, then write like this:
return !ecma_is_value_error (completion) ? JERRY_COMPLETION_CODE_OK
: JERRY_COMPLETION_CODE_UNHANDLED_EXCEPTION;
LGTM otherwise (FWIW) |
jerry_api_value_t ret_val; | ||
ret_code = jerry_api_eval (buffer, len, false, false, &ret_val); | ||
|
||
if (ret_code == JERRY_COMPLETION_CODE_OK) | ||
/* Print return value */ | ||
const jerry_api_value_t args[] = {ret_val}; |
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.
Please add a space before and after ret_val
.
LGTM after comments being fixed. |
JerryScript-DCO-1.0-Signed-off-by: Dániel Bátyai dbatyai@inf.u-szeged.hu
6eaeb9a
to
37333e2
Compare
LGTM |
JerryScript-DCO-1.0-Signed-off-by: Dániel Bátyai dbatyai@inf.u-szeged.hu