[
https://issues.apache.org/jira/browse/SLING-8860?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Radu Cotescu resolved SLING-8860.
---------------------------------
Resolution: Fixed
Implemented in [commit
a972a36|https://github.com/apache/sling-org-apache-sling-scripting-sightly-compiler/commit/a972a36]
and [commit
923db43|https://github.com/apache/sling-htl-maven-plugin/commit/923db43].
> 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
> Priority: Major
> Fix For: HTL Compiler 1.2.2-1.4.0, HTL Maven Plugin 1.3.2-1.4.0
>
> Time Spent: 20m
> Remaining Estimate: 0h
>
> 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)