| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 95eb1c2 commit a9fad85
1 file changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -21,7 +21,6 @@ const { | |||
| 21 | 21 | executionAsyncId, | |
| 22 | 22 | triggerAsyncId, | |
| 23 | 23 | // Private API | |
| 24 | - hasAsyncIdStack, | ||
| 25 | 24 | getHookArrays, | |
| 26 | 25 | enableHooks, | |
| 27 | 26 | disableHooks, | |
@@ -172,14 +171,13 @@ class AsyncResource { | |||
| 172 | 171 | runInAsyncScope(fn, thisArg, ...args) { | |
| 173 | 172 | const asyncId = this[async_id_symbol]; | |
| 174 | 173 | emitBefore(asyncId, this[trigger_async_id_symbol]); | |
| 175 | - try { | ||
| 176 | - if (thisArg === undefined) | ||
| 177 | - return fn(...args); | ||
| 178 | - return ReflectApply(fn, thisArg, args); | ||
| 179 | - } finally { | ||
| 180 | - if (hasAsyncIdStack()) | ||
| 181 | - emitAfter(asyncId); | ||
| 182 | - } | ||
| 174 | + | ||
| 175 | + const ret = thisArg === undefined ? | ||
| 176 | + fn(...args) : | ||
| 177 | + ReflectApply(fn, thisArg, args); | ||
| 178 | + | ||
| 179 | + emitAfter(asyncId); | ||
| 180 | + return ret; | ||
| 183 | 181 | } | |
| 184 | 182 | ||
| 185 | 183 | emitDestroy() { | |
| Back | FazBrowse Home | New Git URL |
0 commit comments