summaryrefslogtreecommitdiff
path: root/libdeno/internal.h
diff options
context:
space:
mode:
authorYoshiya Hinosawa <stibium121@gmail.com>2018-08-26 16:57:16 +0900
committerRyan Dahl <ry@tinyclouds.org>2018-08-26 11:03:41 -0400
commit17d6d6b336e48ab53ae1efa546df7c7b045152da (patch)
tree013b5fe136c93f7526e10b4b30d7fbab5ba910f8 /libdeno/internal.h
parent3a5cf9ca8b6a4dae204139faff3f3bbad1f78b54 (diff)
refactor: add and use libdeno.setGlobalErrorHandler instead of window.onerror
Diffstat (limited to 'libdeno/internal.h')
-rw-r--r--libdeno/internal.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/libdeno/internal.h b/libdeno/internal.h
index c63ba532a..b1806618b 100644
--- a/libdeno/internal.h
+++ b/libdeno/internal.h
@@ -13,6 +13,7 @@ struct deno_s {
const v8::FunctionCallbackInfo<v8::Value>* currentArgs;
std::string last_exception;
v8::Persistent<v8::Function> recv;
+ v8::Persistent<v8::Function> global_error_handler;
v8::Persistent<v8::Context> context;
deno_recv_cb cb;
void* data;
@@ -28,9 +29,11 @@ struct InternalFieldData {
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);
static intptr_t external_references[] = {reinterpret_cast<intptr_t>(Print),
reinterpret_cast<intptr_t>(Recv),
- reinterpret_cast<intptr_t>(Send), 0};
+ reinterpret_cast<intptr_t>(Send),
+ reinterpret_cast<intptr_t>(SetGlobalErrorHandler), 0};
Deno* NewFromSnapshot(void* data, deno_recv_cb cb);