#449 Incorrect optimization of boolean() and not()

v8.6.1
closed
Michael Kay
5
2012-10-08
2005-12-23
Michael Kay
No

Incorrect optimizations are applied to the functions
boolean() and not() in the case where the argument is a
value comparison. This dates from an earlier version of
the spec in which a value comparison never returned an
empty sequence.

The optimization causes boolean() to be treated as a
no-op in this situation, whereas it should actually
convert () to false(); similarly not() inverts the
condition (for example, [not(A gt B)] becomes [A le B])
whereas it should return true() if either operand is ().

Source code fixed.

Discussion