Fix repeated calls to print() clearing output

This commit is contained in:
Arseny Kapoulkine 2021-12-20 15:44:51 -08:00
parent fedd9a5f78
commit d079201a6e

View File

@ -64,11 +64,7 @@
var lastError = undefined;
function output(text) {
var output_clear = document.getElementById("output-clear");
var output_box = document.getElementById("output");
if (output_clear.checked) {
output_box.value = '';
}
output_box.value += text.replace('stdin:', '') + "\n";
// scroll to bottom
output_box.scrollTop = output_box.scrollHeight;
@ -84,6 +80,12 @@
lastError = undefined;
}
var output_clear = document.getElementById("output-clear");
if (output_clear.checked) {
var output_box = document.getElementById("output");
output_box.value = '';
}
var err = Module.ccall('executeScript', 'string', ['string'], [editor.getValue()]);
if (err) {
var err_text = err.replace('stdin:', '');