Skip to content

Commit 85f4674

Browse files
committed
Fixing more lints
1 parent d631f67 commit 85f4674

File tree

2 files changed

+13
-15
lines changed

2 files changed

+13
-15
lines changed

src/javascript/lib/core/functions.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,10 @@ function map_to_object(map, options = []) {
9595

9696
const object = {};
9797

98-
for (let [key, value] of map.entries()) {
98+
for (const entry of map.entries()) {
99+
let key = entry[0];
100+
const value = entry[1];
101+
99102
if (opt_keys === Symbol.for('string') && typeof key === 'number') {
100103
key = key.toString();
101104
} else if (

src/javascript/lib/core/special_forms.js

Lines changed: 9 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ function cond(...clauses) {
1616

1717
function run_list_generators(generator, generators) {
1818
if (generators.length === 0) {
19-
return generator.map(x => {
19+
return generator.map((x) => {
2020
if (Array.isArray(x)) {
2121
return x;
2222
}
@@ -36,29 +36,24 @@ function run_list_generators(generator, generators) {
3636
}
3737

3838
function _for(expression, generators, collectable_protocol, into = []) {
39-
let [result, fun] = collectable_protocol.into(into);
39+
const [result, fun] = collectable_protocol.into(into);
40+
let accumulatingResult = result;
4041

4142
const generatedValues = run_list_generators(generators.pop()(), generators);
4243

4344
for (const value of generatedValues) {
4445
if (expression.guard.apply(this, value)) {
45-
result = fun(
46-
result,
47-
new Core.Tuple(Symbol.for('cont'), expression.fn.apply(this, value))
46+
accumulatingResult = fun(
47+
accumulatingResult,
48+
new Core.Tuple(Symbol.for('cont'), expression.fn.apply(this, value)),
4849
);
4950
}
5051
}
5152

52-
return fun(result, Symbol.for('done'));
53+
return fun(accumulatingResult, Symbol.for('done'));
5354
}
5455

55-
function _try(
56-
do_fun,
57-
rescue_function,
58-
catch_fun,
59-
else_function,
60-
after_function
61-
) {
56+
function _try(do_fun, rescue_function, catch_fun, else_function, after_function) {
6257
let result = null;
6358

6459
try {
@@ -153,7 +148,7 @@ function receive(clauses, timeout = 0, timeoutFn = () => true) {
153148
clause.pattern,
154149
messages[i],
155150
clause.guard,
156-
NOMATCH
151+
NOMATCH,
157152
);
158153

159154
if (value !== NOMATCH) {

0 commit comments

Comments
 (0)