webassembly: Dispatch micropython-print via document not mp_js_stdout.

This commit is contained in:
Nicholas H.Tollervey 2022-10-06 16:38:52 +01:00 committed by Damien George
parent 2d406f2226
commit db978d7155

View File

@ -33,10 +33,9 @@ mergeInto(LibraryManager.library, {
process.stdout.write(b); process.stdout.write(b);
} else { } else {
var c = String.fromCharCode(getValue(ptr + i, 'i8')); var c = String.fromCharCode(getValue(ptr + i, 'i8'));
var mp_js_stdout = document.getElementById('mp_js_stdout'); var printEvent = new CustomEvent('micropython-print');
var print = new Event('print'); printEvent.data = c;
print.data = c; document.dispatchEvent(printEvent);
mp_js_stdout.dispatchEvent(print);
} }
} }
}, },