From 3a1ba8efdbfffad723646dd878e6ca511f9f75bd Mon Sep 17 00:00:00 2001 From: Dan Sinclair Date: Thu, 26 Oct 2017 09:28:59 -0400 Subject: Remove CJS_Array This CL removes the CJS_Array wrapper and uses the v8 objects directly. Change-Id: I904f76e59e27d65db4b4d0bbd503fddb3e8cfc6f Reviewed-on: https://pdfium-review.googlesource.com/16830 Reviewed-by: Tom Sepez Commit-Queue: dsinclair --- fpdfsdk/javascript/JS_Value.cpp | 30 ------------------------------ 1 file changed, 30 deletions(-) (limited to 'fpdfsdk/javascript/JS_Value.cpp') diff --git a/fpdfsdk/javascript/JS_Value.cpp b/fpdfsdk/javascript/JS_Value.cpp index dee06e62f3..fdc8b87725 100644 --- a/fpdfsdk/javascript/JS_Value.cpp +++ b/fpdfsdk/javascript/JS_Value.cpp @@ -179,36 +179,6 @@ CJS_Return::CJS_Return(const CJS_Return&) = default; CJS_Return::~CJS_Return() = default; -CJS_Array::CJS_Array() {} - -CJS_Array::CJS_Array(v8::Local pArray) : m_pArray(pArray) {} - -CJS_Array::CJS_Array(const CJS_Array& other) = default; - -CJS_Array::~CJS_Array() {} - -v8::Local CJS_Array::GetElement(CJS_Runtime* pRuntime, - unsigned index) const { - if (!m_pArray.IsEmpty()) - return {pRuntime->GetArrayElement(m_pArray, index)}; - return {}; -} - -void CJS_Array::SetElement(CJS_Runtime* pRuntime, - unsigned index, - v8::Local value) { - if (m_pArray.IsEmpty()) - m_pArray = pRuntime->NewArray(); - - pRuntime->PutArrayElement(m_pArray, index, value); -} - -int CJS_Array::GetLength(CJS_Runtime* pRuntime) const { - if (m_pArray.IsEmpty()) - return 0; - return pRuntime->GetArrayLength(m_pArray); -} - double JS_GetDateTime() { if (!FSDK_IsSandBoxPolicyEnabled(FPDF_POLICY_MACHINETIME_ACCESS)) return 0; -- cgit v1.2.3