summaryrefslogtreecommitdiff
path: root/fxjs/xfa/cjx_node.cpp
diff options
context:
space:
mode:
authorTom Sepez <tsepez@chromium.org>2018-06-08 18:23:05 +0000
committerChromium commit bot <commit-bot@chromium.org>2018-06-08 18:23:05 +0000
commit1699982f45d01cb18585eba80cce5326a63d3b67 (patch)
tree537d81d989632bab75fda37f5b587e1309e60d5d /fxjs/xfa/cjx_node.cpp
parentf29479d47156d180c0b71f6c98aa4de37c2a7ee2 (diff)
downloadpdfium-1699982f45d01cb18585eba80cce5326a63d3b67.tar.xz
Ensure CJS_Return() with error always includes a message.
Change the signature of the constructors to make it impossible to do this otherwise. Change-Id: I14e88d98a1128f2d599459ce9337cd6d079469fe Reviewed-on: https://pdfium-review.googlesource.com/34531 Reviewed-by: dsinclair <dsinclair@chromium.org> Commit-Queue: Tom Sepez <tsepez@chromium.org>
Diffstat (limited to 'fxjs/xfa/cjx_node.cpp')
-rw-r--r--fxjs/xfa/cjx_node.cpp20
1 files changed, 10 insertions, 10 deletions
diff --git a/fxjs/xfa/cjx_node.cpp b/fxjs/xfa/cjx_node.cpp
index a07aa4cb2c..7c472db6c9 100644
--- a/fxjs/xfa/cjx_node.cpp
+++ b/fxjs/xfa/cjx_node.cpp
@@ -117,7 +117,7 @@ CJS_Return CJX_Node::applyXSL(CFX_V8* runtime,
return CJS_Return(JSGetStringFromID(JSMessage::kParamError));
// TODO(weili): check whether we need to implement this, pdfium:501.
- return CJS_Return(true);
+ return CJS_Return();
}
CJS_Return CJX_Node::assignNode(
@@ -127,7 +127,7 @@ CJS_Return CJX_Node::assignNode(
return CJS_Return(JSGetStringFromID(JSMessage::kParamError));
// TODO(weili): check whether we need to implement this, pdfium:501.
- return CJS_Return(true);
+ return CJS_Return();
}
CJS_Return CJX_Node::clone(CFX_V8* runtime,
@@ -206,7 +206,7 @@ CJS_Return CJX_Node::loadXML(CFX_V8* runtime,
ByteString expression = runtime->ToByteString(params[0]);
if (expression.IsEmpty())
- return CJS_Return(true);
+ return CJS_Return();
bool bIgnoreRoot = true;
if (params.size() >= 2)
@@ -218,11 +218,11 @@ CJS_Return CJX_Node::loadXML(CFX_V8* runtime,
auto pParser = pdfium::MakeUnique<CXFA_DocumentParser>(GetDocument());
if (!pParser)
- return CJS_Return(true);
+ return CJS_Return();
CFX_XMLNode* pXMLNode = pParser->ParseXMLData(expression);
if (!pXMLNode)
- return CJS_Return(true);
+ return CJS_Return();
if (bIgnoreRoot &&
(pXMLNode->GetType() != FX_XMLNODE_Element ||
@@ -278,7 +278,7 @@ CJS_Return CJX_Node::loadXML(CFX_V8* runtime,
pParser->ConstructXFANode(pFakeRoot, pFakeXMLRoot);
pFakeRoot = pParser->GetRootNode();
if (!pFakeRoot)
- return CJS_Return(true);
+ return CJS_Return();
if (bOverwrite) {
CXFA_Node* pChild = GetXFANode()->GetFirstChild();
@@ -326,14 +326,14 @@ CJS_Return CJX_Node::loadXML(CFX_V8* runtime,
}
pFakeRoot->SetFlag(XFA_NodeFlag_HasRemovedChildren);
- return CJS_Return(true);
+ return CJS_Return();
}
CJS_Return CJX_Node::saveFilteredXML(
CFX_V8* runtime,
const std::vector<v8::Local<v8::Value>>& params) {
// TODO(weili): Check whether we need to implement this, pdfium:501.
- return CJS_Return(true);
+ return CJS_Return();
}
CJS_Return CJX_Node::saveXML(CFX_V8* runtime,
@@ -383,7 +383,7 @@ CJS_Return CJX_Node::setAttribute(
WideString attributeValue = runtime->ToWideString(params[0]);
WideString attribute = runtime->ToWideString(params[1]);
SetAttribute(attribute.AsStringView(), attributeValue.AsStringView(), true);
- return CJS_Return(true);
+ return CJS_Return();
}
CJS_Return CJX_Node::setElement(
@@ -393,7 +393,7 @@ CJS_Return CJX_Node::setElement(
return CJS_Return(JSGetStringFromID(JSMessage::kParamError));
// TODO(weili): check whether we need to implement this, pdfium:501.
- return CJS_Return(true);
+ return CJS_Return();
}
void CJX_Node::id(CFXJSE_Value* pValue,