Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(17)

Unified Diff: include/v8.h

Issue 2589113002: [api] add API for Promise status and result. (Closed)
Patch Set: Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | src/api.cc » ('j') | src/api.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/v8.h
diff --git a/include/v8.h b/include/v8.h
index b57a9ca9acbc914163d0b7be90d6ae2e4d47205c..e4d3d0b77bb719d6c7cd32ba1c5261d27be6af2a 100644
--- a/include/v8.h
+++ b/include/v8.h
@@ -3699,6 +3699,8 @@ class V8_EXPORT Function : public Object {
*/
class V8_EXPORT Promise : public Object {
public:
+ enum PromiseStatus { kPending, kFulfilled, kRejected };
jochen (gone - plz use gerrit) 2016/12/20 07:49:52 why not an enum class? also, please add a comment
Yang 2016/12/20 11:38:27 enum class requires static_cast all over the place
+
class V8_EXPORT Resolver : public Object {
public:
/**
@@ -3755,6 +3757,10 @@ class V8_EXPORT Promise : public Object {
*/
bool HasHandler();
+ MaybeLocal<Value> Result();
jochen (gone - plz use gerrit) 2016/12/20 07:49:52 please also add a comment to document this API (an
Yang 2016/12/20 11:38:27 Done.
+
+ PromiseStatus Status();
+
V8_INLINE static Promise* Cast(Value* obj);
private:
« no previous file with comments | « no previous file | src/api.cc » ('j') | src/api.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698