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

Expression.some does not work #183

Open
adrianmroz opened this issue Aug 1, 2019 · 0 comments · May be fixed by #184
Open

Expression.some does not work #183

adrianmroz opened this issue Aug 1, 2019 · 0 comments · May be fixed by #184

Comments

@adrianmroz
Copy link

Expression.some does not work properly.

Examples:

const e1 = Expression.parse("$main.countDistinct($user)");
const e2 = Expression.parse("$main.countDistinct($user) * 100");

Check:

e1.some(e => e instanceof CountDistinctExpression); // returns true
e2.some(e => e instanceof CountDistinctExpression); // returns false

That's because here:

return (v == null) ? null : !v;

we always return some boolean, and inside:

if (pass != null) {

we early return if we get non-null value. So everyHelper doesn't recurse and can't find correct expression nested.

@adrianmroz adrianmroz linked a pull request Aug 1, 2019 that will close this issue
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

Successfully merging a pull request may close this issue.

1 participant