From 2c1a81f448fb73bece5b8c928ff5877b22a086a3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20M=C3=BCllner?= Date: Mon, 4 Feb 2019 13:22:41 +0100 Subject: [PATCH] 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), []);