Radu Cotescu created SLING-8860: ----------------------------------- Summary: Issue a warning when data-sly-test is passed a constant value for evaluation Key: SLING-8860 URL: https://issues.apache.org/jira/browse/SLING-8860 Project: Sling Issue Type: Improvement Components: Scripting Reporter: Radu Cotescu Assignee: Radu Cotescu Fix For: HTL Compiler 1.2.2-1.4.0, HTL Maven Plugin 1.3.2-1.4.0
The {{data-sly-test}} plugin should issue a warning every time it's passed a constant value (including an empty expression which translated into a {{NullLiteral}}) or a concatenation operation for evaluation - the former is redundant, whereas the latter doesn't make sense and could potentially be a typo: {code:html} <!-- Examples that should generate warnings--> <span data-sly-test="${0}">if true</span> <!-- number literal --> <span data-sly-test="${'a'}">if true</span> <!-- string literal --> <span data-sly-test="${}">if true</span> <!-- empty expression, null literal --> <span data-sly-test="${[1, 2, 3]}">if true</span> <!-- array literal --> <span data-sly-test="${properties}}">if true</span> <!-- concatenation --> {code} -- This message was sent by Atlassian Jira (v8.3.4#803005)