(StarlarkThread.Frame fr, BinaryOperatorExpression binop)
| 606 | } |
| 607 | |
| 608 | private static Object evalBinaryOperator(StarlarkThread.Frame fr, BinaryOperatorExpression binop) |
| 609 | throws EvalException, InterruptedException { |
| 610 | Object x = eval(fr, binop.getX()); |
| 611 | // AND and OR require short-circuit evaluation. |
| 612 | switch (binop.getOperator()) { |
| 613 | case AND: |
| 614 | return Starlark.truth(x) ? eval(fr, binop.getY()) : x; |
| 615 | case OR: |
| 616 | return Starlark.truth(x) ? x : eval(fr, binop.getY()); |
| 617 | default: |
| 618 | Object y = eval(fr, binop.getY()); |
| 619 | try { |
| 620 | return EvalUtils.binaryOp(binop.getOperator(), x, y, fr.thread); |
| 621 | } catch (EvalException ex) { |
| 622 | fr.setErrorLocation(binop.getOperatorLocation()); |
| 623 | throw ex; |
| 624 | } |
| 625 | } |
| 626 | } |
| 627 | |
| 628 | private static Object evalConditional(StarlarkThread.Frame fr, ConditionalExpression cond) |
| 629 | throws EvalException, InterruptedException { |
no test coverage detected