public static EcmaValue DefineProperty(EcmaValue target, EcmaValue property, EcmaValue attributes) { Guard.ArgumentIsObject(target); RuntimeObject obj = target.ToObject(); obj.DefinePropertyOrThrow(EcmaPropertyKey.FromValue(property), EcmaPropertyDescriptor.FromValue(attributes)); return(target); }
public static EcmaValue DefineProperties(EcmaValue target, EcmaValue properties) { Guard.ArgumentIsObject(target); RuntimeObject dst = target.ToObject(); foreach (EcmaPropertyEntry e in properties.ToObject().GetEnumerableOwnProperties(true)) { dst.DefinePropertyOrThrow(e.Key, EcmaPropertyDescriptor.FromValue(e.Value)); } return(target); }