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

Unified Diff: Source/bindings/v8/custom/V8SQLResultSetRowListCustom.cpp

Issue 177323003: Migrate V8SQLResultSetRowListCustom to ExceptionState. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 10 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/bindings/v8/custom/V8SQLResultSetRowListCustom.cpp
diff --git a/Source/bindings/v8/custom/V8SQLResultSetRowListCustom.cpp b/Source/bindings/v8/custom/V8SQLResultSetRowListCustom.cpp
index b2343b8341e310bea13799d0e626e9e3661a2d23..c3f90de8297191fd8b5a99ccb8eaa1d4f861c5c0 100644
--- a/Source/bindings/v8/custom/V8SQLResultSetRowListCustom.cpp
+++ b/Source/bindings/v8/custom/V8SQLResultSetRowListCustom.cpp
@@ -31,20 +31,26 @@
#include "config.h"
#include "V8SQLResultSetRowList.h"
+#include "bindings/v8/ExceptionMessages.h"
+#include "bindings/v8/ExceptionState.h"
#include "bindings/v8/V8Binding.h"
+#include "core/dom/ExceptionCode.h"
#include "modules/webdatabase/SQLResultSetRowList.h"
namespace WebCore {
void V8SQLResultSetRowList::itemMethodCustom(const v8::FunctionCallbackInfo<v8::Value>& info)
{
+ ExceptionState exceptionState(ExceptionState::ExecutionContext, "item", "SQLResultSetRowList", info.Holder(), info.GetIsolate());
if (!info.Length()) {
- throwError(v8SyntaxError, "Item index is required.", info.GetIsolate());
+ exceptionState.throwDOMException(SyntaxError, ExceptionMessages::notEnoughArguments(1, 0));
+ exceptionState.throwIfNeeded();
return;
}
if (!info[0]->IsNumber()) {
- throwTypeError("Item index must be a number.", info.GetIsolate());
+ exceptionState.throwTypeError("The index provided is not a number.");
+ exceptionState.throwIfNeeded();
return;
}
@@ -52,7 +58,8 @@ void V8SQLResultSetRowList::itemMethodCustom(const v8::FunctionCallbackInfo<v8::
unsigned long index = info[0]->IntegerValue();
if (index >= rowList->length()) {
- throwError(v8RangeError, "Item index is out of range.", info.GetIsolate());
+ exceptionState.throwDOMException(IndexSizeError, ExceptionMessages::indexExceedsMaximumBound<unsigned>("index", index, rowList->length()));
+ exceptionState.throwIfNeeded();
return;
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698