Add back support for Env's updateInterval.

This commit is contained in:
Christian Williams & Kim Eric Mittler 2009-09-02 15:33:24 -07:00
parent bed9e118b6
commit 3b702bd992
2 changed files with 1884 additions and 1868 deletions

View File

@ -1434,7 +1434,7 @@ jasmine.Queue.prototype.isRunning = function () {
jasmine.Queue.prototype._next = function () {
var self = this;
self.env.setTimeout(function () {
var doNext = function () {
self.offset = 0;
self.index++;
if (self.index < self.blocks.length) {
@ -1444,7 +1444,15 @@ jasmine.Queue.prototype._next = function () {
} else {
self.finish();
}
}, 0);
};
var now = new Date().getTime();
if (this.env.updateInterval && now - this.env.lastUpdate > this.env.updateInterval) {
this.env.lastUpdate = now;
this.env.setTimeout(doNext, 0);
} else {
doNext();
}
};
jasmine.Queue.prototype.finish = function () {

View File

@ -38,7 +38,7 @@ jasmine.Queue.prototype.isRunning = function () {
jasmine.Queue.prototype._next = function () {
var self = this;
self.env.setTimeout(function () {
var doNext = function () {
self.offset = 0;
self.index++;
if (self.index < self.blocks.length) {
@ -48,7 +48,15 @@ jasmine.Queue.prototype._next = function () {
} else {
self.finish();
}
}, 0);
};
var now = new Date().getTime();
if (this.env.updateInterval && now - this.env.lastUpdate > this.env.updateInterval) {
this.env.lastUpdate = now;
this.env.setTimeout(doNext, 0);
} else {
doNext();
}
};
jasmine.Queue.prototype.finish = function () {