style: Stop using braces for single-line arrow functions

Braces are optional for single-line arrow functions, but there's a
subtle difference:
Without braces, the expression is implicitly used as return value; with
braces, the function returns nothing unless there's an explicit return.

We currently reflect that in our style by only omitting braces when the
function is expected to have a return value, but that's not very obvious,
not an important differentiation to make, and not easy to express in an
automatic rule.

So just omit braces consistently as mandated by gjs' coding style.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/608
This commit is contained in:
Florian Müllner
2019-01-28 01:42:00 +01:00
committed by Georges Basile Stavracas Neto
parent 1398aa6562
commit 14d7897a93
39 changed files with 91 additions and 91 deletions

View File

@ -48,7 +48,7 @@ function waitAndDraw(milliseconds) {
cb();
});
return callback => { cb = callback; };
return callback => cb = callback;
}
function waitSignal(object, signal) {
@ -60,7 +60,7 @@ function waitSignal(object, signal) {
cb();
});
return callback => { cb = callback; };
return callback => cb = callback;
}
function extractBootTimestamp() {