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

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: Add TextTrackCue() exception handling test 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/bindings/v8/custom/V8TextTrackCueCustom.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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."));
return true;
}
base->setOption(index, value.get(), exceptionState);
« no previous file with comments | « Source/bindings/v8/custom/V8TextTrackCueCustom.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698