Add atStackTop helper to Thread

This commit is contained in:
Tim Mickel 2016-08-23 18:12:19 -04:00
parent 43f3b59f7c
commit 39fdbaf983

View file

@ -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.