Skip to content

Commit 2178452

Browse files
committed
perf(ui): Tweaks regarding ...args quasarframework#5077
1 parent d12d7a4 commit 2178452

File tree

5 files changed

+15
-12
lines changed

5 files changed

+15
-12
lines changed

ui/src/components/ajax-bar/QAjaxBar.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,15 +57,15 @@ function highjackAjax (start, stop) {
5757
stack.stop.map(fn => { fn() })
5858
}
5959

60-
xhr.prototype.send = function (...args) {
60+
xhr.prototype.send = function (/* ...args */) {
6161
stack.start.map(fn => { fn() })
6262

6363
this.addEventListener('abort', endHandler, false)
6464
this.addEventListener('readystatechange', () => {
6565
if (this.readyState === 4) { endHandler() }
6666
}, false)
6767

68-
send.apply(this, args)
68+
send.apply(this, arguments)
6969
}
7070
}
7171

ui/src/utils/date.js

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -442,16 +442,17 @@ export function endOfDate (date, unit) {
442442
return t
443443
}
444444

445-
export function getMaxDate (date, ...args) {
446-
let t = new Date(date)
447-
args.forEach(d => {
445+
export function getMaxDate (/* date, ...args */) {
446+
let t = 0
447+
Array.prototype.slice.call(arguments).forEach(d => {
448448
t = Math.max(t, new Date(d))
449449
})
450450
return t
451451
}
452-
export function getMinDate (date, ...args) {
452+
453+
export function getMinDate (date /*, ...args */) {
453454
let t = new Date(date)
454-
args.forEach(d => {
455+
Array.prototype.slice.call(arguments, 1).forEach(d => {
455456
t = Math.min(t, new Date(d))
456457
})
457458
return t

ui/src/utils/debounce.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
export default function (fn, wait = 250, immediate) {
22
let timeout
33

4-
function debounced (...args) {
4+
function debounced (/* ...args */) {
5+
const args = arguments
6+
57
const later = () => {
68
timeout = null
79
if (!immediate) {

ui/src/utils/frame-debounce.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
export default function (fn) {
22
let wait = false, frame, callArgs
33

4-
function debounced (...args) {
5-
callArgs = args
4+
function debounced (/* ...args */) {
5+
callArgs = arguments
66
if (wait === true) { return }
77

88
wait = true

ui/src/utils/throttle.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
export default function (fn, limit = 250) {
22
let wait = false, result
3-
4-
return function () {
3+
4+
return function (/* ...args */) {
55
if (wait === false) {
66
wait = true
77
setTimeout(() => { wait = false }, limit)

0 commit comments

Comments
 (0)