aboutsummaryrefslogtreecommitdiff
path: root/web/callback.js
diff options
context:
space:
mode:
authorSebastiano Tronto <sebastiano@tronto.net>2025-05-28 14:32:38 +0200
committerSebastiano Tronto <sebastiano@tronto.net>2025-05-28 14:32:38 +0200
commitb1770039f4d483cdab2d4d136cd7ffbf12f165b7 (patch)
treed1265834aacd157931af287a9b8add04132d43eb /web/callback.js
parentfcf5a819ef52ab3069f687e6943599fa3ccf96b3 (diff)
downloadnissy-core-b1770039f4d483cdab2d4d136cd7ffbf12f165b7.tar.gz
nissy-core-b1770039f4d483cdab2d4d136cd7ffbf12f165b7.zip
Enable WASM64
Diffstat (limited to '')
-rw-r--r--web/callback.js9
1 files changed, 8 insertions, 1 deletions
diff --git a/web/callback.js b/web/callback.js
index 178b8e9..e277cf5 100644
--- a/web/callback.js
+++ b/web/callback.js
@@ -31,8 +31,15 @@ addCallbackFunction: function(f) {
31 31
32callFunction__deps: [ 'cbfl', 'validateCallbackId' ], 32callFunction__deps: [ 'cbfl', 'validateCallbackId' ],
33callFunction: function(id, arg) { 33callFunction: function(id, arg) {
34 // This is a workaround related to usign WASM64
35 // JavaScript's UTF8ToString expects a pointer argument, which for JS is
36 // of type "number", but WASM64 is passing a BigInt. See also:
37 // https://github.com/emscripten-core/emscripten/issues/21541
38 // (but I could not make the suggested solution work in this case).
39 // TODO: check if there is a better workaround.
40 const non64_arg = Number(arg);
34 if (_validateCallbackId(id)) 41 if (_validateCallbackId(id))
35 _cbfl[id](UTF8ToString(arg)); 42 _cbfl[id](UTF8ToString(non64_arg));
36}, 43},
37 44
38callFunctionInt__deps: [ 'cbfl', 'validateCallbackId' ], 45callFunctionInt__deps: [ 'cbfl', 'validateCallbackId' ],

Generated with cgit - Back to sebastiano.tronto.net