Chromium Code Reviews| 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); |
| }) |