mirror of
https://github.com/scratchfoundation/scratch-vm.git
synced 2025-07-10 04:54:04 -04:00
Add atStackTop helper to Thread
This commit is contained in:
parent
43f3b59f7c
commit
39fdbaf983
1 changed files with 8 additions and 0 deletions
|
@ -123,6 +123,14 @@ Thread.prototype.pushReportedValue = function (value) {
|
|||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Whether the current execution of a thread is at the top of the stack.
|
||||
* @return {Boolean} True if execution is at top of the stack.
|
||||
*/
|
||||
Thread.prototype.atStackTop = function () {
|
||||
return this.peekStack() === this.topBlock;
|
||||
};
|
||||
|
||||
/**
|
||||
* Set thread status.
|
||||
* @param {number} status Enum representing thread status.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue