angular/angular.js — pull request #3465 by pkozlowski-opensource (2013-08-03 16:12:43+00:00)
Title: fix(jqLite): forgive unregistration of a non-registered handler

I've bumped into a subtle bug when unregisering handlers with jqLite. If you try to unregister a non-existing handler by specifing both its type and a function jqLite's `off` will fail if there was already a different handler was registered. See the test for more details.

With jQuery this situation is handled correctly, that it, unregistration has no effect.

I was hesitating a bit between fixing it in jqLite or fixing directly the `indexOf` / `arrayRemove` (in Angular.js). In any case the test illustrates my real problem, can amend the fix if needed.