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

Unified Diff: third_party/WebKit/Source/bindings/core/v8/V8Binding.cpp

Issue 2455483002: Use v8::TryCatch in toImplSequence (Closed)
Patch Set: Created 4 years, 2 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 | « third_party/WebKit/Source/bindings/core/v8/V8Binding.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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,
« no previous file with comments | « third_party/WebKit/Source/bindings/core/v8/V8Binding.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698