Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

Commit 452607f

Browse files
committed
fix(events): fixing IE specific issues
IE doesn't have Array#indexOf and [].splice.call doesn't work there either.
1 parent 1940128 commit 452607f

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

src/Scope.js

+4-3
Original file line numberDiff line numberDiff line change
@@ -569,10 +569,11 @@ Scope.prototype = {
569569
* @param {function} listener Function to remove.
570570
*/
571571
$removeListener: function(name, listener) {
572-
var namedListeners = this.$$listeners[name];
573-
var i;
572+
var namedListeners = this.$$listeners[name],
573+
i;
574+
574575
if (namedListeners) {
575-
i = namedListeners.indexOf(listener);
576+
i = indexOf(namedListeners, listener);
576577
namedListeners.splice(i, 1);
577578
}
578579
},

test/ScopeSpec.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -596,7 +596,7 @@ describe('Scope', function() {
596596
scope.$broadcast('fooEvent', 'do', 're', 'me', 'fa');
597597

598598
expect(args.length).toBe(5);
599-
expect([].splice.call(args, 1)).toEqual(['do', 're', 'me', 'fa']);
599+
expect(sliceArgs(args, 1)).toEqual(['do', 're', 'me', 'fa']);
600600
});
601601
});
602602
});

0 commit comments

Comments
 (0)