w3c/web-platform-tests — pull request #887 by inexorabletash (2014-04-14 16:27:25+00:00)
Title: IndexedDB support: Make fail() output clearer if request is still pending

If the `fail()` event listener is triggered due to an unexpected event, it peeks at `e.target.error` to see if that value would be a good thing to report. But if `e.target` is a request and the request's `readyState` is `'pending'`, accessing `.error` will throw, making `fail()` give unhelpful output.

So check `e.target.readyState` before accessing `e.target.error`