Better glows ()

* Strip out old script glowing in thread management

* Add new tracking mechanism for glowing scripts

* Track parents and use them to determine script glows

* Use top-block for a thread if there's nothing on the stack

* Remove `console.log`
This commit is contained in:
Tim Mickel 2016-09-08 09:40:53 -04:00 committed by GitHub
parent 797f844de3
commit 5df0acc895
7 changed files with 107 additions and 28 deletions
src/engine

View file

@ -41,6 +41,7 @@ var execute = function (sequencer, thread) {
}
// Skip through the block.
// (either hat with no predicate, or missing op).
thread.requestScriptGlowInFrame = true;
return;
}
@ -110,6 +111,12 @@ var execute = function (sequencer, thread) {
}
});
if (typeof primitiveReportedValue === 'undefined') {
// No value reported - potentially a command block.
// Edge-activated hats don't request a glow; all commands do.
thread.requestScriptGlowInFrame = true;
}
/**
* Handle any reported value from the primitive, either directly returned
* or after a promise resolves.