cleanup: Use default parameters where appropriate
Since ES6 it is possible to set an explicit default value for optional parameters (overriding the implicit value of 'undefined'). Use them for a nice small cleanup. https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/626
This commit is contained in:

committed by
Georges Basile Stavracas Neto

parent
16ca7a21a7
commit
404bc34089
@ -4,7 +4,7 @@ const { Atk, Clutter, St } = imports.gi;
|
||||
const Signals = imports.signals;
|
||||
|
||||
var BarLevel = class {
|
||||
constructor(value, params) {
|
||||
constructor(value, params = {}) {
|
||||
if (isNaN(value))
|
||||
// Avoid spreading NaNs around
|
||||
throw TypeError('The bar level value must be a number');
|
||||
@ -13,9 +13,6 @@ var BarLevel = class {
|
||||
this._overdriveStart = 1;
|
||||
this._barLevelWidth = 0;
|
||||
|
||||
if (params == undefined)
|
||||
params = {};
|
||||
|
||||
this.actor = new St.DrawingArea({ styleClass: params['styleClass'] || 'barlevel',
|
||||
can_focus: params['canFocus'] || false,
|
||||
reactive: params['reactive'] || false,
|
||||
|
Reference in New Issue
Block a user