Skip to content

Add option to use inaccessible accumulator var#1097

Merged
jnthntatum merged 2 commits into
cel-expr:masterfrom
jnthntatum:restrict-accu-var
Jan 7, 2025
Merged

Add option to use inaccessible accumulator var#1097
jnthntatum merged 2 commits into
cel-expr:masterfrom
jnthntatum:restrict-accu-var

Conversation

@jnthntatum

@jnthntatum jnthntatum commented Dec 17, 2024

Copy link
Copy Markdown
Collaborator

Add an option to use @result as the accumulator variable for builtin comprehensions. The current default __result__ is accessible in the CEL Source, allowing for expressions to type check but lead to unexpected or incorrect results. @result' isn't a normally accessible identifier in the source expression so a bit safer as a default.

@jnthntatum
jnthntatum force-pushed the restrict-accu-var branch 3 times, most recently from 690e79c to dc1bbd5 Compare December 17, 2024 21:39
@jnthntatum
jnthntatum marked this pull request as ready for review December 17, 2024 22:07
Add an option to use '@Result' as the accumulator variable for builtin
comprehensions. The current default "__result__" is accesible in the CEL
Source, allowing for expressions to type check but lead to unexpected or
incorrect results. '@Result' isn't a normally accessible identifier in the
source expression so a bit safer as a default.
@jnthntatum
jnthntatum merged commit fa6eb32 into cel-expr:master Jan 7, 2025
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 this pull request may close these issues.

2 participants