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/global.h" | 7 #include "fpdfsdk/src/javascript/global.h" |
8 | 8 |
9 #include "core/include/fxcrt/fx_ext.h" | 9 #include "core/include/fxcrt/fx_ext.h" |
10 #include "fpdfsdk/include/javascript/IJavaScript.h" | 10 #include "fpdfsdk/include/javascript/IJavaScript.h" |
(...skipping 246 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
257 case JS_GLOBALDATA_TYPE_OBJECT: { | 257 case JS_GLOBALDATA_TYPE_OBJECT: { |
258 v8::Isolate* pRuntime = m_pJSObject->ToV8Object()->GetIsolate(); | 258 v8::Isolate* pRuntime = m_pJSObject->ToV8Object()->GetIsolate(); |
259 v8::Local<v8::Object> pObj = FXJS_NewFxDynamicObj(pRuntime, NULL, -1); | 259 v8::Local<v8::Object> pObj = FXJS_NewFxDynamicObj(pRuntime, NULL, -1); |
260 | 260 |
261 PutObjectProperty(pObj, &pData->data); | 261 PutObjectProperty(pObj, &pData->data); |
262 | 262 |
263 SetGlobalVariables(pData->data.sKey, JS_GLOBALDATA_TYPE_OBJECT, 0, | 263 SetGlobalVariables(pData->data.sKey, JS_GLOBALDATA_TYPE_OBJECT, 0, |
264 false, "", pObj, pData->bPersistent == 1); | 264 false, "", pObj, pData->bPersistent == 1); |
265 FXJS_PutObjectObject(NULL, m_pJSObject->ToV8Object(), | 265 FXJS_PutObjectObject(NULL, m_pJSObject->ToV8Object(), |
266 pData->data.sKey.UTF8Decode().c_str(), pObj); | 266 pData->data.sKey.UTF8Decode().c_str(), pObj); |
267 | |
268 } break; | 267 } break; |
269 case JS_GLOBALDATA_TYPE_NULL: | 268 case JS_GLOBALDATA_TYPE_NULL: |
270 SetGlobalVariables(pData->data.sKey, JS_GLOBALDATA_TYPE_NULL, 0, false, | 269 SetGlobalVariables(pData->data.sKey, JS_GLOBALDATA_TYPE_NULL, 0, false, |
271 "", v8::Local<v8::Object>(), | 270 "", v8::Local<v8::Object>(), |
272 pData->bPersistent == 1); | 271 pData->bPersistent == 1); |
273 FXJS_PutObjectNull(NULL, m_pJSObject->ToV8Object(), | 272 FXJS_PutObjectNull(NULL, m_pJSObject->ToV8Object(), |
274 pData->data.sKey.UTF8Decode().c_str()); | 273 pData->data.sKey.UTF8Decode().c_str()); |
275 break; | 274 break; |
276 } | 275 } |
277 } | 276 } |
(...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
510 return CJS_Value::VT_boolean; | 509 return CJS_Value::VT_boolean; |
511 if (nHash == JSCONST_nDateHash) | 510 if (nHash == JSCONST_nDateHash) |
512 return CJS_Value::VT_date; | 511 return CJS_Value::VT_date; |
513 if (nHash == JSCONST_nObjectHash) | 512 if (nHash == JSCONST_nObjectHash) |
514 return CJS_Value::VT_object; | 513 return CJS_Value::VT_object; |
515 if (nHash == JSCONST_nFXobjHash) | 514 if (nHash == JSCONST_nFXobjHash) |
516 return CJS_Value::VT_fxobject; | 515 return CJS_Value::VT_fxobject; |
517 | 516 |
518 return CJS_Value::VT_unknown; | 517 return CJS_Value::VT_unknown; |
519 } | 518 } |
OLD | NEW |