From db978d715510a1fa01e4c13d209d0fc0df0b23d1 Mon Sep 17 00:00:00 2001 From: "Nicholas H.Tollervey" Date: Thu, 6 Oct 2022 16:38:52 +0100 Subject: [PATCH] webassembly: Dispatch micropython-print via document not mp_js_stdout. --- ports/webassembly/library.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/ports/webassembly/library.js b/ports/webassembly/library.js index 27078e504f..6d9b07cfff 100644 --- a/ports/webassembly/library.js +++ b/ports/webassembly/library.js @@ -33,10 +33,9 @@ mergeInto(LibraryManager.library, { process.stdout.write(b); } else { var c = String.fromCharCode(getValue(ptr + i, 'i8')); - var mp_js_stdout = document.getElementById('mp_js_stdout'); - var print = new Event('print'); - print.data = c; - mp_js_stdout.dispatchEvent(print); + var printEvent = new CustomEvent('micropython-print'); + printEvent.data = c; + document.dispatchEvent(printEvent); } } },