MCPcopy Index your code
hub / github.com/NativeScript/NativeScript / profileMethodNamed

Function profileMethodNamed

packages/core/profiling/index.ts:225–240  ·  view source on GitHub ↗
(name: string)

Source from the content-addressed store, hash-verified

223};
224
225function profileMethodNamed(name: string): MethodDecorator {
226 return (target, key, descriptor: PropertyDescriptor) => {
227 // save a reference to the original method this way we keep the values currently in the
228 // descriptor and don't overwrite what another decorator might have done to the descriptor.
229 if (descriptor === undefined) {
230 descriptor = Object.getOwnPropertyDescriptor(target, key);
231 }
232 const originalMethod = descriptor.value;
233
234 //editing the descriptor/value parameter
235 descriptor.value = profileFunctionFactory(originalMethod, name);
236
237 // return edited descriptor as opposed to overwriting the descriptor
238 return descriptor;
239 };
240}
241
242const voidMethodDecorator = () => {
243 // no op

Callers 1

profileFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected