cleanup: Use method syntax

Modern javascript has a short-hand for function properties, embrace
it for better readability and to prepare for an eventual port to
ES6 classes.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/23
This commit is contained in:
Florian Müllner
2017-10-31 01:03:21 +01:00
committed by Florian Müllner
parent cff0b81f32
commit 76f09b1e49
116 changed files with 3140 additions and 3140 deletions

View File

@ -152,7 +152,7 @@ function listModes() {
var SessionMode = new Lang.Class({
Name: 'SessionMode',
_init: function() {
_init() {
_loadModes();
let isPrimary = (_modes[global.session_mode] &&
_modes[global.session_mode].isPrimary);
@ -161,19 +161,19 @@ var SessionMode = new Lang.Class({
this._sync();
},
pushMode: function(mode) {
pushMode(mode) {
this._modeStack.push(mode);
this._sync();
},
popMode: function(mode) {
popMode(mode) {
if (this.currentMode != mode || this._modeStack.length === 1)
throw new Error("Invalid SessionMode.popMode");
this._modeStack.pop();
this._sync();
},
switchMode: function(to) {
switchMode(to) {
if (this.currentMode == to)
return;
this._modeStack[this._modeStack.length - 1] = to;
@ -184,7 +184,7 @@ var SessionMode = new Lang.Class({
return this._modeStack[this._modeStack.length - 1];
},
_sync: function() {
_sync() {
let params = _modes[this.currentMode];
let defaults;
if (params.parentMode)