Index: src/api.cc |
diff --git a/src/api.cc b/src/api.cc |
index 63ea457cec3c1e75db81b4922f685073f1f66055..f70d0e0e3dc418fc97a886ee9f8a59001cee7de2 100644 |
--- a/src/api.cc |
+++ b/src/api.cc |
@@ -5985,6 +5985,16 @@ Local<Promise> Promise::Then(Handle<Function> handler) { |
} |
+bool Promise::HasHandler() { |
+ i::Handle<i::JSObject> promise = Utils::OpenHandle(this); |
+ i::Isolate* isolate = promise->GetIsolate(); |
+ LOG_API(isolate, "Promise::HasRejectHandler"); |
+ ENTER_V8(isolate); |
+ i::Handle<i::Symbol> key = isolate->factory()->promise_has_handler_symbol(); |
+ return i::JSObject::GetDataProperty(promise, key)->IsTrue(); |
+} |
+ |
+ |
bool v8::ArrayBuffer::IsExternal() const { |
return Utils::OpenHandle(this)->is_external(); |
} |
@@ -6732,6 +6742,13 @@ void Isolate::RemoveCallCompletedCallback(CallCompletedCallback callback) { |
} |
+void Isolate::SetPromiseRejectCallback(PromiseRejectCallback callback) { |
+ if (callback == NULL) return; |
+ i::Isolate* isolate = reinterpret_cast<i::Isolate*>(this); |
+ isolate->SetPromiseRejectCallback(callback); |
+} |
+ |
+ |
void Isolate::RunMicrotasks() { |
reinterpret_cast<i::Isolate*>(this)->RunMicrotasks(); |
} |