resourceloader: Backport jquery-migrate.js patch for exceptionHook
authorTimo Tijhof <krinklemail@gmail.com>
Thu, 22 Jun 2017 22:49:56 +0000 (23:49 +0100)
committerTimo Tijhof <krinklemail@gmail.com>
Thu, 22 Jun 2017 22:49:56 +0000 (23:49 +0100)
jQuery Migrate has to monkey-patch jQuery.Deferred, but in doing so
it also effectively disables exceptionHook, which means exceptions
are no longer logged to the console.

<https://github.com/jquery/jquery-migrate/pull/262>

Bug: T168086
Change-Id: Id46abcc7fb5e65954532b114636bf0f1f000a551

resources/lib/jquery/jquery.migrate.js

index 05b1a80..879509f 100644 (file)
@@ -535,6 +535,8 @@ jQuery.Deferred = function( func ) {
        return deferred;
 };
 
+// Preserve handler of uncaught exceptions in promise chains
+jQuery.Deferred.exceptionHook = oldDeferred.exceptionHook;
 
 
 })( jQuery, window );