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

Function profile

packages/core/profiling/index.ts:246–284  ·  view source on GitHub ↗
(nameFnOrTarget?: string | Function | Object, fnOrKey?: Function | string | symbol, descriptor?: PropertyDescriptor, attrs?: any)

Source from the content-addressed store, hash-verified

244};
245
246export function profile(nameFnOrTarget?: string | Function | Object, fnOrKey?: Function | string | symbol, descriptor?: PropertyDescriptor, attrs?: any): any {
247 if (typeof nameFnOrTarget === 'object' && (typeof fnOrKey === 'string' || typeof fnOrKey === 'symbol')) {
248 if (!profileFunctionFactory) {
249 return;
250 }
251
252 return profileMethodUnnamed(nameFnOrTarget, fnOrKey, descriptor);
253 } else if (typeof nameFnOrTarget === 'function' && (typeof fnOrKey === 'string' || typeof fnOrKey === 'symbol')) {
254 if (!profileFunctionFactory) {
255 return;
256 }
257
258 return profileStaticMethodUnnamed(nameFnOrTarget, fnOrKey, descriptor);
259 } else if (typeof nameFnOrTarget === 'string' && typeof fnOrKey === 'function') {
260 if (!profileFunctionFactory) {
261 return fnOrKey;
262 }
263
264 return profileFunction(fnOrKey, nameFnOrTarget);
265 } else if (typeof nameFnOrTarget === 'function') {
266 if (!profileFunctionFactory) {
267 return nameFnOrTarget;
268 }
269
270 return profileFunction(nameFnOrTarget);
271 } else if (typeof nameFnOrTarget === 'string') {
272 if (!profileFunctionFactory) {
273 return voidMethodDecorator;
274 }
275
276 return profileMethodNamed(nameFnOrTarget);
277 } else {
278 if (!profileFunctionFactory) {
279 return voidMethodDecorator;
280 }
281
282 return profileMethodUnnamed;
283 }
284}
285
286export function dumpProfiles(): void {
287 profileNames.forEach(function (name) {

Callers 6

index.tsFile · 0.90
buildTemplateMethod · 0.90
index.tsFile · 0.90
TestClassClass · 0.90
profiling-tests.tsFile · 0.90
style-scope.tsFile · 0.85

Calls 4

profileMethodUnnamedFunction · 0.85
profileFunctionFunction · 0.85
profileMethodNamedFunction · 0.85

Tested by

no test coverage detected