Change resource name to a string. (#4724)

JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
This commit is contained in:
Zoltan Herczeg
2021-07-27 13:40:19 +02:00
committed by GitHub
parent d99905aca6
commit 951044c036
17 changed files with 105 additions and 106 deletions
+2 -2
View File
@@ -419,12 +419,12 @@ int jerry_main (int argc, char *argv[])
jerry_parse_options_t parse_options;
parse_options.options = JERRY_PARSE_HAS_RESOURCE;
parse_options.resource_name_p = (const jerry_char_t *) file_names[i];
parse_options.resource_name_length = strlen (file_names[i]);
parse_options.resource_name = jerry_create_string ((const jerry_char_t *) file_names[i]);
ret_value = jerry_parse (source_p,
source_size,
&parse_options);
jerry_release_value (parse_options.resource_name);
free ((void*) source_p);
if (!jerry_value_is_error (ret_value))
+2 -2
View File
@@ -259,13 +259,13 @@ jerry_port_module_resolve (const jerry_value_t specifier, /**< module specifier
jerry_parse_options_t parse_options;
parse_options.options = JERRY_PARSE_MODULE | JERRY_PARSE_HAS_RESOURCE;
parse_options.resource_name_p = (jerry_char_t *) in_path_p;
parse_options.resource_name_length = (size_t) in_path_length;
parse_options.resource_name = jerry_create_string_sz ((const jerry_char_t *) in_path_p, in_path_length);
jerry_value_t ret_value = jerry_parse (source_p,
source_size,
&parse_options);
jerry_release_value (parse_options.resource_name);
jerry_port_release_source (source_p);
free (in_path_p);