diff options
author | stephan <stephan@noemail.net> | 2022-12-26 17:15:05 +0000 |
---|---|---|
committer | stephan <stephan@noemail.net> | 2022-12-26 17:15:05 +0000 |
commit | 84261bac96a9d5faeb76aec5bcd97d5fdc707400 (patch) | |
tree | 228f7de5e4c2cc39e67795be4ab86e17d7f53a70 /ext/wasm/common/whwasmutil.js | |
parent | ff78b2bee8a20485e4efd9571e3a60a92760e4a4 (diff) | |
download | sqlite-84261bac96a9d5faeb76aec5bcd97d5fdc707400.tar.gz sqlite-84261bac96a9d5faeb76aec5bcd97d5fdc707400.zip |
Expose the auto-extension API to JS and reorganize some nearby code.
FossilOrigin-Name: 52b229d11d82bfb81c8b63e252c51c57a34dc50498dd685451588c185873c628
Diffstat (limited to 'ext/wasm/common/whwasmutil.js')
-rw-r--r-- | ext/wasm/common/whwasmutil.js | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/ext/wasm/common/whwasmutil.js b/ext/wasm/common/whwasmutil.js index 9b946b24b..e50210206 100644 --- a/ext/wasm/common/whwasmutil.js +++ b/ext/wasm/common/whwasmutil.js @@ -1560,6 +1560,10 @@ self.WhWasmUtilInstaller = function(target){ context. This mode is the default if bindScope is _not_ set but a property named contextKey (described below) is. + - 'permanent': the function is installed and left there + forever. There is no way to recover its pointer address + later on. + - callProxy (function): if set, this must be a function which will act as a proxy for any "converted" JS function. It is passed the being-converted function value and must return @@ -1645,6 +1649,7 @@ self.WhWasmUtilInstaller = function(target){ } this.isTransient = 'transient'===this.bindScope; this.isContext = 'context'===this.bindScope; + this.isPermanent = 'permanent'===this.bindScope; this.singleton = ('singleton'===this.bindScope) ? [] : undefined; //console.warn("FuncPtrAdapter()",opt,this); this.callProxy = (opt.callProxy instanceof Function) @@ -1668,7 +1673,7 @@ self.WhWasmUtilInstaller = function(target){ static debugOut = console.debug.bind(console); static bindScopes = [ - 'transient', 'context', 'singleton' + 'transient', 'context', 'singleton', 'permanent' ]; /* Dummy impl. Overwritten per-instance as needed. */ |