Support resource name and user value for implicit class constructors (#4771)

JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
This commit is contained in:
Zoltan Herczeg
2021-09-17 16:28:10 +02:00
committed by GitHub
parent 430289b27d
commit 053bfa0f9f
13 changed files with 471 additions and 327 deletions
+21
View File
@@ -214,6 +214,27 @@ main (void)
jerry_release_value (parse_options.resource_name);
jerry_release_value (program);
const char *source_6 = "(class {})";
parse_options.options = JERRY_PARSE_HAS_RESOURCE;
parse_options.resource_name = jerry_create_string ((jerry_char_t *) "demo6.js");
program = jerry_parse ((const jerry_char_t *) source_6,
strlen (source_6),
&parse_options);
if (!jerry_value_is_error (program))
{
resource_value = jerry_get_resource_name (program);
compare_result = jerry_binary_operation (JERRY_BIN_OP_STRICT_EQUAL, resource_value, parse_options.resource_name);
TEST_ASSERT (jerry_value_is_true (compare_result));
jerry_release_value (resource_value);
jerry_release_value (compare_result);
}
jerry_release_value (parse_options.resource_name);
jerry_release_value (program);
jerry_cleanup ();
return 0;