mirror of
https://github.com/zulip/zulip.git
synced 2025-11-06 06:53:25 +00:00
zjsunit: Replace add_extensions with Object.assign.
Signed-off-by: Anders Kaseorg <anders@zulipchat.com>
This commit is contained in:
committed by
Tim Abbott
parent
940ff9e95f
commit
19f7c6f012
@@ -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.
|
||||||
//
|
//
|
||||||
|
|||||||
Reference in New Issue
Block a user