MCPcopy Index your code
hub / github.com/nodejs/node / traceSync

Method traceSync

lib/diagnostics_channel.js:517–535  ·  view source on GitHub ↗
(fn, context = { __proto__: null }, thisArg, ...args)

Source from the content-addressed store, hash-verified

515 }
516
517 traceSync(fn, context = { __proto__: null }, thisArg, ...args) {
518 if (!this.hasSubscribers) {
519 return ReflectApply(fn, thisArg, args);
520 }
521
522 const { error } = this;
523
524 // eslint-disable-next-line no-unused-vars
525 using scope = this.#callWindow.withScope(context);
526 try {
527 const result = ReflectApply(fn, thisArg, args);
528 context.result = result;
529 return result;
530 } catch (err) {
531 context.error = err;
532 error.publish(context);
533 throw err;
534 }
535 }
536
537 tracePromise(fn, context = { __proto__: null }, thisArg, ...args) {
538 if (!this.hasSubscribers) {

Calls 2

withScopeMethod · 0.45
publishMethod · 0.45

Tested by

no test coverage detected