params: Don't use Lang module

To copy the passed in default parameters, we can just as well use
another Object.assign() call.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/616
This commit is contained in:
Florian Müllner 2019-07-05 23:36:30 +02:00 committed by Georges Basile Stavracas Neto
parent 55c717c2dc
commit 6ba03ac2a6

View File

@ -1,7 +1,5 @@
// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*- // -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
const Lang = imports.lang;
// parse: // parse:
// @params: caller-provided parameter object, or %null // @params: caller-provided parameter object, or %null
// @defaults-provided defaults object // @defaults-provided defaults object
@ -23,7 +21,6 @@ function parse(params = {}, defaults, allowExtras) {
throw new Error(`Unrecognized parameter "${prop}"`); throw new Error(`Unrecognized parameter "${prop}"`);
} }
let defaultsCopy = {}; let defaultsCopy = Object.assign({}, defaults);
Lang.copyProperties(defaults, defaultsCopy);
return Object.assign(defaultsCopy, params); return Object.assign(defaultsCopy, params);
} }