From b1a4db5551ca7c211c8acbec2b657d25fa7d7f1d Mon Sep 17 00:00:00 2001 From: Lei Zhang Date: Wed, 11 Jul 2018 13:02:54 +0000 Subject: Fix some nits in fxjs code. Change-Id: I533a702947ba371cbc7971d88a3b7dabbc81a298 Reviewed-on: https://pdfium-review.googlesource.com/37511 Commit-Queue: dsinclair Reviewed-by: dsinclair --- fxjs/cjs_global.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'fxjs/cjs_global.cpp') diff --git a/fxjs/cjs_global.cpp b/fxjs/cjs_global.cpp index 6396aa7705..7a319dd4cb 100644 --- a/fxjs/cjs_global.cpp +++ b/fxjs/cjs_global.cpp @@ -387,7 +387,7 @@ void CJS_Global::CommitGlobalPersisitentVariables(CJS_Runtime* pRuntime) { CJS_GlobalVariableArray array; v8::Local obj = v8::Local::New(GetIsolate(), pData->pData); - ObjectToArray(pRuntime, obj, array); + ObjectToArray(pRuntime, obj, &array); m_pGlobalData->SetGlobalVariableObject(name, array); m_pGlobalData->SetGlobalVariablePersistent(name, pData->bPersistent); } break; @@ -401,7 +401,7 @@ void CJS_Global::CommitGlobalPersisitentVariables(CJS_Runtime* pRuntime) { void CJS_Global::ObjectToArray(CJS_Runtime* pRuntime, v8::Local pObj, - CJS_GlobalVariableArray& array) { + CJS_GlobalVariableArray* pArray) { std::vector pKeyList = pRuntime->GetObjectPropertyNames(pObj); for (const auto& ws : pKeyList) { ByteString sKey = ws.UTF8Encode(); @@ -411,7 +411,7 @@ void CJS_Global::ObjectToArray(CJS_Runtime* pRuntime, pObjElement->nType = JS_GlobalDataType::NUMBER; pObjElement->sKey = sKey; pObjElement->dData = pRuntime->ToDouble(v); - array.Add(pObjElement); + pArray->Add(pObjElement); continue; } if (v->IsBoolean()) { @@ -419,7 +419,7 @@ void CJS_Global::ObjectToArray(CJS_Runtime* pRuntime, pObjElement->nType = JS_GlobalDataType::BOOLEAN; pObjElement->sKey = sKey; pObjElement->dData = pRuntime->ToBoolean(v); - array.Add(pObjElement); + pArray->Add(pObjElement); continue; } if (v->IsString()) { @@ -428,22 +428,22 @@ void CJS_Global::ObjectToArray(CJS_Runtime* pRuntime, pObjElement->nType = JS_GlobalDataType::STRING; pObjElement->sKey = sKey; pObjElement->sData = sValue; - array.Add(pObjElement); + pArray->Add(pObjElement); continue; } if (v->IsObject()) { CJS_KeyValue* pObjElement = new CJS_KeyValue; pObjElement->nType = JS_GlobalDataType::OBJECT; pObjElement->sKey = sKey; - ObjectToArray(pRuntime, pRuntime->ToObject(v), pObjElement->objData); - array.Add(pObjElement); + ObjectToArray(pRuntime, pRuntime->ToObject(v), &pObjElement->objData); + pArray->Add(pObjElement); continue; } if (v->IsNull()) { CJS_KeyValue* pObjElement = new CJS_KeyValue; pObjElement->nType = JS_GlobalDataType::NULLOBJ; pObjElement->sKey = sKey; - array.Add(pObjElement); + pArray->Add(pObjElement); } } } -- cgit v1.2.3