summaryrefslogtreecommitdiff
path: root/fxjs/xfa/cjx_container.cpp
diff options
context:
space:
mode:
authorDan Sinclair <dsinclair@chromium.org>2017-12-11 22:01:08 +0000
committerChromium commit bot <commit-bot@chromium.org>2017-12-11 22:01:08 +0000
commitcb22f9ad9265f40b1104ed2b09488ccc6ec9e5aa (patch)
tree4aaa14dfb0528268fb9a9a94a4cac82df1af4602 /fxjs/xfa/cjx_container.cpp
parent731526e3b9f32ceac1cdac600fe3ecd55a0bc9b5 (diff)
downloadpdfium-cb22f9ad9265f40b1104ed2b09488ccc6ec9e5aa.tar.xz
[xfa] Refactor CJX method signatures.
This CL changes the CJX methods from void (*)(CFXJSE_Arguments*) to CJS_Return (*)(CJS_V8* runtime, const std::vector<v8::Local<v8::Value>>& params) which is closer to how CJS works in practice. Change-Id: I3a3129268acfe4262dfeb04179919ed19f6c24e1 Reviewed-on: https://pdfium-review.googlesource.com/20491 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
Diffstat (limited to 'fxjs/xfa/cjx_container.cpp')
-rw-r--r--fxjs/xfa/cjx_container.cpp18
1 files changed, 13 insertions, 5 deletions
diff --git a/fxjs/xfa/cjx_container.cpp b/fxjs/xfa/cjx_container.cpp
index 517fb86f98..a5d7921090 100644
--- a/fxjs/xfa/cjx_container.cpp
+++ b/fxjs/xfa/cjx_container.cpp
@@ -6,7 +6,8 @@
#include "fxjs/xfa/cjx_container.h"
-#include "fxjs/cfxjse_arguments.h"
+#include <vector>
+
#include "fxjs/cfxjse_engine.h"
#include "fxjs/cfxjse_value.h"
#include "xfa/fxfa/parser/cxfa_arraynodelist.h"
@@ -24,10 +25,17 @@ CJX_Container::CJX_Container(CXFA_Node* node) : CJX_Node(node) {
CJX_Container::~CJX_Container() {}
-void CJX_Container::getDelta(CFXJSE_Arguments* pArguments) {}
+CJS_Return CJX_Container::getDelta(
+ CJS_V8* runtime,
+ const std::vector<v8::Local<v8::Value>>& params) {
+ return CJS_Return(true);
+}
-void CJX_Container::getDeltas(CFXJSE_Arguments* pArguments) {
+CJS_Return CJX_Container::getDeltas(
+ CJS_V8* runtime,
+ const std::vector<v8::Local<v8::Value>>& params) {
CXFA_ArrayNodeList* pFormNodes = new CXFA_ArrayNodeList(GetDocument());
- pArguments->GetReturnValue()->SetObject(
- pFormNodes, GetDocument()->GetScriptContext()->GetJseNormalClass());
+ return CJS_Return(runtime->NewXFAObject(
+ pFormNodes,
+ GetDocument()->GetScriptContext()->GetJseNormalClass()->GetTemplate()));
}