| 1 |
import { jQuery } from "../core.js"; |
| 2 |
|
| 3 |
import "../deferred.js"; |
| 4 |
|
| 5 |
// These usually indicate a programmer mistake during development, |
| 6 |
// warn about them ASAP rather than swallowing them by default. |
| 7 |
var rerrorNames = /^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/; |
| 8 |
|
| 9 |
// If `jQuery.Deferred.getErrorHook` is defined, `asyncError` is an error |
| 10 |
// captured before the async barrier to get the original error cause |
| 11 |
// which may otherwise be hidden. |
| 12 |
jQuery.Deferred.exceptionHook = function( error, asyncError ) { |
| 13 |
|
| 14 |
if ( error && rerrorNames.test( error.name ) ) { |
| 15 |
window.console.warn( |
| 16 |
"jQuery.Deferred exception", |
| 17 |
error, |
| 18 |
asyncError |
| 19 |
); |
| 20 |
} |
| 21 |
}; |