Skip to content

Commit 279da8d

Browse files
committed
fix missing print interception of warning message
1 parent d7a4211 commit 279da8d

File tree

3 files changed

+7
-6
lines changed

3 files changed

+7
-6
lines changed

JetStreamDriver.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1109,9 +1109,10 @@ class WasmBenchmark extends Benchmark {
11091109
};
11101110
11111111
oldPrint = globalObject.print;
1112+
oldConsoleLog = globalObject.console.log;
11121113
globalObject.print = globalObject.printErr = (...args) => {
11131114
if (verbose)
1114-
console.log('Intercepted print: ', ...args);
1115+
oldConsoleLog('Intercepted print: ', ...args);
11151116
};
11161117
11171118
let Module = {

sqlite3/polyfills.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,7 @@
22
// Use of this source code is governed by a BSD-style license that can be
33
// found in the LICENSE file.
44

5-
// Crude polyfills for missing browser APIs in JavaScript shells.
6-
7-
globalThis.console.debug = globalThis.console.warn = globalThis.console.error = globalThis.console.log;
5+
// Polyfills for missing browser APIs in JavaScript shells.
86

97
// `TextEncoder` and `TextDecoder`. These are called only a few times with short
108
// ASCII strings, so this is sufficient and not performance-critical.

sqlite3/runner.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,10 @@
33
// found in the LICENSE file.
44

55
const inJetStreamRunner = typeof globalThis.benchmarkTime !== "undefined";
6-
if (!inJetStreamRunner) {
6+
if (inJetStreamRunner) {
7+
// Use JetStream interception of `print()`, see `WasmBenchmark.prerunCode()`.
8+
globalThis.console.debug = globalThis.console.warn = globalThis.console.error = globalThis.console.log = print;
9+
} else {
710
load("polyfills.js");
811

912
// Exports `sqlite3InitModule()` and contains the main code.
@@ -35,7 +38,6 @@ function runTests(sqlite3Module) {
3538

3639
async function doRun() {
3740
let start = benchmarkTime();
38-
// FIXME: Why is the OPFS warning not intercepted by the JetStream runner?
3941
const sqliteModule = await sqlite3InitModule(Module);
4042
reportCompileTime(benchmarkTime() - start);
4143

0 commit comments

Comments
 (0)