Skip to content

Conversation

@imiklos
Copy link
Contributor

@imiklos imiklos commented Apr 19, 2018

Rename the function to represent it's real functionality.

JerryScript-DCO-1.0-Signed-off-by: Istvan Miklos imiklos2@inf.u-szeged.hu

@imiklos imiklos mentioned this pull request Apr 19, 2018
Copy link
Member

@zherczeg zherczeg left a comment

Choose a reason for hiding this comment

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

Just a small changes. But lets wait a bit for others opinion.

- `value` - api value
- return value
- true, if the given `jerry_value_t` has the error flag set
- true, if the given `jerry_value_t` has 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.

has error value. -> is an error value

* Error flag manipulation functions.
*/
bool jerry_value_has_error_flag (const jerry_value_t value);
bool jerry_value_is_error (const jerry_value_t value);
Copy link
Member

Choose a reason for hiding this comment

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

I think this could be moved after bool jerry_value_is_undefined (const jerry_value_t value);.

Copy link
Contributor

Choose a reason for hiding this comment

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

The error flag related functions are grouped together. See the comment above: "Error flag manipulation functions."
I'd keep this separate group, but the comment should be updated

Copy link
Member

Choose a reason for hiding this comment

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

It was good for a flag manipulation functions, but error is a value now. Then we should either grouping others (e.g string, number) or place these to other value management groups. That is my thoughts though.

Copy link
Contributor

Choose a reason for hiding this comment

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

I don't have strong preferences. If we move it in the header, then the implementation must be moved too. Please be careful and keep to the same function order in the .h and .c files.

@LaszloLango LaszloLango added this to the Release 2.0 milestone Apr 19, 2018
@LaszloLango LaszloLango added the api Related to the public API label Apr 19, 2018
**Summary**

Returns whether the given `jerry_value_t` has the error flag set.
Returns whether the given `jerry_value_t` has error value.
Copy link
Contributor

Choose a reason for hiding this comment

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

has -> is

* Error flag manipulation functions.
*/
bool jerry_value_has_error_flag (const jerry_value_t value);
bool jerry_value_is_error (const jerry_value_t value);
Copy link
Contributor

Choose a reason for hiding this comment

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

The error flag related functions are grouped together. See the comment above: "Error flag manipulation functions."
I'd keep this separate group, but the comment should be updated

@imiklos imiklos force-pushed the jerry_value_has_error_flag branch from 6f9a1bf to 3228257 Compare April 26, 2018 12:07
@imiklos
Copy link
Contributor Author

imiklos commented Apr 26, 2018

@zherczeg @LaszloLango I updated the PR, made the changes you mentioned.

@zherczeg
Copy link
Member

Does the documentation follows the function declaration last? Or it has a different order?

@imiklos
Copy link
Contributor Author

imiklos commented Apr 27, 2018

I did not change the order in the documentation. It is in the same order as before. Should I need to change it in the documentation too?

@LaszloLango
Copy link
Contributor

@imiklos yes please

@imiklos imiklos force-pushed the jerry_value_has_error_flag branch from 3228257 to ed76735 Compare April 27, 2018 13:12
@imiklos
Copy link
Contributor Author

imiklos commented Apr 27, 2018

I moved the function in the documentation to keep the same order, and also moved the in the #2291 PR.

Copy link
Member

@zherczeg zherczeg left a comment

Choose a reason for hiding this comment

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

LGTM

bool jerry_value_is_promise (const jerry_value_t value);
bool jerry_value_is_string (const jerry_value_t value);
bool jerry_value_is_undefined (const jerry_value_t value);
bool jerry_value_is_error (const jerry_value_t value);
Copy link
Contributor

Choose a reason for hiding this comment

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

It would be better to keep these in sort. Please move it before ´jerry_value_is_function´. Or am I missing something?

Rename the function to represent it's real functionality.

JerryScript-DCO-1.0-Signed-off-by: Istvan Miklos imiklos2@inf.u-szeged.hu
@imiklos imiklos force-pushed the jerry_value_has_error_flag branch from ed76735 to 3db0602 Compare May 2, 2018 09:31
Copy link
Contributor

@LaszloLango LaszloLango left a comment

Choose a reason for hiding this comment

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

LGTM

@LaszloLango LaszloLango merged commit ba2e49c into jerryscript-project:master May 3, 2018
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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants