index.html 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. <!doctype html>
  2. <html lang="en">
  3. <head>
  4. <meta http-equiv="Content-type" content="text/html; charset=utf-8">
  5. <title>Project1</title>
  6. <meta name="viewport" content="width=device-width, initial-scale=1">
  7. <link href="bulma.min.css" rel="stylesheet">
  8. <script src="exceptdemo2.js"></script>
  9. <style>
  10. .source {
  11. /* width: 730px; */
  12. margin: -45px auto;
  13. font-size: 0.9em;
  14. }
  15. .source-inner {
  16. display: flex;
  17. justify-content: space-between;
  18. align-items: center;
  19. /* width: 482px; */
  20. }
  21. </style>
  22. </head>
  23. <body>
  24. <div class="section pb-4">
  25. <h1 class="title is-4">Exceptions: Getting webassembly Pascal exception info</h1>
  26. <p>
  27. <p>The <em>wasm.exceptions</em> unit in FPC exposes 2 functions which allow you to retrieve exception information from the free pascal RTL.
  28. The default behaviour of the WASI hosting environment is to wrap all calls to a WebAssembly function and use these functions transform the
  29. exception to a <em>EWasmNativeException</em> exception.
  30. </p>
  31. <p>
  32. The output below shows the result of catching this exception.
  33. </p>
  34. <div class="box" id="pasjsconsole"></div>
  35. </div>
  36. <div class="section">
  37. <div class="source">
  38. <div class="source-inner">
  39. <div>
  40. <p>Created using &nbsp; <a target="_blank" href="https://wiki.freepascal.org/pas2js">pas2js.</a> </p>
  41. <p>Pas2JS Sources: &nbsp; <a target="new" href="exceptdemo.lpr">Pas2JS Program</a></p>
  42. <p>Webassembly Sources: &nbsp; <a target="new" href="demolib.lpr">FPC Program</a></p>
  43. </div>
  44. </div>
  45. </div>
  46. </div>
  47. <script>
  48. rtl.showUncaughtExceptions=true;
  49. window.addEventListener("load", rtl.run);
  50. </script>
  51. </body>
  52. </html>