Skip to content

Implemented jerry_api_create_error() #76

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
merged 1 commit into from
May 20, 2015
Merged

Implemented jerry_api_create_error() #76

merged 1 commit into from
May 20, 2015

Conversation

ILyoan
Copy link
Contributor

@ILyoan ILyoan commented May 18, 2015

  • Added jerry_api_create_error()
  • Added test for the api.

@ILyoan
Copy link
Contributor Author

ILyoan commented May 18, 2015

For #35


ecma_standard_error_t standard_error_type = ECMA_ERROR_COMMON;

switch (error_type)
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we really need additional level of abstraction for that? Why don't we simply use ECMA_ERROR_COMMON, ECMA_ERROR_EVAL etc? As for me, its better to extend ecma_standard_error_t enum if needed and use it across the API.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That was questionable for me too, Then let's make it use only ecma_standart_error_t.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

What do you think about naming? should we change the name of enum entry like ECMA_ERROR_COMMON to JERRY_ERROR_COMMON ?

@egavrin egavrin added minor api Related to the public API development Feature implementation labels May 18, 2015
@ILyoan
Copy link
Contributor Author

ILyoan commented May 18, 2015

@egavrin, Updated PR so that it uses ecma_standard_error_t. but it seems like it spoils the naming convention since other apis except this are using JERRY_ prefix. If you feel like we need to follow the naming, let me know.

*
* See also: 15.11.1, 15.11.6
*/
typedef enum
Copy link
Contributor

Choose a reason for hiding this comment

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

There is no need to move this enum out of ecma-exceptions, since all related functionality is defined here. So, just reference ecma-exceptions.h in jerry.cpp.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Would clients for libjerry be supposed referring only jerry-api.h? The api user need to know what kind of error they want to make. If the definition is in ecma-exception.h, user program of libjerry should also need that file to include.

Copy link
Contributor

Choose a reason for hiding this comment

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

Ah...I got your concern. Let's go back to the issue discussion #35.

JerryScript-DCO-1.0-Signed-off-by: Ilyong Cho ily.cho@samsung.com
@ILyoan
Copy link
Contributor Author

ILyoan commented May 20, 2015

@egavrin OK, rolled back to the first PR rebased on top of master.

@egavrin
Copy link
Contributor

egavrin commented May 20, 2015

@ILyoan make push

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 development Feature implementation minor
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants