]> source.dussan.org Git - jquery.git/commit
Ajax: Protect against exceptions thrown synchronously by xhr.send
authorjaubourg <j@ubourg.net>
Sat, 25 Jan 2014 07:20:18 +0000 (08:20 +0100)
committerjaubourg <j@ubourg.net>
Wed, 29 Jan 2014 13:18:58 +0000 (14:18 +0100)
commit01c360f96390ff16edfe65ef3b34e167087ef645
tree2419904105326230d25b97dcececc92a134f2f8d
parent53e31f478e1d88d056aa52f6575d200fe3dcf047
Ajax: Protect against exceptions thrown synchronously by xhr.send

When xhr.send throws an exception synchronously, the onerror handler may have
been called already which, unchecked, makes the exception bubble up outside of
jQuery.ajax.

We now catch the exception pre-emptively and only rethrow if we know it hasn't
already been notified through the onerror handler.

Fixes #14683
src/ajax/xhr.js
test/unit/ajax.js