-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy patherror.html
More file actions
28 lines (25 loc) · 807 Bytes
/
error.html
File metadata and controls
28 lines (25 loc) · 807 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width,initial-scale=1.0" />
</head>
<body>
<div>See console ➡️</div>
<script type="micropython">
from polyscript import XWorker
def handle_error(event):
print("Python")
print(event.data.message)
w = XWorker('./error.py')
w.onerror = handle_error
</script>
<script type="module">
import { XWorker } from "../dist/index.js";
const w = new XWorker("./error.py", { type: "micropython" });
w.onerror = ({ data: error }) => {
console.log('JS', error);
};
</script>
</body>
</html>