exceptionHook.js 640 B

123456789101112131415161718192021
  1. define( [
  2. "../core",
  3. "../deferred"
  4. ], function( jQuery ) {
  5. "use strict";
  6. // These usually indicate a programmer mistake during development,
  7. // warn about them ASAP rather than swallowing them by default.
  8. var rerrorNames = /^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;
  9. jQuery.Deferred.exceptionHook = function( error, stack ) {
  10. // Support: IE 8 - 9 only
  11. // Console exists when dev tools are open, which can happen at any time
  12. if ( window.console && window.console.warn && error && rerrorNames.test( error.name ) ) {
  13. window.console.warn( "jQuery.Deferred exception: " + error.message, error.stack, stack );
  14. }
  15. };
  16. } );