| Index: third_party/WebKit/Source/bindings/core/v8/V8BindingMacros.h
|
| diff --git a/third_party/WebKit/Source/bindings/core/v8/V8BindingMacros.h b/third_party/WebKit/Source/bindings/core/v8/V8BindingMacros.h
|
| index 6f84252260e02cd6de62abffa92ec447a3b66562..583266b7225600ba8c74f3a20179b1706d4e13cf 100644
|
| --- a/third_party/WebKit/Source/bindings/core/v8/V8BindingMacros.h
|
| +++ b/third_party/WebKit/Source/bindings/core/v8/V8BindingMacros.h
|
| @@ -54,11 +54,15 @@ namespace blink {
|
| (value->IsArrayBufferView() && (value.As<v8::ArrayBufferView>()->ByteLength() <= 64) ? \
|
| alloca(value.As<v8::ArrayBufferView>()->ByteLength()) : nullptr)
|
|
|
| +void emptyMaybeHandleReturned();
|
| +
|
| template <typename T>
|
| inline bool v8Call(v8::Maybe<T> maybe, T& outVariable)
|
| {
|
| - if (maybe.IsNothing())
|
| + if (maybe.IsNothing()) {
|
| + emptyMaybeHandleReturned();
|
| return false;
|
| + }
|
| outVariable = maybe.FromJust();
|
| return true;
|
| }
|
| @@ -74,13 +78,18 @@ inline bool v8Call(v8::Maybe<T> maybe, T& outVariable, v8::TryCatch& tryCatch)
|
| {
|
| bool success = v8Call(maybe, outVariable);
|
| ASSERT(success || tryCatch.HasCaught());
|
| + if (!success)
|
| + emptyMaybeHandleReturned();
|
| return success;
|
| }
|
|
|
| template <typename T>
|
| inline bool v8Call(v8::MaybeLocal<T> maybeLocal, v8::Local<T>& outVariable)
|
| {
|
| - return maybeLocal.ToLocal(&outVariable);
|
| + bool success = maybeLocal.ToLocal(&outVariable);
|
| + if (!success)
|
| + emptyMaybeHandleReturned();
|
| + return success;
|
| }
|
|
|
| template <typename T>
|
| @@ -88,6 +97,8 @@ inline bool v8Call(v8::MaybeLocal<T> maybeLocal, v8::Local<T>& outVariable, v8::
|
| {
|
| bool success = maybeLocal.ToLocal(&outVariable);
|
| ASSERT(success || tryCatch.HasCaught());
|
| + if (!success)
|
| + emptyMaybeHandleReturned();
|
| return success;
|
| }
|
|
|
|
|