(tid, scope)
| 203 | let callsSeen = 0; |
| 204 | |
| 205 | function beginFollow(tid, scope) { |
| 206 | const d = (depthByTid.get(tid) || 0) + 1; |
| 207 | depthByTid.set(tid, d); |
| 208 | if (d > 1 && CONFIG.maxDepthFollow) return; // already following at outer frame |
| 209 | |
| 210 | const state = { scope, count: 0, dropped: 0 }; |
| 211 | stateByTid.set(tid, state); |
| 212 | try { |
| 213 | Stalker.follow(tid, { |
| 214 | events: eventsConfig(), |
| 215 | onReceive(events) { drainEvents(tid, state, events); }, |
| 216 | }); |
| 217 | } catch (e) { |
| 218 | console.log(`${C.red}[fstalk] follow ${tid} failed: ${e}${C.reset}`); |
| 219 | } |
| 220 | } |
| 221 | |
| 222 | function endFollow(tid) { |
| 223 | const d = (depthByTid.get(tid) || 0) - 1; |
no test coverage detected