| 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 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 75 operator=(pStr); | 75 operator=(pStr); |
| 76 } | 76 } |
| 77 | 77 |
| 78 CJS_Value::CJS_Value(CJS_Runtime* pRuntime, CJS_Array& array) | 78 CJS_Value::CJS_Value(CJS_Runtime* pRuntime, CJS_Array& array) |
| 79 : m_pJSRuntime(pRuntime) { | 79 : m_pJSRuntime(pRuntime) { |
| 80 operator=(array); | 80 operator=(array); |
| 81 } | 81 } |
| 82 | 82 |
| 83 CJS_Value::~CJS_Value() {} | 83 CJS_Value::~CJS_Value() {} |
| 84 | 84 |
| 85 CJS_Value::CJS_Value(const CJS_Value& other) = default; |
| 86 |
| 85 void CJS_Value::Attach(v8::Local<v8::Value> pValue, Type t) { | 87 void CJS_Value::Attach(v8::Local<v8::Value> pValue, Type t) { |
| 86 m_pValue = pValue; | 88 m_pValue = pValue; |
| 87 m_eType = t; | 89 m_eType = t; |
| 88 } | 90 } |
| 89 | 91 |
| 90 void CJS_Value::Attach(CJS_Value* pValue) { | 92 void CJS_Value::Attach(CJS_Value* pValue) { |
| 91 if (pValue) | 93 if (pValue) |
| 92 Attach(pValue->ToV8Value(), pValue->GetType()); | 94 Attach(pValue->ToV8Value(), pValue->GetType()); |
| 93 } | 95 } |
| 94 | 96 |
| (...skipping 308 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 403 } | 405 } |
| 404 | 406 |
| 405 CJS_PropValue::operator v8::Local<v8::Value>() const { | 407 CJS_PropValue::operator v8::Local<v8::Value>() const { |
| 406 return m_pValue; | 408 return m_pValue; |
| 407 } | 409 } |
| 408 | 410 |
| 409 CJS_Array::CJS_Array(CJS_Runtime* pRuntime) : m_pJSRuntime(pRuntime) {} | 411 CJS_Array::CJS_Array(CJS_Runtime* pRuntime) : m_pJSRuntime(pRuntime) {} |
| 410 | 412 |
| 411 CJS_Array::~CJS_Array() {} | 413 CJS_Array::~CJS_Array() {} |
| 412 | 414 |
| 415 CJS_Array::CJS_Array(const CJS_Array& other) = default; |
| 416 |
| 413 void CJS_Array::Attach(v8::Local<v8::Array> pArray) { | 417 void CJS_Array::Attach(v8::Local<v8::Array> pArray) { |
| 414 m_pArray = pArray; | 418 m_pArray = pArray; |
| 415 } | 419 } |
| 416 | 420 |
| 417 FX_BOOL CJS_Array::IsAttached() { | 421 FX_BOOL CJS_Array::IsAttached() { |
| 418 return FALSE; | 422 return FALSE; |
| 419 } | 423 } |
| 420 | 424 |
| 421 void CJS_Array::GetElement(unsigned index, CJS_Value& value) { | 425 void CJS_Array::GetElement(unsigned index, CJS_Value& value) { |
| 422 if (m_pArray.IsEmpty()) | 426 if (m_pArray.IsEmpty()) |
| (...skipping 470 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 893 for (size_t i = 0; i < nKeywords; ++i) { | 897 for (size_t i = 0; i < nKeywords; ++i) { |
| 894 const wchar_t* property = va_arg(ap, const wchar_t*); | 898 const wchar_t* property = va_arg(ap, const wchar_t*); |
| 895 v8::Local<v8::Value> v8Value = | 899 v8::Local<v8::Value> v8Value = |
| 896 FXJS_GetObjectElement(pRuntime->GetIsolate(), pObj, property); | 900 FXJS_GetObjectElement(pRuntime->GetIsolate(), pObj, property); |
| 897 if (!v8Value->IsUndefined()) | 901 if (!v8Value->IsUndefined()) |
| 898 result[i] = CJS_Value(pRuntime, v8Value, CJS_Value::VT_unknown); | 902 result[i] = CJS_Value(pRuntime, v8Value, CJS_Value::VT_unknown); |
| 899 } | 903 } |
| 900 va_end(ap); | 904 va_end(ap); |
| 901 return result; | 905 return result; |
| 902 } | 906 } |
| OLD | NEW |