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

Unified Diff: Source/core/dom/CharacterData.cpp

Issue 24199003: Improve exception messages for Source/core/dom/CharacterData.cpp (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: rebaseline. Created 7 years, 3 months 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 | « LayoutTests/fast/dom/characterdata-api-arguments-expected.txt ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/dom/CharacterData.cpp
diff --git a/Source/core/dom/CharacterData.cpp b/Source/core/dom/CharacterData.cpp
index f9c57b15d5f79ab8a5f7a7ca23970bac7f18e150..9d6f9c7e3a9cb3c14488558538f26487890cc608 100644
--- a/Source/core/dom/CharacterData.cpp
+++ b/Source/core/dom/CharacterData.cpp
@@ -22,6 +22,7 @@
#include "config.h"
#include "core/dom/CharacterData.h"
+#include "bindings/v8/ExceptionMessages.h"
#include "bindings/v8/ExceptionState.h"
#include "core/dom/Document.h"
#include "core/dom/EventNames.h"
@@ -61,7 +62,7 @@ void CharacterData::setData(const String& data)
String CharacterData::substringData(unsigned offset, unsigned count, ExceptionState& es)
{
if (offset > length()) {
- es.throwDOMException(IndexSizeError);
+ es.throwDOMException(IndexSizeError, ExceptionMessages::failedToExecute("substringData", "CharacterData", "The offset " + String::number(offset) + " is greater than the node's length (" + String::number(length()) + ")."));
return String();
}
@@ -120,7 +121,7 @@ void CharacterData::appendData(const String& data)
void CharacterData::insertData(unsigned offset, const String& data, ExceptionState& es, RecalcStyleBehavior recalcStyleBehavior)
{
if (offset > length()) {
- es.throwDOMException(IndexSizeError);
+ es.throwDOMException(IndexSizeError, ExceptionMessages::failedToExecute("insertData", "CharacterData", "The offset " + String::number(offset) + " is greater than the node's length (" + String::number(length()) + ")."));
return;
}
@@ -135,7 +136,7 @@ void CharacterData::insertData(unsigned offset, const String& data, ExceptionSta
void CharacterData::deleteData(unsigned offset, unsigned count, ExceptionState& es, RecalcStyleBehavior recalcStyleBehavior)
{
if (offset > length()) {
- es.throwDOMException(IndexSizeError);
+ es.throwDOMException(IndexSizeError, ExceptionMessages::failedToExecute("deleteData", "CharacterData", "The offset " + String::number(offset) + " is greater than the node's length (" + String::number(length()) + ")."));
return;
}
@@ -156,7 +157,7 @@ void CharacterData::deleteData(unsigned offset, unsigned count, ExceptionState&
void CharacterData::replaceData(unsigned offset, unsigned count, const String& data, ExceptionState& es)
{
if (offset > length()) {
- es.throwDOMException(IndexSizeError);
+ es.throwDOMException(IndexSizeError, ExceptionMessages::failedToExecute("replaceData", "CharacterData", "The offset " + String::number(offset) + " is greater than the node's length (" + String::number(length()) + ")."));
return;
}
« no previous file with comments | « LayoutTests/fast/dom/characterdata-api-arguments-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698