summaryrefslogtreecommitdiff
path: root/fpdfsdk/javascript/Field.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/Field.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/Field.cpp')
-rw-r--r--fpdfsdk/javascript/Field.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/fpdfsdk/javascript/Field.cpp b/fpdfsdk/javascript/Field.cpp
index 0ed0594b3b..35b808c733 100644
--- a/fpdfsdk/javascript/Field.cpp
+++ b/fpdfsdk/javascript/Field.cpp
@@ -879,7 +879,7 @@ bool Field::set_current_value_indices(CJS_Runtime* pRuntime,
std::vector<uint32_t> array;
if (vp.ToV8Value()->IsNumber()) {
array.push_back(pRuntime->ToInt32(vp.ToV8Value()));
- } else if (vp.IsArrayObject()) {
+ } else if (!vp.ToV8Value().IsEmpty() && vp.ToV8Value()->IsArray()) {
CJS_Array SelArray(pRuntime->ToArray(vp.ToV8Value()));
for (int i = 0, sz = SelArray.GetLength(pRuntime); i < sz; i++)
array.push_back(
@@ -1210,7 +1210,7 @@ bool Field::set_export_values(CJS_Runtime* pRuntime,
return false;
}
- return m_bCanSet && vp.IsArrayObject();
+ return m_bCanSet && !vp.ToV8Value().IsEmpty() && vp.ToV8Value()->IsArray();
}
bool Field::get_file_select(CJS_Runtime* pRuntime,
@@ -1297,7 +1297,7 @@ bool Field::set_fill_color(CJS_Runtime* pRuntime,
return false;
if (!m_bCanSet)
return false;
- if (!vp.IsArrayObject())
+ if (vp.ToV8Value().IsEmpty() || !vp.ToV8Value()->IsArray())
return false;
return true;
}
@@ -1797,7 +1797,7 @@ bool Field::set_rect(CJS_Runtime* pRuntime,
WideString* sError) {
if (!m_bCanSet)
return false;
- if (!vp.IsArrayObject())
+ if (vp.ToV8Value().IsEmpty() || !vp.ToV8Value()->IsArray())
return false;
CJS_Array rcArray(pRuntime->ToArray(vp.ToV8Value()));
@@ -2017,7 +2017,7 @@ bool Field::set_stroke_color(CJS_Runtime* pRuntime,
WideString* sError) {
if (!m_bCanSet)
return false;
- if (!vp.IsArrayObject())
+ if (vp.ToV8Value().IsEmpty() || !vp.ToV8Value()->IsArray())
return false;
return true;
}
@@ -2131,7 +2131,7 @@ bool Field::set_text_color(CJS_Runtime* pRuntime,
WideString* sError) {
if (!m_bCanSet)
return false;
- if (!vp.IsArrayObject())
+ if (vp.ToV8Value().IsEmpty() || !vp.ToV8Value()->IsArray())
return false;
return true;
}
@@ -2342,7 +2342,7 @@ bool Field::set_value(CJS_Runtime* pRuntime,
return false;
std::vector<WideString> strArray;
- if (vp.IsArrayObject()) {
+ if (!vp.ToV8Value().IsEmpty() && vp.ToV8Value()->IsArray()) {
CJS_Array ValueArray(pRuntime->ToArray(vp.ToV8Value()));
for (int i = 0, sz = ValueArray.GetLength(pRuntime); i < sz; i++) {
CJS_Value ElementValue(ValueArray.GetElement(pRuntime, i));