dropbear
dropbear copied to clipboard
Evaluate function fails if node.value is falsy
Using 0 in a function, e.g. max
, evaluates to NaN
. Entering 0 in the REPL as a value expression evaluates to undefined
. Empty string also evaluates to undefined.
I fixed it in my local copy by simply adding checks for 0 and an empty string to the evaluate function:
if (node.value) {
return node.value;
} else if (node.value === 0) {
return 0;
} else if (node.value === '') {
return '""';
}
I guess I could submit a pull request, but I really just wanted to make sure you were aware in case you decided to redo this workshop or put it on somewhere else.