summaryrefslogtreecommitdiff
path: root/fxjs
diff options
context:
space:
mode:
authorLei Zhang <thestig@chromium.org>2018-08-28 22:52:30 +0000
committerChromium commit bot <commit-bot@chromium.org>2018-08-28 22:52:30 +0000
commitcf59f804ea8bc83fe0d70148de15a3b5cedc801f (patch)
tree987af5870d44d868eb56ca44ac645c7126c96d25 /fxjs
parent48cd65d67eead592bce6c67084047ad6a7071267 (diff)
downloadpdfium-cf59f804ea8bc83fe0d70148de15a3b5cedc801f.tar.xz
Initialize some CFXJSE_Engine members in the header.
Change-Id: I6fd6004cb6c2e5a801fce0fbb43a6f7d65f560dd Reviewed-on: https://pdfium-review.googlesource.com/41354 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: Lei Zhang <thestig@chromium.org>
Diffstat (limited to 'fxjs')
-rw-r--r--fxjs/cfxjse_engine.cpp7
-rw-r--r--fxjs/cfxjse_engine.h10
2 files changed, 6 insertions, 11 deletions
diff --git a/fxjs/cfxjse_engine.cpp b/fxjs/cfxjse_engine.cpp
index c3b9dd3639..a4fc0a2bdb 100644
--- a/fxjs/cfxjse_engine.cpp
+++ b/fxjs/cfxjse_engine.cpp
@@ -102,12 +102,7 @@ CFXJSE_Engine::CFXJSE_Engine(CXFA_Document* pDocument,
m_JsContext(CFXJSE_Context::Create(fxjs_runtime->GetIsolate(),
&GlobalClassDescriptor,
pDocument->GetRoot())),
- m_pJsClass(nullptr),
- m_eScriptType(CXFA_Script::Type::Unknown),
- m_pScriptNodeArray(nullptr),
- m_ResolveProcessor(pdfium::MakeUnique<CFXJSE_ResolveProcessor>()),
- m_pThisObject(nullptr),
- m_eRunAtType(XFA_AttributeEnum::Client) {
+ m_ResolveProcessor(pdfium::MakeUnique<CFXJSE_ResolveProcessor>()) {
RemoveBuiltInObjs(m_JsContext.get());
m_JsContext->EnableCompatibleMode();
diff --git a/fxjs/cfxjse_engine.h b/fxjs/cfxjse_engine.h
index 632010d079..4d4daf8e0d 100644
--- a/fxjs/cfxjse_engine.h
+++ b/fxjs/cfxjse_engine.h
@@ -110,8 +110,8 @@ class CFXJSE_Engine final : public CFX_V8 {
UnownedPtr<CJS_Runtime> const m_pSubordinateRuntime;
UnownedPtr<CXFA_Document> const m_pDocument;
std::unique_ptr<CFXJSE_Context> m_JsContext;
- CFXJSE_Class* m_pJsClass;
- CXFA_Script::Type m_eScriptType;
+ CFXJSE_Class* m_pJsClass = nullptr;
+ CXFA_Script::Type m_eScriptType = CXFA_Script::Type::Unknown;
std::map<CXFA_Object*, std::unique_ptr<CFXJSE_Value>> m_mapObjectToValue;
std::map<CXFA_Object*, std::unique_ptr<CFXJSE_Context>>
m_mapVariableToContext;
@@ -119,11 +119,11 @@ class CFXJSE_Engine final : public CFX_V8 {
std::vector<CXFA_Node*> m_upObjectArray;
// CacheList holds the List items so we can clean them up when we're done.
std::vector<std::unique_ptr<CXFA_List>> m_CacheList;
- std::vector<CXFA_Node*>* m_pScriptNodeArray;
+ std::vector<CXFA_Node*>* m_pScriptNodeArray = nullptr;
std::unique_ptr<CFXJSE_ResolveProcessor> m_ResolveProcessor;
std::unique_ptr<CFXJSE_FormCalcContext> m_FM2JSContext;
- CXFA_Object* m_pThisObject;
- XFA_AttributeEnum m_eRunAtType;
+ CXFA_Object* m_pThisObject = nullptr;
+ XFA_AttributeEnum m_eRunAtType = XFA_AttributeEnum::Client;
};
#endif // FXJS_CFXJSE_ENGINE_H_