| 760 | |
| 761 | |
| 762 | ResultType Var::AssignSkipAddRef(IObject *aValueToAssign) |
| 763 | { |
| 764 | if (mType == VAR_ALIAS) |
| 765 | return mAliasFor->AssignSkipAddRef(aValueToAssign); |
| 766 | |
| 767 | if (mType == VAR_VIRTUAL) |
| 768 | { |
| 769 | auto result = AssignVirtual(ExprTokenType(aValueToAssign)); |
| 770 | aValueToAssign->Release(); // Caller wanted us to take responsibility for this. |
| 771 | return result; |
| 772 | } |
| 773 | |
| 774 | Free(); // If var contains an object, this will Release() it. It will also clear any string contents and free memory if appropriate. |
| 775 | |
| 776 | // Already done by Free() above: |
| 777 | //mAttrib &= ~(VAR_ATTRIB_OFTEN_REMOVED | VAR_ATTRIB_UNINITIALIZED); |
| 778 | |
| 779 | _SetObject(aValueToAssign); |
| 780 | |
| 781 | return OK; |
| 782 | } |
| 783 | |
| 784 | |
| 785 |
no test coverage detected