(state: State, value?: T | PromiseLike<T> | any)
| 159 | /** Run the executor for the SyncPromise. */ |
| 160 | private _runExecutor(executor: Executor<T>): void { |
| 161 | const setResult = (state: State, value?: T | PromiseLike<T> | any): void => { |
| 162 | if (this._state !== STATE_PENDING) { |
| 163 | return; |
| 164 | } |
| 165 | |
| 166 | if (isThenable(value)) { |
| 167 | void (value as PromiseLike<T>).then(resolve, reject); |
| 168 | return; |
| 169 | } |
| 170 | |
| 171 | this._state = state; |
| 172 | this._value = value; |
| 173 | |
| 174 | this._executeHandlers(); |
| 175 | }; |
| 176 | |
| 177 | const resolve = (value: unknown): void => { |
| 178 | setResult(STATE_RESOLVED, value); |
nothing calls this directly
no test coverage detected