feat(parser): change Parser to return null when one of the operands is null
This commit is contained in:
@ -86,19 +86,7 @@ export class Binary extends AST {
|
||||
var right = this.right.eval(context, formatters);
|
||||
|
||||
// Null check for the operations.
|
||||
if (left == null || right == null) {
|
||||
switch (this.operation) {
|
||||
case '+':
|
||||
if (left != null) return left;
|
||||
if (right != null) return right;
|
||||
return 0;
|
||||
case '-':
|
||||
if (left != null) return left;
|
||||
if (right != null) return 0 - right;
|
||||
return 0;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
if (left == null || right == null) return null;
|
||||
|
||||
switch (this.operation) {
|
||||
case '+' : return autoConvertAdd(left, right);
|
||||
|
Reference in New Issue
Block a user