mirror of
https://github.com/home-assistant/frontend.git
synced 2026-07-04 13:05:06 +01:00
e4cc1eaad2
computeCssVariable built its nested var() fallback chain with props.reverse(), which reverses the caller's array in place. Every current caller passes a freshly built array so there is no visible corruption today, but mutating an input parameter is a latent trap: a shared, memoized, or frozen array would produce wrong output or throw. Use reduceRight to build the same chain from last to first without mutating or copying the array. Output is unchanged. Add tests for computeCssVariable (including a no-mutation guarantee) and computeCssValue, which previously had no coverage.