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 323 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
334 | 334 |
335 v8::Local<v8::Context> context = pObj->CreationContext(); | 335 v8::Local<v8::Context> context = pObj->CreationContext(); |
336 v8::Isolate* isolate = context->GetIsolate(); | 336 v8::Isolate* isolate = context->GetIsolate(); |
337 | 337 |
338 for (int i=0; i<nObjElements; i++) | 338 for (int i=0; i<nObjElements; i++) |
339 { | 339 { |
340 | 340 |
341 CFX_WideString ws = JS_ToString(JS_GetArrayElemnet(pKeyList, i))
; | 341 CFX_WideString ws = JS_ToString(JS_GetArrayElemnet(pKeyList, i))
; |
342 CFX_ByteString sKey = ws.UTF8Encode(); | 342 CFX_ByteString sKey = ws.UTF8Encode(); |
343 | 343 |
344 » » v8::Handle<v8::Value> v = JS_GetObjectElement(isolate, pObj, (FX
_LPCWSTR)ws); | 344 » » v8::Handle<v8::Value> v = JS_GetObjectElement(isolate, pObj, ws.
c_str()); |
345 FXJSVALUETYPE vt = GET_VALUE_TYPE(v); | 345 FXJSVALUETYPE vt = GET_VALUE_TYPE(v); |
346 switch (vt) | 346 switch (vt) |
347 { | 347 { |
348 case VT_number: | 348 case VT_number: |
349 { | 349 { |
350 CJS_KeyValue* pObjElement = new CJS_KeyValue; | 350 CJS_KeyValue* pObjElement = new CJS_KeyValue; |
351 pObjElement->nType = JS_GLOBALDATA_TYPE_NUMBER; | 351 pObjElement->nType = JS_GLOBALDATA_TYPE_NUMBER; |
352 pObjElement->sKey = sKey; | 352 pObjElement->sKey = sKey; |
353 pObjElement->dData = JS_ToNumber(v); | 353 pObjElement->dData = JS_ToNumber(v); |
354 array.Add(pObjElement); | 354 array.Add(pObjElement); |
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
541 } | 541 } |
542 break; | 542 break; |
543 default: | 543 default: |
544 return FALSE; | 544 return FALSE; |
545 } | 545 } |
546 | 546 |
547 m_mapGlobal.SetAt(propname, (FX_LPVOID)pNewData); | 547 m_mapGlobal.SetAt(propname, (FX_LPVOID)pNewData); |
548 | 548 |
549 return TRUE; | 549 return TRUE; |
550 } | 550 } |
OLD | NEW |