pivotal/jasmine — pull request #283 by mickeyreiss (2012-10-01 22:28:31+00:00)
Title: Passing arguments to setInterval and setTimeout callbacks

I noticed an issue where Jasmine's mock `setInterval` and `setTimeout` functions had different behavior from most browsers (read, non-IE).

In non-IE browsers, you can pass more than two arguments to setInterval. The first two, which are implemented in Jasmine, are the callback and the time in ms. The additional arguments specify the arguments that are supposed to be applied to the callback function; Jasmine does not capture these arguments or pass them to the callback.

```
setInterval(callback, time, [arg1, arg2, ...])
```

See the attached code for an example of this usage.

I could imagine that this behavior was not included intentionally in order to avoid Internet Explorer compatibility issues. I am also aware of one basic workaround to this issue that involves wrapping the callback in an anonymous function.

However, if you agree that these specs are correct, reply to this pull request, and I can try to implement the behavior.

Thanks!

See also: http://msdn.microsoft.com/en-us/library/ie/ms536753(v=vs.85).aspx
And: https://developer.mozilla.org/en-US/docs/DOM/window.setTimeout#Callback_arguments