Use now() in the compat and underscore builds too.

This commit is contained in:
John-David Dalton
2013-09-24 19:10:09 -07:00
parent 92409831c2
commit 7cfa7f3de4
5 changed files with 93 additions and 91 deletions

View File

@@ -5493,7 +5493,7 @@
trailing = 'trailing' in options ? options.trailing : trailing;
}
var delayed = function() {
var remaining = wait - (new Date - stamp);
var remaining = wait - (now() - stamp);
if (remaining <= 0) {
if (maxTimeoutId) {
clearTimeout(maxTimeoutId);
@@ -5501,7 +5501,7 @@
var isCalled = trailingCall;
maxTimeoutId = timeoutId = trailingCall = undefined;
if (isCalled) {
lastCalled = +new Date;
lastCalled = now();
result = func.apply(thisArg, args);
}
} else {
@@ -5515,14 +5515,14 @@
}
maxTimeoutId = timeoutId = trailingCall = undefined;
if (trailing || (maxWait !== wait)) {
lastCalled = +new Date;
lastCalled = now();
result = func.apply(thisArg, args);
}
};
return function() {
args = arguments;
stamp = +new Date;
stamp = now();
thisArg = this;
trailingCall = trailing && (timeoutId || !leading);