From b5ea2f8bb6df077b1d1eaa88b062d558a5cdb3e4 Mon Sep 17 00:00:00 2001 From: Bastien Nocera Date: Fri, 26 Jul 2019 16:38:42 +0200 Subject: [PATCH] Fix deprecation warnings Similarly to https://gitlab.gnome.org/GNOME/gnome-characters/issues/44 --- src/menu.js | 4 ++-- src/window.js | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/menu.js b/src/menu.js index c7510f5..cbd28a4 100644 --- a/src/menu.js +++ b/src/menu.js @@ -72,7 +72,7 @@ var MenuPopover = GObject.registerClass({ _handleSearchChanged(entry) { let text = entry.get_text().replace(/^\s+|\s+$/g, ''); let keywords = text == '' ? [] : text.split(/\s+/); - this._keywords = keywords.map(String.toLowerCase); + this._keywords = keywords.map(x => x.toLowerCase()); this._font_listbox.invalidate_filter(); return true; } @@ -91,7 +91,7 @@ var MenuPopover = GObject.registerClass({ if (row._family == 'None') return true; - let nameWords = row._family.split(/\s+/).map(String.toLowerCase); + let nameWords = row._family.split(/\s+/).map(x => x.toLowerCase()); return this._keywords.every(function(keyword, index, array) { return nameWords.some(function(nameWord, index, array) { return nameWord.indexOf(keyword) >= 0; diff --git a/src/window.js b/src/window.js index 2066105..5498b58 100644 --- a/src/window.js +++ b/src/window.js @@ -168,7 +168,7 @@ var MainWindow = GObject.registerClass({ _handleSearchChanged(entry) { const text = entry.get_text().replace(/^\s+|\s+$/g, ''); let keywords = text == '' ? [] : text.split(/\s+/); - keywords = keywords.map(String.toUpperCase); + keywords = keywords.map(x => x.toUpperCase()); if (keywords != this._searchKeywords) { this._mainView.cancelSearch(); this._searchKeywords = keywords; -- 2.25.1