| Index: src/api.cc
|
| diff --git a/src/api.cc b/src/api.cc
|
| index bda34bdfacacbb369f5e8db2b18d03c6f38b1ec7..ad544f580e138aade3dbd45004e7265be1b78080 100644
|
| --- a/src/api.cc
|
| +++ b/src/api.cc
|
| @@ -2068,6 +2068,17 @@ Local<String> Message::Get() const {
|
| }
|
|
|
|
|
| +v8::Handle<v8::Promise> Message::GetPromise() const {
|
| + i::Handle<i::JSMessageObject> message =
|
| + i::Handle<i::JSMessageObject>::cast(Utils::OpenHandle(this));
|
| + i::Object* promise = message->promise();
|
| + if (promise->IsUndefined()) return v8::Handle<v8::Promise>();
|
| + i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate();
|
| + i::Handle<i::JSObject> promise_handle(i::JSObject::cast(promise), isolate);
|
| + return Utils::PromiseToLocal(promise_handle);
|
| +}
|
| +
|
| +
|
| ScriptOrigin Message::GetScriptOrigin() const {
|
| i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate();
|
| i::Handle<i::JSMessageObject> message =
|
| @@ -5971,6 +5982,20 @@ Local<Promise> Promise::Then(Handle<Function> handler) {
|
| }
|
|
|
|
|
| +bool Promise::HasRejectHandler() {
|
| + i::Handle<i::JSObject> promise = Utils::OpenHandle(this);
|
| + i::Isolate* isolate = promise->GetIsolate();
|
| + LOG_API(isolate, "Promise::HasRejectHandler");
|
| + ENTER_V8(isolate);
|
| + EXCEPTION_PREAMBLE(isolate);
|
| + i::Handle<i::Object> result;
|
| + has_pending_exception = !i::Execution::PromiseHasRejectHandler(
|
| + isolate, promise).ToHandle(&result);
|
| + EXCEPTION_BAILOUT_CHECK(isolate, false);
|
| + return result->BooleanValue();
|
| +}
|
| +
|
| +
|
| bool v8::ArrayBuffer::IsExternal() const {
|
| return Utils::OpenHandle(this)->is_external();
|
| }
|
|
|