diff options
author | Ryan Dahl <ry@tinyclouds.org> | 2018-06-10 05:34:03 +0200 |
---|---|---|
committer | Ryan Dahl <ry@tinyclouds.org> | 2018-06-10 05:34:03 +0200 |
commit | ff48eca5403140b134a3e6a772ffb6f8905fae3e (patch) | |
tree | 95935ed417348820b781061a51547722526f3913 /deno2/deno_internal.h | |
parent | 3062039ffe5563cab1f80b2d7da2d9c7e468c462 (diff) |
Expose deno::from_snapshot() constructor
Diffstat (limited to 'deno2/deno_internal.h')
-rw-r--r-- | deno2/deno_internal.h | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/deno2/deno_internal.h b/deno2/deno_internal.h new file mode 100644 index 000000000..d125f39b1 --- /dev/null +++ b/deno2/deno_internal.h @@ -0,0 +1,32 @@ +// Copyright 2018 Ryan Dahl <ry@tinyclouds.org> +// All rights reserved. MIT License. +#ifndef DENO_INTERNAL_H_ +#define DENO_INTERNAL_H_ + +#include <string> +#include "include/deno.h" +#include "v8/include/v8.h" + +namespace deno { + +void Print(const v8::FunctionCallbackInfo<v8::Value>& args); +void Recv(const v8::FunctionCallbackInfo<v8::Value>& args); +void Send(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}; + +// deno_s = Wrapped Isolate. +struct deno_s { + v8::Isolate* isolate; + std::string last_exception; + v8::Persistent<v8::Function> recv; + v8::Persistent<v8::Context> context; + RecvCallback cb; + void* data; +}; + +void deno_add_isolate(Deno* d, v8::Isolate* isolate); + +} // namespace deno +#endif // DENO_INTERNAL_H_ |