Bug in jsrt::expr_lte
Status: Alpha
Brought to you by:
metal_hurlant
The following code looks suspicious:
static function expr_lte($a, $b) {
$v = jsrt::cmp($b, $a);
if ($v == jsrt::$true or $v == jsrt::$undefined) return jsrt::$false;
return $v;
}
If $v is TRUE then expr_lte returns FALSE. On the other hand, when $v is FALSE it returns $v that is FALSE. Looks like this function returns FALSE in any case.
The following patch for jsrt.php (v1.1, 2005-07-07) corrected the less-than-or-equal operator for me (see 11.8.3 of ECMA-262 3rd edition):
631c631
< return $v;
---
> return jsrt::$true;
And the following patch for jsrt.php (v1.1, 2005-07-07) corrected the greater-than-or-equal operator for me (see 11.8.4 of ECMA-262 3rd edition):
636c636
< return $v;
---
> return jsrt::$true;