Skip to content

Check error values in API functions #1167

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

Merged

Conversation

LaszloLango
Copy link
Contributor

Internal functions cannot handle error values, so it must be avoided to
pass error values to the engine.

JerryScript-DCO-1.0-Signed-off-by: László Langó llango.u-szeged@partner.samsung.com

@LaszloLango LaszloLango added enhancement An improvement api Related to the public API labels Jun 23, 2016
@LaszloLango LaszloLango added this to the Release v1.0 milestone Jun 23, 2016
@zherczeg
Copy link
Member

Please check the travis fails.

@LaszloLango LaszloLango force-pushed the jerry-api-error-handling branch from 74342a9 to 886477c Compare June 27, 2016 10:54
@@ -62,6 +62,8 @@ static jerry_flag_t jerry_flags;
*/
static bool jerry_api_available;

static const jerry_char_t *error_value_msg_p = (const jerry_char_t *) "argument cannot be an error value";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"cannot have an error flag" is better

@LaszloLango LaszloLango force-pushed the jerry-api-error-handling branch from 886477c to 4f4f916 Compare June 29, 2016 06:44
@LaszloLango
Copy link
Contributor Author

@zherczeg, I've updated the PR. Please check.

@@ -144,6 +144,7 @@ bool jerry_value_to_boolean (const jerry_value_t);
jerry_value_t jerry_value_to_number (const jerry_value_t);
jerry_value_t jerry_value_to_object (const jerry_value_t);
jerry_value_t jerry_value_to_string (const jerry_value_t);
jerry_value_t jerry_value_to_normal_value (const jerry_value_t);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what about jerry_value_remove_error_flag? I don't think people will understand the "normal" phrase.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't mind to change it.

@LaszloLango LaszloLango force-pushed the jerry-api-error-handling branch from 4f4f916 to 1a0127b Compare June 29, 2016 06:50
@zherczeg
Copy link
Member

I was thinking, and I convinced myself that the current approach is right.
LGTM

Internal functions cannot handle error values, so it must be avoided to
pass error values to the engine.

JerryScript-DCO-1.0-Signed-off-by: László Langó llango.u-szeged@partner.samsung.com
@LaszloLango LaszloLango force-pushed the jerry-api-error-handling branch from 1a0127b to c3541c3 Compare June 29, 2016 12:27
@dbatyai
Copy link
Member

dbatyai commented Jun 29, 2016

LGTM

@LaszloLango LaszloLango merged commit c3541c3 into jerryscript-project:master Jun 29, 2016
@LaszloLango LaszloLango deleted the jerry-api-error-handling branch July 12, 2016 11:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api Related to the public API enhancement An improvement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants