From f7045b862a5b7c3de8ee2ea3da67616b38a667cc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jes=C3=BAs=20Eduardo?= Date: Sun, 6 Aug 2017 20:43:24 -0500 Subject: first commit --- lib/jquery/src/deferred/exceptionHook.js | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 lib/jquery/src/deferred/exceptionHook.js (limited to 'lib/jquery/src/deferred/exceptionHook.js') diff --git a/lib/jquery/src/deferred/exceptionHook.js b/lib/jquery/src/deferred/exceptionHook.js new file mode 100644 index 0000000..6dbdc85 --- /dev/null +++ b/lib/jquery/src/deferred/exceptionHook.js @@ -0,0 +1,21 @@ +define( [ + "../core", + "../deferred" +], function( jQuery ) { + +"use strict"; + +// These usually indicate a programmer mistake during development, +// warn about them ASAP rather than swallowing them by default. +var rerrorNames = /^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/; + +jQuery.Deferred.exceptionHook = function( error, stack ) { + + // Support: IE 8 - 9 only + // Console exists when dev tools are open, which can happen at any time + if ( window.console && window.console.warn && error && rerrorNames.test( error.name ) ) { + window.console.warn( "jQuery.Deferred exception: " + error.message, error.stack, stack ); + } +}; + +} ); -- cgit v1.2.3