| 94 | struct V8Context : public Context::Pimpl |
| 95 | { |
| 96 | V8Context() |
| 97 | { |
| 98 | (void) V8Initialiser::get(); |
| 99 | |
| 100 | createParams.array_buffer_allocator = v8::ArrayBuffer::Allocator::NewDefaultAllocator(); |
| 101 | isolate = v8::Isolate::New (createParams); |
| 102 | isolate->SetData (0, this); |
| 103 | |
| 104 | isolate->SetHostImportModuleDynamicallyCallback (+[] (v8::Local<v8::Context> c, |
| 105 | v8::Local<v8::Data> /*hostOptions*/, |
| 106 | v8::Local<v8::Value> /*resourceName*/, |
| 107 | v8::Local<v8::String> specifier, |
| 108 | v8::Local<v8::FixedArray> /*importAssertions*/) |
| 109 | { |
| 110 | return static_cast<V8Context*> (c->GetIsolate()->GetData (0)) |
| 111 | ->loadDynamicModule (c, specifier); |
| 112 | }); |
| 113 | |
| 114 | v8::Isolate::Scope isolateScope (isolate); |
| 115 | v8::HandleScope handleScope (isolate); |
| 116 | |
| 117 | context.Reset (isolate, v8::Context::New (isolate)); |
| 118 | } |
| 119 | |
| 120 | ~V8Context() override |
| 121 | { |
nothing calls this directly
no test coverage detected