Index: Source/bindings/v8/V8BindingMacros.h |
diff --git a/Source/bindings/v8/V8BindingMacros.h b/Source/bindings/v8/V8BindingMacros.h |
index 95e3cbbf7a52b3b52101630bc35d3dca56dfce03..67629a58879a2806bf7a15952589415c393fd242 100644 |
--- a/Source/bindings/v8/V8BindingMacros.h |
+++ b/Source/bindings/v8/V8BindingMacros.h |
@@ -57,6 +57,19 @@ namespace WebCore { |
} \ |
} |
+#define TONATIVE_VOID_ASYNC(type, var, value, info) \ |
+ type var; \ |
+ { \ |
+ v8::TryCatch block; \ |
+ var = (value); \ |
+ if (UNLIKELY(block.HasCaught())) { \ |
+ v8::Isolate* isolate = info.GetIsolate(); \ |
+ ScriptPromise promise = ScriptPromise::reject(block.Exception(), isolate); \ |
+ v8SetReturnValue(info, promise.v8Value()); \ |
+ return; \ |
+ } \ |
+ } |
+ |
#define TONATIVE_BOOL(type, var, value, retVal) \ |
type var; \ |
{ \ |
@@ -79,15 +92,28 @@ namespace WebCore { |
return; \ |
} |
+#define TONATIVE_VOID_EXCEPTIONSTATE_ASYNC(type, var, value, exceptionState, info) \ |
+ type var; \ |
+ { \ |
+ v8::TryCatch block; \ |
+ var = (value); \ |
+ if (UNLIKELY(block.HasCaught())) \ |
+ exceptionState.rethrowV8Exception(block.Exception()); \ |
+ if (UNLIKELY(exceptionState.hadException())) { \ |
+ v8SetReturnValue(info, exceptionState.reject().v8Value()); \ |
+ return; \ |
+ } \ |
+ } |
+ |
#define TONATIVE_BOOL_EXCEPTIONSTATE(type, var, value, exceptionState, retVal) \ |
- type var; \ |
- { \ |
- v8::TryCatch block; \ |
- var = (value); \ |
- if (UNLIKELY(block.HasCaught())) \ |
- exceptionState.rethrowV8Exception(block.Exception()); \ |
- if (UNLIKELY(exceptionState.throwIfNeeded())) \ |
- return retVal; \ |
+ type var; \ |
+ { \ |
+ v8::TryCatch block; \ |
+ var = (value); \ |
+ if (UNLIKELY(block.HasCaught())) \ |
+ exceptionState.rethrowV8Exception(block.Exception()); \ |
+ if (UNLIKELY(exceptionState.throwIfNeeded())) \ |
+ return retVal; \ |
} |
// type is an instance of class template V8StringResource<>, |
@@ -103,6 +129,19 @@ namespace WebCore { |
if (UNLIKELY(!var.prepare())) \ |
return retVal; |
+#define TOSTRING_VOID_ASYNC(type, var, value, info) \ |
+ type var(value); \ |
+ { \ |
+ v8::TryCatch block; \ |
+ var.prepare(); \ |
+ if (UNLIKELY(block.HasCaught())) { \ |
+ v8::Isolate* isolate = info.GetIsolate(); \ |
+ ScriptPromise promise = ScriptPromise::reject(block.Exception(), isolate); \ |
+ v8SetReturnValue(info, promise.v8Value()); \ |
+ return; \ |
+ } \ |
+ } |
+ |
} // namespace WebCore |
#endif // V8BindingMacros_h |