Subj : Re: Rhino bug in parseFloat with + or - To : Josh Gertzen From : Igor Bukanov Date : Thu Aug 12 2004 10:18 am That was fixed in Rhino CVS, see http://bugzilla.mozilla.org/show_bug.cgi?id=249471 Josh Gertzen wrote: > Hello, > > I believe I discovered a bug in Rhino's parseFloat implemenation. I'm > currently using 1.5R5. If you type parseFloat("+") or parseFloat("-") > within the console you'll get a StringIndexOutOfBoundsException. The > source is line 296 within the NativeGloba.js_parseFloat() method. The > cause is the following two lines of code: > > if (c == '+' || c == '-') > c = s.charAt(++i); > > If I understand it correctly, parseFloat should return NaN in this > situation. Therefore, to correct the problem, I changed those lines > to: > > if (c == '+' || c == '-') { > if (len == 1) > return ScriptRuntime.NaNobj; > > c = s.charAt(++i); > } > > Please let me know if this is wrong. > > Thanks, > > -Josh .