diff options
author | Dan Sinclair <dsinclair@chromium.org> | 2017-10-24 15:29:01 -0400 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2017-10-24 20:48:32 +0000 |
commit | 037eae6e99ef16a42cb74a72b0b52d515a099b3a (patch) | |
tree | 4d4b14f1bc05759f628ae0c60903d9412f173e8f /fpdfsdk/javascript/color.cpp | |
parent | 4674441379a2b876ae128ef2e70454dcd14ae2f5 (diff) | |
download | pdfium-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/color.cpp')
-rw-r--r-- | fpdfsdk/javascript/color.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/fpdfsdk/javascript/color.cpp b/fpdfsdk/javascript/color.cpp index 56baa59019..c095678732 100644 --- a/fpdfsdk/javascript/color.cpp +++ b/fpdfsdk/javascript/color.cpp @@ -289,7 +289,7 @@ bool color::GetPropertyHelper(CJS_Runtime* pRuntime, bool color::SetPropertyHelper(CJS_Runtime* pRuntime, const CJS_Value& vp, CFX_Color* var) { - if (!vp.IsArrayObject()) + if (vp.ToV8Value().IsEmpty() || !vp.ToV8Value()->IsArray()) return false; *var = ConvertArrayToPWLColor(pRuntime, @@ -304,7 +304,7 @@ bool color::convert(CJS_Runtime* pRuntime, int iSize = params.size(); if (iSize < 2) return false; - if (!params[0].IsArrayObject()) + if (params[0].ToV8Value().IsEmpty() || !params[0].ToV8Value()->IsArray()) return false; WideString sDestSpace = pRuntime->ToWideString(params[1].ToV8Value()); @@ -337,8 +337,10 @@ bool color::equal(CJS_Runtime* pRuntime, WideString& sError) { if (params.size() < 2) return false; - if (!params[0].IsArrayObject() || !params[1].IsArrayObject()) + if (params[0].ToV8Value().IsEmpty() || !params[0].ToV8Value()->IsArray() || + params[1].ToV8Value().IsEmpty() || !params[1].ToV8Value()->IsArray()) { return false; + } CFX_Color color1 = ConvertArrayToPWLColor( pRuntime, CJS_Array(pRuntime->ToArray(params[0].ToV8Value()))); |