You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Dmitri Blinov (Jira)" <ji...@apache.org> on 2019/11/11 11:48:00 UTC

[jira] [Comment Edited] (JEXL-307) Variable redeclaration option

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

Dmitri Blinov edited comment on JEXL-307 at 11/11/19 11:47 AM:
---------------------------------------------------------------

Regarding Options API cleanup - what is the purpose of having lexical option both at context level and at parsing level? I mean its easy to get in trouble by, for example, parsing the script in non-lexical mode and later executing it with lexical option enabled. I haven't tested this mix, but sure there will be unexpected results... Should we better bind this to the script whether it was in lexical mode or not at parsing time?


was (Author: dmitri_blinov):
Regarding Options API cleanup - what is the purpose of having lexical option both at context level and at parsing level? I mean its easy to get in trouble by, for example parsing, the script in lon-lexical mode and later executing it with lexical option enabled. I haven't tested this mix, but sure there will be unexpected results... Should we better bind this to the script whether it was in lexical mode or not at parsing time?

> 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)