modules: add ability to clear cache (#2300)

This adds the ability to remove a single module from the cache, or to
clear the entire module cache.

JerryScript-DCO-1.0-Signed-off-by: Gabriel Schulhof gabriel.schulhof@intel.com
This commit is contained in:
Gabriel "_|Nix|_" Schulhof
2018-05-03 21:12:17 -04:00
committed by yichoi
parent 369447aa09
commit 6dc2764a94
4 changed files with 186 additions and 62 deletions
@@ -134,6 +134,13 @@ jerry_value_t jerryx_module_resolve (const jerry_value_t name,
const jerryx_module_resolver_t **resolvers,
size_t count);
/**
* Delete a module from the cache or, if name has the JavaScript value of undefined, clear the entire cache.
*/
void jerryx_module_clear_cache (const jerry_value_t name,
const jerryx_module_resolver_t **resolvers,
size_t count);
#ifdef __cplusplus
}
#endif /* __cplusplus */