| OLD | NEW |
| 1 // Copyright 2014 PDFium Authors. All rights reserved. | 1 // Copyright 2014 PDFium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com | 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com |
| 6 | 6 |
| 7 #include "fpdfsdk/javascript/JS_Value.h" | 7 #include "fpdfsdk/javascript/JS_Value.h" |
| 8 | 8 |
| 9 #include <time.h> | 9 #include <time.h> |
| 10 | 10 |
| (...skipping 402 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 413 CJS_Array::~CJS_Array() {} | 413 CJS_Array::~CJS_Array() {} |
| 414 | 414 |
| 415 void CJS_Array::Attach(v8::Local<v8::Array> pArray) { | 415 void CJS_Array::Attach(v8::Local<v8::Array> pArray) { |
| 416 m_pArray = pArray; | 416 m_pArray = pArray; |
| 417 } | 417 } |
| 418 | 418 |
| 419 FX_BOOL CJS_Array::IsAttached() { | 419 FX_BOOL CJS_Array::IsAttached() { |
| 420 return FALSE; | 420 return FALSE; |
| 421 } | 421 } |
| 422 | 422 |
| 423 void CJS_Array::GetElement(unsigned index, CJS_Value& value) { | 423 void CJS_Array::GetObjectBy(unsigned index, CJS_Value& value) { |
| 424 if (m_pArray.IsEmpty()) | 424 if (m_pArray.IsEmpty()) |
| 425 return; | 425 return; |
| 426 v8::Local<v8::Value> p = | 426 v8::Local<v8::Value> p = |
| 427 FXJS_GetArrayElement(m_pJSRuntime->GetIsolate(), m_pArray, index); | 427 FXJS_GetArrayElement(m_pJSRuntime->GetIsolate(), m_pArray, index); |
| 428 value.Attach(p, CJS_Value::VT_object); | 428 value.Attach(p, CJS_Value::VT_object); |
| 429 } | 429 } |
| 430 | 430 |
| 431 void CJS_Array::SetElement(unsigned index, CJS_Value value) { | 431 void CJS_Array::SetElement(unsigned index, CJS_Value value) { |
| 432 if (m_pArray.IsEmpty()) | 432 if (m_pArray.IsEmpty()) |
| 433 m_pArray = FXJS_NewArray(m_pJSRuntime->GetIsolate()); | 433 m_pArray = FXJS_NewArray(m_pJSRuntime->GetIsolate()); |
| (...skipping 462 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 896 for (size_t i = 0; i < nKeywords; ++i) { | 896 for (size_t i = 0; i < nKeywords; ++i) { |
| 897 const wchar_t* property = va_arg(ap, const wchar_t*); | 897 const wchar_t* property = va_arg(ap, const wchar_t*); |
| 898 v8::Local<v8::Value> v8Value = | 898 v8::Local<v8::Value> v8Value = |
| 899 FXJS_GetObjectElement(pRuntime->GetIsolate(), pObj, property); | 899 FXJS_GetObjectElement(pRuntime->GetIsolate(), pObj, property); |
| 900 if (!v8Value->IsUndefined()) | 900 if (!v8Value->IsUndefined()) |
| 901 result[i] = CJS_Value(pRuntime, v8Value, CJS_Value::VT_unknown); | 901 result[i] = CJS_Value(pRuntime, v8Value, CJS_Value::VT_unknown); |
| 902 } | 902 } |
| 903 va_end(ap); | 903 va_end(ap); |
| 904 return result; | 904 return result; |
| 905 } | 905 } |
| OLD | NEW |