(operandHandler)
| 989 | * @returns {BasicEvaluatedExpression | undefined} the evaluated expression |
| 990 | */ |
| 991 | const handleConstOperation = (operandHandler) => { |
| 992 | const left = this.evaluateExpression(expr.left); |
| 993 | if (!left.isCompileTimeValue()) return; |
| 994 | |
| 995 | const right = this.evaluateExpression(expr.right); |
| 996 | if (!right.isCompileTimeValue()) return; |
| 997 | |
| 998 | const result = operandHandler( |
| 999 | /** @type {T} */ (left.asCompileTimeValue()), |
| 1000 | /** @type {T} */ (right.asCompileTimeValue()) |
| 1001 | ); |
| 1002 | return valueAsExpression( |
| 1003 | result, |
| 1004 | expr, |
| 1005 | left.couldHaveSideEffects() || right.couldHaveSideEffects() |
| 1006 | ); |
| 1007 | }; |
| 1008 | |
| 1009 | /** |
| 1010 | * Helper function to determine if two booleans are always different. This is used in `handleStrictEqualityComparison` |
nothing calls this directly
no test coverage detected