1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-07-27 20:41:58 +03:00

Add capability to override the JS's use of console.log/debug/warn/error() with client-provided versions via the bootstrap-time config object.

FossilOrigin-Name: c54f29d8e55419eaa9168e799dab5030e89063b13d8390a50616606422d164dc
This commit is contained in:
stephan
2023-02-06 14:01:19 +00:00
parent ee18659f69
commit 3ff812aa94
9 changed files with 59 additions and 41 deletions

View File

@ -82,6 +82,12 @@
the `realloc(3)`-compatible routine for the WASM
environment. Defaults to `"sqlite3_realloc"`.
- `debug`, `log`, `warn`, and `error` may be functions equivalent
to the like-named methods of the global `console` object. By
default, these map directly to their `console` counterparts, but
can be replaced with (e.g.) empty functions to squelch all such
output.
- `wasmfsOpfsDir`[^1]: As of 2022-12-17, this feature does not
currently work due to incompatible Emscripten-side changes made
in the WASMFS+OPFS combination. This option is currently ignored.
@ -113,6 +119,10 @@ self.sqlite3ApiBootstrap = function sqlite3ApiBootstrap(
}
return !!self.BigInt64Array;
})(),
debug: console.debug.bind(console),
warn: console.warn.bind(console),
error: console.error.bind(console),
log: console.log.bind(console),
wasmfsOpfsDir: '/opfs',
/**
useStdAlloc is just for testing an allocator discrepancy. The