Rework ES2015 module system and add missing features. (#2792)

Co-authored-by: Dániel Bátyai <dbatyai@inf.u-szeged.hu>
JerryScript-DCO-1.0-Signed-off-by: Dániel Bátyai dbatyai@inf.u-szeged.hu
JerryScript-DCO-1.0-Signed-off-by: Daniel Vince vinced@inf.u-szeged.hu
This commit is contained in:
Daniel Vince
2019-04-25 14:57:17 +02:00
committed by Robert Fancsik
parent 938e9c7530
commit 37b7645e6a
59 changed files with 2209 additions and 991 deletions
+20 -4
View File
@@ -199,11 +199,11 @@ void jerry_port_print_char (char c);
* is enabled. The path is specified in the import statement's 'from "..."'
* section.
*
* @param file_name_p Path that points to the EcmaScript file in the
* filesystem.
* @param out_size_p The opened file's size in bytes.
* @param file_name_p Path that points to the EcmaScript file in the
* filesystem.
* @param out_size_p The opened file's size in bytes.
*
* @return the pointer to the buffer which contains the content of the file.
* @return the pointer to the buffer which contains the content of the file.
*/
uint8_t *jerry_port_read_source (const char *file_name_p, size_t *out_size_p);
@@ -215,6 +215,22 @@ uint8_t *jerry_port_read_source (const char *file_name_p, size_t *out_size_p);
*/
void jerry_port_release_source (uint8_t *buffer_p);
/**
* Normalize a file path string.
*
* Note:
* This port function is called by jerry-core when ES2015_MODULE_SYSTEM
* is enabled. The normalized path is used to uniquely identify modules.
*
* @param in_path_p Input path as a zero terminated string.
* @param out_buf_p Pointer to the output buffer where the normalized path should be written.
* @param out_buf_size Size of the output buffer.
*
* @return length of the string written to the output buffer
* zero, if the buffer was not sufficient or an error occured
*/
size_t jerry_port_normalize_path (const char *in_path_p, char *out_buf_p, size_t out_buf_size);
/**
* @}
*/