[gnome-shell] runDialog: Don't return from finally block
- From: Georges Basile Stavracas Neto <gbsneto src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-shell] runDialog: Don't return from finally block
- Date: Mon, 1 Jul 2019 21:15:11 +0000 (UTC)
commit 2c1a81f448fb73bece5b8c928ff5877b22a086a3
Author: Florian Müllner <fmuellner gnome org>
Date: Mon Feb 4 13:22:41 2019 +0100
runDialog: Don't return from finally block
Control flow statements like return, break or continue are considered
unsafe in finally blocks, as they take precendence over any control
flow statement in the try and catch blocks, which may be unexpected.
This isn't the case here as the statement in the finally block is the
only one, but we can just as well avoid the finally block altogether
and use a regular return statement.
https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/606
js/ui/runDialog.js | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
---
diff --git a/js/ui/runDialog.js b/js/ui/runDialog.js
index a4ac8c82b..9186ff7bb 100644
--- a/js/ui/runDialog.js
+++ b/js/ui/runDialog.js
@@ -169,9 +169,8 @@ class RunDialog extends ModalDialog.ModalDialog {
if (!e.matches(Gio.IOErrorEnum, Gio.IOErrorEnum.NOT_FOUND) &&
!e.matches(Gio.IOErrorEnum, Gio.IOErrorEnum.NOT_DIRECTORY))
log(e);
- } finally {
- return results;
}
+ return results;
});
let results = someResults.reduce((a, b) => a.concat(b), []);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]