Skip to content

Restore exceptionHook #265

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/deferred.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,3 +54,5 @@ jQuery.Deferred = function( func ) {
return deferred;
};

// Preserve handler of uncaught exceptions in promise chains
jQuery.Deferred.exceptionHook = oldDeferred.exceptionHook;
7 changes: 7 additions & 0 deletions test/deferred.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@

QUnit.module( "deferred" );

QUnit.test( "jQuery.Deferred.exceptionHook", function( assert ) {
assert.expect( 1 );

// Make sure our shimming didn't clobber the default hook
assert.ok ( typeof jQuery.Deferred.exceptionHook === "function", "hook is present" );
} );

QUnit.test( ".pipe() warnings", function( assert ) {
assert.expect( 4 );

Expand Down