Lines Matching defs:module
18 #include "jerryscript-ext/module.h"
32 * string containing the name of the module that was requested when the error occurred.
39 const jerry_value_t module_name) /**< the module name */
54 * Initialize the module manager extension.
63 * Deinitialize the module manager extension.
114 * Attempt to retrieve a module by name from a cache, and return false if not found.
117 jerryx_module_check_cache (jerry_value_t cache, /**< cache from which to attempt to retrieve the module by name */
118 jerry_value_t module_name, /**< JerryScript string value holding the module name */
123 /* Check if the cache has the module. */
131 /* If the module is indeed in the cache, we return it. */
148 * Attempt to cache a loaded module.
150 * @return the module on success, otherwise the error encountered when attempting to cache. In the latter case, the
151 * @p module is released.
154 jerryx_module_add_to_cache (jerry_value_t cache, /**< cache to which to add the module */
155 jerry_value_t module_name, /**< key at which to cache the module */
156 jerry_value_t module) /**< the module to cache */
158 jerry_value_t ret = jerry_set_property (cache, module_name, module);
162 jerry_release_value (module);
167 ret = module;
176 * Declare and define the default module resolver - one which examines what modules are defined in the above linker
181 jerryx_resolve_native_module (const jerry_value_t canonical_name, /**< canonical name of the module */
182 jerry_value_t *result) /**< [out] where to put the resulting module instance */
202 /* Look for the module by its name in the list of module definitions. */
209 /* If we find the module by its name we load it and cache it if it has an on_resolve () and complain otherwise. */
234 jerryx_module_resolve_local (const jerry_value_t name, /**< name of the module to load */
237 jerry_value_t *result) /**< location to store the result, or NULL to remove the module */
269 * Establish the canonical name for the requested module. Each resolver presents its own canonical name. If one of
270 * the canonical names matches a cached module, it is returned as the result.
280 /* A NULL for result indicates that we are to delete the module from the cache if found. Let's do that here.*/
295 * Past this point we assume a module is wanted, and therefore result is not NULL. So, we try each resolver until one
296 * manages to resolve the module.
311 /* If none of the resolvers manage to find the module, complain with "Module not found" */
326 * Resolve a single module using the module resolvers available in the section declared above and load it into the
329 * @p name - name of the module to resolve
334 * - the result of having loaded the module named @p name, or
336 * - an error indicating that something went wrong during the attempt to load the module.
339 jerryx_module_resolve (const jerry_value_t name, /**< name of the module to load */
350 jerryx_module_clear_cache (const jerry_value_t name, /**< name of the module to remove, or undefined */
364 /* Delete the requested module from the cache if it's there. */