Fix spy arity stuff to work in IE8
This commit is contained in:
@@ -2058,7 +2058,8 @@ getJasmineRequireObj().Spy = function (j$) {
|
|||||||
More explanation here (look at comments): http://www.bennadel.com/blog/1909-javascript-function-constructor-does-not-create-a-closure.htm
|
More explanation here (look at comments): http://www.bennadel.com/blog/1909-javascript-function-constructor-does-not-create-a-closure.htm
|
||||||
*/
|
*/
|
||||||
/* jshint evil: true */
|
/* jshint evil: true */
|
||||||
wrapper = eval('(function (' + args + ') { return spy.apply(this, Array.prototype.slice.call(arguments)); })'),
|
wrapper = eval('(0, function (' + args + ') { return spy.apply(this, Array.prototype.slice.call(arguments)); })'),
|
||||||
|
/* jshint evil: false */
|
||||||
spyStrategy = new j$.SpyStrategy({
|
spyStrategy = new j$.SpyStrategy({
|
||||||
name: name,
|
name: name,
|
||||||
fn: originalFn,
|
fn: originalFn,
|
||||||
|
|||||||
@@ -69,8 +69,8 @@ describe('Spies', function () {
|
|||||||
function senary (arg1, arg2, arg3, arg4, arg5, arg6) {}
|
function senary (arg1, arg2, arg3, arg4, arg5, arg6) {}
|
||||||
];
|
];
|
||||||
|
|
||||||
functions.forEach(function (someFunction, arity) {
|
for (var arity = 0; arity < functions.length; arity++) {
|
||||||
var spy = jasmineUnderTest.createSpy(someFunction.name, someFunction);
|
var spy = jasmineUnderTest.createSpy(functions[arity].name, someFunction);
|
||||||
|
|
||||||
expect(spy.length).toEqual(arity);
|
expect(spy.length).toEqual(arity);
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -8,7 +8,8 @@ getJasmineRequireObj().Spy = function (j$) {
|
|||||||
More explanation here (look at comments): http://www.bennadel.com/blog/1909-javascript-function-constructor-does-not-create-a-closure.htm
|
More explanation here (look at comments): http://www.bennadel.com/blog/1909-javascript-function-constructor-does-not-create-a-closure.htm
|
||||||
*/
|
*/
|
||||||
/* jshint evil: true */
|
/* jshint evil: true */
|
||||||
wrapper = eval('(function (' + args + ') { return spy.apply(this, Array.prototype.slice.call(arguments)); })'),
|
wrapper = eval('(0, function (' + args + ') { return spy.apply(this, Array.prototype.slice.call(arguments)); })'),
|
||||||
|
/* jshint evil: false */
|
||||||
spyStrategy = new j$.SpyStrategy({
|
spyStrategy = new j$.SpyStrategy({
|
||||||
name: name,
|
name: name,
|
||||||
fn: originalFn,
|
fn: originalFn,
|
||||||
|
|||||||
Reference in New Issue
Block a user