Part I: Implement ES2015 module system. (#2599)

JerryScript-DCO-1.0-Signed-off-by: Daniel Vince vinced@inf.u-szeged.hu
This commit is contained in:
Daniel Vince
2019-03-18 16:22:06 +01:00
committed by László Langó
parent 3d3e6fdf58
commit 4123f35a3b
45 changed files with 2095 additions and 8 deletions
+24
View File
@@ -191,6 +191,30 @@ void jerry_port_sleep (uint32_t sleep_time);
*/
void jerry_port_print_char (char c);
/**
* Open a source file and read its contents into a buffer.
*
* Note:
* This port function is called by jerry-core when ES2015_MODULE_SYSTEM
* 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.
*
* @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);
/**
* Frees the allocated buffer after the contents of the file are not needed
* anymore.
*
* @param buffer_p The pointer the allocated buffer.
*/
void jerry_port_release_source (uint8_t *buffer_p);
/**
* @}
*/