summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--xfa/fxfa/fm2js/cxfa_fmexpression.cpp15
-rw-r--r--xfa/fxfa/fm2js/cxfa_fmparser_unittest.cpp3
2 files changed, 6 insertions, 12 deletions
diff --git a/xfa/fxfa/fm2js/cxfa_fmexpression.cpp b/xfa/fxfa/fm2js/cxfa_fmexpression.cpp
index 638922cfd5..481b76c868 100644
--- a/xfa/fxfa/fm2js/cxfa_fmexpression.cpp
+++ b/xfa/fxfa/fm2js/cxfa_fmexpression.cpp
@@ -263,17 +263,10 @@ bool CXFA_FMIfExpression::ToJavaScript(CFX_WideTextBuf& js, ReturnType type) {
}
if (m_pElseExpression) {
- if (m_pElseExpression->GetExpType() == XFA_FM_EXPTYPE_IF) {
- js << L"else\n{\n";
- if (!m_pElseExpression->ToJavaScript(js, type))
- return false;
-
- js << L"}\n";
- } else {
- js << L"else\n";
- if (!m_pElseExpression->ToJavaScript(js, type))
- return false;
- }
+ js << L"else\n{\n";
+ if (!m_pElseExpression->ToJavaScript(js, type))
+ return false;
+ js << L"}\n";
}
return !CXFA_IsTooBig(js);
}
diff --git a/xfa/fxfa/fm2js/cxfa_fmparser_unittest.cpp b/xfa/fxfa/fm2js/cxfa_fmparser_unittest.cpp
index cff98531bd..458213a4a0 100644
--- a/xfa/fxfa/fm2js/cxfa_fmparser_unittest.cpp
+++ b/xfa/fxfa/fm2js/cxfa_fmparser_unittest.cpp
@@ -90,7 +90,7 @@ TEST(CXFA_FMParserTest, Parse) {
L"pfm_rt.dot_acc(border, \"border\", \"fill\", 0, 0), \"\", "
L"\"color\", 0, 0), \"\", \"value\", 0, 0), \"255,64,64\");\n"
L"}\n"
- L"}\nelse\n{\n"
+ L"}\nelse\n{\n{\n"
L"if (pfm_rt.is_obj(pfm_rt.dot_acc(pfm_rt.dot_acc(pfm_rt.dot_acc("
L"border, \"border\", \"fill\", 0, 0), \"\", \"color\", 0, 0), \"\", "
L"\"value\", 0, 0)))\n{\n"
@@ -99,6 +99,7 @@ TEST(CXFA_FMParserTest, Parse) {
L"\"color\", 0, 0), \"\", \"value\", 0, 0), \"20,170,13\");\n"
L"}\n"
L"}\n"
+ L"}\n"
L"pfm_ret = this;\n"
L"return pfm_rt.get_val(pfm_ret);\n"
L"}\n).call(this);\n";