7#include "fxjs/xfa/cjx_list.h"
9#include "core/fxcrt/numerics/safe_conversions.h"
10#include "core/fxcrt/span.h"
12#include "fxjs/js_resources.h"
13#include "fxjs/xfa/cfxjse_class.h"
14#include "fxjs/xfa/cfxjse_engine.h"
15#include "v8/include/v8-object.h"
16#include "v8/include/v8-primitive.h"
17#include "xfa/fxfa/parser/cxfa_document.h"
18#include "xfa/fxfa/parser/cxfa_list.h"
19#include "xfa/fxfa/parser/cxfa_node.h"
22 {
"insert", insert_static},
23 {
"item", item_static},
24 {
"remove", remove_static}};
27 DefineMethods(MethodSpecs);
41 pdfium::span<v8::Local<v8::Value>> params) {
42 if (params.size() != 1)
45 auto* pNode = ToNode(runtime->ToXFAObject(params[0]));
56 pdfium::span<v8::Local<v8::Value>> params) {
57 if (params.size() != 2)
60 auto* pNewNode = ToNode(runtime->ToXFAObject(params[0]));
64 auto* pBeforeNode = ToNode(runtime->ToXFAObject(params[1]));
72 pdfium::span<v8::Local<v8::Value>> params) {
73 if (params.size() != 1)
76 auto* pNode = ToNode(runtime->ToXFAObject(params[0]));
85 pdfium::span<v8::Local<v8::Value>> params) {
86 if (params.size() != 1)
89 int32_t index = runtime->ToInt32(params[0]);
90 size_t cast_index =
static_cast<size_t>(index);
91 if (index < 0 || cast_index >= GetXFAList()->GetLength())
95 runtime->NewNormalXFAObject(GetXFAList()->Item(cast_index))
);
99 v8::Local<v8::Value>* pValue,
106 *pValue = fxv8::NewNumberHelper(
107 pIsolate,
pdfium::checked_cast<int32_t>(GetXFAList()->GetLength()));
friend class EventParamScope
static CJS_Result Success()
static CJS_Result Failure(JSMessage id)
CJX_List(CXFA_List *list)
bool DynamicTypeIs(TypeTag eType) const override
CXFA_Object * GetXFAObject() const
void ThrowInvalidPropertyException(v8::Isolate *pIsolate) const
virtual bool DynamicTypeIs(TypeTag eType) const
virtual void Remove(CXFA_Node *pNode)=0
virtual bool Append(CXFA_Node *pNode)=0
virtual bool Insert(CXFA_Node *pNewNode, CXFA_Node *pBeforeNode)=0