aboutsummaryrefslogtreecommitdiff
path: root/emccpre.js
diff options
context:
space:
mode:
Diffstat (limited to 'emccpre.js')
-rw-r--r--emccpre.js6
1 files changed, 6 insertions, 0 deletions
diff --git a/emccpre.js b/emccpre.js
index bca2aef..606401a 100644
--- a/emccpre.js
+++ b/emccpre.js
@@ -19,6 +19,12 @@
// immediately. On the other hand, the Emscripten runtime hasn't
// started yet, so Module.cwrap isn't safe.
+// Error handler to make any failures from here on visible to the
+// user, maybe.
+window.addEventListener("error", function (e) {
+ alert(e.message);
+});
+
// To avoid flicker while doing complicated drawing, we use two
// canvases, the same size. One is actually on the web page, and the
// other is off-screen. We do all our drawing on the off-screen one