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

Unified Diff: Source/core/html/HTMLOptionsCollection.cpp

Issue 98783003: Make HTMLOptionsCollection report TypeErrors. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: 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
Index: Source/core/html/HTMLOptionsCollection.cpp
diff --git a/Source/core/html/HTMLOptionsCollection.cpp b/Source/core/html/HTMLOptionsCollection.cpp
index 34154a054bf551d068e9cd6e9544a032fdf6eabd..aae87b078b91e92c0d6e2a108c83a51ec86dfb58 100644
--- a/Source/core/html/HTMLOptionsCollection.cpp
+++ b/Source/core/html/HTMLOptionsCollection.cpp
@@ -52,12 +52,12 @@ void HTMLOptionsCollection::add(PassRefPtr<HTMLOptionElement> element, int index
HTMLOptionElement* newOption = element.get();
if (!newOption) {
- exceptionState.throwDOMException(TypeMismatchError, ExceptionMessages::failedToExecute("add", "HTMLOptionsCollection", "The element provided was not an HTMLOptionElement."));
+ exceptionState.throwTypeError("The element provided was not an HTMLOptionElement.");
return;
}
if (index < -1) {
- exceptionState.throwDOMException(IndexSizeError, ExceptionMessages::failedToExecute("add", "HTMLOptionsCollection", "The index provided (" + String::number(index) + ") is less than -1."));
+ exceptionState.throwDOMException(IndexSizeError, "The index provided (" + String::number(index) + ") is less than -1.");
return;
}
@@ -125,7 +125,7 @@ bool HTMLOptionsCollection::anonymousIndexedSetter(unsigned index, PassRefPtr<HT
{
HTMLSelectElement* base = toHTMLSelectElement(ownerNode());
if (!value) {
- exceptionState.throwDOMException(TypeMismatchError, ExceptionMessages::failedToSet(String::number(index), "HTMLOptionsCollection", "The element provided was not an HTMLOptionElement."));
+ exceptionState.throwTypeError(ExceptionMessages::failedToSet(String::number(index), "HTMLOptionsCollection", "The element provided was not an HTMLOptionElement."));
Mike West 2013/12/02 11:18:13 We'll take care of this one in Bindings, I suppose
sof 2013/12/02 11:21:55 Yes, once the generated indexedPropertySetter() pa
return true;
}
base->setOption(index, value.get(), exceptionState);

Powered by Google App Engine
This is Rietveld 408576698