const accessor: ServicesAccessor = {
get: <T>(id: ServiceIdentifier<T>) => {
if (_done) {
throw illegalState('service accessor is only valid during the invocation of its target method');
}
const result = this._getOrCreateServiceInstance(id, _trace);
if (!result) {
this._throwIfStrict(`[invokeFunction] unknown service '${id}'`, false);
}
return result;
};
return fn(accessor, ...args);