Bump CEL to 0.11.2

This commit is contained in:
Joe Betz
2022-03-24 11:34:14 -04:00
parent e7845861a5
commit 4c90653d19
139 changed files with 2688 additions and 1637 deletions

View File

@@ -677,7 +677,19 @@ func (m *evalMap) Eval(ctx Activation) ref.Val {
}
func (m *evalMap) InitVals() []Interpretable {
return append(m.keys, m.vals...)
if len(m.keys) != len(m.vals) {
return nil
}
result := make([]Interpretable, len(m.keys)+len(m.vals))
idx := 0
for i, k := range m.keys {
v := m.vals[i]
result[idx] = k
idx++
result[idx] = v
idx++
}
return result
}
func (m *evalMap) Type() ref.Type {
@@ -852,7 +864,7 @@ func (fold *evalFold) Cost() (min, max int64) {
iMax + aMax + cMax*rangeCnt + sMax*rangeCnt + rMax
}
// Optional Intepretable implementations that specialize, subsume, or extend the core evaluation
// Optional Interpretable implementations that specialize, subsume, or extend the core evaluation
// plan via decorators.
// evalSetMembership is an Interpretable implementation which tests whether an input value
@@ -969,7 +981,7 @@ func (e *evalWatchConstQual) Qualify(vars Activation, obj interface{}) (interfac
return out, err
}
// QualifierValueEquals tests whether the incoming value is equal to the qualificying constant.
// QualifierValueEquals tests whether the incoming value is equal to the qualifying constant.
func (e *evalWatchConstQual) QualifierValueEquals(value interface{}) bool {
qve, ok := e.ConstantQualifier.(qualifierValueEquator)
return ok && qve.QualifierValueEquals(value)