The value of the literal can be negative. For example:

var i = 0xffff

iValue will be <0. In this case, we check the absolute value against the negative limit (i.e. 32768). Otherwise, the positive limit is used (i.e. 32767). This is what was already used if a TOKEN_OP_NEG is in front of the literal.