[ 
https://issues.apache.org/jira/browse/JEXL-307?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16977341#comment-16977341
 ] 

Henri Biestro commented on JEXL-307:
------------------------------------

The story could read as: as a script developer, I need a controllable migration 
path from 3.1 to 3.2 by being able to turn the lexical/shade/antish flags 
on/off from scripts.

This can not be achieved through features since these apply at parsing time; 
this is readily achieved through pragmas. Some script devs want to manipulate 
these at runtime (through contextually exposed options and not only pragmas) so 
they can, from their end, automate +non-regression testing+ ; this feature +is+ 
considered pretty +useful+.

I'm adding a unit test to illustrate their use case. Hopefully, this will make 
you embrace the usefulness of the current design.

> Variable redeclaration option
> -----------------------------
>
>                 Key: JEXL-307
>                 URL: https://issues.apache.org/jira/browse/JEXL-307
>             Project: Commons JEXL
>          Issue Type: New Feature
>    Affects Versions: 3.1
>            Reporter: Dmitri Blinov
>            Assignee: Henri Biestro
>            Priority: Minor
>             Fix For: 3.2
>
>
> As of now, JEXL allows a script writer to redeclare a local variable during 
> script evaluation.
> {code:java}
> var a = 1; var a = 2;{code}
> This may lead to potential errors with misspelled names and clashed 
> variables. Checking for already defined variable is a common feature of many 
> languages. This feature can be implemented in JEXL as an additional option of 
> JexlFeatures class, enabled by default, thus allowing compatibility with 
> existing code.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to