fix(tui): replace spread-into-push in Container.render() to prevent stack overflow, closes #2651
This commit is contained in:
@@ -2,6 +2,10 @@
|
|||||||
|
|
||||||
## [Unreleased]
|
## [Unreleased]
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
|
||||||
|
- Fixed `Container.render()` stack overflow on long sessions by replacing `Array.push(...spread)` with a loop-based push, preventing `RangeError: Maximum call stack size exceeded` when child output exceeds the V8 call stack argument limit ([#2651](https://github.com/badlogic/pi-mono/issues/2651))
|
||||||
|
|
||||||
## [0.66.1] - 2026-04-08
|
## [0.66.1] - 2026-04-08
|
||||||
|
|
||||||
## [0.66.0] - 2026-04-08
|
## [0.66.0] - 2026-04-08
|
||||||
|
|||||||
@@ -202,7 +202,10 @@ export class Container implements Component {
|
|||||||
render(width: number): string[] {
|
render(width: number): string[] {
|
||||||
const lines: string[] = [];
|
const lines: string[] = [];
|
||||||
for (const child of this.children) {
|
for (const child of this.children) {
|
||||||
lines.push(...child.render(width));
|
const childLines = child.render(width);
|
||||||
|
for (const line of childLines) {
|
||||||
|
lines.push(line);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return lines;
|
return lines;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user