MCPcopy Create free account
hub / github.com/HaxeFoundation/hxcpp / __SetField

Method __SetField

src/hx/Anon.cpp:259–284  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

257
258
259hx::Val Anon_obj::__SetField(const String &inName,const hx::Val &inValue, hx::PropertyAccess inCallProp)
260{
261 int slot = findFixed(inName);
262 if (slot>=0)
263 {
264 #ifdef HXCPP_GC_GENERATIONAL
265 VariantKey *fixed = getFixed() + slot;
266 fixed->value=inValue;
267 if (fixed->value.type <= cpp::Variant::typeString)
268 HX_OBJ_WB_GET(this, fixed->value.valObject);
269 #else
270 getFixed()[slot].value=inValue;
271 #endif
272 return inValue;
273 }
274
275 // TODO - fixed
276 if (!mFields.mPtr)
277 {
278 mFields = hx::FieldMapCreate();
279 HX_OBJ_WB_GET(this, mFields.mPtr);
280 }
281
282 __string_hash_set(HX_MAP_THIS_ mFields,inName,inValue,true);
283 return inValue;
284}
285
286Anon_obj *Anon_obj::Add(const String &inName,const Dynamic &inValue,bool inSetThisPointer)
287{

Callers

nothing calls this directly

Calls 2

getFixedFunction · 0.85
FieldMapCreateFunction · 0.85

Tested by

no test coverage detected