| 1460 | } |
| 1461 | |
| 1462 | ResultType 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 | // |
nothing calls this directly
no test coverage detected