(config: DebugInfoConfig, ioInfo)
| 45 | } |
| 46 | |
| 47 | function normalizeIOInfo(config: DebugInfoConfig, ioInfo) { |
| 48 | const {debugTask, debugStack, debugLocation, ...copy} = ioInfo; |
| 49 | if (ioInfo.stack) { |
| 50 | copy.stack = config.useV8Stack |
| 51 | ? formatV8Stack(ioInfo.stack) |
| 52 | : normalizeStack(ioInfo.stack); |
| 53 | } |
| 54 | if (ioInfo.owner) { |
| 55 | copy.owner = normalizeDebugInfo(config, ioInfo.owner); |
| 56 | } |
| 57 | if (typeof ioInfo.start === 'number' && config.useFixedTime) { |
| 58 | copy.start = 0; |
| 59 | } |
| 60 | if (typeof ioInfo.end === 'number' && config.useFixedTime) { |
| 61 | copy.end = 0; |
| 62 | } |
| 63 | const promise = ioInfo.value; |
| 64 | if (promise) { |
| 65 | promise.then(); // init |
| 66 | if (promise.status === 'fulfilled') { |
| 67 | if (ioInfo.name === 'RSC stream') { |
| 68 | copy.byteSize = 0; |
| 69 | copy.value = { |
| 70 | value: 'stream', |
| 71 | }; |
| 72 | } else { |
| 73 | copy.value = { |
| 74 | value: promise.value, |
| 75 | }; |
| 76 | } |
| 77 | } else if (promise.status === 'rejected') { |
| 78 | copy.value = { |
| 79 | reason: promise.reason, |
| 80 | }; |
| 81 | } else { |
| 82 | copy.value = { |
| 83 | status: promise.status, |
| 84 | }; |
| 85 | } |
| 86 | } |
| 87 | return copy; |
| 88 | } |
| 89 | |
| 90 | function normalizeDebugInfo(config: DebugInfoConfig, original) { |
| 91 | const {debugTask, debugStack, debugLocation, ...debugInfo} = original; |
no test coverage detected