index.html 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  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="exceptdemo.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>The <em>wasm.exceptions</em> unit in FPC exposes 2 functions which allow you to retrieve exception information from the free pascal RTL.
  27. You can use this to check if a <em>Webassembly.Exception</em> exception is the result of a Free Pascal exception and retrieve the classname and message from the exception.
  28. </p>
  29. <p>
  30. The output below shows the result of this.
  31. </p>
  32. <div class="box" id="pasjsconsole"></div>
  33. </div>
  34. <div class="section">
  35. <div class="source">
  36. <div class="source-inner">
  37. <div>
  38. <p>Created using &nbsp; <a target="_blank" href="https://wiki.freepascal.org/pas2js">pas2js.</a> </p>
  39. <p>Pas2JS Sources: &nbsp; <a target="new" href="exceptdemo.lpr">Pas2JS Program</a></p>
  40. <p>Webassembly Sources: &nbsp; <a target="new" href="demolib.lpr">FPC Program</a></p>
  41. </div>
  42. </div>
  43. </div>
  44. </div>
  45. <script>
  46. rtl.showUncaughtExceptions=true;
  47. window.addEventListener("load", rtl.run);
  48. </script>
  49. </body>
  50. </html>