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
+7 -3
View File
@@ -1863,10 +1863,10 @@ parser_parse_source (const uint8_t *arg_list_p, /**< function argument list */
if (context.options_p != NULL
&& (context.options_p->options & JERRY_PARSE_HAS_RESOURCE)
&& context.options_p->resource_name_length > 0)
&& ecma_is_value_string (context.options_p->resource_name))
{
resource_name = ecma_find_or_create_literal_string (context.options_p->resource_name_p,
(lit_utf8_size_t) context.options_p->resource_name_length);
ecma_ref_ecma_string (ecma_get_string_from_value (context.options_p->resource_name));
resource_name = context.options_p->resource_name;
}
else if (context.global_status_flags & ECMA_PARSE_EVAL)
{
@@ -2100,6 +2100,10 @@ parser_parse_source (const uint8_t *arg_list_p, /**< function argument list */
parser_free_literals (&context.literal_pool);
parser_cbc_stream_free (&context.byte_code);
#if JERRY_RESOURCE_NAME
ecma_deref_ecma_string (ecma_get_string_from_value (context.script_p->resource_name));
#endif /* JERRY_RESOURCE_NAME */
JERRY_ASSERT (context.script_p->refs_and_type >= CBC_SCRIPT_REF_ONE);
jmem_heap_free_block (context.script_p, script_size);
}