Apply rest arguments transform.

This commit is contained in:
John-David Dalton
2017-01-06 15:49:42 -08:00
parent f4a6e9ede9
commit bf54267f0b
7 changed files with 15 additions and 15 deletions

View File

@@ -18,19 +18,19 @@ function shortOut(func) {
var count = 0,
lastCalled = 0;
return function() {
return function(...args) {
var stamp = nativeNow(),
remaining = HOT_SPAN - (stamp - lastCalled);
lastCalled = stamp;
if (remaining > 0) {
if (++count >= HOT_COUNT) {
return arguments[0];
return args[0];
}
} else {
count = 0;
}
return func(...arguments);
return func(...args);
};
}