File tree Expand file tree Collapse file tree 3 files changed +7
-6
lines changed Expand file tree Collapse file tree 3 files changed +7
-6
lines changed Original file line number Diff line number Diff line change @@ -1109,9 +1109,10 @@ class WasmBenchmark extends Benchmark {
1109
1109
};
1110
1110
1111
1111
oldPrint = globalObject.print;
1112
+ oldConsoleLog = globalObject.console.log;
1112
1113
globalObject.print = globalObject.printErr = (...args) => {
1113
1114
if (verbose)
1114
- console.log ('Intercepted print: ', ...args);
1115
+ oldConsoleLog ('Intercepted print: ', ...args);
1115
1116
};
1116
1117
1117
1118
let Module = {
Original file line number Diff line number Diff line change 2
2
// Use of this source code is governed by a BSD-style license that can be
3
3
// found in the LICENSE file.
4
4
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.
8
6
9
7
// `TextEncoder` and `TextDecoder`. These are called only a few times with short
10
8
// ASCII strings, so this is sufficient and not performance-critical.
Original file line number Diff line number Diff line change 3
3
// found in the LICENSE file.
4
4
5
5
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 {
7
10
load ( "polyfills.js" ) ;
8
11
9
12
// Exports `sqlite3InitModule()` and contains the main code.
@@ -35,7 +38,6 @@ function runTests(sqlite3Module) {
35
38
36
39
async function doRun ( ) {
37
40
let start = benchmarkTime ( ) ;
38
- // FIXME: Why is the OPFS warning not intercepted by the JetStream runner?
39
41
const sqliteModule = await sqlite3InitModule ( Module ) ;
40
42
reportCompileTime ( benchmarkTime ( ) - start ) ;
41
43
You can’t perform that action at this time.
0 commit comments