Include file path in Syntax error messages (#2941)
When using ES6 modules it was not possible to identify which module an error originates from. This PR changes the error message to also include the file path using the file:line:column format, and updates the source context printing for unhandled exceptions to use the correct file. Co-authored-by: Marko Fabo <mfabo@inf.u-szeged.hu> JerryScript-DCO-1.0-Signed-off-by: Dániel Bátyai dbatyai@inf.u-szeged.hu
This commit is contained in:
@@ -2962,8 +2962,9 @@ parser_parse_script (const uint8_t *arg_list_p, /**< function argument list */
|
||||
ecma_value_t col_str_val = ecma_make_uint32_value (parser_error.column);
|
||||
|
||||
ecma_value_t error_value = ecma_raise_standard_error_with_format (ECMA_ERROR_SYNTAX,
|
||||
"% [line: %, column: %]",
|
||||
"% [%:%:%]",
|
||||
err_str_val,
|
||||
JERRY_CONTEXT (resource_name),
|
||||
line_str_val,
|
||||
col_str_val);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user