MCPcopy Index your code
hub / github.com/getsentry/sentry-javascript / setResult

Method setResult

packages/core/src/utils/syncpromise.ts:161–175  ·  view source on GitHub ↗
(state: State, value?: T | PromiseLike<T> | any)

Source from the content-addressed store, hash-verified

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);

Callers

nothing calls this directly

Calls 3

_executeHandlersMethod · 0.95
isThenableFunction · 0.90
thenMethod · 0.45

Tested by

no test coverage detected