From 2dc4325a906fb15a096bfec2ad36357f56c8ae19 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20M=C3=BCllner?= Date: Wed, 7 Aug 2019 04:08:02 +0200 Subject: [PATCH] places-menu: Use spread operator for variadic function Invoking functions via Function.prototype.apply() and .call() is less performant than a regular function call, and makes code harder to read. Before ES6 there was no other way of writing a function with variadic arguments, but since we now have the spread operator, we can use that as the better alternative. https://gitlab.gnome.org/GNOME/gnome-shell-extensions/merge_requests/91 --- extensions/places-menu/placeDisplay.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/extensions/places-menu/placeDisplay.js b/extensions/places-menu/placeDisplay.js index ff41eb07..a80e1a3b 100644 --- a/extensions/places-menu/placeDisplay.js +++ b/extensions/places-menu/placeDisplay.js @@ -20,8 +20,8 @@ const Hostname1Iface = ' \ const Hostname1 = Gio.DBusProxy.makeProxyWrapper(Hostname1Iface); class PlaceInfo { - constructor() { - this._init.apply(this, arguments); + constructor(...params) { + this._init(...params); } _init(kind, file, name, icon) {