Fix Symbol.description API reference count management (#4267)
JerryScript-DCO-1.0-Signed-off-by: Robert Fancsik frobert@inf.u-szeged.hu
This commit is contained in:
@@ -3815,7 +3815,7 @@ jerry_get_symbol_description (const jerry_value_t symbol) /**< symbol value */
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Note: This operation cannot throw an error */
|
/* Note: This operation cannot throw an error */
|
||||||
return ecma_get_symbol_description (ecma_get_symbol_from_value (symbol));
|
return ecma_copy_value (ecma_get_symbol_description (ecma_get_symbol_from_value (symbol)));
|
||||||
#else /* !ENABLED (JERRY_ESNEXT) */
|
#else /* !ENABLED (JERRY_ESNEXT) */
|
||||||
JERRY_UNUSED (symbol);
|
JERRY_UNUSED (symbol);
|
||||||
|
|
||||||
|
|||||||
@@ -191,6 +191,7 @@ main (void)
|
|||||||
jerry_string_to_char_buffer (bar_symbol_string, str_buff, bar_symbol_string_size);
|
jerry_string_to_char_buffer (bar_symbol_string, str_buff, bar_symbol_string_size);
|
||||||
TEST_ASSERT (memcmp (str_buff, STRING_BAR, sizeof (SYMBOL_DESCIPTION_BAR) - 1) == 0);
|
TEST_ASSERT (memcmp (str_buff, STRING_BAR, sizeof (SYMBOL_DESCIPTION_BAR) - 1) == 0);
|
||||||
|
|
||||||
|
jerry_release_value (bar_symbol_string);
|
||||||
jerry_release_value (bar_symbol);
|
jerry_release_value (bar_symbol);
|
||||||
|
|
||||||
/* Test symbol get description operation with undefined description */
|
/* Test symbol get description operation with undefined description */
|
||||||
|
|||||||
Reference in New Issue
Block a user