summaryrefslogtreecommitdiff
path: root/fpdfsdk/javascript/util.cpp
diff options
context:
space:
mode:
authorDan Sinclair <dsinclair@chromium.org>2017-10-24 15:29:01 -0400
committerChromium commit bot <commit-bot@chromium.org>2017-10-24 20:48:32 +0000
commit037eae6e99ef16a42cb74a72b0b52d515a099b3a (patch)
tree4d4b14f1bc05759f628ae0c60903d9412f173e8f /fpdfsdk/javascript/util.cpp
parent4674441379a2b876ae128ef2e70454dcd14ae2f5 (diff)
downloadpdfium-037eae6e99ef16a42cb74a72b0b52d515a099b3a.tar.xz
Remove IsArrayObject and IsDateObject methods
This CL removes the IsArrayObject and IsDateObject methods and asks the v8 objects directly. Change-Id: I4e2b957dbdfcddb426270f72666fce83854d92e0 Reviewed-on: https://pdfium-review.googlesource.com/16616 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.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/fpdfsdk/javascript/util.cpp b/fpdfsdk/javascript/util.cpp
index 28ab0bb95c..4a7e148697 100644
--- a/fpdfsdk/javascript/util.cpp
+++ b/fpdfsdk/javascript/util.cpp
@@ -149,12 +149,12 @@ bool util::printd(CJS_Runtime* pRuntime,
const CJS_Value& p1 = params[0];
const CJS_Value& p2 = params[1];
- if (!p2.IsDateObject()) {
+ if (p2.ToV8Value().IsEmpty() || !p2.ToV8Value()->IsDate()) {
sError = JSGetStringFromID(IDS_STRING_JSPRINT1);
return false;
}
- ASSERT(p2.IsDateObject());
+ ASSERT(!p2.ToV8Value().IsEmpty() && p2.ToV8Value()->IsDate());
v8::Local<v8::Value> mutable_value = p2.ToV8Value();
CJS_Date jsDate(mutable_value.As<v8::Date>());
if (!jsDate.IsValidDate(pRuntime)) {