77 * @flow
88 */
99
10- import type { ReactDebugInfo , ReactComponentInfo } from 'shared/ReactTypes' ;
10+ import type {
11+ ReactDebugInfo ,
12+ ReactComponentInfo ,
13+ ReactStackTrace ,
14+ } from 'shared/ReactTypes' ;
1115
1216export const IO_NODE = 0 ;
1317export const PROMISE_NODE = 1 ;
@@ -22,7 +26,7 @@ type PromiseWithDebugInfo = interface extends Promise<any> {
2226export type IONode = {
2327 tag : 0 ,
2428 owner : null | ReactComponentInfo ,
25- stack : Error , // callsite that spawned the I/O
29+ stack : ReactStackTrace , // callsite that spawned the I/O
2630 debugInfo : null , // not used on I/O
2731 start : number , // start time when the first part of the I/O sequence started
2832 end : number , // we typically don't use this. only when there's no promise intermediate.
@@ -34,7 +38,7 @@ export type PromiseNode = {
3438 tag : 1 ,
3539 owner : null | ReactComponentInfo ,
3640 debugInfo : null | ReactDebugInfo , // forwarded debugInfo from the Promise
37- stack : Error , // callsite that created the Promise
41+ stack : ReactStackTrace , // callsite that created the Promise
3842 start : number , // start time when the Promise was created
3943 end : number , // end time when the Promise was resolved.
4044 awaited : null | AsyncSequence , // the thing that ended up resolving this promise
@@ -45,7 +49,7 @@ export type AwaitNode = {
4549 tag : 2 ,
4650 owner : null | ReactComponentInfo ,
4751 debugInfo : null | ReactDebugInfo , // forwarded debugInfo from the Promise
48- stack : Error , // callsite that awaited (using await, .then(), Promise.all(), ...)
52+ stack : ReactStackTrace , // callsite that awaited (using await, .then(), Promise.all(), ...)
4953 start : number , // when we started blocking. This might be later than the I/O started.
5054 end : number , // when we unblocked. This might be later than the I/O resolved if there's CPU time.
5155 awaited : null | AsyncSequence , // the promise we were waiting on
@@ -56,7 +60,7 @@ export type UnresolvedPromiseNode = {
5660 tag : 3 ,
5761 owner : null | ReactComponentInfo ,
5862 debugInfo : WeakRef < PromiseWithDebugInfo > , // holds onto the Promise until we can extract debugInfo when it resolves
59- stack : Error , // callsite that created the Promise
63+ stack : ReactStackTrace , // callsite that created the Promise
6064 start : number , // start time when the Promise was created
6165 end : - 1.1 , // set when we resolve.
6266 awaited : null | AsyncSequence , // the thing that ended up resolving this promise
@@ -67,7 +71,7 @@ export type UnresolvedAwaitNode = {
6771 tag : 4 ,
6872 owner : null | ReactComponentInfo ,
6973 debugInfo : WeakRef < PromiseWithDebugInfo > , // holds onto the Promise until we can extract debugInfo when it resolves
70- stack : Error , // callsite that awaited (using await, .then(), Promise.all(), ...)
74+ stack : ReactStackTrace , // callsite that awaited (using await, .then(), Promise.all(), ...)
7175 start : number , // when we started blocking. This might be later than the I/O started.
7276 end : - 1.1 , // set when we resolve.
7377 awaited : null | AsyncSequence , // the promise we were waiting on
0 commit comments