| Index: third_party/WebKit/Source/bindings/core/v8/DictionaryIterator.cpp
|
| diff --git a/third_party/WebKit/Source/bindings/core/v8/DictionaryIterator.cpp b/third_party/WebKit/Source/bindings/core/v8/DictionaryIterator.cpp
|
| index 444d225dcc84a911e16534a61787fd4dea01e32f..dc4c32d31a59b62a49a2e49b0856fe20097478bb 100644
|
| --- a/third_party/WebKit/Source/bindings/core/v8/DictionaryIterator.cpp
|
| +++ b/third_party/WebKit/Source/bindings/core/v8/DictionaryIterator.cpp
|
| @@ -28,12 +28,17 @@ bool DictionaryIterator::next(ExecutionContext* executionContext,
|
| ExceptionState& exceptionState) {
|
| DCHECK(!isNull());
|
|
|
| + v8::TryCatch tryCatch(m_isolate);
|
| +
|
| v8::Local<v8::Value> next;
|
| - // TODO(alancutter): Support callable objects as well as functions.
|
| if (!v8Call(m_iterator->Get(m_isolate->GetCurrentContext(), m_nextKey),
|
| next) ||
|
| !next->IsFunction()) {
|
| - exceptionState.throwTypeError("Expected next() function on iterator.");
|
| + if (tryCatch.HasCaught()) {
|
| + exceptionState.rethrowV8Exception(tryCatch.Exception());
|
| + } else {
|
| + exceptionState.throwTypeError("Expected next() function on iterator.");
|
| + }
|
| m_done = true;
|
| return false;
|
| }
|
| @@ -44,8 +49,12 @@ bool DictionaryIterator::next(ExecutionContext* executionContext,
|
| nullptr, m_isolate),
|
| result) ||
|
| !result->IsObject()) {
|
| - exceptionState.throwTypeError(
|
| - "Expected iterator.next() to return an Object.");
|
| + if (tryCatch.HasCaught()) {
|
| + exceptionState.rethrowV8Exception(tryCatch.Exception());
|
| + } else {
|
| + exceptionState.throwTypeError(
|
| + "Expected iterator.next() to return an Object.");
|
| + }
|
| m_done = true;
|
| return false;
|
| }
|
| @@ -64,6 +73,9 @@ bool DictionaryIterator::next(ExecutionContext* executionContext,
|
| } else {
|
| m_done = false;
|
| }
|
| + if (tryCatch.HasCaught()) {
|
| + exceptionState.rethrowV8Exception(tryCatch.Exception());
|
| + }
|
| return !m_done;
|
| }
|
|
|
|
|