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

Method run

lib/internal/async_local_storage/async_hooks.js:106–124  ·  view source on GitHub ↗
(store, callback, ...args)

Source from the content-addressed store, hash-verified

104 }
105
106 run(store, callback, ...args) {
107 // Avoid creation of an AsyncResource if store is already active
108 if (ObjectIs(store, this.getStore())) {
109 return ReflectApply(callback, null, args);
110 }
111
112 this._enable();
113
114 const resource = executionAsyncResource();
115 const oldStore = resource[this.kResourceStore];
116
117 resource[this.kResourceStore] = store;
118
119 try {
120 return ReflectApply(callback, null, args);
121 } finally {
122 resource[this.kResourceStore] = oldStore;
123 }
124 }
125
126 exit(callback, ...args) {
127 if (!this.enabled) {

Callers 3

mainFunction · 0.95
buildAsyncLocalStorageFunction · 0.95
mainFunction · 0.95

Calls 3

getStoreMethod · 0.95
_enableMethod · 0.95
executionAsyncResourceFunction · 0.85

Tested by

no test coverage detected