Browse Source

webassembly: Dispatch micropython-print via document not mp_js_stdout.

pull/9710/head
Nicholas H.Tollervey 2 years ago
committed by Damien George
parent
commit
db978d7155
  1. 7
      ports/webassembly/library.js

7
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);
}
}
},

Loading…
Cancel
Save