Class Context
- Namespace
- JavaScriptCore
- Assembly
- JavaScriptCore-6.0.dll
public sealed class Context : Object, IDisposable, NativeObject, GTypeProvider, InstanceFactory
- Inheritance
-
Context
- Implements
- Inherited Members
Constructors
Context(params ConstructArgument[])
[Obsolete("Regular C# constructors on native classes will be removed in a future version. Please see the linked documentation for more details. It contains scenarios and possible solutions to prepare for the upcoming changes.", DiagnosticId = "GirCore1007", UrlFormat = "https://gircore.github.io/docs/integration/diagnostic/1007.html")]
public Context(params ConstructArgument[] constructArguments)
Parameters
constructArgumentsConstructArgument[]
Context(CreationData)
[Obsolete("This constructor is a workaround to keep legacy APIs alive. Do not use it.")]
protected Context(CreationData data)
Parameters
dataCreationData
Context(ContextHandle)
protected Context(ContextHandle handle)
Parameters
handleContextHandle
Fields
VirtualMachinePropertyDefinition
public static readonly Property<VirtualMachine?, Context> VirtualMachinePropertyDefinition
Field Value
Properties
VirtualMachine
public VirtualMachine? VirtualMachine { get; }
Property Value
Methods
ClearException()
public void ClearException()
Evaluate(string, nint)
public Value Evaluate(string code, nint length)
Parameters
Returns
EvaluateWithSourceUri(string, nint, string, uint)
public Value EvaluateWithSourceUri(string code, nint length, string uri, uint lineNumber)
Parameters
Returns
GetCurrent()
public static Context? GetCurrent()
Returns
GetException()
public Exception? GetException()
Returns
GetGType()
public static Type GetGType()
Returns
GetGlobalObject()
public Value GetGlobalObject()
Returns
GetValue(string)
public Value GetValue(string name)
Parameters
namestring
Returns
GetVirtualMachine()
public VirtualMachine GetVirtualMachine()
Returns
New()
public static Context New()
Returns
NewFromPointer(nint, bool)
Creates a new managed Context instance for a given pointer.
public static Context NewFromPointer(nint ptr, bool ownsHandle)
Parameters
Returns
NewWithProperties(ConstructArgument[])
Creates a new Context and sets the properties specified by the construct arguments.
public static Context NewWithProperties(ConstructArgument[] constructArguments)
Parameters
constructArgumentsConstructArgument[]The properties to set.
Returns
NewWithVirtualMachine(VirtualMachine)
public static Context NewWithVirtualMachine(VirtualMachine vm)
Parameters
Returns
PopExceptionHandler()
public void PopExceptionHandler()
PushExceptionHandler(ExceptionHandler)
public void PushExceptionHandler(ExceptionHandler handler)
Parameters
handlerExceptionHandler
SetValue(string, Value)
public void SetValue(string name, Value value)
Parameters
Throw(string)
public void Throw(string errorMessage)
Parameters
errorMessagestring
ThrowException(Exception)
public void ThrowException(Exception exception)
Parameters
exceptionException
ThrowWithName(string, string)
public void ThrowWithName(string errorName, string errorMessage)