Fix: make jerryx_module_resolve resolvers argument const (#1942)
The resolvers argument that is passed to jerryx_module_resolve() is not mutated by the function. Therefore the argument should be const. In the docs, a static const array is passed, but this currently does not work w/o a cast. This patch fixes this. JerryScript-DCO-1.0-Signed-off-by: Martijn The martijn.the@intel.com
This commit is contained in:
committed by
Zsolt Borbély
parent
2a2a15f364
commit
66b072d5ae
@@ -38,7 +38,7 @@ called.
|
||||
```c
|
||||
jerry_value_t
|
||||
jerryx_module_resolve (const jerry_char_t *name,
|
||||
jerryx_module_resolver_t *resolvers_p,
|
||||
const jerryx_module_resolver_t *resolvers_p,
|
||||
size_t resolver_count);
|
||||
```
|
||||
|
||||
@@ -134,7 +134,7 @@ load_and_evaluate_js_file (const jerry_char_t *name, jerry_value_t *result)
|
||||
|
||||
We can now load JavaScript files:
|
||||
```c
|
||||
static const jerryx_module_resolver_t resolvers =
|
||||
static const jerryx_module_resolver_t resolvers[] =
|
||||
{
|
||||
/* Consult the JerryScript module resolver first, in case the requested module is a compiled-in JerryScript module. */
|
||||
jerryx_module_native_resolver,
|
||||
|
||||
Reference in New Issue
Block a user