| Index: third_party/WebKit/Source/bindings/core/v8/V8Binding.cpp
|
| diff --git a/third_party/WebKit/Source/bindings/core/v8/V8Binding.cpp b/third_party/WebKit/Source/bindings/core/v8/V8Binding.cpp
|
| index 95446d8c2c24dfd8f6babf5160d96b2dd564d0a3..76ca1263094f78a0b2895652f1f5fe97f84566a9 100644
|
| --- a/third_party/WebKit/Source/bindings/core/v8/V8Binding.cpp
|
| +++ b/third_party/WebKit/Source/bindings/core/v8/V8Binding.cpp
|
| @@ -897,30 +897,35 @@ v8::Local<v8::Function> getBoundFunction(v8::Local<v8::Function> function) {
|
| : function;
|
| }
|
|
|
| -v8::MaybeLocal<v8::Object> getEsIterator(v8::Isolate* isolate,
|
| - v8::Local<v8::Object> object,
|
| - ExceptionState& exceptionState) {
|
| +v8::Local<v8::Object> getEsIterator(v8::Isolate* isolate,
|
| + v8::Local<v8::Object> object,
|
| + ExceptionState& exceptionState) {
|
| + v8::TryCatch block(isolate);
|
| v8::Local<v8::Context> context = isolate->GetCurrentContext();
|
| v8::Local<v8::Value> iteratorGetter;
|
| if (!object->Get(context, v8::Symbol::GetIterator(isolate))
|
| - .ToLocal(&iteratorGetter))
|
| - return v8::MaybeLocal<v8::Object>();
|
| + .ToLocal(&iteratorGetter)) {
|
| + exceptionState.rethrowV8Exception(block.Exception());
|
| + return v8::Local<v8::Object>();
|
| + }
|
| if (!iteratorGetter->IsFunction()) {
|
| exceptionState.throwTypeError("Iterator getter is not callable.");
|
| - return v8::MaybeLocal<v8::Object>();
|
| + return v8::Local<v8::Object>();
|
| }
|
|
|
| v8::Local<v8::Function> getterFunction = iteratorGetter.As<v8::Function>();
|
| v8::Local<v8::Value> iterator;
|
| if (!V8ScriptRunner::callFunction(getterFunction, toExecutionContext(context),
|
| object, 0, nullptr, isolate)
|
| - .ToLocal(&iterator))
|
| - return v8::MaybeLocal<v8::Object>();
|
| + .ToLocal(&iterator)) {
|
| + exceptionState.rethrowV8Exception(block.Exception());
|
| + return v8::Local<v8::Object>();
|
| + }
|
| if (!iterator->IsObject()) {
|
| exceptionState.throwTypeError("Iterator is not an object.");
|
| - return v8::MaybeLocal<v8::Object>();
|
| + return v8::Local<v8::Object>();
|
| }
|
| - return v8::MaybeLocal<v8::Object>(iterator.As<v8::Object>());
|
| + return iterator.As<v8::Object>();
|
| }
|
|
|
| bool addHiddenValueToArray(v8::Isolate* isolate,
|
|
|