diff options
Diffstat (limited to 'fxjs')
-rw-r--r-- | fxjs/cjs_global.cpp | 16 | ||||
-rw-r--r-- | fxjs/cjs_global.h | 2 | ||||
-rw-r--r-- | fxjs/js_define.h | 2 |
3 files changed, 10 insertions, 10 deletions
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<v8::Object> obj = v8::Local<v8::Object>::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<v8::Object> pObj, - CJS_GlobalVariableArray& array) { + CJS_GlobalVariableArray* pArray) { std::vector<WideString> 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); } } } diff --git a/fxjs/cjs_global.h b/fxjs/cjs_global.h index 17a519e651..ba5d57cd07 100644 --- a/fxjs/cjs_global.h +++ b/fxjs/cjs_global.h @@ -78,7 +78,7 @@ class CJS_Global : public CJS_Object { bool bDefaultPersistent); void ObjectToArray(CJS_Runtime* pRuntime, v8::Local<v8::Object> pObj, - CJS_GlobalVariableArray& array); + CJS_GlobalVariableArray* pArray); void PutObjectProperty(v8::Local<v8::Object> obj, CJS_KeyValue* pData); std::map<ByteString, std::unique_ptr<JSGlobalData>> m_MapGlobal; diff --git a/fxjs/js_define.h b/fxjs/js_define.h index 0f16749779..01dfb15e2d 100644 --- a/fxjs/js_define.h +++ b/fxjs/js_define.h @@ -54,7 +54,7 @@ static void JSConstructor(CFXJS_Engine* pEngine, v8::Local<v8::Object> obj) { obj, pdfium::MakeUnique<T>(obj, static_cast<CJS_Runtime*>(pEngine))); } -// CJS_Object has vitual dtor, template not required. +// CJS_Object has virtual dtor, template not required. void JSDestructor(v8::Local<v8::Object> obj); template <class C, CJS_Return (C::*M)(CJS_Runtime*)> |