-
Notifications
You must be signed in to change notification settings - Fork 673
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
Improve location info for syntax errors. #4816
base: master
Are you sure you want to change the base?
Conversation
b27ea39
to
e07af28
Compare
Patch is ready for review. |
e07af28
to
82df616
Compare
JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg [email protected]
82df616
to
048874e
Compare
} | ||
} | ||
|
||
return jerry_throw (ecma_raise_type_error (ECMA_ERR_MSG ("Location is not available"))); |
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'm wondering wether it would be better to simply return with undefined if there is no location, or with a pre-defined magic string. And similarly when error messages are disabled.
It feels to me like the location info is an added bonus, it can be used when it's available, but if it's not, then that's not really a problem. Or at least not something that would warrant an error.
* error, otherwise | ||
*/ | ||
jerry_value_t | ||
jerry_get_syntax_error_location (jerry_value_t value, /**< SyntaxError object */ |
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.
How about not making this syntax error specific, and changing the name to be generic for errors. Functionally it already seems to be generic. Also in the future we could possibly include location info for other error types as well.
Same for the jerry_syntax_error_location_t
type, I would just call it jerry_error_location_t
.
@zherczeg please rebase |
No description provided.