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
This commit is contained in:
Florian Müllner 2019-02-01 14:36:37 +01:00
parent fe83cd91bb
commit 321730fcb9
2 changed files with 8 additions and 10 deletions

View File

@ -147,8 +147,8 @@ class TelepathyClient extends Tp.BaseClient {
this._delegatedChannelsCb.bind(this)); this._delegatedChannelsCb.bind(this));
} }
vfunc_observe_channels(account, conn, channels, vfunc_observe_channels(...args) {
dispatchOp, requests, context) { let [account, conn, channels, dispatchOp, requests, context] = args;
let len = channels.length; let len = channels.length;
for (let i = 0; i < len; i++) { for (let i = 0; i < len; i++) {
let channel = channels[i]; let channel = channels[i];
@ -180,8 +180,8 @@ class TelepathyClient extends Tp.BaseClient {
}); });
} }
vfunc_handle_channels(account, conn, channels, requests, vfunc_handle_channels(...args) {
user_action_time, context) { let [account, conn, channels, requests, user_action_time, context] = args;
this._handlingChannels(account, conn, channels, true); this._handlingChannels(account, conn, channels, true);
context.accept(); context.accept();
} }
@ -220,8 +220,8 @@ class TelepathyClient extends Tp.BaseClient {
} }
} }
vfunc_add_dispatch_operation(account, conn, channels, vfunc_add_dispatch_operation(...args) {
dispatchOp, context) { let [account, conn, channels, dispatchOp, context] = args;
let channel = channels[0]; let channel = channels[0];
let chanType = channel.get_channel_type(); let chanType = channel.get_channel_type();

View File

@ -129,10 +129,8 @@ function resumeTweens(...args) {
} }
function registerSpecialProperty(name, getFunction, setFunction, function registerSpecialProperty(...args) {
parameters, preProcessFunction) { Tweener.registerSpecialProperty(...args);
Tweener.registerSpecialProperty(name, getFunction, setFunction,
parameters, preProcessFunction);
} }
function registerSpecialPropertyModifier(name, modifyFunction, getFunction) { function registerSpecialPropertyModifier(name, modifyFunction, getFunction) {