| Index: include/v8.h
|
| diff --git a/include/v8.h b/include/v8.h
|
| index 4d5d7138043954bb598c7ad4b5319c6d27c38a15..134b9d4fb875168a54a187a9863949f54e7f6a09 100644
|
| --- a/include/v8.h
|
| +++ b/include/v8.h
|
| @@ -85,6 +85,7 @@ class ObjectOperationDescriptor;
|
| class ObjectTemplate;
|
| class Platform;
|
| class Primitive;
|
| +class Promise;
|
| class RawOperationDescriptor;
|
| class Script;
|
| class Signature;
|
| @@ -2851,6 +2852,12 @@ class V8_EXPORT Promise : public Object {
|
| Local<Promise> Catch(Handle<Function> handler);
|
| Local<Promise> Then(Handle<Function> handler);
|
|
|
| + /**
|
| + * Returns true if the promise has a reject handler
|
| + * (including default handler).
|
| + */
|
| + bool HasRejectHandler();
|
| +
|
| V8_INLINE static Promise* Cast(Value* obj);
|
|
|
| private:
|
| @@ -4196,6 +4203,16 @@ typedef void (*MemoryAllocationCallback)(ObjectSpace space,
|
| // --- Leave Script Callback ---
|
| typedef void (*CallCompletedCallback)();
|
|
|
| +// --- Promise Reject Callback ---
|
| +enum PromiseRejectEvent {
|
| + kPromiseRejectWithNoHandler = 0,
|
| + kPromiseHandlerAddedAfterReject = 1
|
| +};
|
| +
|
| +typedef void (*PromiseRejectCallback)(Handle<Promise> promise,
|
| + Handle<Value> value,
|
| + PromiseRejectEvent event);
|
| +
|
| // --- Microtask Callback ---
|
| typedef void (*MicrotaskCallback)(void* data);
|
|
|
| @@ -4771,6 +4788,13 @@ class V8_EXPORT Isolate {
|
| */
|
| void RemoveCallCompletedCallback(CallCompletedCallback callback);
|
|
|
| +
|
| + /**
|
| + * Set callback to notify about promise reject with no handler, or
|
| + * revocation of such a previous notification once the handler is added.
|
| + */
|
| + void SetPromiseRejectCallback(PromiseRejectCallback callback);
|
| +
|
| /**
|
| * Experimental: Runs the Microtask Work Queue until empty
|
| * Any exceptions thrown by microtask callbacks are swallowed.
|
| @@ -5880,7 +5904,7 @@ class Internals {
|
| static const int kNullValueRootIndex = 7;
|
| static const int kTrueValueRootIndex = 8;
|
| static const int kFalseValueRootIndex = 9;
|
| - static const int kEmptyStringRootIndex = 164;
|
| + static const int kEmptyStringRootIndex = 166;
|
|
|
| // The external allocation limit should be below 256 MB on all architectures
|
| // to avoid that resource-constrained embedders run low on memory.
|
|
|