I was reading NodeJS and V8 source, particulary node_contextify.cc
file, and I could not understand the following line:
Context::Scope context_scope(debug_context);
I don't understand what is that Context::Scope
before what seems to be a function call. I don't think it is a declaration because it is a function code, together with an if
and other calls.
Complete relevant code:
...
if (debug_context.IsEmpty()) {
// [... lines removed for brevity ...]
}
Context::Scope context_scope(debug_context);
MaybeLocal<Script> script = Script::Compile(debug_context, script_source);
if (script.IsEmpty())
return; // Exception pending.
args.GetReturnValue().Set(script.ToLocalChecked()->Run());
}
...
What is the meaning of that Context::Scope
?
Further information:
File: node/node_contextify.cc (the line 268 is highlighted).
While I understand it is a basic question about syntax, I don't even know how to call it, so I was not able to find any result in Google, StackOverflow or C++ reference.
The question title is one of my attempts when searching for it.