diff options
author | Ryan Dahl <ry@tinyclouds.org> | 2019-01-29 11:32:40 -0500 |
---|---|---|
committer | Ryan Dahl <ry@tinyclouds.org> | 2019-01-30 15:53:23 -0500 |
commit | 13582ff3f2478f2e2cafa3042fc6aa96ae5049c5 (patch) | |
tree | 02c7828b99b5e7dcb394aea7dd0e5f5b14779fbe /libdeno/internal.h | |
parent | b9e368cb4c24a8fb52d151c2d80288642433156d (diff) |
libdeno: improve exception handling
Diffstat (limited to 'libdeno/internal.h')
-rw-r--r-- | libdeno/internal.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/libdeno/internal.h b/libdeno/internal.h index 39e578e66..d1b9f1d96 100644 --- a/libdeno/internal.h +++ b/libdeno/internal.h @@ -40,6 +40,10 @@ class DenoIsolate { delete array_buffer_allocator_; } + static inline DenoIsolate* FromIsolate(v8::Isolate* isolate) { + return static_cast<DenoIsolate*>(isolate->GetData(0)); + } + void AddIsolate(v8::Isolate* isolate); void RegisterModule(const char* filename, v8::Local<v8::Module> module); void ResolveOk(const char* filename, const char* source); @@ -115,12 +119,14 @@ void Shared(v8::Local<v8::Name> property, const v8::PropertyCallbackInfo<v8::Value>& info); void BuiltinModules(v8::Local<v8::Name> property, const v8::PropertyCallbackInfo<v8::Value>& info); +void MessageCallback(v8::Local<v8::Message> message, v8::Local<v8::Value> data); static intptr_t external_references[] = { reinterpret_cast<intptr_t>(Print), reinterpret_cast<intptr_t>(Recv), reinterpret_cast<intptr_t>(Send), reinterpret_cast<intptr_t>(Shared), reinterpret_cast<intptr_t>(BuiltinModules), + reinterpret_cast<intptr_t>(MessageCallback), 0}; static const deno_buf empty_buf = {nullptr, 0, nullptr, 0}; |