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
This commit is contained in:
committed by
Florian Müllner
parent
376502e952
commit
2dc4325a90
@@ -20,8 +20,8 @@ const Hostname1Iface = '<node> \
|
||||
const Hostname1 = Gio.DBusProxy.makeProxyWrapper(Hostname1Iface);
|
||||
|
||||
class PlaceInfo {
|
||||
constructor() {
|
||||
this._init.apply(this, arguments);
|
||||
constructor(...params) {
|
||||
this._init(...params);
|
||||
}
|
||||
|
||||
_init(kind, file, name, icon) {
|
||||
|
||||
Reference in New Issue
Block a user