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

Dmitri Blinov commented on JEXL-307:
------------------------------------

Please don't get me wrong, I'm very grateful for all what you have been doing, 
but as a thought - now we are adding a new option to mitigate other options. 
Options are great to be changed on the fly, for example - there is nothing 
wrong to use different calculation precision or rounding mode in one part of 
the script, thats why we did it configurable via context in 3.1. But lexical 
option is another story - in my opinion the ability to enable/disable lexical 
option is pretty much useless. May be its better to have it as a lexical 
feature with a level - runtime/syntax?

> 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