hmmm.  We're using the latest binary you can download... I believe
it's 1.6R7

could you try

function foo( param ) {
    return (param || 0);
}

foo();

thanks

On Jan 15, 10:27 pm, Norris Boyd <[EMAIL PROTECTED]> wrote:
> On Jan 15, 8:50 am, "Tiest Vilee" <[EMAIL PROTECTED]> wrote:
>
>
>
> > We are getting JSLint to work in Rhino so it can be part of our check-in
> > process.  We found two places where JSLint doesn't work, and both are of
> > the form -
>
> > var i = (variableName || 0);
>
> > The intent being that, if the variableName is falsey then i defaults to
> > 0.
>
> > This doesn't happen, instead 'i' gets an undefined value, resulting in
> > errors.
>
> > So it seems to me that there is a bug in Rhino.  I believe that if all
> > the values in a list of OR'ed values are falsey, then the last value
> > should be returned.
>
> > Am I correct?  Has this bug been addressed in a more recent version of
> > Rhino?
>
> > I look forward to your replies,
> > Tiest
>
> Works for me in the latest CVS and in the released 1.6R7:
>
> js> var variableName = false;
> js> var i = (variableName || 0);
> js> i
> 0
>
> I don't remember this being a bug in prior versions; seems like a
> pretty basic thing. What version are you on?
>
> --N

_______________________________________________
dev-tech-js-engine-rhino mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-tech-js-engine-rhino

Reply via email to