| 43 | } |
| 44 | |
| 45 | void AppRuntime::RunEnvironmentTier(const char* executablePath) |
| 46 | { |
| 47 | // Create the isolate. |
| 48 | Module::Initialize(executablePath); |
| 49 | v8::Isolate::CreateParams create_params; |
| 50 | create_params.array_buffer_allocator = v8::ArrayBuffer::Allocator::NewDefaultAllocator(); |
| 51 | v8::Isolate* isolate = v8::Isolate::New(create_params); |
| 52 | |
| 53 | // Use the isolate within a scope. |
| 54 | { |
| 55 | v8::Isolate::Scope isolate_scope{isolate}; |
| 56 | v8::HandleScope isolate_handle_scope{isolate}; |
| 57 | v8::Local<v8::Context> context = v8::Context::New(isolate); |
| 58 | v8::Context::Scope context_scope{context}; |
| 59 | |
| 60 | Napi::Env env = Napi::Attach(context); |
| 61 | Run(env); |
| 62 | Napi::Detach(env); |
| 63 | } |
| 64 | |
| 65 | // Destroy the isolate. |
| 66 | // todo : GetArrayBufferAllocator not available? |
| 67 | // delete isolate->GetArrayBufferAllocator(); |
| 68 | isolate->Dispose(); |
| 69 | } |
| 70 | } |
nothing calls this directly
no test coverage detected