Rework module linking (#4632)

The module linking process from jerry_parse is moved out into
a new jerry_module_link function, and jerry_parse is limited to
create unlinked modules.

JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
This commit is contained in:
Zoltan Herczeg
2021-03-30 15:40:09 +02:00
committed by GitHub
parent 874a6a49d5
commit 6c484f3529
22 changed files with 1574 additions and 789 deletions
-36
View File
@@ -126,42 +126,6 @@ jerry_port_release_source (uint8_t *buffer_p) /**< buffer to free */
free (buffer_p);
} /* jerry_port_release_source */
/**
* Normalize a file path
*
* @return length of the path written to the output buffer
*/
size_t
jerry_port_normalize_path (const char *in_path_p, /**< input file path */
char *out_buf_p, /**< output buffer */
size_t out_buf_size, /**< size of output buffer */
char *base_file_p) /**< base file path */
{
(void) base_file_p;
size_t len = strlen (in_path_p);
if (len + 1 > out_buf_size)
{
return 0;
}
/* Return the original string. */
strcpy (out_buf_p, in_path_p);
return len;
} /* jerry_port_normalize_path */
/**
* Get the module object of a native module.
*
* @return undefined
*/
jerry_value_t
jerry_port_get_native_module (jerry_value_t name) /**< module specifier */
{
(void) name;
return jerry_create_undefined ();
} /* jerry_port_get_native_module */
/**
* Dummy function to get the time zone adjustment.
*