pivotal/jasmine — pull request #658 by tgirardi (2014-08-26 16:12:52+00:00)
Title: Allow clearInterval to clear it's own interval

As described in issue #655, the handler of an interval cannot
successfully clear the same interval that generated it's invocation.

Solve this issue by changing the order in which interval's handlers are
called and then rescheduled to: first reschedule it and then call it.

The actual order (call first then reschedule) produces that, during the
execution of the interval's handler, the handler is not registered as
a function to run after a timeout or interval ("scheduledFunctions"),
because it was previously unregistered. Consequently, if the handler
calls clearInterval, that function wont be able to find the handler and
remove it completely.