MCPcopy Create free account
hub / github.com/AutoHotkey/AutoHotkey / GetOwnPropDesc

Method GetOwnPropDesc

source/script_object.cpp:1462–1485  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1460}
1461
1462ResultType Object::GetOwnPropDesc(ResultToken &aResultToken, int aID, int aFlags, ExprTokenType *aParam[], int aParamCount)
1463{
1464 auto name = ParamIndexToString(0, _f_number_buf);
1465 if (!*name)
1466 _o_throw_param(0);
1467 auto field = FindField(name);
1468 if (!field)
1469 _o__ret(aResultToken.UnknownMemberError(ExprTokenType(this), IT_GET, name));
1470 auto desc = Object::Create();
1471 desc->SetInternalCapacity(1 + (field->symbol == SYM_DYNAMIC));
1472 if (field->symbol == SYM_DYNAMIC)
1473 {
1474 if (auto getter = field->prop->Getter()) desc->SetOwnProp(_T("Get"), getter);
1475 if (auto setter = field->prop->Setter()) desc->SetOwnProp(_T("Set"), setter);
1476 if (auto method = field->prop->Method()) desc->SetOwnProp(_T("Call"), method);
1477 }
1478 else
1479 {
1480 ExprTokenType value;
1481 field->ToToken(value);
1482 desc->SetOwnProp(_T("Value"), value);
1483 }
1484 _o_return(desc);
1485}
1486
1487
1488//

Callers

nothing calls this directly

Calls 8

ExprTokenTypeClass · 0.85
UnknownMemberErrorMethod · 0.80
SetInternalCapacityMethod · 0.80
GetterMethod · 0.80
SetOwnPropMethod · 0.80
SetterMethod · 0.80
MethodMethod · 0.80
ToTokenMethod · 0.45

Tested by

no test coverage detected