Index: Source/modules/indexeddb/IDBCursor.cpp |
diff --git a/Source/modules/indexeddb/IDBCursor.cpp b/Source/modules/indexeddb/IDBCursor.cpp |
index 8ea735858c5ba2e5254bbb7ca3ec2074d93d6faa..ed68e84584ce7cb5e220a845a730adf99e6927d3 100644 |
--- a/Source/modules/indexeddb/IDBCursor.cpp |
+++ b/Source/modules/indexeddb/IDBCursor.cpp |
@@ -142,6 +142,10 @@ PassRefPtr<IDBRequest> IDBCursor::update(ScriptState* state, ScriptValue& value, |
void IDBCursor::advance(unsigned long count, ExceptionState& exceptionState) |
{ |
IDB_TRACE("IDBCursor::advance"); |
+ if (!count) { |
+ exceptionState.throwTypeError("A count argument with value 0 (zero) was supplied, must be greater than 0."); |
+ return; |
+ } |
if (!m_gotValue) { |
exceptionState.throwDOMException(InvalidStateError, IDBDatabase::noValueErrorMessage); |
return; |
@@ -160,11 +164,6 @@ void IDBCursor::advance(unsigned long count, ExceptionState& exceptionState) |
return; |
} |
- if (!count) { |
- exceptionState.throwUninformativeAndGenericTypeError(); |
- return; |
- } |
- |
m_request->setPendingCursor(this); |
m_gotValue = false; |
m_backend->advance(count, WebIDBCallbacksImpl::create(m_request).leakPtr()); |