summaryrefslogtreecommitdiff
path: root/xfa/fxfa/fm2js/cxfa_fmexpression.cpp
diff options
context:
space:
mode:
authorDan Sinclair <dsinclair@chromium.org>2018-06-06 18:00:14 +0000
committerChromium commit bot <commit-bot@chromium.org>2018-06-06 18:00:14 +0000
commit5caa34c64382d8587a3ec3de5edbb30976b1390d (patch)
tree171e464aefbaf7072db676262b1243a7d397a660 /xfa/fxfa/fm2js/cxfa_fmexpression.cpp
parent2f6a861d2082bff2fe1125445b84cc5f7e11b826 (diff)
downloadpdfium-5caa34c64382d8587a3ec3de5edbb30976b1390d.tar.xz
[fm2js] Fixup initialized variable conversion
When converting a Var statement from formcalc to JS we would neglect to add the ; if the variable was initialized. This generated invalid JS as we'd end up with two statements smushed together. FormCalc: var s = "" Previous JS: var s = ""s = pfm.... New JS: var s = ""; s = pfm ... Bug: pdfium:1097 Change-Id: I8a869f07374cac68a06a487dace89699a4e5540c Reviewed-on: https://pdfium-review.googlesource.com/34110 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Ryan Harrison <rharrison@chromium.org> Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
Diffstat (limited to 'xfa/fxfa/fm2js/cxfa_fmexpression.cpp')
-rw-r--r--xfa/fxfa/fm2js/cxfa_fmexpression.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/xfa/fxfa/fm2js/cxfa_fmexpression.cpp b/xfa/fxfa/fm2js/cxfa_fmexpression.cpp
index 9ff043a1ab..244030e4ab 100644
--- a/xfa/fxfa/fm2js/cxfa_fmexpression.cpp
+++ b/xfa/fxfa/fm2js/cxfa_fmexpression.cpp
@@ -131,6 +131,7 @@ bool CXFA_FMVarExpression::ToJavaScript(CFX_WideTextBuf* js, ReturnType type) {
if (!m_pInit->ToJavaScript(js, ReturnType::kInfered))
return false;
+ *js << L";\n";
*js << tempName << L" = pfm_rt.var_filter(" << tempName << L");\n";
} else {
*js << L"\"\";\n";