Index: include/v8.h |
diff --git a/include/v8.h b/include/v8.h |
index b57a9ca9acbc914163d0b7be90d6ae2e4d47205c..f75ff4fb86476f847f88e9ffad9e465fed95e604 100644 |
--- a/include/v8.h |
+++ b/include/v8.h |
@@ -3699,6 +3699,12 @@ class V8_EXPORT Function : public Object { |
*/ |
class V8_EXPORT Promise : public Object { |
public: |
+ /** |
+ * State of the promise. Each value corresponds to one of the possible values |
+ * of the [[PromiseState]] field. |
+ */ |
+ enum PromiseState { kPending, kFulfilled, kRejected }; |
+ |
class V8_EXPORT Resolver : public Object { |
public: |
/** |
@@ -3755,6 +3761,17 @@ class V8_EXPORT Promise : public Object { |
*/ |
bool HasHandler(); |
+ /** |
+ * Returns the content of the [[PromiseResult]] field. The Promise must not |
+ * be pending. |
+ */ |
+ Local<Value> Result(); |
+ |
+ /** |
+ * Returns the value of the [[PromiseState]] field. |
+ */ |
+ PromiseState State(); |
+ |
V8_INLINE static Promise* Cast(Value* obj); |
private: |