pivotal/jasmine — pull request #462 by tidoust (2013-11-07 13:57:02+00:00)
Title: Clears timeout timer even when async spec throws an exception

When an async spec throws a (sync) exception for some reason, the
exception was correctly caught and reported by Jasmine but the timeout
timer continued to run in the background.

For instance, running the (rather stupid) example below would report
the exception immediately but would also make the process loop for 5s
(and report the exception depending on the reported being used).

```javascript
describe('exception', function () {
it('is caught but timer continues to run', function (done) {
throw new Error('Oh no!');
});
});
```

This happened because the timout timer is set in `Spec` while the
`try... catch` block is in the queue runner. The `callDone` function
of `timeoutable` that resets the timer was thus not called.

The commit simply introduces a `try... catch` block within the
`timeoutable` function to ensure that `callDone` gets called even
when an exception is thrown.