A script context.

Each script context contains its own global object, distinct from the global object in other script contexts.

Many Chakra hosting APIs require an "active" script context, which can be set using Current. Chakra hosting APIs that require a current context to be set will note that explicitly in their documentation.

 /// <summary>
 /// Initializes a new instance of the <see cref="Scope"/> struct. 
 /// </summary>
 /// <param name="context">The context to create the scope for.</param>
 public Scope(JavaScriptContext context)
 {
     _disposed = false;
     _previousContext = Current;
     Current = context;
 }
 internal static extern JavaScriptErrorCode JsSetCurrentContext(JavaScriptContext context);
 internal static extern JavaScriptErrorCode JsGetRuntime(JavaScriptContext context, out JavaScriptRuntime runtime);
 internal static extern JavaScriptErrorCode JsGetCurrentContext(out JavaScriptContext currentContext);
 internal static extern JavaScriptErrorCode JsCreateContext(JavaScriptRuntime runtime, IDebugApplication32 debugSite, out JavaScriptContext newContext);
 internal static extern JavaScriptErrorCode JsContextRelease(JavaScriptContext reference, out uint count);