diff options
| author | Sebastiano Tronto <sebastiano@tronto.net> | 2025-06-06 15:25:54 +0200 |
|---|---|---|
| committer | Sebastiano Tronto <sebastiano@tronto.net> | 2025-06-06 15:25:54 +0200 |
| commit | 18132bf9c9755a7de41a8c89dc6b02409a629cd5 (patch) | |
| tree | e8cb194f06523edc574430e8c24ca5b46306ce48 | |
| parent | 54825bc0aeb8192c4526a43a5e0fd78cda9561af (diff) | |
| download | emscripten-tutorial-18132bf9c9755a7de41a8c89dc6b02409a629cd5.tar.gz emscripten-tutorial-18132bf9c9755a7de41a8c89dc6b02409a629cd5.zip | |
small adjustment
Diffstat (limited to '')
| -rw-r--r-- | 05_callback/worker.mjs | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/05_callback/worker.mjs b/05_callback/worker.mjs index 736e9f8..b78d366 100644 --- a/05_callback/worker.mjs +++ b/05_callback/worker.mjs | |||
| @@ -2,7 +2,10 @@ import Primes from "./build/primes.mjs"; | |||
| 2 | 2 | ||
| 3 | var primes = await Primes(); | 3 | var primes = await Primes(); |
| 4 | const logPtr = primes.addFunction((cstr) => { | 4 | const logPtr = primes.addFunction((cstr) => { |
| 5 | postMessage({ message: primes.UTF8ToString(cstr) }); | 5 | const str = primes.UTF8ToString(cstr); |
| 6 | |||
| 7 | console.log(str); | ||
| 8 | postMessage({ message: str }); | ||
| 6 | }, "vp"); | 9 | }, "vp"); |
| 7 | 10 | ||
| 8 | onmessage = (e) => { | 11 | onmessage = (e) => { |
