public static string join(ExecutionContext GLOBAL, object selfOb, string sep) { JSObjectBase self = (JSObjectBase)selfOb; List <string> strings = new List <string>(); int idx; for (idx = 0; idx < JSObject.ToNumber(GLOBAL, self.GetItem(GLOBAL, "length").GetValue(GLOBAL)); idx++) { string istr = idx.ToString(); if (self.HasOwnProperty(istr) && self.GetItem(GLOBAL, istr).GetValue(GLOBAL) != null) { strings.Add(JSObject.ToPrimitive(GLOBAL, self.GetItem(GLOBAL, istr).GetValue(GLOBAL))); } else { strings.Add(""); } } return(string.Join(sep, strings.ToArray())); }