mirror of
https://github.com/scratchfoundation/scratch-vm.git
synced 2025-07-26 22:20:41 -04:00
Add visual reporting of top-level reporter execution
This commit is contained in:
parent
d4353458ff
commit
9c6dca8131
4 changed files with 32 additions and 0 deletions
src/engine
|
@ -96,6 +96,10 @@ var execute = function (sequencer, thread) {
|
|||
primitiveReportedValue.then(function(resolvedValue) {
|
||||
// Promise resolved: the primitive reported a value.
|
||||
thread.pushReportedValue(resolvedValue);
|
||||
// Report the value visually if necessary.
|
||||
if (thread.peekStack() === thread.topBlock) {
|
||||
runtime.visualReport(thread.peekStack(), resolvedValue);
|
||||
}
|
||||
thread.setStatus(Thread.STATUS_RUNNING);
|
||||
sequencer.proceedThread(thread);
|
||||
}, function(rejectionReason) {
|
||||
|
@ -107,6 +111,10 @@ var execute = function (sequencer, thread) {
|
|||
});
|
||||
} else if (thread.status === Thread.STATUS_RUNNING) {
|
||||
thread.pushReportedValue(primitiveReportedValue);
|
||||
// Report the value visually if necessary.
|
||||
if (thread.peekStack() === thread.topBlock) {
|
||||
runtime.visualReport(thread.peekStack(), primitiveReportedValue);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue