mirror of
https://github.com/inexorabletash/jsbasic.git
synced 2025-01-01 12:31:01 +00:00
Fix for previous - don't call callback synchronously
This commit is contained in:
parent
555f8de2ae
commit
a23879b693
6
dos.js
6
dos.js
@ -587,15 +587,15 @@ function DOS(tty) {
|
||||
tty.writeString(prompt); // TODO: Correct? Newline?
|
||||
var tmp = clockbuf;
|
||||
clockbuf = '';
|
||||
callback(tmp);
|
||||
setTimeout(function() { callback(tmp); }, 0);
|
||||
}
|
||||
function clock_readChar(callback) {
|
||||
if (!clockbuf.length) {
|
||||
callback('\r');
|
||||
setTimeout(function() { callback('\r'); }, 0);
|
||||
} else {
|
||||
var c = clockbuf.substring(0, 1);
|
||||
clockbuf = clockbuf.slice(1);
|
||||
callback(c);
|
||||
setTimeout(function() { callback(c); }, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user