-
Notifications
You must be signed in to change notification settings - Fork 0
API Host ScriptFunctionDelegate
高级宿主回调使用的低层已编译脚本函数委托签名。
Low-level compiled function delegate shape used by advanced host callbacks.
命名空间:AuroraScript.Runtime。类型:delegate。
Namespace:
AuroraScript.Runtime. Kind: delegate.
Purpose
ScriptFunctionDelegate 是公开宿主类型。通过下方签名选择调用方式;对运行时对象、生命周期和异常,应由宿主在边界处明确处理。
Low-level compiled function delegate shape used by advanced host callbacks.
Simple Example
下面是 ScriptFunctionDelegate 的最小使用方式。
A minimal use of
ScriptFunctionDelegate.
ScriptFunctionDelegate countArguments = (ctx, args) =>
ScriptDatum.FromNumber(args.Length);
// 此委托通常由高级宿主回调或已编译块使用。Members
调用 Invoke 完成其公开操作。
Use the member according to its public signature.
Parameters:
-
ctx
当前脚本执行上下文。Current script execution context.
-
args
传给脚本或回调的实参数组。Argument array passed to a script or callback.
Returns
返回 ScriptDatum。
Returns
ScriptDatum.
调用示意
以下示例展示调用形状;将占位实例和参数替换为宿主中的实际值。
The example shows the call shape; replace placeholder instances and arguments with actual host values.
ScriptFunctionDelegate value = /* 从宿主 API 获取实例 */;
var result = value.Invoke(/* ctx */, /* args */);AuroraScript.JIT 4.0.0 · Documentation Home · Repository · MIT License