import{test,afterAll}from'vitest';const trace=[];const foreign={tag:'foreign'};let assertion,local,task,phase='collection';function method(){trace.push({phase,kind:'invoke',receiver:this===assertion?'assertion':this===foreign?'foreign':typeof this});return this;}function exercise(){const value=assertion.toEqual;trace.push({phase,kind:'reads',sameMethod:value===method,sameDescriptor:Object.getOwnPropertyDescriptor(assertion,'toEqual').value===method,direct:assertion.toEqual()===assertion,call:value.call(assertion)===assertion,bound:value.bind(assertion)()===assertion,foreign:value.call(foreign)===foreign,extracted:value()===undefined});}test('owned function receiver source',context=>{phase='body';local=context.expect;task=context.task;assertion=local('owned');Object.defineProperty(assertion,'toEqual',{configurable:true,writable:true,value:method});exercise();});afterAll(()=>{phase='afterAll';exercise();console.log('DECLARATION_FN:'+JSON.stringify({kind:'owned-function-receivers',trace,count:local.getState().assertionCalls,state:task.result?.state??null}));});
