diff --git a/src/lib/libdylink.js b/src/lib/libdylink.js index 50020af24a7fc..f1a4b6f57fa9e 100644 --- a/src/lib/libdylink.js +++ b/src/lib/libdylink.js @@ -880,7 +880,7 @@ var LibraryDylink = { cSig = cSig.split(','); for (var arg of cSig) { var jsArg = arg.split(' ').pop(); - jsArgs.push(jsArg.replace('*', '')); + jsArgs.push(jsArg.replaceAll('*', '')); } } var func = `(${jsArgs}) => ${body};`; diff --git a/test/other/test_em_js_main.out b/test/other/test_em_js_main.out index eb0ab8066d2b9..66124f6fd3377 100644 --- a/test/other/test_em_js_main.out +++ b/test/other/test_em_js_main.out @@ -2,3 +2,4 @@ in main hello from side module 42 + hello hello again hello from void func +indirect ptr value: 0 diff --git a/test/other/test_em_js_side.c b/test/other/test_em_js_side.c index 11844c452a06a..5c9ed73e027e1 100644 --- a/test/other/test_em_js_side.c +++ b/test/other/test_em_js_side.c @@ -14,9 +14,14 @@ EM_JS(void, js_side_func_void, (), { out(`hello from void func`); }); +EM_JS(void, js_side_func_indirect_ptr, (char **pptr), { + out(`indirect ptr value: ${pptr}`); +}); + int test_side() { js_side_func(42, "hello"); js_side_func2("hello again"); js_side_func_void(); + js_side_func_indirect_ptr(NULL); return 0; }