From 321730fcb9c975f50322783a6b7c68a6ae25f20f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20M=C3=BCllner?= Date: Fri, 1 Feb 2019 14:36:37 +0100 Subject: [PATCH] cleanup: Use rest operator to handle overly long argument lists The existing indentation is bonkers, but there's no good replacement with that many arguments. So switch to using the rest operator and array destructuring as an alternative. https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/607 --- js/ui/components/telepathyClient.js | 12 ++++++------ js/ui/tweener.js | 6 ++---- 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/js/ui/components/telepathyClient.js b/js/ui/components/telepathyClient.js index c316084a2..1292d9a00 100644 --- a/js/ui/components/telepathyClient.js +++ b/js/ui/components/telepathyClient.js @@ -147,8 +147,8 @@ class TelepathyClient extends Tp.BaseClient { this._delegatedChannelsCb.bind(this)); } - vfunc_observe_channels(account, conn, channels, - dispatchOp, requests, context) { + vfunc_observe_channels(...args) { + let [account, conn, channels, dispatchOp, requests, context] = args; let len = channels.length; for (let i = 0; i < len; i++) { let channel = channels[i]; @@ -180,8 +180,8 @@ class TelepathyClient extends Tp.BaseClient { }); } - vfunc_handle_channels(account, conn, channels, requests, - user_action_time, context) { + vfunc_handle_channels(...args) { + let [account, conn, channels, requests, user_action_time, context] = args; this._handlingChannels(account, conn, channels, true); context.accept(); } @@ -220,8 +220,8 @@ class TelepathyClient extends Tp.BaseClient { } } - vfunc_add_dispatch_operation(account, conn, channels, - dispatchOp, context) { + vfunc_add_dispatch_operation(...args) { + let [account, conn, channels, dispatchOp, context] = args; let channel = channels[0]; let chanType = channel.get_channel_type(); diff --git a/js/ui/tweener.js b/js/ui/tweener.js index 26f3aeb0e..3656f8119 100644 --- a/js/ui/tweener.js +++ b/js/ui/tweener.js @@ -129,10 +129,8 @@ function resumeTweens(...args) { } -function registerSpecialProperty(name, getFunction, setFunction, - parameters, preProcessFunction) { - Tweener.registerSpecialProperty(name, getFunction, setFunction, - parameters, preProcessFunction); +function registerSpecialProperty(...args) { + Tweener.registerSpecialProperty(...args); } function registerSpecialPropertyModifier(name, modifyFunction, getFunction) {