summaryrefslogtreecommitdiff
path: root/fxjs/cfxjse_engine.cpp
diff options
context:
space:
mode:
authorDan Sinclair <dsinclair@chromium.org>2017-12-14 20:29:23 +0000
committerChromium commit bot <commit-bot@chromium.org>2017-12-14 20:29:23 +0000
commit07c0a4952a9fe45e51c6ba5a2e19296e52ea6ec7 (patch)
tree818bfc4ae4832250add9f92037994832f22b8e89 /fxjs/cfxjse_engine.cpp
parentc5e0f66f5f2e0645f2beab70b44690fe510a9f2d (diff)
downloadpdfium-07c0a4952a9fe45e51c6ba5a2e19296e52ea6ec7.tar.xz
Fold CXFA_ScriptData into CXFA_Script
This CL removes the CXFA_ScriptData wrapper and uses CXFA_Script directly. Change-Id: I1f1932ef96ee4a24407de7eb1d68b8631a5a67ea Reviewed-on: https://pdfium-review.googlesource.com/21173 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
Diffstat (limited to 'fxjs/cfxjse_engine.cpp')
-rw-r--r--fxjs/cfxjse_engine.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/fxjs/cfxjse_engine.cpp b/fxjs/cfxjse_engine.cpp
index 65aedddf4f..a1c70a7d16 100644
--- a/fxjs/cfxjse_engine.cpp
+++ b/fxjs/cfxjse_engine.cpp
@@ -98,7 +98,7 @@ CFXJSE_Engine::CFXJSE_Engine(CXFA_Document* pDocument, v8::Isolate* pIsolate)
&GlobalClassDescriptor,
pDocument->GetRoot())),
m_pJsClass(nullptr),
- m_eScriptType(CXFA_ScriptData::Type::Unknown),
+ m_eScriptType(CXFA_Script::Type::Unknown),
m_pScriptNodeArray(nullptr),
m_ResolveProcessor(pdfium::MakeUnique<CFXJSE_ResolveProcessor>()),
m_pThisObject(nullptr),
@@ -117,14 +117,14 @@ CFXJSE_Engine::~CFXJSE_Engine() {
delete ToThisProxy(pair.second->GetGlobalObject().get(), nullptr);
}
-bool CFXJSE_Engine::RunScript(CXFA_ScriptData::Type eScriptType,
+bool CFXJSE_Engine::RunScript(CXFA_Script::Type eScriptType,
const WideStringView& wsScript,
CFXJSE_Value* hRetValue,
CXFA_Object* pThisObject) {
ByteString btScript;
- AutoRestorer<CXFA_ScriptData::Type> typeRestorer(&m_eScriptType);
+ AutoRestorer<CXFA_Script::Type> typeRestorer(&m_eScriptType);
m_eScriptType = eScriptType;
- if (eScriptType == CXFA_ScriptData::Type::Formcalc) {
+ if (eScriptType == CXFA_Script::Type::Formcalc) {
if (!m_FM2JSContext) {
m_FM2JSContext = pdfium::MakeUnique<CFXJSE_FormCalcContext>(
GetIsolate(), m_JsContext.get(), m_pDocument.Get());
@@ -210,7 +210,7 @@ void CFXJSE_Engine::GlobalPropertyGetter(CFXJSE_Value* pObject,
CXFA_Document* pDoc = pOriginalObject->GetDocument();
CFXJSE_Engine* lpScriptContext = pDoc->GetScriptContext();
WideString wsPropName = WideString::FromUTF8(szPropName);
- if (lpScriptContext->GetType() == CXFA_ScriptData::Type::Formcalc) {
+ if (lpScriptContext->GetType() == CXFA_Script::Type::Formcalc) {
if (szPropName == kFormCalcRuntime) {
lpScriptContext->m_FM2JSContext->GlobalPropertyGetter(pValue);
return;
@@ -305,7 +305,7 @@ void CFXJSE_Engine::NormalPropertyGetter(CFXJSE_Value* pOriginalValue,
return;
if (pObject == lpScriptContext->GetThisObject() ||
- (lpScriptContext->GetType() == CXFA_ScriptData::Type::Javascript &&
+ (lpScriptContext->GetType() == CXFA_Script::Type::Javascript &&
!lpScriptContext->IsStrictScopeInJavaScript())) {
bRet = lpScriptContext->QueryNodeByFlag(
ToNode(pObject), wsPropName.AsStringView(), pReturnValue,
@@ -417,7 +417,7 @@ bool CFXJSE_Engine::IsStrictScopeInJavaScript() {
return m_pDocument->HasFlag(XFA_DOCFLAG_StrictScoping);
}
-CXFA_ScriptData::Type CFXJSE_Engine::GetType() {
+CXFA_Script::Type CFXJSE_Engine::GetType() {
return m_eScriptType;
}
@@ -537,7 +537,7 @@ bool CFXJSE_Engine::ResolveObjects(CXFA_Object* refObject,
if (wsExpression.IsEmpty())
return false;
- if (m_eScriptType != CXFA_ScriptData::Type::Formcalc ||
+ if (m_eScriptType != CXFA_Script::Type::Formcalc ||
(dwStyles & (XFA_RESOLVENODE_Parent | XFA_RESOLVENODE_Siblings))) {
m_upObjectArray.clear();
}