diff options
author | Dan Sinclair <dsinclair@chromium.org> | 2018-02-22 20:01:15 +0000 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2018-02-22 20:01:15 +0000 |
commit | 26fc813975170de5040e9abe79a80b7034719944 (patch) | |
tree | 3ba21bf39f87fb4b47df8da5ecd31c41f5bb4c9a /fxjs/cfxjse_formcalc_context.cpp | |
parent | cc48741d63e216b3030fc2e452b6cf07481596ea (diff) | |
download | pdfium-26fc813975170de5040e9abe79a80b7034719944.tar.xz |
[formcalc] Cleanup function handling
This CL creates a CXFA_FMAST root for the AST tree instead of
overloading the CXFA_FMFunctionDefinition. This Removes the m_global
from FunctionDefinition and simpifies the code.
Change-Id: I9347769a291ef1753539701f334cc8dd69b7187e
Reviewed-on: https://pdfium-review.googlesource.com/27590
Commit-Queue: dsinclair <dsinclair@chromium.org>
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
Diffstat (limited to 'fxjs/cfxjse_formcalc_context.cpp')
-rw-r--r-- | fxjs/cfxjse_formcalc_context.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/fxjs/cfxjse_formcalc_context.cpp b/fxjs/cfxjse_formcalc_context.cpp index 82884265cf..f773da1e3f 100644 --- a/fxjs/cfxjse_formcalc_context.cpp +++ b/fxjs/cfxjse_formcalc_context.cpp @@ -6175,12 +6175,12 @@ bool CFXJSE_FormCalcContext::Translate(const WideStringView& wsFormcalc, } CXFA_FMParser parser(wsFormcalc); - std::unique_ptr<CXFA_FMFunctionDefinition> func = parser.Parse(); - if (!func || parser.HasError()) + std::unique_ptr<CXFA_FMAST> ast = parser.Parse(); + if (!ast || parser.HasError()) return false; CXFA_FMToJavaScriptDepth::Reset(); - if (!func->ToJavaScript(*wsJavascript, ReturnType::kInfered)) + if (!ast->ToJavaScript(*wsJavascript)) return false; wsJavascript->AppendChar(0); |