diff options
author | Tristan Marion <trismarion@gmail.com> | 2018-06-22 15:30:35 +0200 |
---|---|---|
committer | Ryan Dahl <ry@tinyclouds.org> | 2018-06-22 15:30:35 +0200 |
commit | 3b595253a2e9f8badc416f85d0b09bf48f344634 (patch) | |
tree | 85939e43b504cf0ff78f69a1912209e90b67ffe5 /src/deno_internal.h | |
parent | 86354a29a40fb97e334f951428239ab8e171e2dd (diff) |
Move `deno2` folder to `src` (#277)
Diffstat (limited to 'src/deno_internal.h')
-rw-r--r-- | src/deno_internal.h | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/src/deno_internal.h b/src/deno_internal.h new file mode 100644 index 000000000..e0a4c34a4 --- /dev/null +++ b/src/deno_internal.h @@ -0,0 +1,44 @@ +// 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" + +extern "C" { +// deno_s = Wrapped Isolate. +struct deno_s { + v8::Isolate* isolate; + const v8::FunctionCallbackInfo<v8::Value>* currentArgs; + std::string last_exception; + v8::Persistent<v8::Function> sub; + v8::Persistent<v8::Context> context; + deno_sub_cb cb; + void* data; +}; +} + +namespace deno { + +struct InternalFieldData { + uint32_t data; +}; + +void Print(const v8::FunctionCallbackInfo<v8::Value>& args); +void Sub(const v8::FunctionCallbackInfo<v8::Value>& args); +void Pub(const v8::FunctionCallbackInfo<v8::Value>& args); +static intptr_t external_references[] = {reinterpret_cast<intptr_t>(Print), + reinterpret_cast<intptr_t>(Sub), + reinterpret_cast<intptr_t>(Pub), 0}; + +Deno* NewFromSnapshot(void* data, deno_sub_cb cb); + +void InitializeContext(v8::Isolate* isolate, v8::Local<v8::Context> context, + const char* js_filename, const char* js_source); + +void AddIsolate(Deno* d, v8::Isolate* isolate); + +} // namespace deno +#endif // DENO_INTERNAL_H_ |