Index: Source/bindings/v8/ExceptionState.h |
diff --git a/Source/bindings/v8/ExceptionState.h b/Source/bindings/v8/ExceptionState.h |
index d9c2b05b8efbf964243352d5fbea2f0cb792aa08..e09e223f8ea44d7d7a4b8fd5aaa7e585eaffe7bd 100644 |
--- a/Source/bindings/v8/ExceptionState.h |
+++ b/Source/bindings/v8/ExceptionState.h |
@@ -32,6 +32,7 @@ |
#define ExceptionState_h |
#include "bindings/v8/ScopedPersistent.h" |
+#include "bindings/v8/ScriptPromise.h" |
#include "bindings/v8/V8ThrowException.h" |
#include "wtf/Noncopyable.h" |
#include "wtf/text/WTFString.h" |
@@ -92,6 +93,13 @@ public: |
return true; |
} |
+ ScriptPromise rejectedPromise() |
+ { |
+ if (hadException()) |
+ return ScriptPromise::reject(m_exception.newLocal(m_isolate), m_isolate); |
+ return ScriptPromise::reject(V8ThrowException::createError(v8GeneralError, "Unknown Error", m_isolate), m_isolate); |
+ } |
+ |
Context context() const { return m_context; } |
const char* propertyName() const { return m_propertyName; } |
const char* interfaceName() const { return m_interfaceName; } |