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 333 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
344 | 344 |
345 v8::Local<v8::Context> context = pObj->CreationContext(); | 345 v8::Local<v8::Context> context = pObj->CreationContext(); |
346 v8::Isolate* isolate = context->GetIsolate(); | 346 v8::Isolate* isolate = context->GetIsolate(); |
347 | 347 |
348 for (int i=0; i<nObjElements; i++) | 348 for (int i=0; i<nObjElements; i++) |
349 { | 349 { |
350 | 350 |
351 CFX_WideString ws = JS_ToString(JS_GetArrayElemnet(pKeyList, i))
; | 351 CFX_WideString ws = JS_ToString(JS_GetArrayElemnet(pKeyList, i))
; |
352 CFX_ByteString sKey = ws.UTF8Encode(); | 352 CFX_ByteString sKey = ws.UTF8Encode(); |
353 | 353 |
354 » » v8::Handle<v8::Value> v = JS_GetObjectElement(isolate, pObj, (FX
_LPCWSTR)ws); | 354 » » v8::Handle<v8::Value> v = JS_GetObjectElement(isolate, pObj, ws.
c_str()); |
355 FXJSVALUETYPE vt = GET_VALUE_TYPE(v); | 355 FXJSVALUETYPE vt = GET_VALUE_TYPE(v); |
356 switch (vt) | 356 switch (vt) |
357 { | 357 { |
358 case VT_number: | 358 case VT_number: |
359 { | 359 { |
360 CJS_KeyValue* pObjElement = new CJS_KeyValue; | 360 CJS_KeyValue* pObjElement = new CJS_KeyValue; |
361 pObjElement->nType = JS_GLOBALDATA_TYPE_NUMBER; | 361 pObjElement->nType = JS_GLOBALDATA_TYPE_NUMBER; |
362 pObjElement->sKey = sKey; | 362 pObjElement->sKey = sKey; |
363 pObjElement->dData = JS_ToNumber(v); | 363 pObjElement->dData = JS_ToNumber(v); |
364 array.Add(pObjElement); | 364 array.Add(pObjElement); |
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
551 } | 551 } |
552 break; | 552 break; |
553 default: | 553 default: |
554 return FALSE; | 554 return FALSE; |
555 } | 555 } |
556 | 556 |
557 m_mapGlobal.SetAt(propname, (FX_LPVOID)pNewData); | 557 m_mapGlobal.SetAt(propname, (FX_LPVOID)pNewData); |
558 | 558 |
559 return TRUE; | 559 return TRUE; |
560 } | 560 } |
OLD | NEW |