diff options
author | Tom Sepez <tsepez@chromium.org> | 2016-01-20 11:34:01 -0800 |
---|---|---|
committer | Tom Sepez <tsepez@chromium.org> | 2016-01-20 11:34:01 -0800 |
commit | f13d510cf267c27f4c123494de67670ec201cedc (patch) | |
tree | 2b5e279bef4fb9eb4a3a7e963cae93c65bc80fba /testing | |
parent | b196c7bebad66c9938d2705ccf64961bcdd774e2 (diff) | |
download | pdfium-f13d510cf267c27f4c123494de67670ec201cedc.tar.xz |
Bugs in CJS_PublicMethods::ParseNumber().
Fix the bugs by removing ParseNumber() entirely.
For PDFium's JavaScript bindings, we want to get out of the
numeric conversion business and inflict that on V8 as
possible, avoiding platform-specific issue in strtod().
For other uses, there is a FX_atof() which is similarly
buggy, but we can consolidate the use. Add an overloaded
FX_atof() to handle wide strings more simply.
BUG=pdfium:361
R=jochen@chromium.org
Review URL: https://codereview.chromium.org/1586203006 .
Diffstat (limited to 'testing')
-rw-r--r-- | testing/resources/javascript/bug_361_expected.txt | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/testing/resources/javascript/bug_361_expected.txt b/testing/resources/javascript/bug_361_expected.txt index f7f7a562bb..04d72bce20 100644 --- a/testing/resources/javascript/bug_361_expected.txt +++ b/testing/resources/javascript/bug_361_expected.txt @@ -12,31 +12,31 @@ Alert: Answer for " 4 Alert: Answer for "4 3 2 1" is: string 4 3 2 1 Alert: Answer for "-4" is: number -4 Alert: Answer for "23.00000001" is: number 23.00000001 -Alert: Answer for "23.00000000000000001" is: number 0 +Alert: Answer for "23.00000000000000001" is: number 23 Alert: Answer for "4e+25" is: number 4e+25 -Alert: Answer for "40000000000000000000000000" is: number 0 -Alert: Answer for "25,5" is: number 25.5 +Alert: Answer for "40000000000000000000000000" is: number 4e+25 +Alert: Answer for "25,5" is: string 25,5 Alert: Answer for "1e+5" is: number 100000 -Alert: Answer for "1e5" is: number 1 +Alert: Answer for "1e5" is: number 100000 Alert: Answer for "1e-5" is: number 0.00001 Alert: Answer for "-1e-5" is: number -0.00001 -Alert: Answer for "1.2e5" is: number 1.2 -Alert: Answer for "Infinity" is: string Infinity -Alert: Answer for "Infinity" is: string Infinity +Alert: Answer for "1.2e5" is: number 120000 +Alert: Answer for "Infinity" is: number Infinity +Alert: Answer for "Infinity" is: number Infinity Alert: Answer for "INFINITY" is: string INFINITY Alert: Answer for "INF" is: string INF -Alert: Answer for "NaN" is: string NaN -Alert: Answer for "NaN" is: string NaN +Alert: Answer for "NaN" is: number NaN +Alert: Answer for "NaN" is: number NaN Alert: Answer for "NAN" is: string NAN -Alert: Answer for "0x100" is: string 0x100 +Alert: Answer for "0x100" is: number 256 Alert: Answer for "0x100.1" is: string 0x100.1 Alert: Answer for "0x100,1" is: string 0x100,1 Alert: Answer for "0x100x1" is: string 0x100x1 Alert: Answer for "123x6" is: string 123x6 Alert: Answer for "123xy6" is: string 123xy6 Alert: Answer for "123.y6" is: string 123.y6 -Alert: Answer for "1,000,000" is: number 1 -Alert: Answer for "1.2.3" is: number 1.2 +Alert: Answer for "1,000,000" is: string 1,000,000 +Alert: Answer for "1.2.3" is: string 1.2.3 Alert: Answer for "1-3" is: string 1-3 Alert: Answer for "1+3" is: string 1+3 Alert: Answer for "1.-3" is: string 1.-3 |