1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556 |
- <!doctype html>
- <html lang="en">
- <head>
- <meta http-equiv="Content-type" content="text/html; charset=utf-8">
- <title>Project1</title>
- <meta name="viewport" content="width=device-width, initial-scale=1">
- <link href="bulma.min.css" rel="stylesheet">
- <script src="exceptdemo2.js"></script>
- <style>
- .source {
- /* width: 730px; */
- margin: -45px auto;
- font-size: 0.9em;
- }
- .source-inner {
- display: flex;
- justify-content: space-between;
- align-items: center;
- /* width: 482px; */
- }
- </style>
- </head>
- <body>
- <div class="section pb-4">
- <h1 class="title is-4">Exceptions: Getting webassembly Pascal exception info</h1>
- <p>
- <p>The <em>wasm.exceptions</em> unit in FPC exposes 2 functions which allow you to retrieve exception information from the free pascal RTL.
- The default behaviour of the WASI hosting environment is to wrap all calls to a WebAssembly function and use these functions transform the
- exception to a <em>EWasmNativeException</em> exception.
- </p>
- <p>
- The output below shows the result of catching this exception.
- </p>
- <div class="box" id="pasjsconsole"></div>
- </div>
- <div class="section">
- <div class="source">
- <div class="source-inner">
- <div>
- <p>Created using <a target="_blank" href="https://wiki.freepascal.org/pas2js">pas2js.</a> </p>
- <p>Pas2JS Sources: <a target="new" href="exceptdemo.lpr">Pas2JS Program</a></p>
- <p>Webassembly Sources: <a target="new" href="demolib.lpr">FPC Program</a></p>
- </div>
- </div>
- </div>
- </div>
- <script>
- rtl.showUncaughtExceptions=true;
- window.addEventListener("load", rtl.run);
- </script>
- </body>
- </html>
|