Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(412)

Issue 1586203006: Bugs in CJS_PublicMethods::ParseNumber() (Closed)

Created:
4 years, 11 months ago by Tom Sepez
Modified:
4 years, 11 months ago
CC:
pdfium-reviews_googlegroups.com, Lei Zhang, Tom Bergan
Base URL:
https://pdfium.googlesource.com/pdfium.git@master
Target Ref:
refs/heads/master
Visibility:
Public.

Description

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 Committed: https://pdfium.googlesource.com/pdfium/+/f13d510cf267c27f4c123494de67670ec201cedc

Patch Set 1 #

Total comments: 1

Patch Set 2 : Dead Code #

Patch Set 3 : Remove entirely, pass "NaN" as NaN. #

Total comments: 5
Unified diffs Side-by-side diffs Delta from patch set Stats (+97 lines, -272 lines) Patch
M core/include/fxcrt/fx_string.h View 1 2 2 chunks +8 lines, -3 lines 0 comments Download
M fpdfsdk/src/javascript/Field.cpp View 3 chunks +8 lines, -42 lines 0 comments Download
M fpdfsdk/src/javascript/JS_Value.h View 1 chunk +5 lines, -0 lines 2 comments Download
M fpdfsdk/src/javascript/JS_Value.cpp View 1 2 4 chunks +20 lines, -10 lines 0 comments Download
M fpdfsdk/src/javascript/PublicMethods.h View 1 2 1 chunk +0 lines, -9 lines 0 comments Download
M fpdfsdk/src/javascript/PublicMethods.cpp View 1 2 4 chunks +44 lines, -196 lines 3 comments Download
M testing/resources/javascript/bug_361_expected.txt View 1 2 1 chunk +12 lines, -12 lines 0 comments Download

Messages

Total messages: 17 (7 generated)
Tom Sepez
Jochen, pls review the usage of V8.
4 years, 11 months ago (2016-01-15 21:34:46 UTC) #4
Tom Bergan
This is much cleaner than parsing strings. https://codereview.chromium.org/1586203006/diff/1/testing/resources/javascript/bug_361_expected.txt File testing/resources/javascript/bug_361_expected.txt (right): https://codereview.chromium.org/1586203006/diff/1/testing/resources/javascript/bug_361_expected.txt#newcode28 testing/resources/javascript/bug_361_expected.txt:28: Alert: Answer ...
4 years, 11 months ago (2016-01-15 21:49:52 UTC) #5
Tom Sepez
On 2016/01/15 21:49:52, Tom Bergan wrote: > This is much cleaner than parsing strings. > ...
4 years, 11 months ago (2016-01-15 22:53:07 UTC) #6
Tom Sepez
+Lei for the fx_string stuff, etc.
4 years, 11 months ago (2016-01-15 23:08:03 UTC) #10
jochen (gone - plz use gerrit)
https://codereview.chromium.org/1586203006/diff/40001/fpdfsdk/src/javascript/JS_Value.h File fpdfsdk/src/javascript/JS_Value.h (right): https://codereview.chromium.org/1586203006/diff/40001/fpdfsdk/src/javascript/JS_Value.h#newcode68 fpdfsdk/src/javascript/JS_Value.h:68: void MaybeCoerceToNumber(); is it ok if the number has ...
4 years, 11 months ago (2016-01-19 17:16:25 UTC) #11
Charles Lew
https://codereview.chromium.org/1586203006/diff/40001/fpdfsdk/src/javascript/PublicMethods.cpp File fpdfsdk/src/javascript/PublicMethods.cpp (right): https://codereview.chromium.org/1586203006/diff/40001/fpdfsdk/src/javascript/PublicMethods.cpp#newcode1722 fpdfsdk/src/javascript/PublicMethods.cpp:1722: vRet = 0; Actually the Adobe implementation of these ...
4 years, 11 months ago (2016-01-19 18:01:45 UTC) #12
Tom Sepez
On 2016/01/19 17:16:25, jochen wrote: > https://codereview.chromium.org/1586203006/diff/40001/fpdfsdk/src/javascript/JS_Value.h > File fpdfsdk/src/javascript/JS_Value.h (right): > > https://codereview.chromium.org/1586203006/diff/40001/fpdfsdk/src/javascript/JS_Value.h#newcode68 > ...
4 years, 11 months ago (2016-01-19 22:16:31 UTC) #13
Tom Sepez
https://codereview.chromium.org/1586203006/diff/40001/fpdfsdk/src/javascript/JS_Value.h File fpdfsdk/src/javascript/JS_Value.h (right): https://codereview.chromium.org/1586203006/diff/40001/fpdfsdk/src/javascript/JS_Value.h#newcode68 fpdfsdk/src/javascript/JS_Value.h:68: void MaybeCoerceToNumber(); On 2016/01/19 17:16:25, jochen wrote: > is ...
4 years, 11 months ago (2016-01-19 22:19:16 UTC) #14
jochen (gone - plz use gerrit)
v8 usage lgtm
4 years, 11 months ago (2016-01-20 12:29:50 UTC) #15
Tom Sepez
4 years, 11 months ago (2016-01-20 19:34:09 UTC) #17
Message was sent while issue was closed.
Committed patchset #3 (id:40001) manually as
f13d510cf267c27f4c123494de67670ec201cedc (presubmit successful).

Powered by Google App Engine
This is Rietveld 408576698