diff options
author | Ryan Dahl <ry@tinyclouds.org> | 2019-01-06 16:32:21 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-01-06 16:32:21 -0500 |
commit | 1b7938e3aa0ba1fb7ad7d6699f01cbf3c8a4196c (patch) | |
tree | 25b63f93af0d5e9e571a1fd3c8c4b02191706dcf /libdeno/internal.h | |
parent | f37d67e80933bc437fbd29092108eaf2deeee383 (diff) |
Add libdeno.builtinModules (#1463)
This is needed to support builtin modules like
import { open } from "deno"
Diffstat (limited to 'libdeno/internal.h')
-rw-r--r-- | libdeno/internal.h | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/libdeno/internal.h b/libdeno/internal.h index d8316ce6b..454b3e2e4 100644 --- a/libdeno/internal.h +++ b/libdeno/internal.h @@ -45,6 +45,8 @@ class DenoIsolate { void ResolveOk(const char* filename, const char* source); void ClearModules(); + v8::Local<v8::Object> GetBuiltinModules(); + v8::Isolate* isolate_; v8::ArrayBuffer::Allocator* array_buffer_allocator_; deno_buf shared_; @@ -63,6 +65,8 @@ class DenoIsolate { // Set by deno_resolve_ok v8::Persistent<v8::Module> resolve_module_; + v8::Persistent<v8::Object> builtin_modules_; + v8::Persistent<v8::Context> context_; std::map<int32_t, v8::Persistent<v8::Value>> async_data_map_; std::map<int, v8::Persistent<v8::Value>> pending_promise_map_; @@ -108,9 +112,15 @@ void Recv(const v8::FunctionCallbackInfo<v8::Value>& args); void Send(const v8::FunctionCallbackInfo<v8::Value>& args); 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); 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), 0}; + 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), + 0}; static const deno_buf empty_buf = {nullptr, 0, nullptr, 0}; |