in src/main/java/org/apache/sling/scripting/sightly/impl/compiler/optimization/DeadCodeRemoval.java [69:86]
public void visit(VariableBinding.Start variableBindingStart) {
Boolean truthValue = null;
ExpressionNode node = variableBindingStart.getExpression();
if (node instanceof StringConstant) {
truthValue = ObjectModel.toBoolean(((StringConstant) node).getText());
}
if (node instanceof BooleanConstant) {
truthValue = ((BooleanConstant) node).getValue();
}
if (node instanceof NumericConstant) {
truthValue = ObjectModel.toBoolean(((NumericConstant) node).getValue());
}
if (node instanceof NullLiteral) {
truthValue = ObjectModel.toBoolean(null);
}
tracker.pushVariable(variableBindingStart.getVariableName(), truthValue);
outStream.write(variableBindingStart);
}