Regenerate jasmine.js after adding ensured support.
This commit is contained in:
committed by
Davis W. Frank & Rajan Agaskar
parent
bbc4c70c91
commit
c5ba032d28
@@ -1961,6 +1961,10 @@ jasmine.StringPrettyPrinter.prototype.append = function(value) {
|
||||
};
|
||||
jasmine.Queue = function(env) {
|
||||
this.env = env;
|
||||
|
||||
// parallel to blocks. each true value in this array means the block will
|
||||
// get executed even if we abort
|
||||
this.ensured = [];
|
||||
this.blocks = [];
|
||||
this.running = false;
|
||||
this.index = 0;
|
||||
@@ -1968,15 +1972,30 @@ jasmine.Queue = function(env) {
|
||||
this.abort = false;
|
||||
};
|
||||
|
||||
jasmine.Queue.prototype.addBefore = function(block) {
|
||||
jasmine.Queue.prototype.addBefore = function(block, ensure) {
|
||||
if (ensure === jasmine.undefined) {
|
||||
ensure = false;
|
||||
}
|
||||
|
||||
this.blocks.unshift(block);
|
||||
this.ensured.unshift(ensure);
|
||||
};
|
||||
|
||||
jasmine.Queue.prototype.add = function(block) {
|
||||
jasmine.Queue.prototype.add = function(block, ensure) {
|
||||
if (ensure === jasmine.undefined) {
|
||||
ensure = false;
|
||||
}
|
||||
|
||||
this.blocks.push(block);
|
||||
this.ensured.push(ensure);
|
||||
};
|
||||
|
||||
jasmine.Queue.prototype.insertNext = function(block) {
|
||||
jasmine.Queue.prototype.insertNext = function(block, ensure) {
|
||||
if (ensure === jasmine.undefined) {
|
||||
ensure = false;
|
||||
}
|
||||
|
||||
this.ensured.splice((this.index + this.offset + 1), 0, ensure);
|
||||
this.blocks.splice((this.index + this.offset + 1), 0, block);
|
||||
this.offset++;
|
||||
};
|
||||
@@ -2000,7 +2019,7 @@ jasmine.Queue.prototype.next_ = function() {
|
||||
while (goAgain) {
|
||||
goAgain = false;
|
||||
|
||||
if (self.index < self.blocks.length && !this.abort) {
|
||||
if (self.index < self.blocks.length && !(this.abort && !this.ensured[self.index])) {
|
||||
var calledSynchronously = true;
|
||||
var completedSynchronously = false;
|
||||
|
||||
@@ -2291,7 +2310,7 @@ jasmine.Spec.prototype.finish = function(onComplete) {
|
||||
|
||||
jasmine.Spec.prototype.after = function(doAfter) {
|
||||
if (this.queue.isRunning()) {
|
||||
this.queue.add(new jasmine.Block(this.env, doAfter, this));
|
||||
this.queue.add(new jasmine.Block(this.env, doAfter, this), true);
|
||||
} else {
|
||||
this.afterCallbacks.unshift(doAfter);
|
||||
}
|
||||
@@ -2329,15 +2348,15 @@ jasmine.Spec.prototype.addBeforesAndAftersToQueue = function() {
|
||||
this.queue.addBefore(new jasmine.Block(this.env, runner.before_[i], this));
|
||||
}
|
||||
for (i = 0; i < this.afterCallbacks.length; i++) {
|
||||
this.queue.add(new jasmine.Block(this.env, this.afterCallbacks[i], this));
|
||||
this.queue.add(new jasmine.Block(this.env, this.afterCallbacks[i], this), true);
|
||||
}
|
||||
for (suite = this.suite; suite; suite = suite.parentSuite) {
|
||||
for (i = 0; i < suite.after_.length; i++) {
|
||||
this.queue.add(new jasmine.Block(this.env, suite.after_[i], this));
|
||||
this.queue.add(new jasmine.Block(this.env, suite.after_[i], this), true);
|
||||
}
|
||||
}
|
||||
for (i = 0; i < runner.after_.length; i++) {
|
||||
this.queue.add(new jasmine.Block(this.env, runner.after_[i], this));
|
||||
this.queue.add(new jasmine.Block(this.env, runner.after_[i], this), true);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user