summaryrefslogtreecommitdiff
path: root/xfa/fxfa/fm2js/xfa_fmparse.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'xfa/fxfa/fm2js/xfa_fmparse.cpp')
-rw-r--r--xfa/fxfa/fm2js/xfa_fmparse.cpp20
1 files changed, 7 insertions, 13 deletions
diff --git a/xfa/fxfa/fm2js/xfa_fmparse.cpp b/xfa/fxfa/fm2js/xfa_fmparse.cpp
index 53e94666de..2dfdfdb4d2 100644
--- a/xfa/fxfa/fm2js/xfa_fmparse.cpp
+++ b/xfa/fxfa/fm2js/xfa_fmparse.cpp
@@ -78,9 +78,8 @@ CXFA_FMParse::ParseTopExpression() {
}
std::unique_ptr<CXFA_FMExpression> CXFA_FMParse::ParseFunction() {
- std::unique_ptr<CXFA_FMExpression> expr;
CFX_WideStringC ident;
- std::unique_ptr<CFX_WideStringCArray> pArguments;
+ std::vector<CFX_WideStringC> arguments;
std::vector<std::unique_ptr<CXFA_FMExpression>> expressions;
uint32_t line = m_pToken->m_uLinenum;
NextToken();
@@ -96,12 +95,9 @@ std::unique_ptr<CXFA_FMExpression> CXFA_FMParse::ParseFunction() {
if (m_pToken->m_type == TOKrparen) {
NextToken();
} else {
- pArguments = pdfium::MakeUnique<CFX_WideStringCArray>();
- CFX_WideStringC p;
while (1) {
if (m_pToken->m_type == TOKidentifier) {
- p = m_pToken->m_wstring;
- pArguments->Add(p);
+ arguments.push_back(m_pToken->m_wstring);
NextToken();
if (m_pToken->m_type == TOKcomma) {
NextToken();
@@ -129,13 +125,11 @@ std::unique_ptr<CXFA_FMExpression> CXFA_FMParse::ParseFunction() {
expressions = ParseTopExpression();
Check(TOKendfunc);
}
- if (m_pErrorInfo->message.IsEmpty()) {
- expr = pdfium::MakeUnique<CXFA_FMFunctionDefinition>(
- line, false, ident, std::move(pArguments), std::move(expressions));
- } else if (pArguments) {
- pArguments->RemoveAll();
- }
- return expr;
+ if (!m_pErrorInfo->message.IsEmpty())
+ return nullptr;
+
+ return pdfium::MakeUnique<CXFA_FMFunctionDefinition>(
+ line, false, ident, std::move(arguments), std::move(expressions));
}
std::unique_ptr<CXFA_FMExpression> CXFA_FMParse::ParseExpression() {