Files
effectcraft/crates/expr
vangel76 b33f5f62a8 Expressions: a function declaration ends at its brace, so a next line starting with '-' is a new statement (#3212)
The array-math rewrite folded `function f(x){…}\n-50 + 100` into
`__add(__sub(function f(x){…}, 50), 100)`: the declaration became a function
expression operand, the result was NaN and the property fell back to its
static value. In ECMAScript an expression statement cannot start with
`function`, so at statement start it is a FunctionDeclaration that ends at
its `}`. The rewriter now emits a function in statement position as a
declaration on its own and never as an operand of what follows; function
expressions (after `=`, `(`, `,`, `:`, `return` …) stay operands.

The empty expressionError for evaluation errors is tracked in #3219.

Fixes #3212
2026-11-07 13:58:35 +01:00
..