Exemple #1
0
 public EcmaArray ToPartArray(EcmaPropertyKey annotationProperty, string[] annotations)
 {
     Guard.ArgumentNotNull(annotations, "annotations");
     if (annotations.Length != parts.Length)
     {
         throw new ArgumentException("Supplied array must have the same length of part array", "unitAnnotations");
     }
     return(new EcmaArray(parts.Select((v, i) => {
         RuntimeObject obj = v.ToValue().ToObject();
         if (annotations[i] != null)
         {
             obj.CreateDataPropertyOrThrow(annotationProperty, annotations[i]);
         }
         return obj.ToValue();
     }).ToArray()));
 }