@@ -716,8 +716,10 @@ JSModuleDef *js_module_loader(JSContext *ctx,
716716 js_free (ctx , buf );
717717 if (JS_IsException (func_val ))
718718 return NULL ;
719- /* XXX: could propagate the exception */
720- js_module_set_import_meta (ctx , func_val , true, false);
719+ if (js_module_set_import_meta (ctx , func_val , true, false) < 0 ) {
720+ JS_FreeValue (ctx , func_val );
721+ return NULL ;
722+ }
721723 /* the module is already referenced, so we must free it */
722724 m = JS_VALUE_GET_PTR (func_val );
723725 JS_FreeValue (ctx , func_val );
@@ -900,7 +902,8 @@ static JSValue js_evalScript(JSContext *ctx, JSValue this_val,
900902 if (JS_ResolveModule (ctx , obj ) < 0 )
901903 return JS_EXCEPTION ;
902904
903- js_module_set_import_meta (ctx , obj , false, false);
905+ if (js_module_set_import_meta (ctx , obj , false, false) < 0 )
906+ return JS_EXCEPTION ;
904907
905908 return JS_EvalFunction (ctx , obj );
906909 }
@@ -4257,15 +4260,17 @@ void js_std_eval_binary(JSContext *ctx, const uint8_t *buf, size_t buf_len,
42574260 goto exception ;
42584261 if (load_only ) {
42594262 if (JS_VALUE_GET_TAG (obj ) == JS_TAG_MODULE ) {
4260- js_module_set_import_meta (ctx , obj , false, false);
4263+ if (js_module_set_import_meta (ctx , obj , false, false) < 0 )
4264+ goto exception ;
42614265 }
42624266 } else {
42634267 if (JS_VALUE_GET_TAG (obj ) == JS_TAG_MODULE ) {
42644268 if (JS_ResolveModule (ctx , obj ) < 0 ) {
42654269 JS_FreeValue (ctx , obj );
42664270 goto exception ;
42674271 }
4268- js_module_set_import_meta (ctx , obj , false, true);
4272+ if (js_module_set_import_meta (ctx , obj , false, true) < 0 )
4273+ goto exception ;
42694274 val = JS_EvalFunction (ctx , obj );
42704275 val = js_std_await (ctx , val );
42714276 } else {
0 commit comments