Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2011)

Unified Diff: Source/core/xml/XPathResult.cpp

Issue 99083002: WIP: Migrate generated bindings to new ExceptionState constructor. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebase. Created 7 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/xml/XPathParser.cpp ('k') | Source/modules/crypto/NormalizeAlgorithm.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/xml/XPathResult.cpp
diff --git a/Source/core/xml/XPathResult.cpp b/Source/core/xml/XPathResult.cpp
index 7769d94f4465bb7d396a35308cd49bcfff4dff21..17aa9dd2061af467c816879a3c771620bedfb535 100644
--- a/Source/core/xml/XPathResult.cpp
+++ b/Source/core/xml/XPathResult.cpp
@@ -27,7 +27,6 @@
#include "config.h"
#include "core/xml/XPathResult.h"
-#include "bindings/v8/ExceptionMessages.h"
#include "bindings/v8/ExceptionState.h"
#include "core/dom/Document.h"
#include "core/dom/ExceptionCode.h"
@@ -90,14 +89,14 @@ void XPathResult::convertTo(unsigned short type, ExceptionState& exceptionState)
case ANY_UNORDERED_NODE_TYPE:
case FIRST_ORDERED_NODE_TYPE: // This is correct - singleNodeValue() will take care of ordering.
if (!m_value.isNodeSet()) {
- exceptionState.throwTypeError(ExceptionMessages::failedToExecute("evaluate", "XPathExpression", "The result is not a node set, and therefore cannot be converted to the desired type."));
+ exceptionState.throwTypeError("The result is not a node set, and therefore cannot be converted to the desired type.");
return;
}
m_resultType = type;
break;
case ORDERED_NODE_ITERATOR_TYPE:
if (!m_value.isNodeSet()) {
- exceptionState.throwTypeError(ExceptionMessages::failedToExecute("evaluate", "XPathExpression", "The result is not a node set, and therefore cannot be converted to the desired type."));
+ exceptionState.throwTypeError("The result is not a node set, and therefore cannot be converted to the desired type.");
return;
}
m_nodeSet.sort();
@@ -105,7 +104,7 @@ void XPathResult::convertTo(unsigned short type, ExceptionState& exceptionState)
break;
case ORDERED_NODE_SNAPSHOT_TYPE:
if (!m_value.isNodeSet()) {
- exceptionState.throwTypeError(ExceptionMessages::failedToExecute("evaluate", "XPathExpression", "The result is not a node set, and therefore cannot be converted to the desired type."));
+ exceptionState.throwTypeError("The result is not a node set, and therefore cannot be converted to the desired type.");
return;
}
m_value.toNodeSet().sort();
@@ -122,7 +121,7 @@ unsigned short XPathResult::resultType() const
double XPathResult::numberValue(ExceptionState& exceptionState) const
{
if (resultType() != NUMBER_TYPE) {
- exceptionState.throwTypeError(ExceptionMessages::failedToGet("numberValue", "XPathResult", "The result type is not a number."));
+ exceptionState.throwTypeError("The result type is not a number.");
return 0.0;
}
return m_value.toNumber();
@@ -131,7 +130,7 @@ double XPathResult::numberValue(ExceptionState& exceptionState) const
String XPathResult::stringValue(ExceptionState& exceptionState) const
{
if (resultType() != STRING_TYPE) {
- exceptionState.throwTypeError(ExceptionMessages::failedToGet("stringValue", "XPathResult", "The result type is not a string."));
+ exceptionState.throwTypeError("The result type is not a string.");
return String();
}
return m_value.toString();
@@ -140,7 +139,7 @@ String XPathResult::stringValue(ExceptionState& exceptionState) const
bool XPathResult::booleanValue(ExceptionState& exceptionState) const
{
if (resultType() != BOOLEAN_TYPE) {
- exceptionState.throwTypeError(ExceptionMessages::failedToGet("booleanValue", "XPathResult", "The result type is not a boolean."));
+ exceptionState.throwTypeError("The result type is not a boolean.");
return false;
}
return m_value.toBoolean();
@@ -149,7 +148,7 @@ bool XPathResult::booleanValue(ExceptionState& exceptionState) const
Node* XPathResult::singleNodeValue(ExceptionState& exceptionState) const
{
if (resultType() != ANY_UNORDERED_NODE_TYPE && resultType() != FIRST_ORDERED_NODE_TYPE) {
- exceptionState.throwTypeError(ExceptionMessages::failedToGet("singleNodeValue", "XPathResult", "The result type is not a single node."));
+ exceptionState.throwTypeError("The result type is not a single node.");
return 0;
}
@@ -172,7 +171,7 @@ bool XPathResult::invalidIteratorState() const
unsigned long XPathResult::snapshotLength(ExceptionState& exceptionState) const
{
if (resultType() != UNORDERED_NODE_SNAPSHOT_TYPE && resultType() != ORDERED_NODE_SNAPSHOT_TYPE) {
- exceptionState.throwTypeError(ExceptionMessages::failedToGet("snapshotLength", "XPathResult", "The result type is not a snapshot."));
+ exceptionState.throwTypeError("The result type is not a snapshot.");
return 0;
}
@@ -182,12 +181,12 @@ unsigned long XPathResult::snapshotLength(ExceptionState& exceptionState) const
Node* XPathResult::iterateNext(ExceptionState& exceptionState)
{
if (resultType() != UNORDERED_NODE_ITERATOR_TYPE && resultType() != ORDERED_NODE_ITERATOR_TYPE) {
- exceptionState.throwTypeError(ExceptionMessages::failedToExecute("iterateNext", "XPathResult", "The result type is not an iterator."));
+ exceptionState.throwTypeError("The result type is not an iterator.");
return 0;
}
if (invalidIteratorState()) {
- exceptionState.throwDOMException(InvalidStateError, ExceptionMessages::failedToExecute("iterateNext", "XPathResult", "The document has mutated since the result was returned."));
+ exceptionState.throwDOMException(InvalidStateError, "The document has mutated since the result was returned.");
return 0;
}
@@ -204,7 +203,7 @@ Node* XPathResult::iterateNext(ExceptionState& exceptionState)
Node* XPathResult::snapshotItem(unsigned long index, ExceptionState& exceptionState)
{
if (resultType() != UNORDERED_NODE_SNAPSHOT_TYPE && resultType() != ORDERED_NODE_SNAPSHOT_TYPE) {
- exceptionState.throwTypeError(ExceptionMessages::failedToExecute("snapshotItem", "XPathResult", "The result type is not a snapshot."));
+ exceptionState.throwTypeError("The result type is not a snapshot.");
return 0;
}
« no previous file with comments | « Source/core/xml/XPathParser.cpp ('k') | Source/modules/crypto/NormalizeAlgorithm.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698