Tidy up SpyStrategy#exec
This commit is contained in:
@@ -97,14 +97,12 @@ getJasmineRequireObj().SpyStrategy = function(j$) {
|
|||||||
* @function
|
* @function
|
||||||
*/
|
*/
|
||||||
SpyStrategy.prototype.exec = function(context, args, invokeNew) {
|
SpyStrategy.prototype.exec = function(context, args, invokeNew) {
|
||||||
var list = [context].concat(args ? Array.prototype.slice.call(args) : []);
|
var contextArgs = [context].concat(
|
||||||
var target = this.plan.bind.apply(this.plan, list);
|
args ? Array.prototype.slice.call(args) : []
|
||||||
|
);
|
||||||
|
var target = this.plan.bind.apply(this.plan, contextArgs);
|
||||||
|
|
||||||
if (invokeNew) {
|
return invokeNew ? new target() : target();
|
||||||
return new target();
|
|
||||||
} else {
|
|
||||||
return target();
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user