retire new threads if they have no block after the hat

This commit is contained in:
Michael "Z" Goddard 2019-04-19 15:50:44 -04:00
parent 6ed3263ca9
commit ebdf3865d4
No known key found for this signature in database
GPG key ID: 762CD40DD5349872

View file

@ -177,6 +177,12 @@ class Sequencer {
if (!currentBlockId) {
// A "null block" - empty branch.
thread.popStack();
// Did the null follow a hat block?
if (thread.stack.length === 0) {
thread.status = Thread.STATUS_DONE;
return;
}
}
// Save the current block ID to notice if we did control flow.
while ((currentBlockId = thread.peekStack())) {