summaryrefslogtreecommitdiff
path: root/xfa/fxfa/parser/cxfa_nodelist.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'xfa/fxfa/parser/cxfa_nodelist.cpp')
-rw-r--r--xfa/fxfa/parser/cxfa_nodelist.cpp23
1 files changed, 12 insertions, 11 deletions
diff --git a/xfa/fxfa/parser/cxfa_nodelist.cpp b/xfa/fxfa/parser/cxfa_nodelist.cpp
index cbee420870..4c5e5435c2 100644
--- a/xfa/fxfa/parser/cxfa_nodelist.cpp
+++ b/xfa/fxfa/parser/cxfa_nodelist.cpp
@@ -17,7 +17,8 @@ CXFA_NodeList::CXFA_NodeList(CXFA_Document* pDocument)
: CXFA_Object(pDocument,
XFA_ObjectType::NodeList,
XFA_Element::NodeList,
- WideStringView(L"nodeList")) {
+ WideStringView(L"nodeList"),
+ pdfium::MakeUnique<CJX_Object>(this)) {
m_pDocument->GetScriptContext()->AddToCacheList(
std::unique_ptr<CXFA_NodeList>(this));
}
@@ -38,13 +39,13 @@ CXFA_Node* CXFA_NodeList::NamedItem(const WideStringView& wsName) {
void CXFA_NodeList::Script_ListClass_Append(CFXJSE_Arguments* pArguments) {
int32_t argc = pArguments->GetLength();
if (argc != 1) {
- ThrowParamCountMismatchException(L"append");
+ JSObject()->ThrowParamCountMismatchException(L"append");
return;
}
CXFA_Node* pNode = static_cast<CXFA_Node*>(pArguments->GetObject(0));
if (!pNode) {
- ThrowArgumentMismatchException();
+ JSObject()->ThrowArgumentMismatchException();
return;
}
Append(pNode);
@@ -53,14 +54,14 @@ void CXFA_NodeList::Script_ListClass_Append(CFXJSE_Arguments* pArguments) {
void CXFA_NodeList::Script_ListClass_Insert(CFXJSE_Arguments* pArguments) {
int32_t argc = pArguments->GetLength();
if (argc != 2) {
- ThrowParamCountMismatchException(L"insert");
+ JSObject()->ThrowParamCountMismatchException(L"insert");
return;
}
CXFA_Node* pNewNode = static_cast<CXFA_Node*>(pArguments->GetObject(0));
CXFA_Node* pBeforeNode = static_cast<CXFA_Node*>(pArguments->GetObject(1));
if (!pNewNode) {
- ThrowArgumentMismatchException();
+ JSObject()->ThrowArgumentMismatchException();
return;
}
Insert(pNewNode, pBeforeNode);
@@ -69,13 +70,13 @@ void CXFA_NodeList::Script_ListClass_Insert(CFXJSE_Arguments* pArguments) {
void CXFA_NodeList::Script_ListClass_Remove(CFXJSE_Arguments* pArguments) {
int32_t argc = pArguments->GetLength();
if (argc != 1) {
- ThrowParamCountMismatchException(L"remove");
+ JSObject()->ThrowParamCountMismatchException(L"remove");
return;
}
CXFA_Node* pNode = static_cast<CXFA_Node*>(pArguments->GetObject(0));
if (!pNode) {
- ThrowArgumentMismatchException();
+ JSObject()->ThrowArgumentMismatchException();
return;
}
Remove(pNode);
@@ -84,13 +85,13 @@ void CXFA_NodeList::Script_ListClass_Remove(CFXJSE_Arguments* pArguments) {
void CXFA_NodeList::Script_ListClass_Item(CFXJSE_Arguments* pArguments) {
int32_t argc = pArguments->GetLength();
if (argc != 1) {
- ThrowParamCountMismatchException(L"item");
+ JSObject()->ThrowParamCountMismatchException(L"item");
return;
}
int32_t iIndex = pArguments->GetInt32(0);
if (iIndex < 0 || iIndex >= GetLength()) {
- ThrowIndexOutOfBoundsException();
+ JSObject()->ThrowIndexOutOfBoundsException();
return;
}
pArguments->GetReturnValue()->Assign(
@@ -101,7 +102,7 @@ void CXFA_NodeList::Script_TreelistClass_NamedItem(
CFXJSE_Arguments* pArguments) {
int32_t argc = pArguments->GetLength();
if (argc != 1) {
- ThrowParamCountMismatchException(L"namedItem");
+ JSObject()->ThrowParamCountMismatchException(L"namedItem");
return;
}
@@ -119,7 +120,7 @@ void CXFA_NodeList::Script_ListClass_Length(CFXJSE_Value* pValue,
bool bSetting,
XFA_ATTRIBUTE eAttribute) {
if (bSetting) {
- ThrowInvalidPropertyException();
+ JSObject()->ThrowInvalidPropertyException();
return;
}
pValue->SetInteger(GetLength());