You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Henri Biestro (Jira)" <ji...@apache.org> on 2019/10/27 13:02:00 UTC

[jira] [Resolved] (JEXL-307) Variable redeclaration option

     [ https://issues.apache.org/jira/browse/JEXL-307?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Henri Biestro resolved JEXL-307.
--------------------------------
    Resolution: Fixed

Changeset: d15901734478efeac605d3dc55c4b25a479c28d4
Author:    henrib <he...@apache.org>
Date:      2019-10-27 13:59
Message:   JEXL-307: added lexical and lexical shade option;
JEXL-307: added lexical feature, controlling var redefinition at parsing time;
JEXL-307: refactored option (JexlOption) and added feature to deal with lexical scope;
JEXL-307: refactored test code to use new option classes;
JEXL-307: added lexical scope and frame handling interpreting scripts, lambdas, for-loops;
JEXL-314: changed JexlArithmetic/Interpreter to handle NullOperand exception when needed

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