summaryrefslogtreecommitdiff
path: root/fpdfsdk/javascript/PublicMethods.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/PublicMethods.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/PublicMethods.cpp')
-rw-r--r--fpdfsdk/javascript/PublicMethods.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/fpdfsdk/javascript/PublicMethods.cpp b/fpdfsdk/javascript/PublicMethods.cpp
index 68fc30572b..200e7d1046 100644
--- a/fpdfsdk/javascript/PublicMethods.cpp
+++ b/fpdfsdk/javascript/PublicMethods.cpp
@@ -247,7 +247,7 @@ double CJS_PublicMethods::AF_Simple(const wchar_t* sFuction,
CJS_Array CJS_PublicMethods::AF_MakeArrayFromList(CJS_Runtime* pRuntime,
CJS_Value val) {
- if (val.IsArrayObject())
+ if (!val.ToV8Value().IsEmpty() && val.ToV8Value()->IsArray())
return CJS_Array(pRuntime->ToArray(val.ToV8Value()));
WideString wsStr = pRuntime->ToWideString(val.ToV8Value());
@@ -1675,7 +1675,8 @@ bool CJS_PublicMethods::AFSimple_Calculate(CJS_Runtime* pRuntime,
}
CJS_Value params1(params[1]);
- if (!params1.IsArrayObject() && !params1.ToV8Value()->IsString()) {
+ if ((params[1].ToV8Value().IsEmpty() || !params[1].ToV8Value()->IsArray()) &&
+ !params1.ToV8Value()->IsString()) {
sError = JSGetStringFromID(IDS_STRING_JSPARAMERROR);
return false;
}