| 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/IJavaScript.h" | 8 #include "../../include/javascript/IJavaScript.h" |
| 9 #include "../../include/javascript/JS_Define.h" | 9 #include "../../include/javascript/JS_Define.h" |
| 10 #include "../../include/javascript/JS_Object.h" | 10 #include "../../include/javascript/JS_Object.h" |
| (...skipping 250 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 261 else | 261 else |
| 262 { | 262 { |
| 263 vp.SetNull(); | 263 vp.SetNull(); |
| 264 return TRUE; | 264 return TRUE; |
| 265 } | 265 } |
| 266 } | 266 } |
| 267 | 267 |
| 268 return FALSE; | 268 return FALSE; |
| 269 } | 269 } |
| 270 | 270 |
| 271 FX_BOOL global_alternate::setPersistent(OBJ_METHOD_PARAMS) | 271 FX_BOOL global_alternate::setPersistent(IFXJS_Context* cc, const CJS_Parameters&
params, CJS_Value& vRet, JS_ErrorString& sError) |
| 272 { | 272 { |
| 273 if (params.size() != 2) | 273 if (params.size() != 2) |
| 274 { | 274 { |
| 275 //sError = JSGetStringFromID(IDS_STRING_JSPARAMERROR); | 275 //sError = JSGetStringFromID(IDS_STRING_JSPARAMERROR); |
| 276 return FALSE; | 276 return FALSE; |
| 277 } | 277 } |
| 278 | 278 |
| 279 CFX_ByteString sName = params[0]; | 279 CFX_ByteString sName = params[0]; |
| 280 | 280 |
| 281 js_global_data* pData = NULL; | 281 js_global_data* pData = NULL; |
| (...skipping 326 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 608 } | 608 } |
| 609 break; | 609 break; |
| 610 default: | 610 default: |
| 611 return FALSE; | 611 return FALSE; |
| 612 } | 612 } |
| 613 | 613 |
| 614 m_mapGlobal.SetAt(propname, (FX_LPVOID)pNewData); | 614 m_mapGlobal.SetAt(propname, (FX_LPVOID)pNewData); |
| 615 | 615 |
| 616 return TRUE; | 616 return TRUE; |
| 617 } | 617 } |
| 618 |
| 619 FXJSVALUETYPE GET_VALUE_TYPE(v8::Handle<v8::Value> p) |
| 620 { |
| 621 const unsigned int nHash = JS_CalcHash(JS_GetTypeof(p)); |
| 622 |
| 623 if (nHash == JSCONST_nUndefHash) |
| 624 return VT_undefined; |
| 625 if (nHash == JSCONST_nNullHash) |
| 626 return VT_null; |
| 627 if (nHash == JSCONST_nStringHash) |
| 628 return VT_string; |
| 629 if (nHash == JSCONST_nNumberHash) |
| 630 return VT_number; |
| 631 if (nHash == JSCONST_nBoolHash) |
| 632 return VT_boolean; |
| 633 if (nHash == JSCONST_nDateHash) |
| 634 return VT_date; |
| 635 if (nHash == JSCONST_nObjectHash) |
| 636 return VT_object; |
| 637 if (nHash == JSCONST_nFXobjHash) |
| 638 return VT_fxobject; |
| 639 |
| 640 return VT_unknown; |
| 641 } |
| 642 |
| OLD | NEW |