steveH wrote:
> Rhino evaluates "test" || 1 as true, rather than 1.
I think the result of
"test" || 1
should be the value of the first operand, that is the string value
"test" as that when converted to a boolean value already gives true so
the or condition is already fullfilled.
With Rhino 1.6 R2 I get
Rhino 1.6 release 2 2005 09 19
js> "test" || 1
true
so
>Is this a bug
yes, it is a bug. I have filed it here:
<https://bugzilla.mozilla.org/show_bug.cgi?id=309957>
--
Martin Honnen
http://JavaScript.FAQTs.com/