Skip to content

armgit / zulip

Public Imported from GitHub
0

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.

node_tests: Revert wrong conversion of some functions to arrows.

Anders Kaseorg174fa0a33117
diff --git a/frontend_tests/node_tests/compose_ui.js b/frontend_tests/node_tests/compose_ui.js
index 937c39bf029..87b1250522b 100644
--- a/frontend_tests/node_tests/compose_ui.js
+++ b/frontend_tests/node_tests/compose_ui.js
@@ -39,7 +39,7 @@ function make_textbox(s) {
widget.s = s;
widget.focused = false;
- widget.caret = (arg) => {
+ widget.caret = function (arg) {
if (typeof arg === "number") {
widget.pos = arg;
return this;
@@ -58,7 +58,7 @@ function make_textbox(s) {
return widget.pos;
};
- widget.val = (new_val) => {
+ widget.val = function (new_val) {
if (new_val) {
widget.s = new_val;
return this;
@@ -66,7 +66,7 @@ function make_textbox(s) {
return widget.s;
};
- widget.trigger = (type) => {
+ widget.trigger = function (type) {
if (type === "focus") {
widget.focused = true;
} else if (type === "blur") {
@@ -95,7 +95,7 @@ run_test("autosize_textarea", (override) => {
run_test("insert_syntax_and_focus", () => {
$("#compose-textarea").val("xyz ");
- $("#compose-textarea").caret = (syntax) => {
+ $("#compose-textarea").caret = function (syntax) {
if (syntax !== undefined) {
$("#compose-textarea").val($("#compose-textarea").val() + syntax);
return this;
diff --git a/frontend_tests/node_tests/composebox_typeahead.js b/frontend_tests/node_tests/composebox_typeahead.js
index d488f793698..add29aa43c7 100644
--- a/frontend_tests/node_tests/composebox_typeahead.js
+++ b/frontend_tests/node_tests/composebox_typeahead.js
@@ -313,7 +313,7 @@ run_test("content_typeahead_selected", () => {
};
let caret_called1 = false;
let caret_called2 = false;
- fake_this.$element.caret = (...args) => {
+ fake_this.$element.caret = function (...args) {
if (args.length === 0) {
// .caret() used in split_at_cursor
caret_called1 = true;