From 1b7938e3aa0ba1fb7ad7d6699f01cbf3c8a4196c Mon Sep 17 00:00:00 2001 From: Ryan Dahl Date: Sun, 6 Jan 2019 16:32:21 -0500 Subject: Add libdeno.builtinModules (#1463) This is needed to support builtin modules like import { open } from "deno" --- libdeno/internal.h | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'libdeno/internal.h') 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 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 resolve_module_; + v8::Persistent builtin_modules_; + v8::Persistent context_; std::map> async_data_map_; std::map> pending_promise_map_; @@ -108,9 +112,15 @@ void Recv(const v8::FunctionCallbackInfo& args); void Send(const v8::FunctionCallbackInfo& args); void Shared(v8::Local property, const v8::PropertyCallbackInfo& info); +void BuiltinModules(v8::Local property, + const v8::PropertyCallbackInfo& info); static intptr_t external_references[] = { - reinterpret_cast(Print), reinterpret_cast(Recv), - reinterpret_cast(Send), reinterpret_cast(Shared), 0}; + reinterpret_cast(Print), + reinterpret_cast(Recv), + reinterpret_cast(Send), + reinterpret_cast(Shared), + reinterpret_cast(BuiltinModules), + 0}; static const deno_buf empty_buf = {nullptr, 0, nullptr, 0}; -- cgit v1.2.3