cleanup: Use default parameters where appropriate
Since ES6 it is possible to set an explicit default value for optional parameters (overriding the implicit value of 'undefined'). Use them for a nice small cleanup. https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/626
This commit is contained in:

committed by
Georges Basile Stavracas Neto

parent
16ca7a21a7
commit
404bc34089
@ -151,11 +151,7 @@ function getAllProps(obj) {
|
||||
// e.g., expr="({ foo: null, bar: null, 4: null })" will
|
||||
// return ["foo", "bar", ...] but the list will not include "4",
|
||||
// since methods accessed with '.' notation must star with a letter or _.
|
||||
function getPropertyNamesFromExpression(expr, commandHeader) {
|
||||
if (commandHeader == null) {
|
||||
commandHeader = '';
|
||||
}
|
||||
|
||||
function getPropertyNamesFromExpression(expr, commandHeader = '') {
|
||||
let obj = {};
|
||||
if (!isUnsafeExpression(expr)) {
|
||||
try {
|
||||
|
Reference in New Issue
Block a user