From fe83cd91bbf746d32c9d53e868c75bd18e2f7240 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20M=C3=BCllner?= Date: Tue, 12 Feb 2019 12:24:30 +0100 Subject: [PATCH] cleanup: Use rest parameters instead of arguments Spotted by eslint. https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/607 --- js/extensionPrefs/main.js | 4 ++-- js/ui/environment.js | 4 ++-- js/ui/tweener.js | 13 +++++++------ 3 files changed, 11 insertions(+), 10 deletions(-) diff --git a/js/extensionPrefs/main.js b/js/extensionPrefs/main.js index 24ecdc165..b0be67f49 100644 --- a/js/extensionPrefs/main.js +++ b/js/extensionPrefs/main.js @@ -611,8 +611,8 @@ function initEnvironment() { // Monkey-patch in a "global" object that fakes some Shell utilities // that ExtensionUtils depends on. window.global = { - log() { - print([].join.call(arguments, ', ')); + log(...args) { + print(args.join(', ')); }, logError(s) { diff --git a/js/ui/environment.js b/js/ui/environment.js index f70394710..573857126 100644 --- a/js/ui/environment.js +++ b/js/ui/environment.js @@ -57,8 +57,8 @@ function _patchLayoutClass(layoutClass, styleProps) { }; } -function _loggingFunc() { - let fields = {'MESSAGE': [].join.call(arguments, ', ')}; +function _loggingFunc(...args) { + let fields = {'MESSAGE': args.join(', ')}; let domain = "GNOME Shell"; // If the caller is an extension, add it as metadata diff --git a/js/ui/tweener.js b/js/ui/tweener.js index 946506a3a..26f3aeb0e 100644 --- a/js/ui/tweener.js +++ b/js/ui/tweener.js @@ -109,8 +109,9 @@ function isTweening(scope) { return Tweener.getTweenCount(scope) != 0; } -function removeTweens(scope) { - if (Tweener.removeTweens.apply(null, arguments)) { +function removeTweens(...args) { + if (Tweener.removeTweens(args)) { + let [scope] = args; // If we just removed the last active tween, clean up if (Tweener.getTweenCount(scope) == 0) _tweenCompleted(scope); @@ -119,12 +120,12 @@ function removeTweens(scope) { return false; } -function pauseTweens() { - return Tweener.pauseTweens.apply(null, arguments); +function pauseTweens(...args) { + return Tweener.pauseTweens(...args); } -function resumeTweens() { - return Tweener.resumeTweens.apply(null, arguments); +function resumeTweens(...args) { + return Tweener.resumeTweens(...args); }