Skip to content

Commit 1bc3284

Browse files
authored
Add valueOf Check
1 parent ec111ff commit 1bc3284

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/lambda-calculus.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -417,4 +417,4 @@ function printStackTrace(error, term, stack) {
417417
console.error( stack.slice(stackCutoff).reverse().map( v => `\twhile evaluating ${ v }`).join('\n') );
418418
}
419419

420-
Object.defineProperty( Function.prototype, "valueOf", { value: function valueOf() { return toInt(this); } } );
420+
Object.defineProperty( Function.prototype, "valueOf", { value: function valueOf() { if (this.term) return toInt(this); else return this; } } );

0 commit comments

Comments
 (0)