aboutsummaryrefslogtreecommitdiff
path: root/ext/wasm/common/whwasmutil.js
diff options
context:
space:
mode:
Diffstat (limited to 'ext/wasm/common/whwasmutil.js')
-rw-r--r--ext/wasm/common/whwasmutil.js20
1 files changed, 15 insertions, 5 deletions
diff --git a/ext/wasm/common/whwasmutil.js b/ext/wasm/common/whwasmutil.js
index 880ef4ab4..5d6569d8e 100644
--- a/ext/wasm/common/whwasmutil.js
+++ b/ext/wasm/common/whwasmutil.js
@@ -447,7 +447,7 @@ self.WhWasmUtilInstaller = function(target){
type(s) of the given function signature, or throws if the
signature is invalid. */
/******** // only valid for use with the WebAssembly.Function ctor, which
- // is not yet documented on MDN.
+ // is not yet documented on MDN.
sigToWasm: function(sig){
const rc = {parameters:[], results: []};
if('v'!==sig[0]) rc.results.push(f.sigTypes(sig[0]));
@@ -1575,10 +1575,20 @@ self.WhWasmUtilInstaller = function(target){
not actually bind any functions. Its convertArg() method is
called via xWrap() to perform any bindings.
- Shortcomings: function pointers which include C-string arguments
- may still need a level of hand-written wrappers around them,
- depending on how they're used, in order to provide the client
- with JS strings.
+ Shortcomings:
+
+ - These "reverse" bindings, i.e. calling into a JS-defined
+ function from a WASM-defined function (the generated proxy
+ wrapper), lack all type conversion support. That means, for
+ example, that...
+
+ - Function pointers which include C-string arguments may still
+ need a level of hand-written wrappers around them, depending on
+ how they're used, in order to provide the client with JS
+ strings. Alternately, clients will need to perform such conversions
+ on their own, e.g. using cstrtojs(). Or maybe we can find a way
+ to perform such conversions here, via addition of an xWrap()-style
+ function signature to the options argument.
*/
xArg.FuncPtrAdapter = class FuncPtrAdapter extends AbstractArgAdapter {
constructor(opt) {