diff options
author | Fabrice Bellard <fabrice@bellard.org> | 2024-01-27 13:27:32 +0100 |
---|---|---|
committer | Fabrice Bellard <fabrice@bellard.org> | 2024-01-27 13:27:32 +0100 |
commit | c6cc6a9a5e420fa2707e828da23d131d2bf170f7 (patch) | |
tree | 91d422049a20e4fced05aac8e3e27dee99d0a18f /quickjs.c | |
parent | cd666a851f14acfa08dcbf042d3993ffab968374 (diff) | |
download | quickjs-c6cc6a9a5e420fa2707e828da23d131d2bf170f7.tar.gz quickjs-c6cc6a9a5e420fa2707e828da23d131d2bf170f7.zip |
export JS_GetModuleNamespace (github issue #34)
Diffstat (limited to 'quickjs.c')
-rw-r--r-- | quickjs.c | 12 |
1 files changed, 5 insertions, 7 deletions
@@ -27792,13 +27792,11 @@ static int exported_names_cmp(const void *p1, const void *p2, void *opaque) return ret; } -static JSValue js_get_module_ns(JSContext *ctx, JSModuleDef *m); - static JSValue js_module_ns_autoinit(JSContext *ctx, JSObject *p, JSAtom atom, void *opaque) { JSModuleDef *m = opaque; - return js_get_module_ns(ctx, m); + return JS_GetModuleNamespace(ctx, m); } static JSValue js_build_module_ns(JSContext *ctx, JSModuleDef *m) @@ -27904,7 +27902,7 @@ static JSValue js_build_module_ns(JSContext *ctx, JSModuleDef *m) return JS_EXCEPTION; } -static JSValue js_get_module_ns(JSContext *ctx, JSModuleDef *m) +JSValue JS_GetModuleNamespace(JSContext *ctx, JSModuleDef *m) { if (JS_IsUndefined(m->module_ns)) { JSValue val; @@ -28165,7 +28163,7 @@ static int js_inner_module_linking(JSContext *ctx, JSModuleDef *m, if (mi->import_name == JS_ATOM__star_) { JSValue val; /* name space import */ - val = js_get_module_ns(ctx, m1); + val = JS_GetModuleNamespace(ctx, m1); if (JS_IsException(val)) goto fail; set_value(ctx, &var_refs[mi->var_idx]->value, val); @@ -28189,7 +28187,7 @@ static int js_inner_module_linking(JSContext *ctx, JSModuleDef *m, JSModuleDef *m2; /* name space import from */ m2 = res_m->req_module_entries[res_me->u.req_module_idx].module; - val = js_get_module_ns(ctx, m2); + val = JS_GetModuleNamespace(ctx, m2); if (JS_IsException(val)) goto fail; var_ref = js_create_module_var(ctx, TRUE); @@ -28397,7 +28395,7 @@ static JSValue js_load_module_fulfilled(JSContext *ctx, JSValueConst this_val, JSValue ret, ns; /* return the module namespace */ - ns = js_get_module_ns(ctx, m); + ns = JS_GetModuleNamespace(ctx, m); if (JS_IsException(ns)) { JSValue err = JS_GetException(ctx); js_load_module_rejected(ctx, JS_UNDEFINED, 1, (JSValueConst *)&err, 0, func_data); |