diff --git a/src/lib/libdylink.js b/src/lib/libdylink.js index 87f8ea2ee1371..9f45e32cb9900 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/codesize/test_codesize_hello_dylink.json b/test/codesize/test_codesize_hello_dylink.json index 565c180431299..0e78d62ce3e77 100644 --- a/test/codesize/test_codesize_hello_dylink.json +++ b/test/codesize/test_codesize_hello_dylink.json @@ -1,10 +1,10 @@ { - "a.out.js": 26546, - "a.out.js.gz": 11349, + "a.out.js": 26549, + "a.out.js.gz": 11353, "a.out.nodebug.wasm": 17761, "a.out.nodebug.wasm.gz": 9003, - "total": 44307, - "total_gz": 20352, + "total": 44310, + "total_gz": 20356, "sent": [ "__syscall_stat64", "emscripten_resize_heap", diff --git a/test/codesize/test_codesize_hello_dylink_all.json b/test/codesize/test_codesize_hello_dylink_all.json index d8afa1e025859..93a7838e9f34d 100644 --- a/test/codesize/test_codesize_hello_dylink_all.json +++ b/test/codesize/test_codesize_hello_dylink_all.json @@ -1,7 +1,7 @@ { - "a.out.js": 245299, + "a.out.js": 245302, "a.out.nodebug.wasm": 574162, - "total": 819461, + "total": 819464, "sent": [ "IMG_Init", "IMG_Load", diff --git a/test/other/test_em_js_main.out b/test/other/test_em_js_main.out index eb0ab8066d2b9..cbf7cbf9556da 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 +hello diff --git a/test/other/test_em_js_side.c b/test/other/test_em_js_side.c index 11844c452a06a..246f9b00efbdc 100644 --- a/test/other/test_em_js_side.c +++ b/test/other/test_em_js_side.c @@ -14,9 +14,15 @@ EM_JS(void, js_side_func_void, (), { out(`hello from void func`); }); +EM_JS(void, js_side_func_indirect_ptr, (const char **pptr), { + out(UTF8ToString(getValue(pptr, '*'))); +}); + int test_side() { + const char *hello = "hello"; js_side_func(42, "hello"); js_side_func2("hello again"); js_side_func_void(); + js_side_func_indirect_ptr(&hello); return 0; }