diff options
author | Kevin (Kun) "Kassimo" Qian <kevinkassimo@gmail.com> | 2018-10-12 11:22:52 -0700 |
---|---|---|
committer | Ryan Dahl <ry@tinyclouds.org> | 2018-10-12 14:22:52 -0400 |
commit | 45d3b8955de628db0ef051eeb8e351837b4a3b3e (patch) | |
tree | 252bab755760d86cab48502abdabe6ff0c2b9af2 /libdeno/internal.h | |
parent | c9f95d51da9f6075b1f28a842dc830ec5fe7a30e (diff) |
Fix promise reject issue (#936)
Diffstat (limited to 'libdeno/internal.h')
-rw-r--r-- | libdeno/internal.h | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/libdeno/internal.h b/libdeno/internal.h index 08e5cc0f5..f8b587658 100644 --- a/libdeno/internal.h +++ b/libdeno/internal.h @@ -14,6 +14,9 @@ struct deno_s { std::string last_exception; v8::Persistent<v8::Function> recv; v8::Persistent<v8::Function> global_error_handler; + v8::Persistent<v8::Function> promise_reject_handler; + v8::Persistent<v8::Function> promise_error_examiner; + int32_t pending_promise_events; v8::Persistent<v8::Context> context; v8::Persistent<v8::Map> async_data_map; deno_recv_cb cb; @@ -32,10 +35,16 @@ void Print(const v8::FunctionCallbackInfo<v8::Value>& args); void Recv(const v8::FunctionCallbackInfo<v8::Value>& args); void Send(const v8::FunctionCallbackInfo<v8::Value>& args); void SetGlobalErrorHandler(const v8::FunctionCallbackInfo<v8::Value>& args); +void SetPromiseRejectHandler(const v8::FunctionCallbackInfo<v8::Value>& args); +void SetPromiseErrorExaminer(const v8::FunctionCallbackInfo<v8::Value>& args); static intptr_t external_references[] = { - reinterpret_cast<intptr_t>(Print), reinterpret_cast<intptr_t>(Recv), + reinterpret_cast<intptr_t>(Print), + reinterpret_cast<intptr_t>(Recv), reinterpret_cast<intptr_t>(Send), - reinterpret_cast<intptr_t>(SetGlobalErrorHandler), 0}; + reinterpret_cast<intptr_t>(SetGlobalErrorHandler), + reinterpret_cast<intptr_t>(SetPromiseRejectHandler), + reinterpret_cast<intptr_t>(SetPromiseErrorExaminer), + 0}; Deno* NewFromSnapshot(void* user_data, deno_recv_cb cb); |