mirror of
https://github.com/zulip/zulip.git
synced 2025-11-04 14:03:30 +00:00
js: Convert self-referential vars to const.
ESLint won’t convert these automatically because it can’t rule out a
behavior difference arising from an access to a self-referential var
before it’s initialized:
> var x = (f => f())(() => x);
undefined
> let y = (f => f())(() => y);
Thrown:
ReferenceError: Cannot access 'y' before initialization
at repl:1:26
at repl:1:15
Signed-off-by: Anders Kaseorg <anders@zulipchat.com>
This commit is contained in:
committed by
Tim Abbott
parent
7ae84d5ce1
commit
02004c9b0f
@@ -375,7 +375,7 @@ function edit_message(row, raw_content) {
|
||||
// Do this right away, rather than waiting for the timer to do its first update,
|
||||
// since otherwise there is a noticeable lag
|
||||
message_edit_countdown_timer.text(timer_text(seconds_left));
|
||||
var countdown_timer = setInterval(function () {
|
||||
const countdown_timer = setInterval(function () {
|
||||
seconds_left -= 1;
|
||||
if (seconds_left <= 0) {
|
||||
clearInterval(countdown_timer);
|
||||
|
||||
Reference in New Issue
Block a user