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
+17 -1
View File
@@ -85,7 +85,8 @@ void jerry_port_print_char (char c);
### ES2015 Module system helper functions
The import statement requires two specific functions for opening and closing files (the modules) port specific.
The module system requires two specific functions for opening and closing files.
It also requires a platform specific way of normalizing file paths.
```c
/**
@@ -108,6 +109,21 @@ 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 */
{
// normalize in_path_p by expanding relative paths etc.
// write to out_buf_p the normalized path
// return length of written path
} /* jerry_port_normalize_path */
```
## Date