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

Unified Diff: src/js/prologue.js

Issue 2784213002: Add V8 extra utils for promise state (Closed)
Patch Set: Created 3 years, 9 months 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 | test/cctest/test-api.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/js/prologue.js
diff --git a/src/js/prologue.js b/src/js/prologue.js
index 59949344656b14a13069ff1f44cb05da9add3eb7..92d99e007214631b6a3938f3e4a9605d97ad50cb 100644
--- a/src/js/prologue.js
+++ b/src/js/prologue.js
@@ -218,6 +218,16 @@ extrasUtils.markPromiseAsHandled = function markPromiseAsHandled(promise) {
%PromiseMarkAsHandled(promise);
};
+extrasUtils.promiseState = function promiseState(promise) {
+ return %PromiseStatus(promise);
Dan Ehrenberg 2017/03/30 12:05:53 Is it OK for V8 extras to crash when not-a-promise
+};
+
+// [[PromiseState]] values (for extrasUtils.promiseState())
+// These values should be kept in sync with PromiseStatus in globals.h
+extrasUtils.kPROMISE_PENDING = 0;
+extrasUtils.kPROMISE_FULFILLED = 1;
+extrasUtils.kPROMISE_REJECTED = 2;
+
%ToFastProperties(extrasUtils);
})
« no previous file with comments | « no previous file | test/cctest/test-api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698