Skip to content

Commit 8c5b8bf

Browse files
committed
Change let to const
1 parent d5b0615 commit 8c5b8bf

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

JavaScript/7-spin-lock.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ class Mutex {
1616
enter() {
1717
return new Promise(resolve => {
1818
const tryEnter = () => {
19-
let prev = Atomics.exchange(this.lock, 0, LOCKED);
19+
const prev = Atomics.exchange(this.lock, 0, LOCKED);
2020
if (prev === UNLOCKED) {
2121
this.owner = true;
2222
resolve();

JavaScript/8-async.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ class Mutex {
3131

3232
tryEnter() {
3333
if (!this.resolve) return;
34-
let prev = Atomics.exchange(this.lock, 0, LOCKED);
34+
const prev = Atomics.exchange(this.lock, 0, LOCKED);
3535
if (prev === UNLOCKED) {
3636
this.owner = true;
3737
this.trying = false;
@@ -59,7 +59,7 @@ class Thread {
5959
next.postMessage(kind);
6060
}
6161
}
62-
})
62+
});
6363
}
6464
}
6565

0 commit comments

Comments
 (0)