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" |
(...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
209 | 209 |
210 void CJS_Value::SetNull() | 210 void CJS_Value::SetNull() |
211 { | 211 { |
212 m_pValue = JS_NewNull(); | 212 m_pValue = JS_NewNull(); |
213 | 213 |
214 m_eType = VT_null; | 214 m_eType = VT_null; |
215 } | 215 } |
216 | 216 |
217 void CJS_Value::operator = (FX_LPCSTR pStr) | 217 void CJS_Value::operator = (FX_LPCSTR pStr) |
218 { | 218 { |
219 » operator = (CFX_WideString::FromLocal(pStr)); | 219 » operator = (CFX_WideString::FromLocal(pStr).c_str()); |
220 } | 220 } |
221 | 221 |
222 void CJS_Value::operator = (CJS_Array & array) | 222 void CJS_Value::operator = (CJS_Array & array) |
223 { | 223 { |
224 m_pValue = JS_NewObject2(m_isolate,(v8::Handle<v8::Array>)array); | 224 m_pValue = JS_NewObject2(m_isolate,(v8::Handle<v8::Array>)array); |
225 | 225 |
226 m_eType = VT_object; | 226 m_eType = VT_object; |
227 } | 227 } |
228 | 228 |
229 void CJS_Value::operator = (CJS_Date & date) | 229 void CJS_Value::operator = (CJS_Date & date) |
(...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
426 | 426 |
427 void CJS_PropValue::operator >>(CFX_WideString &wide_string) const | 427 void CJS_PropValue::operator >>(CFX_WideString &wide_string) const |
428 { | 428 { |
429 ASSERT(m_bIsSetting); | 429 ASSERT(m_bIsSetting); |
430 wide_string = CJS_Value::ToCFXWideString(); | 430 wide_string = CJS_Value::ToCFXWideString(); |
431 } | 431 } |
432 | 432 |
433 void CJS_PropValue::operator <<(CFX_WideString wide_string) | 433 void CJS_PropValue::operator <<(CFX_WideString wide_string) |
434 { | 434 { |
435 ASSERT(!m_bIsSetting); | 435 ASSERT(!m_bIsSetting); |
436 » CJS_Value::operator = (wide_string); | 436 » CJS_Value::operator = (wide_string.c_str()); |
437 } | 437 } |
438 | 438 |
439 void CJS_PropValue::operator >>(CJS_Array &array) const | 439 void CJS_PropValue::operator >>(CJS_Array &array) const |
440 { | 440 { |
441 ASSERT(m_bIsSetting); | 441 ASSERT(m_bIsSetting); |
442 ConvertToArray(array); | 442 ConvertToArray(array); |
443 } | 443 } |
444 | 444 |
445 void CJS_PropValue::operator <<(CJS_Array &array) | 445 void CJS_PropValue::operator <<(CJS_Array &array) |
446 { | 446 { |
(...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
652 return 0.0; | 652 return 0.0; |
653 return JS_ToNumber(m_pDate); | 653 return JS_ToNumber(m_pDate); |
654 } | 654 } |
655 | 655 |
656 CFX_WideString CJS_Date::ToString() const | 656 CFX_WideString CJS_Date::ToString() const |
657 { | 657 { |
658 if(m_pDate.IsEmpty()) | 658 if(m_pDate.IsEmpty()) |
659 return L""; | 659 return L""; |
660 return JS_ToString(m_pDate); | 660 return JS_ToString(m_pDate); |
661 } | 661 } |
OLD | NEW |