// Create JSValueObject as a shallow copy of 'other'. public static JSValueObject CopyFrom(IReadOnlyDictionary <string, JSValue> other) { JSValueObject obj = new JSValueObject(); foreach (var keyValue in other) { obj.Add(keyValue.Key, keyValue.Value); } return(obj); }
private static JSValueObject InternalReadObjectFrom(IJSValueReader reader) { var jsObject = new JSValueObject(); while (reader.GetNextObjectProperty(out string propertyName)) { jsObject.Add(propertyName, InternalReadFrom(reader)); } return(jsObject); }