Closed Bug 501972 Opened 15 years ago Closed 15 years ago

parseFloat doesn't correctly trim leading white spaces

Categories

(Rhino Graveyard :: Core, defect)

x86
Linux
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: mguillemot, Unassigned)

Details

Attachments

(1 file)

User-Agent:       Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.0.11) Gecko/2009060308 Ubuntu/9.04 (jaunty) Firefox/3.0.11
Build Identifier: 

According to ECMA spec, parseFloat should trim leading spaces, among others \n but following for instance returns NaN:
parseFloat(" \n7.89")

Reproducible: Always
Patched, thanks!

Checking in src/org/mozilla/javascript/NativeGlobal.java;
/cvsroot/mozilla/js/rhino/src/org/mozilla/javascript/NativeGlobal.java,v  <--  NativeGlobal.java
new revision: 1.84; previous revision: 1.83
done
RCS file: /cvsroot/mozilla/js/rhino/testsrc/org/mozilla/javascript/tests/GlobalParseXTest.java,v
done
Checking in testsrc/org/mozilla/javascript/tests/GlobalParseXTest.java;
/cvsroot/mozilla/js/rhino/testsrc/org/mozilla/javascript/tests/GlobalParseXTest.java,v  <--  GlobalParseXTest.java
initial revision: 1.1
done
Status: UNCONFIRMED → RESOLVED
Closed: 15 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: