Skip to content

Commit 739208a

Browse files
Craig SpaethCraig Spaeth
authored andcommitted
Use spread operator to fix cond function
1 parent 242fd39 commit 739208a

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/javascript/lib/core/special_forms.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ function _case(condition, clauses) {
44
return Core.Patterns.defmatch(...clauses)(condition);
55
}
66

7-
function cond(clauses) {
7+
function cond(...clauses) {
88
for (const clause of clauses) {
99
if (clause[0]) {
1010
return clause[1]();

src/javascript/tests/cond.spec.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ test('cond', t => {
1010
[true, () => 'This will'],
1111
];
1212

13-
const result = SpecialForms.cond(clauses);
13+
const result = SpecialForms.cond(...clauses);
1414

1515
t.is(result, 'This will');
1616
});

0 commit comments

Comments
 (0)