MCPcopy Create free account
hub / github.com/GoogleChrome/samples / constructor

Method constructor

sqlite-wasm-cos/sqlite3-node.mjs:5046–5072  ·  view source on GitHub ↗

Constructs this object with a message depending on its arguments: If its first argument is an integer, it is assumed to be an SQLITE_... result code and it is passed to sqlite3.capi.sqlite3_js_rc_str() to stringify it. If called with exactly 2 arguments and the 2nd is a

(...args)

Source from the content-addressed store, hash-verified

5044 else it will be set to capi.SQLITE_ERROR.
5045 */
5046 constructor(...args){
5047 let rc;
5048 if(args.length){
5049 if(isInt32(args[0])){
5050 rc = args[0];
5051 if(1===args.length){
5052 super(__rcStr(args[0]));
5053 }else{
5054 const rcStr = __rcStr(rc);
5055 if('object'===typeof args[1]){
5056 super(rcStr,args[1]);
5057 }else{
5058 args[0] = rcStr+':';
5059 super(args.join(' '));
5060 }
5061 }
5062 }else{
5063 if(2===args.length && 'object'===typeof args[1]){
5064 super(...args);
5065 }else{
5066 super(args.join(' '));
5067 }
5068 }
5069 }
5070 this.resultCode = rc || capi.SQLITE_ERROR;
5071 this.name = 'SQLite3Error';
5072 }
5073 };
5074
5075 /**

Callers

nothing calls this directly

Calls 2

isInt32Function · 0.70
__rcStrFunction · 0.70

Tested by

no test coverage detected