MCPcopy Create free account
hub / github.com/X-Profiler/xprofiler / JsSetupEnvironmentData

Function JsSetupEnvironmentData

src/jsapi/export_environment.cc:15–39  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

13using v8::Object;
14
15void 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

Callers

nothing calls this directly

Calls 2

OneByteStringFunction · 0.85
GetMethod · 0.45

Tested by

no test coverage detected