| 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/global.h" | 7 #include "fpdfsdk/javascript/global.h" |
| 8 | 8 |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 396 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 407 m_mapGlobal.clear(); | 407 m_mapGlobal.clear(); |
| 408 } | 408 } |
| 409 | 409 |
| 410 FX_BOOL JSGlobalAlternate::SetGlobalVariables(const CFX_ByteString& propname, | 410 FX_BOOL JSGlobalAlternate::SetGlobalVariables(const CFX_ByteString& propname, |
| 411 int nType, | 411 int nType, |
| 412 double dData, | 412 double dData, |
| 413 bool bData, | 413 bool bData, |
| 414 const CFX_ByteString& sData, | 414 const CFX_ByteString& sData, |
| 415 v8::Local<v8::Object> pData, | 415 v8::Local<v8::Object> pData, |
| 416 bool bDefaultPersistent) { | 416 bool bDefaultPersistent) { |
| 417 if (!propname) | 417 if (propname.IsEmpty()) |
| 418 return FALSE; | 418 return FALSE; |
| 419 | 419 |
| 420 auto it = m_mapGlobal.find(propname); | 420 auto it = m_mapGlobal.find(propname); |
| 421 if (it != m_mapGlobal.end()) { | 421 if (it != m_mapGlobal.end()) { |
| 422 JSGlobalData* pTemp = it->second; | 422 JSGlobalData* pTemp = it->second; |
| 423 if (pTemp->bDeleted || pTemp->nType != nType) { | 423 if (pTemp->bDeleted || pTemp->nType != nType) { |
| 424 pTemp->dData = 0; | 424 pTemp->dData = 0; |
| 425 pTemp->bData = 0; | 425 pTemp->bData = 0; |
| 426 pTemp->sData = ""; | 426 pTemp->sData = ""; |
| 427 pTemp->nType = nType; | 427 pTemp->nType = nType; |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 504 return CJS_Value::VT_boolean; | 504 return CJS_Value::VT_boolean; |
| 505 if (nHash == JSCONST_nDateHash) | 505 if (nHash == JSCONST_nDateHash) |
| 506 return CJS_Value::VT_date; | 506 return CJS_Value::VT_date; |
| 507 if (nHash == JSCONST_nObjectHash) | 507 if (nHash == JSCONST_nObjectHash) |
| 508 return CJS_Value::VT_object; | 508 return CJS_Value::VT_object; |
| 509 if (nHash == JSCONST_nFXobjHash) | 509 if (nHash == JSCONST_nFXobjHash) |
| 510 return CJS_Value::VT_fxobject; | 510 return CJS_Value::VT_fxobject; |
| 511 | 511 |
| 512 return CJS_Value::VT_unknown; | 512 return CJS_Value::VT_unknown; |
| 513 } | 513 } |
| OLD | NEW |