zjsunit: Replace add_extensions with Object.assign.

Signed-off-by: Anders Kaseorg <anders@zulipchat.com>
This commit is contained in:
Anders Kaseorg
2020-02-06 02:52:12 +00:00
committed by Tim Abbott
parent 940ff9e95f
commit 19f7c6f012

View File

@@ -398,17 +398,11 @@ exports.make_zjquery = function (opts) {
// Our fn structure helps us simulate extending jQuery. // Our fn structure helps us simulate extending jQuery.
const fn = {}; const fn = {};
function add_extensions(obj) {
_.each(fn, (v, k) => {
obj[k] = v;
});
}
function new_elem(selector) { function new_elem(selector) {
const elem = exports.make_new_elem(selector, { const elem = exports.make_new_elem(selector, {
silent: opts.silent, silent: opts.silent,
}); });
add_extensions(elem); Object.assign(elem, fn);
// Create a proxy handler to detect missing stubs. // Create a proxy handler to detect missing stubs.
// //