You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+35-23Lines changed: 35 additions & 23 deletions
Original file line number
Diff line number
Diff line change
@@ -561,8 +561,9 @@ build variant of quickjs-emscripten, and also the [DEBUG_SYNC] build variant.
561
561
The debug sync build variant has extra instrumentation code for detecting memory
562
562
leaks.
563
563
564
-
The class [TestQuickJSWASMModule] exposes the memory leak detection API, although
565
-
this API is only accurate when using `DEBUG_SYNC` variant.
564
+
The class [TestQuickJSWASMModule] exposes the memory leak detection API,
565
+
although this API is only accurate when using `DEBUG_SYNC` variant. You can also
566
+
enable [debug logging](#debugging) to help diagnose failures.
566
567
567
568
```typescript
568
569
// Define your test suite in a function, so that you can test against
@@ -744,40 +745,51 @@ You can use quickjs-emscripten directly from an HTML file in two ways:
744
745
745
746
### Debugging
746
747
747
-
- Switch to a DEBUG build variant of the WebAssembly module to see debug log messages from the C part of this library:
748
+
Debug logging can be enabled globally, or for specific runtimes. You need to use a DEBUG build variant of the WebAssembly module to see debug log messages from the C part of this library.
To enable debug logging globally, call [setDebugMode][setDebugMode]. This affects global Javascript parts of the library, like the module loader and asyncify internals, and is inherited by runtimes created after the call.
* This setting is inherited by newly created QuickJSRuntime instances.
9
10
* To get debug logging in the WebAssembly module, you need to use a debug build variant.
11
+
* See [the quickjs-emscripten-core README](https://github.com/justjake/quickjs-emscripten/tree/main/doc/quickjs-emscripten-core) for more about build variants.
0 commit comments