[gnome-shell] cleanup: Don't use Array/Object constructors
- From: Georges Basile Stavracas Neto <gbsneto src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-shell] cleanup: Don't use Array/Object constructors
- Date: Mon, 16 Sep 2019 20:40:39 +0000 (UTC)
commit 81ab2865f76b098affe22a0f065791e8922ad730
Author: Florian Müllner <fmuellner gnome org>
Date: Mon Aug 19 21:18:54 2019 +0200
cleanup: Don't use Array/Object constructors
The corresponding literals are more concise and cleaner.
https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/731
js/ui/altTab.js | 8 ++++----
js/ui/keyboard.js | 7 ++++---
2 files changed, 8 insertions(+), 7 deletions(-)
---
diff --git a/js/ui/altTab.js b/js/ui/altTab.js
index 98ca5b3862..46f4ed912c 100644
--- a/js/ui/altTab.js
+++ b/js/ui/altTab.js
@@ -877,9 +877,9 @@ class ThumbnailList extends SwitcherPopup.SwitcherList {
_init(windows) {
super._init(false);
- this._labels = new Array();
- this._thumbnailBins = new Array();
- this._clones = new Array();
+ this._labels = [];
+ this._thumbnailBins = [];
+ this._clones = [];
this._windows = windows;
for (let i = 0; i < windows.length; i++) {
@@ -940,7 +940,7 @@ class ThumbnailList extends SwitcherPopup.SwitcherList {
}
// Make sure we only do this once
- this._thumbnailBins = new Array();
+ this._thumbnailBins = [];
}
_removeThumbnail(source, clone) {
diff --git a/js/ui/keyboard.js b/js/ui/keyboard.js
index 68071506f4..183f821384 100644
--- a/js/ui/keyboard.js
+++ b/js/ui/keyboard.js
@@ -104,9 +104,10 @@ class KeyContainer extends St.Widget {
this._currentRow++;
this._currentCol = 0;
- let row = new Object();
- row.keys = [];
- row.width = 0;
+ let row = {
+ keys: [],
+ width: 0,
+ };
this._rows.push(row);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]