| 175 | } |
| 176 | |
| 177 | _init(uid, type, triggerAsyncId, handle) { |
| 178 | const activity = { |
| 179 | uid, |
| 180 | type, |
| 181 | triggerAsyncId, |
| 182 | // In some cases (e.g. Timeout) the handle is a function, thus the usual |
| 183 | // `typeof handle === 'object' && handle !== null` check can't be used. |
| 184 | handleIsObject: handle instanceof Object, |
| 185 | handle, |
| 186 | }; |
| 187 | this._stamp(activity, 'init'); |
| 188 | this._activities.set(uid, activity); |
| 189 | this._maybeLog(uid, type, 'init'); |
| 190 | this.oninit(uid, type, triggerAsyncId, handle); |
| 191 | } |
| 192 | |
| 193 | _before(uid) { |
| 194 | const h = this._getActivity(uid, 'before'); |