Skip to main content

property_item

Function property_item 

Source
pub fn property_item<A: IVm>(k: String<A>, v: Any<A>) -> ObjectItem<A>
Expand description

A property entry, k: v in {k: v, ...o}. A computed key uses property_item(key.to_string()?, value), establishing its string conversion before the value argument is evaluated. The VM has no symbols, so Any::to_string supplies ToPropertyKey for its values. A plain object becomes "[object Object]"; an own callable toString supplies the primitive, with valueOf as the fallback if needed. A throw or failure to produce a primitive propagates before the value starts.