[Bug]: An array literal with a large array element throws "Maximum call stack size exceeded"
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Aptitud para principiantes
- 74/100
- Tipo de issue
- Error
- Claridad
- Bien especificado
- Estado de actividad
- Activo
- Stack tecnológico
- node.js, typescript
Línea de trabajo
Start with Interpreter.ts and the ARRAY branch of Interpreter.evaluateAst at the listed lines 266, 269, 278, and 280. Check how large arrays are passed to push() and run the relevant evaluator tests with the supplied 40,000-row formula. Done means the array literal evaluates without a RangeError and the formula cell can be read.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Description
An array literal with a large array as an element throws a RangeError from buildFromArray and setCellContents:
const data = Array.from({length: 40000}, () => [1])
data[0].push('=SUM({VSTACK(A1:A40000,A1:A40000,A1:A40000,A1:A40000)})')
HyperFormula.buildFromArray(data, {licenseKey: 'gpl-v3'})
// RangeError: Maximum call stack size exceeded
Without the braces, =SUM(VSTACK(A1:A40000,A1:A40000,A1:A40000,A1:A40000)) returns 160000, as the equivalent formula does in Microsoft Excel Online. In Node.js 22 the error starts at about 125,000 rows or columns in one element. After it is thrown by setCellContents, the formula is stored, but reading the cell throws Value of the formula cell is not computed.
Cause: the ARRAY branch of Interpreter.evaluateAst spreads element arrays into push() (Interpreter.ts:266, :269, :278 and :280). Each spread passes one argument per row or value, and large arrays exceed the JavaScript engine's limit on the number of arguments in a call.
Expected: the array literal is built for any size that the other array functions accept.
Video or screenshots
N/A
Demo
Code snippet in the description.
HyperFormula version
3.5.0 (also develop at ec7512d21)
Your framework
None (Node.js)
Your environment
Node.js 22.23.4 on Linux
- Lenguaje dominante
- TypeScript
- Estrellas
- 2.8k
- Forks
- 175
- Merge medio
- 2 d 5 h
- PR fusionados (30 d)
- 23
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de handsontable/hyperformula
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
handsontable/hyperformula#1803 ·
Los mantenedores suelen responder en 1 día
-
numberToSimpleDate returns day 0 for 31 December of some years when leapYear1900 is truePosiblemente ocupada Un pull request vinculado a esta issue está abierto o ya se fusionó. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 85/100
handsontable/hyperformula#1793 ·
Los mantenedores suelen responder en 1 día
-
Bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 84/100
handsontable/hyperformula#1745 ·
Los mantenedores suelen responder en 1 día
-
Bug Impact: Low
Dificultad 1/5 1-3 horas Aptitud para principiantes 68/100
handsontable/hyperformula#1641 ·
Los mantenedores suelen responder en 1 día
-
Bug
Dificultad 3/5 1-2 días Aptitud para principiantes 67/100
handsontable/hyperformula#1877 ·
Los mantenedores suelen responder en 1 día
Todos los issues de handsontable/hyperformula
Issues similares
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 88/100
Los mantenedores suelen responder en 1 día
-
pending close triaging
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
anomalyco/opencode#62582 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
feature request
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
callstack/react-native-paper#5189 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
live-codes/livecodes#1079 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Add: ESP 2 ROAbiertoapproved check:passed streams:add
Dificultad 2/5 1-3 horas Aptitud para principiantes 66/100
Los mantenedores suelen responder en 1 día