Skip to content

Commit 2484b90

Browse files
author
Johan Wiltink
committed
bugfix
1 parent 904147f commit 2484b90

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/lambda-calculus.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -340,7 +340,7 @@ function evalLC(term) {
340340
// callback function which will evaluate term.body in an env with the input
341341
function result(arg) {
342342
let argEnv;
343-
if ( arg.term && arg.env ) ({ term: arg, env: argEnv } = arg); // if callback is passed another callback, or a term
343+
if ( arg?.term && arg?.env ) ({ term: arg, env: argEnv } = arg); // if callback is passed another callback, or a term
344344
const termVal = new Tuple( typeof arg !== 'number' ? arg : fromInt(arg) , new Env(argEnv) );
345345
return runEval( new Tuple(term.body, new Env(env).setThunk(term.name, termVal)), stack );
346346
}

0 commit comments

Comments
 (0)