| 8938 | |
| 8939 | |
| 8940 | ResultType GetObjectIntProperty(IObject *aObject, LPTSTR aPropName, __int64 &aValue, ResultToken &aResultToken, bool aOptional) |
| 8941 | { |
| 8942 | FuncResult result_token; |
| 8943 | ExprTokenType this_token = aObject; |
| 8944 | |
| 8945 | auto result = aObject->Invoke(result_token, IT_GET, aPropName, this_token, nullptr, 0); |
| 8946 | |
| 8947 | if (result_token.symbol != SYM_INTEGER) |
| 8948 | { |
| 8949 | result_token.Free(); |
| 8950 | if (result == FAIL || result == EARLY_EXIT) |
| 8951 | { |
| 8952 | aResultToken.SetExitResult(result); |
| 8953 | return FAIL; |
| 8954 | } |
| 8955 | if (result != INVOKE_NOT_HANDLED) // Property exists but is not an integer. |
| 8956 | return aResultToken.Error(ERR_TYPE_MISMATCH, aPropName, ErrorPrototype::Type); |
| 8957 | //aValue = 0; // Caller should set default value for these cases. |
| 8958 | if (!aOptional) |
| 8959 | return aResultToken.UnknownMemberError(ExprTokenType(aObject), IT_GET, aPropName); |
| 8960 | return result; // Let caller know it wasn't found. |
| 8961 | } |
| 8962 | |
| 8963 | aValue = result_token.value_int64; |
| 8964 | return OK; |
| 8965 | } |
| 8966 | |
| 8967 | ResultType SetObjectIntProperty(IObject *aObject, LPTSTR aPropName, __int64 aValue, ResultToken &aResultToken) |
| 8968 | { |
no test coverage detected