Skip to content
This repository was archived by the owner on May 29, 2019. It is now read-only.

Commit 1e19292

Browse files
committed
Revert "fix(debounce): fix argument slicing"
This reverts commit e196be8.
1 parent e196be8 commit 1e19292

File tree

2 files changed

+3
-11
lines changed

2 files changed

+3
-11
lines changed

src/debounce/debounce.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ angular.module('ui.bootstrap.debounce', [])
88

99
return function() {
1010
var self = this;
11-
var args = Array.prototype.slice.call(arguments);
11+
var args = Array.prototype.slice(arguments);
1212
if (timeoutPromise) {
1313
$timeout.cancel(timeoutPromise);
1414
}
@@ -18,4 +18,4 @@ angular.module('ui.bootstrap.debounce', [])
1818
}, debounceTime);
1919
};
2020
};
21-
}]);
21+
}]);

src/debounce/test/debounce.spec.js

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
11
describe('$$debounce', function() {
2-
var $$debounce, $timeout, debouncedFunction, i, args;
2+
var $$debounce, $timeout, debouncedFunction, i;
33

44
beforeEach(module('ui.bootstrap.debounce'));
55
beforeEach(inject(function(_$$debounce_, _$timeout_) {
66
$$debounce = _$$debounce_;
77
$timeout = _$timeout_;
88
i = 0;
99
debouncedFunction = $$debounce(function() {
10-
args = Array.prototype.slice.call(arguments);
1110
i++;
1211
}, 100);
1312
}));
@@ -38,11 +37,4 @@ describe('$$debounce', function() {
3837

3938
expect(i).toBe(1);
4039
});
41-
42-
it('should properly pass arguments to debounced function', function() {
43-
debouncedFunction(1, 2, 3);
44-
$timeout.flush(100);
45-
46-
expect(args).toEqual([1, 2, 3]);
47-
});
4840
});

0 commit comments

Comments
 (0)