From 6ba03ac2a6a138f7a7d8a6b08ac2636702e7da44 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20M=C3=BCllner?= Date: Fri, 5 Jul 2019 23:36:30 +0200 Subject: [PATCH] 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 --- js/misc/params.js | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/js/misc/params.js b/js/misc/params.js index 6878395e9..40dd9168e 100644 --- a/js/misc/params.js +++ b/js/misc/params.js @@ -1,7 +1,5 @@ // -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*- -const Lang = imports.lang; - // parse: // @params: caller-provided parameter object, or %null // @defaults-provided defaults object @@ -23,7 +21,6 @@ function parse(params = {}, defaults, allowExtras) { throw new Error(`Unrecognized parameter "${prop}"`); } - let defaultsCopy = {}; - Lang.copyProperties(defaults, defaultsCopy); + let defaultsCopy = Object.assign({}, defaults); return Object.assign(defaultsCopy, params); }