Native modules should be unlinked state after creation (#4655)

JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
This commit is contained in:
Zoltan Herczeg
2021-04-16 15:55:12 +02:00
committed by GitHub
parent 7b6743403f
commit a7a4cb29e4
3 changed files with 9 additions and 4 deletions
+6 -2
View File
@@ -379,7 +379,7 @@ main (void)
module = jerry_native_module_create (NULL, NULL, 0);
TEST_ASSERT (!jerry_value_is_error (module));
TEST_ASSERT (jerry_module_get_state (module) == JERRY_MODULE_STATE_LINKED);
TEST_ASSERT (jerry_module_get_state (module) == JERRY_MODULE_STATE_UNLINKED);
result = jerry_native_module_get_export (object, number);
TEST_ASSERT (jerry_value_is_error (result));
@@ -396,7 +396,11 @@ main (void)
module = jerry_native_module_create (NULL, &export, 1);
TEST_ASSERT (!jerry_value_is_error (module));
TEST_ASSERT (jerry_module_get_state (module) == JERRY_MODULE_STATE_LINKED);
TEST_ASSERT (jerry_module_get_state (module) == JERRY_MODULE_STATE_UNLINKED);
result = jerry_module_link (module, NULL, NULL);
TEST_ASSERT (jerry_value_is_boolean (result) && jerry_get_boolean_value (result));
jerry_release_value (result);
result = jerry_module_evaluate (module);
TEST_ASSERT (jerry_value_is_undefined (result));