Remove YieldTimers, unused WeDo blocks

This commit is contained in:
Tim Mickel 2016-06-30 17:06:50 -04:00
parent 6daee9a70e
commit ab6e0d3839
8 changed files with 11 additions and 280 deletions
src/engine

View file

@ -1,5 +1,3 @@
var YieldTimers = require('../util/yieldtimers.js');
/**
* A thread is a running stack context and all the metadata needed.
* @param {?string} firstBlock First block to execute in the thread.
@ -30,12 +28,6 @@ function Thread (firstBlock) {
* @type {number}
*/
this.status = 0; /* Thread.STATUS_RUNNING */
/**
* Execution-synced timeouts.
* @type {number}
*/
this.timeoutIds = [];
}
/**
@ -131,29 +123,4 @@ Thread.prototype.yield = function () {
this.status = Thread.STATUS_YIELD;
};
/**
* Add an execution-synced timeouts for this thread.
* See also: util/yieldtimers.js:timeout
* @param {!Function} callback To be called when the timer is done.
* @param {number} timeDelta Time to wait, in ms.
*/
Thread.prototype.addTimeout = function (callback, timeDelta) {
var timeoutId = YieldTimers.timeout(callback, timeDelta);
this.timeoutIds.push(timeoutId);
};
/**
* Attempt to resolve all execution-synced timeouts on this thread.
*/
Thread.prototype.resolveTimeouts = function () {
var newTimeouts = [];
for (var i = 0; i < this.timeoutIds.length; i++) {
var resolved = YieldTimers.resolve(this.timeoutIds[i]);
if (!resolved) {
newTimeouts.push(this.timeoutIds[i]);
}
}
this.timeoutIds = newTimeouts;
};
module.exports = Thread;