[Laszlo-dev] semantics of || (or) in rhino -- tricky

P T Withington ptw at pobox.com
Fri Jun 23 18:20:17 EDT 2006


On 2006-06-23, at 17:37 EDT, P T Withington wrote:

> On 2006-06-23, at 17:22 EDT, Benjamin Shine wrote:

[...]

>> [ben at linux-builder vendor]$ java -jar /home/ben/lib/rhino1_6R2/js.jar
>> Rhino 1.6 release 2 2005 09 19
>> js> print (undefined || 2)
>> true
>>
>> Right now we run our lztests with rhino 1.5R3. The orbit branch is
>> developing with rhino 1.6R2 or 1.6pre3. Tucker, which semantics are
>> correct?
>
> Rhino 1.6 has a bug.  ||  should coerce its first operand to a  
> boolean and test if it is true.  undefined is defined to coerce to  
> false.  Better send them a bug report!

Fixed in 1.6r3:

https://bugzilla.mozilla.org/show_bug.cgi?id=309957

[Later]

Which has not yet been released.  Hm.  Wonder if we need to work  
around this in the compiler?


More information about the Laszlo-dev mailing list