| 13 | using v8::Object; |
| 14 | |
| 15 | void JsSetupEnvironmentData(const Nan::FunctionCallbackInfo<v8::Value>& info) { |
| 16 | Isolate* isolate = info.GetIsolate(); |
| 17 | HandleScope scope(isolate); |
| 18 | Local<Context> context = isolate->GetCurrentContext(); |
| 19 | |
| 20 | Local<Object> data = info[0].As<Object>(); |
| 21 | Local<Number> thread_id = |
| 22 | data->Get(context, OneByteString(isolate, "threadId")) |
| 23 | .ToLocalChecked() |
| 24 | .As<Number>(); |
| 25 | Local<Boolean> is_main_thread = |
| 26 | data->Get(context, OneByteString(isolate, "isMainThread")) |
| 27 | .ToLocalChecked() |
| 28 | .As<Boolean>(); |
| 29 | Local<v8::String> node_version = |
| 30 | data->Get(context, OneByteString(isolate, "nodeVersion")) |
| 31 | .ToLocalChecked() |
| 32 | .As<v8::String>(); |
| 33 | |
| 34 | Nan::Utf8String node_version_string(node_version); |
| 35 | |
| 36 | EnvironmentData::JsSetupEnvironmentData(isolate, is_main_thread->Value(), |
| 37 | thread_id->Value(), |
| 38 | (*node_version_string)); |
| 39 | } |
| 40 | } // namespace xprofiler |
nothing calls this directly
no test coverage detected