summaryrefslogtreecommitdiff
path: root/fpdfsdk/javascript/util.cpp
diff options
context:
space:
mode:
authorDan Sinclair <dsinclair@chromium.org>2017-10-25 14:34:26 -0400
committerChromium commit bot <commit-bot@chromium.org>2017-10-25 19:51:33 +0000
commit6687f780d0c7a9a4f453f166bb4efb55294349a6 (patch)
tree22b88cfdd122b65f01cbbb319f4d72e2797da8b9 /fpdfsdk/javascript/util.cpp
parent4c50b8b2a2cc1b88e8df92dbee7048356ec0a6fb (diff)
downloadpdfium-6687f780d0c7a9a4f453f166bb4efb55294349a6.tar.xz
Remove CJS_Date
This CL removes the CJS_Date class and uses the v8::Local<v8::Date> directly. Change-Id: I4a59b0076bc0e5dc3142b36bd7125115605d416f Reviewed-on: https://pdfium-review.googlesource.com/16811 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
Diffstat (limited to 'fpdfsdk/javascript/util.cpp')
-rw-r--r--fpdfsdk/javascript/util.cpp8
1 files changed, 3 insertions, 5 deletions
diff --git a/fpdfsdk/javascript/util.cpp b/fpdfsdk/javascript/util.cpp
index 26e44496da..b9deda1db8 100644
--- a/fpdfsdk/javascript/util.cpp
+++ b/fpdfsdk/javascript/util.cpp
@@ -143,13 +143,11 @@ CJS_Return util::printd(CJS_Runtime* pRuntime,
if (params[1].IsEmpty() || !params[1]->IsDate())
return CJS_Return(JSGetStringFromID(IDS_STRING_JSPRINT1));
- CJS_Date jsDate(params[1].As<v8::Date>());
- if (jsDate.ToV8Value().IsEmpty() ||
- std::isnan(pRuntime->ToDouble(jsDate.ToV8Value()))) {
+ v8::Local<v8::Date> v8_date = params[1].As<v8::Date>();
+ if (v8_date.IsEmpty() || std::isnan(pRuntime->ToDouble(v8_date)))
return CJS_Return(JSGetStringFromID(IDS_STRING_JSPRINT2));
- }
- double date = JS_LocalTime(pRuntime->ToDouble(jsDate.ToV8Value()));
+ double date = JS_LocalTime(pRuntime->ToDouble(v8_date));
int year = JS_GetYearFromTime(date);
int month = JS_GetMonthFromTime(date) + 1; // One-based.
int day = JS_GetDayFromTime(date);