Chromium Code Reviews| Index: Source/bindings/v8/V8BindingMacros.h |
| diff --git a/Source/bindings/v8/V8BindingMacros.h b/Source/bindings/v8/V8BindingMacros.h |
| index e5841c9beda84810daf9ed7ea80f01cb7aca48cd..59b8cf9af5c1f58ad87d1f90cadd7f6dbfd32823 100644 |
| --- a/Source/bindings/v8/V8BindingMacros.h |
| +++ b/Source/bindings/v8/V8BindingMacros.h |
| @@ -46,15 +46,18 @@ namespace WebCore { |
| return block.ReThrow(); \ |
| } |
| +#define TONATIVE_VOID_INTERNAL(var, value) \ |
| + var = (value); \ |
| + if (UNLIKELY(block.HasCaught())) { \ |
| + block.ReThrow(); \ |
| + return; \ |
| + } |
| + |
| #define TONATIVE_VOID(type, var, value) \ |
| type var; \ |
| { \ |
| v8::TryCatch block; \ |
| - var = (value); \ |
| - if (UNLIKELY(block.HasCaught())) { \ |
| - block.ReThrow(); \ |
| - return; \ |
| - } \ |
| + TONATIVE_VOID_INTERNAL(var, value); \ |
| } |
| #define TONATIVE_DEFAULT(type, var, value, retVal) \ |
| @@ -68,15 +71,18 @@ namespace WebCore { |
| } \ |
| } |
| -#define TONATIVE_VOID_EXCEPTIONSTATE(type, var, value, exceptionState) \ |
| - type var; \ |
| - { \ |
| - v8::TryCatch block; \ |
| - var = (value); \ |
| - if (UNLIKELY(block.HasCaught())) \ |
| - exceptionState.rethrowV8Exception(block.Exception()); \ |
| - if (UNLIKELY(exceptionState.throwIfNeeded())) \ |
| - return; \ |
| +#define TONATIVE_VOID_EXCEPTIONSTATE_INTERNAL(var, value, exceptionState) \ |
| + var = (value); \ |
| + if (UNLIKELY(block.HasCaught())) \ |
| + exceptionState.rethrowV8Exception(block.Exception()); \ |
| + if (UNLIKELY(exceptionState.throwIfNeeded())) \ |
| + return; |
| + |
| +#define TONATIVE_VOID_EXCEPTIONSTATE(type, var, value, exceptionState) \ |
| + type var; \ |
| + { \ |
| + v8::TryCatch block; \ |
| + TONATIVE_VOID_EXCEPTIONSTATE_INTERNAL(var, value, exceptionState); \ |
| } |
| #define TONATIVE_DEFAULT_EXCEPTIONSTATE(type, var, value, exceptionState, retVal) \ |
| @@ -98,6 +104,11 @@ namespace WebCore { |
| if (UNLIKELY(!var.prepare())) \ |
| return; |
| +#define TOSTRING_VOID_INTERNAL(var, value) \ |
| + var = value; \ |
| + if (UNLIKELY(!var.prepare())) \ |
| + return; |
|
Jens Widell
2014/05/09 13:42:10
It seems we need a "block.ReThrow()" here as well.
|
| + |
| #define TOSTRING_DEFAULT(type, var, value, retVal) \ |
| type var(value); \ |
| if (UNLIKELY(!var.prepare())) \ |