diff --git a/frontend_tests/zjsunit/zjquery.js b/frontend_tests/zjsunit/zjquery.js index 509cdf902f..3ece134d58 100644 --- a/frontend_tests/zjsunit/zjquery.js +++ b/frontend_tests/zjsunit/zjquery.js @@ -6,6 +6,9 @@ const noop = function () {}; class Event { constructor(type, props) { + if (!(this instanceof Event)) { + return new Event(type, props); + } this.type = type; Object.assign(this, props); } @@ -518,7 +521,7 @@ exports.make_zjquery = function (opts) { return res; }; - zjquery.Event = (type, props) => new Event(type, props); + zjquery.Event = Event; fn.after = function (s) { return s;