summaryrefslogtreecommitdiff
path: root/fpdfsdk/javascript/app.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/app.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/app.cpp')
-rw-r--r--fpdfsdk/javascript/app.cpp24
1 files changed, 10 insertions, 14 deletions
diff --git a/fpdfsdk/javascript/app.cpp b/fpdfsdk/javascript/app.cpp
index 26f28f5b48..cb07a0ee7b 100644
--- a/fpdfsdk/javascript/app.cpp
+++ b/fpdfsdk/javascript/app.cpp
@@ -414,21 +414,17 @@ bool app::alert(CJS_Runtime* pRuntime,
}
WideString swMsg;
- if (newParams[0].ToV8Value()->IsObject()) {
- if (newParams[0].IsArrayObject()) {
- CJS_Array carray(pRuntime->ToArray(newParams[0].ToV8Value()));
- swMsg = L"[";
- for (int i = 0; i < carray.GetLength(pRuntime); ++i) {
- if (i)
- swMsg += L", ";
-
- CJS_Value element(carray.GetElement(pRuntime, i));
- swMsg += pRuntime->ToWideString(element.ToV8Value());
- }
- swMsg += L"]";
- } else {
- swMsg = pRuntime->ToWideString(newParams[0].ToV8Value());
+ if (newParams[0].ToV8Value()->IsArray()) {
+ CJS_Array carray(pRuntime->ToArray(newParams[0].ToV8Value()));
+ swMsg = L"[";
+ for (int i = 0; i < carray.GetLength(pRuntime); ++i) {
+ if (i)
+ swMsg += L", ";
+
+ CJS_Value element(carray.GetElement(pRuntime, i));
+ swMsg += pRuntime->ToWideString(element.ToV8Value());
}
+ swMsg += L"]";
} else {
swMsg = pRuntime->ToWideString(newParams[0].ToV8Value());
}