@@ -154,19 +154,19 @@ func handleAtom(a schema.Atom, tr schema.TypeRef, ah atomHandler) ValidationErro
154154}
155155
156156// Returns the list, or an error. Reminder: nil is a valid list and might be returned.
157- func listValue (a * value.ValueFreelist , val value.Value ) (value.List , error ) {
157+ func listValue (a value.Allocator , val value.Value ) (value.List , error ) {
158158 if val .IsNull () {
159159 // Null is a valid list.
160160 return nil , nil
161161 }
162162 if ! val .IsList () {
163163 return nil , fmt .Errorf ("expected list, got %v" , val )
164164 }
165- return a . AsList ( val ), nil
165+ return val . AsListInto ( a ), nil
166166}
167167
168168// Returns the map, or an error. Reminder: nil is a valid map and might be returned.
169- func mapValue (a * value.ValueFreelist , val value.Value ) (value.Map , error ) {
169+ func mapValue (a value.Allocator , val value.Value ) (value.Map , error ) {
170170 if val == nil {
171171 return nil , fmt .Errorf ("expected map, got nil" )
172172 }
@@ -177,10 +177,10 @@ func mapValue(a *value.ValueFreelist, val value.Value) (value.Map, error) {
177177 if ! val .IsMap () {
178178 return nil , fmt .Errorf ("expected map, got %v" , val )
179179 }
180- return a . AsMap ( val ), nil
180+ return val . AsMapInto ( a ), nil
181181}
182182
183- func keyedAssociativeListItemToPathElement (a * value.ValueFreelist , list * schema.List , index int , child value.Value ) (fieldpath.PathElement , error ) {
183+ func keyedAssociativeListItemToPathElement (a value.Allocator , list * schema.List , index int , child value.Value ) (fieldpath.PathElement , error ) {
184184 pe := fieldpath.PathElement {}
185185 if child .IsNull () {
186186 // For now, the keys are required which means that null entries
@@ -191,7 +191,7 @@ func keyedAssociativeListItemToPathElement(a *value.ValueFreelist, list *schema.
191191 return pe , errors .New ("associative list with keys may not have non-map elements" )
192192 }
193193 keyMap := value.FieldList {}
194- m := a . AsMap ( child )
194+ m := child . AsMapInto ( a )
195195 defer a .Free (m )
196196 for _ , fieldName := range list .Keys {
197197 if val , ok := m .Get (fieldName ); ok {
0 commit comments