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 2023/08/30 14:35:00 UTC
[jira] [Resolved] (JEXL-404) Support array-access safe navigation (x?[y])
[ https://issues.apache.org/jira/browse/JEXL-404?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Henri Biestro resolved JEXL-404.
--------------------------------
Resolution: Fixed
Turned issue into enhancement and added syntax.
Commit [589b088|https://github.com/apache/commons-jexl/commit/589b0888142541085714bbd7b0fc7e3615ae2727].
> Support array-access safe navigation (x?[y])
> --------------------------------------------
>
> Key: JEXL-404
> URL: https://issues.apache.org/jira/browse/JEXL-404
> Project: Commons JEXL
> Issue Type: Improvement
> Affects Versions: 3.3
> Reporter: Xu Pengcheng
> Assignee: Henri Biestro
> Priority: Major
> Fix For: 3.3.1
>
>
> The same way the expression a?.b shortcuts evaluation and returns null if a is null, this enhancement is to have the equivalent a?['b'] return null for the same reason.
> Code example:
> {code:java}
> var a = {:};
> a.b; // ok
> a['b']; // ok
> a?.b; // ok
> a?['b']; // 3.3 - parsing error in ';' {code}
> with new JexlBuilder().safe(false).strict(true)
>
> Thanks!
--
This message was sent by Atlassian Jira
(v8.20.10#820010)