It seems in the nunjucks expression language NaN and Infinity can't be parsed as constants and instead are parsed as references to (usually) undefined properties.
This means that when an expression is output like {{ Infinity }} it outputs nothing. Whereas {{ 1 / 0 }} outputs Infinity. This shows that Infinity can still arise as a value but can't be expressed as a literal.
Likewise, {{ NaN }} outputs nothing where {{ +'asdf' }} outputs NaN.
To fix this, we should remove these literals from the expression parser.
It seems in the nunjucks expression language
NaN
andInfinity
can't be parsed as constants and instead are parsed as references to (usually) undefined properties.This means that when an expression is output like
{{ Infinity }}
it outputs nothing. Whereas{{ 1 / 0 }}
outputsInfinity
. This shows thatInfinity
can still arise as a value but can't be expressed as a literal.Likewise,
{{ NaN }}
outputs nothing where{{ +'asdf' }}
outputsNaN
.To fix this, we should remove these literals from the expression parser.