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 "../../include/javascript/JavaScript.h" | 7 #include "../../include/javascript/JavaScript.h" |
8 #include "../../include/javascript/JS_Define.h" | 8 #include "../../include/javascript/JS_Define.h" |
9 #include "../../include/javascript/JS_Object.h" | 9 #include "../../include/javascript/JS_Object.h" |
10 #include "../../include/javascript/JS_Value.h" | 10 #include "../../include/javascript/JS_Value.h" |
| 11 #include "../../include/javascript/Document.h" |
11 | 12 |
12 /* ---------------------------- CJS_Value ---------------------------- */ | 13 /* ---------------------------- CJS_Value ---------------------------- */ |
13 | 14 |
14 CJS_Value::CJS_Value(v8::Isolate* isolate) : m_eType(VT_unknown),m_isolate(isola
te) | 15 CJS_Value::CJS_Value(v8::Isolate* isolate) : m_eType(VT_unknown),m_isolate(isola
te) |
15 { | 16 { |
16 } | 17 } |
17 CJS_Value::CJS_Value(v8::Isolate* isolate, v8::Handle<v8::Value> pValue,FXJSVALU
ETYPE t) : | 18 CJS_Value::CJS_Value(v8::Isolate* isolate, v8::Handle<v8::Value> pValue,FXJSVALU
ETYPE t) : |
18 m_pValue(pValue), m_eType(t), m_isolate(isolate) | 19 m_pValue(pValue), m_eType(t), m_isolate(isolate) |
19 { | 20 { |
20 } | 21 } |
(...skipping 16 matching lines...) Expand all Loading... |
37 CJS_Value::CJS_Value(v8::Isolate* isolate, const double &dValue):m_isolate(isola
te) | 38 CJS_Value::CJS_Value(v8::Isolate* isolate, const double &dValue):m_isolate(isola
te) |
38 { | 39 { |
39 operator =(dValue); | 40 operator =(dValue); |
40 } | 41 } |
41 | 42 |
42 CJS_Value::CJS_Value(v8::Isolate* isolate, JSFXObject pJsObj):m_isolate(isolate
) | 43 CJS_Value::CJS_Value(v8::Isolate* isolate, JSFXObject pJsObj):m_isolate(isolate
) |
43 { | 44 { |
44 operator =(pJsObj); | 45 operator =(pJsObj); |
45 } | 46 } |
46 | 47 |
47 CJS_Value::CJS_Value(v8::Isolate* isolate, CJS_Object * pJsObj):m_isolate(isolat
e) | 48 CJS_Value::CJS_Value(v8::Isolate* isolate, CJS_Object* pJsObj):m_isolate(isolate
) |
48 { | 49 { |
49 operator =(pJsObj); | 50 operator =(pJsObj); |
50 } | 51 } |
51 | 52 |
| 53 CJS_Value::CJS_Value(v8::Isolate* isolate, CJS_Document* pJsDoc):m_isolate(isola
te) |
| 54 { |
| 55 m_eType = VT_object; |
| 56 if (pJsDoc) |
| 57 m_pValue = (JSFXObject)*pJsDoc; |
| 58 } |
| 59 |
52 CJS_Value::CJS_Value(v8::Isolate* isolate, FX_LPCWSTR pWstr):m_isolate(isolate) | 60 CJS_Value::CJS_Value(v8::Isolate* isolate, FX_LPCWSTR pWstr):m_isolate(isolate) |
53 { | 61 { |
54 operator =(pWstr); | 62 operator =(pWstr); |
55 } | 63 } |
56 | 64 |
57 CJS_Value::CJS_Value(v8::Isolate* isolate, FX_LPCSTR pStr):m_isolate(isolate) | 65 CJS_Value::CJS_Value(v8::Isolate* isolate, FX_LPCSTR pStr):m_isolate(isolate) |
58 { | 66 { |
59 operator = (pStr); | 67 operator = (pStr); |
60 } | 68 } |
61 | 69 |
(...skipping 573 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
635 return 0.0; | 643 return 0.0; |
636 return JS_ToNumber(m_pDate); | 644 return JS_ToNumber(m_pDate); |
637 } | 645 } |
638 | 646 |
639 CFX_WideString CJS_Date::ToString() const | 647 CFX_WideString CJS_Date::ToString() const |
640 { | 648 { |
641 if(m_pDate.IsEmpty()) | 649 if(m_pDate.IsEmpty()) |
642 return L""; | 650 return L""; |
643 return JS_ToString(m_pDate); | 651 return JS_ToString(m_pDate); |
644 } | 652 } |
OLD | NEW |