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/src/javascript/JS_Value.h" | 7 #include "fpdfsdk/src/javascript/JS_Value.h" |
8 | 8 |
9 #include <time.h> | 9 #include <time.h> |
10 #include <algorithm> | 10 #include <algorithm> |
(...skipping 256 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
267 FX_BOOL CJS_Value::ConvertToArray(CJS_Array& array) const { | 267 FX_BOOL CJS_Value::ConvertToArray(CJS_Array& array) const { |
268 if (IsArrayObject()) { | 268 if (IsArrayObject()) { |
269 array.Attach(FXJS_ToArray(m_pJSRuntime->GetIsolate(), m_pValue)); | 269 array.Attach(FXJS_ToArray(m_pJSRuntime->GetIsolate(), m_pValue)); |
270 return TRUE; | 270 return TRUE; |
271 } | 271 } |
272 | 272 |
273 return FALSE; | 273 return FALSE; |
274 } | 274 } |
275 | 275 |
276 FX_BOOL CJS_Value::ConvertToDate(CJS_Date& date) const { | 276 FX_BOOL CJS_Value::ConvertToDate(CJS_Date& date) const { |
277 // if (GetType() == VT_date) | |
278 // { | |
279 // date = (double)(*this); | |
280 // return TRUE; | |
281 // } | |
282 | |
283 if (IsDateObject()) { | 277 if (IsDateObject()) { |
284 date.Attach(m_pValue); | 278 date.Attach(m_pValue); |
285 return TRUE; | 279 return TRUE; |
286 } | 280 } |
287 | 281 |
288 return FALSE; | 282 return FALSE; |
289 } | 283 } |
290 | 284 |
291 /* ---------------------------- CJS_PropValue ---------------------------- */ | 285 /* ---------------------------- CJS_PropValue ---------------------------- */ |
292 | 286 |
(...skipping 612 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
905 for (int i = 0; i < nKeywords; ++i) { | 899 for (int i = 0; i < nKeywords; ++i) { |
906 const wchar_t* property = va_arg(ap, const wchar_t*); | 900 const wchar_t* property = va_arg(ap, const wchar_t*); |
907 v8::Local<v8::Value> v8Value = | 901 v8::Local<v8::Value> v8Value = |
908 FXJS_GetObjectElement(pRuntime->GetIsolate(), pObj, property); | 902 FXJS_GetObjectElement(pRuntime->GetIsolate(), pObj, property); |
909 if (!v8Value->IsUndefined()) | 903 if (!v8Value->IsUndefined()) |
910 result[i] = CJS_Value(pRuntime, v8Value, CJS_Value::VT_unknown); | 904 result[i] = CJS_Value(pRuntime, v8Value, CJS_Value::VT_unknown); |
911 } | 905 } |
912 va_end(ap); | 906 va_end(ap); |
913 return result; | 907 return result; |
914 } | 908 } |
OLD | NEW |