Chapter 12. Debugging

 

This chapter covers

  • Various debugging methods for WebAssembly modules
  • Error handling during compilation and at runtime
  • Debugging with browser developer tools

At some point during development, you’ll likely discover that your code isn’t working as expected, and you need to find a way to track down the issue. Sometimes tracking it down is as simple as reading over the code. Other times, you need to dig deeper.

At the time of writing, WebAssembly’s debugging options are a bit limited, but this will change as browser and IDE (integrated development environment) tooling improve. At the moment, you have the following options for debugging a WebAssembly module:

12.1. Extending the game

12.2. Adjusting the HTML

12.3. Displaying the number of tries

12.4. Incrementing the number of tries

12.5. Updating the summary screen

Exercises

Summary

sitemap