Class ScriptExecutionContext
Class giving access to details of the environment where the script is executing
Inheritance
Inherited Members
Namespace: System.Dynamic.ExpandoObject
Assembly: cs.temp.dll.dll
Syntax
public class ScriptExecutionContext : IScriptPrivateResource
Properties
AdditionalData
Gets or sets the additional data associated to this CLR function call.
Declaration
public object AdditionalData { get; set; }
Property Value
System.Object
|
CallingLocation
Gets the location of the code calling back
Declaration
public SourceRef CallingLocation { get; }
Property Value
SourceRef
|
CurrentGlobalEnv
Gets the current global env, or null if not found.
Declaration
public Table CurrentGlobalEnv { get; }
Property Value
Table
|
IsDynamicExecution
Gets a value indicating whether this instance is running a dynamic execution. Under a dynamic execution, most methods of ScriptExecutionContext are not reliable as the processing engine of the script is not "really" running or is not available.
Declaration
public bool IsDynamicExecution { get; }
Property Value
System.Boolean
|
OwnerScript
Gets the script owning this resource.
Declaration
public Script OwnerScript { get; }
Property Value
Script
The script owning this resource. |
Implements
Methods
Call(DynValue, DynValue[])
Calls the specified function, supporting most cases. The called function must not yield.
Declaration
public DynValue Call(DynValue func, params DynValue[] args)
Parameters
DynValue
func
The function; it must be a Function or ClrFunction or have a call metamethod defined. |
DynValue[]
args
The arguments. |
Returns
DynValue
|
Exceptions
ScriptRuntimeException
If the function yields, returns a tail call request with continuations/handlers or, of course, if it encounters errors. |
EmulateClassicCall(CallbackArguments, String, Func<LuaState, Int32>)
Calls a callback function implemented in "classic way". Useful to port C code from Lua, or C# code from UniLua and KopiLua. Lua : http://www.lua.org/ UniLua : http://github.com/xebecnan/UniLua KopiLua : http://github.com/NLua/KopiLua
Declaration
public DynValue EmulateClassicCall(CallbackArguments args, string functionName, Func<LuaState, int> callback)
Parameters
CallbackArguments
args
The arguments. |
System.String
functionName
Name of the function - for error messages. |
Func<LuaState, System.Int32>
callback
The callback. |
Returns
DynValue
|
EvaluateSymbol(SymbolRef)
Tries to get the reference of a symbol in the current execution state
Declaration
public DynValue EvaluateSymbol(SymbolRef symref)
Parameters
SymbolRef
symref
|
Returns
DynValue
|
EvaluateSymbolByName(String)
Tries to get the value of a symbol in the current execution state
Declaration
public DynValue EvaluateSymbolByName(string symbol)
Parameters
System.String
symbol
|
Returns
DynValue
|
FindSymbolByName(String)
Finds a symbol by name in the current execution state
Declaration
public SymbolRef FindSymbolByName(string symbol)
Parameters
System.String
symbol
|
Returns
SymbolRef
|
GetBinaryMetamethod(DynValue, DynValue, String)
Gets the metamethod to be used for a binary operation using op1 and op2.
Declaration
public DynValue GetBinaryMetamethod(DynValue op1, DynValue op2, string eventName)
Parameters
DynValue
op1
|
DynValue
op2
|
System.String
eventName
|
Returns
DynValue
|
GetCallingCoroutine()
Gets the coroutine which is performing the call
Declaration
public Coroutine GetCallingCoroutine()
Returns
Coroutine
|
GetMetamethod(DynValue, String)
Gets the specified metamethod associated with the given value.
Declaration
public DynValue GetMetamethod(DynValue value, string metamethod)
Parameters
DynValue
value
The value. |
System.String
metamethod
The metamethod name. |
Returns
DynValue
|
GetMetamethodTailCall(DynValue, String, DynValue[])
prepares a tail call request for the specified metamethod, or null if no metamethod is found.
Declaration
public DynValue GetMetamethodTailCall(DynValue value, string metamethod, params DynValue[] args)
Parameters
DynValue
value
|
System.String
metamethod
|
DynValue[]
args
|
Returns
DynValue
|
GetMetatable(DynValue)
Gets the metatable associated with the given value.
Declaration
public Table GetMetatable(DynValue value)
Parameters
DynValue
value
The value. |
Returns
Table
|
GetScript()
Gets the script object associated with this request
Declaration
public Script GetScript()
Returns
Script
|
PerformMessageDecorationBeforeUnwind(DynValue, ScriptRuntimeException)
Performs a message decoration before unwinding after an error. To be used in the implementation of xpcall like functions.
Declaration
public void PerformMessageDecorationBeforeUnwind(DynValue messageHandler, ScriptRuntimeException exception)
Parameters
DynValue
messageHandler
The message handler. |
ScriptRuntimeException
exception
The exception. |