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:
@@ -24,9 +24,9 @@
|
||||
#include "js-parser.h"
|
||||
#include "lit-magic-strings.h"
|
||||
|
||||
#if ENABLED (JERRY_LINE_INFO)
|
||||
#if ENABLED (JERRY_LINE_INFO) || ENABLED (JERRY_ERROR_MESSAGES)
|
||||
#include "jcontext.h"
|
||||
#endif /* ENABLED (JERRY_LINE_INFO) */
|
||||
#endif /* ENABLED (JERRY_LINE_INFO) || ENABLED (JERRY_ERROR_MESSAGES) */
|
||||
|
||||
#define ECMA_BUILTINS_INTERNAL
|
||||
#include "ecma-builtins-internal.h"
|
||||
@@ -159,9 +159,9 @@ ecma_builtin_function_dispatch_construct (const ecma_value_t *arguments_list_p,
|
||||
ECMA_STRING_TO_UTF8_STRING (arguments_str_p, arguments_buffer_p, arguments_buffer_size);
|
||||
ECMA_STRING_TO_UTF8_STRING (function_body_str_p, function_body_buffer_p, function_body_buffer_size);
|
||||
|
||||
#if ENABLED (JERRY_LINE_INFO)
|
||||
JERRY_CONTEXT (resource_name) = ecma_make_magic_string_value (LIT_MAGIC_STRING__EMPTY);
|
||||
#endif /* ENABLED (JERRY_LINE_INFO) */
|
||||
#if ENABLED (JERRY_LINE_INFO) || ENABLED (JERRY_ERROR_MESSAGES)
|
||||
JERRY_CONTEXT (resource_name) = ecma_make_magic_string_value (LIT_MAGIC_STRING_RESOURCE_ANON);
|
||||
#endif /* ENABLED (JERRY_LINE_INFO) || ENABLED (JERRY_ERROR_MESSAGES) */
|
||||
|
||||
ecma_compiled_code_t *bytecode_data_p = NULL;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user