Add more _.debounce and _.throttle tests.

Former-commit-id: db3cb30a8eac82850a056f85d0c363e752d10027
This commit is contained in:
John-David Dalton
2013-04-05 22:14:44 -07:00
parent 7f637e4acc
commit 4a03ba3874
8 changed files with 192 additions and 84 deletions

View File

@@ -3461,9 +3461,9 @@
if (options === true) {
var leading = true;
trailing = false;
} else if (options) {
} else if (options && objectTypes[typeof options]) {
leading = options.leading;
trailing = options.trailing;
trailing = 'trailing' in options ? options.trailing : trailing;
}
return function() {
var isLeading = leading && !timeoutId;
@@ -3649,9 +3649,9 @@
}
if (options === false) {
leading = false;
} else if (options) {
leading = options.leading;
trailing = options.trailing;
} else if (options && objectTypes[typeof options]) {
leading = 'leading' in options ? options.leading : leading;
trailing = 'trailing' in options ? options.trailing : trailing;
}
return function() {
var now = new Date;