Skip to content
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
- Fixed unbounded parser cache growth in long-running instances that process many distinct formulas, including when undo is disabled. [#1635](https://github.com/handsontable/hyperformula/issues/1635)
- Fixed array formulas spilling past the `maxRows` and `maxColumns` limits: they now return `#SPILL!` when their result extends beyond the sheet edge. [#1774](https://github.com/handsontable/hyperformula/pull/1774)
- Fixed the `ADDRESS` function adding the sheet separator (`!`) when the `sheetName` argument is an empty argument slot (e.g. `=ADDRESS(2,3,1,FALSE(),)` now returns `R2C3` instead of `!R2C3`), while an explicit `""` still adds it. [#1641](https://github.com/handsontable/hyperformula/issues/1641)
- Fixed `IMSUM`, `IMPRODUCT` and `TEXTJOIN` throwing an uncaught `RangeError` for very large ranges, such as `=IMSUM(A1:D40000)`, which stopped the recalculation; they now return a result or an error value in the cell. [#1901](https://github.com/handsontable/hyperformula/pull/1901)

## [3.5.0] - 2026-10-09

Expand Down
1 change: 1 addition & 0 deletions hyperformula/dev-docs/INTERPRETER.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@

- **Coerce through `ArithmeticHelper`.** Never write ad-hoc string-to-number or value-to-boolean conversion inside a function; the coercion rules are spreadsheet semantics, not JavaScript semantics, and they are already implemented once.
- **Errors are values.** Return a `CellError` with a message from `hyperformula/src/error-message.ts`. Do not throw: a thrown error escapes the evaluation of one cell and takes the recalculation with it.
- **Never spread a range's values into a call.** `push(...values)` and `Math.max(...values)` pass one argument per value, and a range or array of about 125,000 values (Node 24, default stack size) throws `RangeError: Maximum call stack size exceeded` out of the recalculation. Append in a loop.
- **The registry is keyed by id, not by implementation.** A custom plugin can be registered over a built-in id. Do not assume the plugin you are reading is the one that will answer for that id at run time.
- **Evaluate each argument once.** Evaluating the same argument twice doubles its cost and, when it contains a volatile function such as `RAND`, can see two different values.
- **This is the hot path.** `Interpreter.evaluateAst` runs once per formula, and once per cell for array-broadcast arguments. Allocation inside a per-cell loop is measurable.
Expand Down
4 changes: 3 additions & 1 deletion hyperformula/src/interpreter/ArithmeticHelper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,9 @@ export class ArithmeticHelper {
if (arr instanceof CellError) {
return arr
} else {
expandedVals.push(...arr)
for (const value of arr) {
expandedVals.push(value)
}
}
} else {
expandedVals.push(val)
Expand Down
4 changes: 3 additions & 1 deletion hyperformula/src/interpreter/plugin/TextPlugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -544,7 +544,9 @@ export class TextPlugin extends FunctionPlugin implements FunctionPluginTypechec
if (coerced instanceof CellError) {
return coerced
}
texts.push(...coerced)
for (const text of coerced) {
texts.push(text)
}
}

const parts = ignoreEmpty ? texts.filter((t) => t !== '') : texts
Expand Down
Loading