* Processes stack record. * * @param {number} pc Program counter. * @param {number} func JS Function. * @param {string[]} stack String representation of a stack. * @return {number[]} Processed stack.
(pc, func, stack)
| 188 | * @return {number[]} Processed stack. |
| 189 | */ |
| 190 | processStack(pc, func, stack) { |
| 191 | const fullStack = func ? [pc, func] : [pc]; |
| 192 | let prevFrame = pc; |
| 193 | const length = stack.length; |
| 194 | for (let i = 0, n = length; i < n; ++i) { |
| 195 | const frame = stack[i]; |
| 196 | const firstChar = frame[0]; |
| 197 | if (firstChar === '+' || firstChar === '-') { |
| 198 | // An offset from the previous frame. |
| 199 | prevFrame += this.parseFrame(frame); |
| 200 | fullStack.push(prevFrame); |
| 201 | // Filter out possible 'overflow' string. |
| 202 | } else if (firstChar !== 'o') { |
| 203 | fullStack.push(this.parseFrame(frame)); |
| 204 | } else { |
| 205 | console.error(`Dropping unknown tick frame: ${frame}`); |
| 206 | } |
| 207 | } |
| 208 | return fullStack; |
| 209 | } |
| 210 | |
| 211 | /** |
| 212 | * Does a dispatch of a log record. |
no test coverage detected