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

Method ReturnRef

source/script_object.cpp:1690–1710  ·  view source on GitHub ↗

Return value, knowing Variant will be kept around. Copying of value can be skipped.

Source from the content-addressed store, hash-verified

1688// Return value, knowing Variant will be kept around.
1689// Copying of value can be skipped.
1690void Object::Variant::ReturnRef(ResultToken &result)
1691{
1692 switch (result.symbol = symbol) // Assign.
1693 {
1694 case SYM_STRING:
1695 result.marker = string;
1696 result.marker_length = string.Length();
1697 break;
1698 case SYM_OBJECT:
1699 object->AddRef();
1700 result.object = object;
1701 break;
1702 case SYM_MISSING:
1703 result.SetValue(_T(""), 0);
1704 break;
1705 //case SYM_INTEGER:
1706 //case SYM_FLOAT:
1707 default:
1708 result.value_int64 = n_int64; // Union copy.
1709 }
1710}
1711
1712// Return value, knowing Variant will shortly be deleted.
1713// Value may be moved from Variant into ResultToken.

Callers 1

InvokeMethod · 0.80

Calls 3

SetValueMethod · 0.80
LengthMethod · 0.45
AddRefMethod · 0.45

Tested by

no test coverage detected