Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot read properties of undefined (reading '0') #129

Open
DearGaz opened this issue Mar 1, 2023 · 0 comments
Open

Cannot read properties of undefined (reading '0') #129

DearGaz opened this issue Mar 1, 2023 · 0 comments

Comments

@DearGaz
Copy link

DearGaz commented Mar 1, 2023

const context = {"a": 1};
const exp = "a.b[0] != null";
jexl.eval(context, exp);//Cannot read properties of undefined (reading '0')

i'm building a dynamic rule engine and jexl contributes a lot. Appreciating for jexl very much!
But there is a problem that has been bothering me for a long time. Just like the example code above:
the rule engine expects that "a.b[0] != null" should be false, but jexl throws an exception like the comment.
im wondering could jexl acts like lodash.get when he evals "a.b[0]" ? or any other suggestions?

Looking forward to your reply❤

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant