| 1804 | } |
| 1805 | |
| 1806 | void fx_WeakRef(txMachine* the) |
| 1807 | { |
| 1808 | txSlot* target; |
| 1809 | txSlot* instance; |
| 1810 | if (!mxHasTarget) |
| 1811 | mxTypeError("call: WeakRef"); |
| 1812 | if (mxArgc < 1) |
| 1813 | mxTypeError("no target"); |
| 1814 | target = fxCanBeHeldWeakly(the, mxArgv(0)); |
| 1815 | if (!target) |
| 1816 | mxTypeError("target: not an object"); |
| 1817 | mxPushSlot(mxTarget); |
| 1818 | fxGetPrototypeFromConstructor(the, &mxWeakRefPrototype); |
| 1819 | instance = fxNewWeakRefInstance(the); |
| 1820 | mxPullSlot(mxResult); |
| 1821 | fxKeepDuringJobs(the, target); |
| 1822 | instance->next->value.weakRef.target = target; |
| 1823 | } |
| 1824 | |
| 1825 | void fx_WeakRef_prototype_deref(txMachine* the) |
| 1826 | { |
nothing calls this directly
no test coverage detected