Chromium Code Reviews| Index: Source/bindings/core/v8/V8BindingMacros.h |
| diff --git a/Source/bindings/core/v8/V8BindingMacros.h b/Source/bindings/core/v8/V8BindingMacros.h |
| index 77a7faafd9a59fd952e4ad244a637f205fda3013..39864ef65a92eb4850d8d0658d07314ac2b98ec6 100644 |
| --- a/Source/bindings/core/v8/V8BindingMacros.h |
| +++ b/Source/bindings/core/v8/V8BindingMacros.h |
| @@ -77,6 +77,18 @@ namespace blink { |
| if (UNLIKELY(!var.prepare())) \ |
| return retVal; |
| +// Use this macro to call V8 APIs which return MaybeLocal<T>. |
| +#define CALL_V8_WITH_CHECK_MAYBELOCAL_DEFAULT(type, outVariable, callExpression, returnValue) \ |
|
Jens Widell
2015/03/04 10:33:05
This macro reminds me quite a lot about the growin
|
| + v8::Local<type> outVariable; \ |
| + { \ |
| + v8::TryCatch block; \ |
|
Jens Widell
2015/03/04 10:21:45
This TryCatch serves no purpose. Exceptions are pr
|
| + if (!(callExpression).ToLocal(&outVariable)) { \ |
|
bashi
2015/03/04 10:12:45
Dropped outVariable.IsEmpty() check because when t
|
| + if (block.HasCaught()) \ |
| + block.ReThrow(); \ |
| + return returnValue; \ |
| + } \ |
| + } |
| + |
| } // namespace blink |
| #endif // V8BindingMacros_h |