aboutsummaryrefslogtreecommitdiff
path: root/ext/wasm/api/sqlite3-api-oo1.js
diff options
context:
space:
mode:
authorstephan <stephan@noemail.net>2022-12-24 13:46:27 +0000
committerstephan <stephan@noemail.net>2022-12-24 13:46:27 +0000
commit0db1c901378e29fd576e93d16a1305c6269d411d (patch)
treebf40c460f31c7832371f005a14b5168022279f1d /ext/wasm/api/sqlite3-api-oo1.js
parent4b4ae86445c621a3eb6b67b96c67a3eb29d9751a (diff)
downloadsqlite-0db1c901378e29fd576e93d16a1305c6269d411d.tar.gz
sqlite-0db1c901378e29fd576e93d16a1305c6269d411d.zip
Add a test for the (failure) case of client-level code calling the oo1.Stmt constructor directly.
FossilOrigin-Name: 6a37874db04f3b4842994ad17fc74cb6222f8ea0fa1315a23aff1ffa69bcd12a
Diffstat (limited to 'ext/wasm/api/sqlite3-api-oo1.js')
-rw-r--r--ext/wasm/api/sqlite3-api-oo1.js19
1 files changed, 11 insertions, 8 deletions
diff --git a/ext/wasm/api/sqlite3-api-oo1.js b/ext/wasm/api/sqlite3-api-oo1.js
index 5404fc52d..87509b59a 100644
--- a/ext/wasm/api/sqlite3-api-oo1.js
+++ b/ext/wasm/api/sqlite3-api-oo1.js
@@ -337,7 +337,7 @@ self.sqlite3ApiBootstrap.initializers.push(function(sqlite3){
*/
const Stmt = function(){
if(BindTypes!==arguments[2]){
- toss3("Do not call the Stmt constructor directly. Use DB.prepare().");
+ toss3(capi.SQLITE_MISUSE, "Do not call the Stmt constructor directly. Use DB.prepare().");
}
this.db = arguments[0];
__ptrMap.set(this, arguments[1]);
@@ -887,10 +887,11 @@ self.sqlite3ApiBootstrap.initializers.push(function(sqlite3){
}
return arg.returnVal();
}/*exec()*/,
+
/**
- Creates a new scalar UDF (User-Defined Function) which is
- accessible via SQL code. This function may be called in any
- of the following forms:
+ Creates a new UDF (User-Defined Function) which is accessible
+ via SQL code. This function may be called in any of the
+ following forms:
- (name, function)
- (name, function, optionsObject)
@@ -906,10 +907,12 @@ self.sqlite3ApiBootstrap.initializers.push(function(sqlite3){
functions. Creating an aggregate or window function requires
the options-object form (see below for details).
- UDFs cannot currently be removed from a DB handle after they're
- added. More correctly, they can be removed as documented for
- sqlite3_create_function_v2(), but doing so will "leak" the
- JS-created WASM binding of those functions.
+ UDFs can be removed as documented for
+ sqlite3_create_function_v2() and
+ sqlite3_create_window_function(), but doing so will "leak" the
+ JS-created WASM binding of those functions (meaning that their
+ entries in the WASM indirect function table still
+ exist). Eliminating that potential leak is a pending TODO.
On success, returns this object. Throws on error.