Skip to content

Commit 451ee10

Browse files
authored
Merge pull request #88 from JohanWiltink/main
fix #87
2 parents 4a5a892 + 751795e commit 451ee10

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

src/lambda-calculus.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -392,10 +392,9 @@ function evalLC(term) {
392392
env = lastEnv;
393393
} else { // lastTerm is a JS function
394394
const res = lastTerm(term);
395-
if ( res.term ) {
396-
({term, env} = res);
397-
if ( ! env ) env = new Env;
398-
} else
395+
if ( res?.term )
396+
( {term, env=new Env} = res );
397+
else
399398
term = res;
400399
}
401400
}

0 commit comments

Comments
 (0)