Repository navigation
API Host ReceiverExportAttribute
Liu.Yandong.Hanks edited this page Sep 7, 2026
·
2 revisions
把 public static Core 方法导出为引擎自有 NativeReceiverType 的脚本实例成员。
命名空间:AuroraScript.Hosting。类型:class。
[NativeType("String", NativeReceiverType = typeof(string))]
public sealed partial class StringValue
{
[ReceiverExport("trim")]
public static string TrimCore(string value) => value.Trim();
}可选 ScriptContext 之后的第一个 Core 参数是原始 CLR 接收者,不属于脚本实参。目前接收者表示支持 string、double、long 和 ulong。该属性不支持 setter。
ReceiverExportAttribute(string scriptName)
ReceiverExportAttribute(string scriptName, MatchFailure failure)string ScriptNameMatchFailure Failure-
string DynamicAdapter— 指定后使用已有动态回调,不生成动态包装器;同名重载必须共享该适配器。 bool IsGetterbool Writablebool Enumerable
方法默认不可写、不可枚举。Writable = true 的成员可在脚本原型上替换,因此不会进入编译器 Native 直调目录。存在可写成员时,生成的原型不会被冻结。
AuroraScript.JIT 4.0.0 · 文档首页 · 仓库 · MIT License
- 宿主集成
- 脚本原生类型
- .NET 宿主 API 参考
- 引擎与执行
- 编译配置
- 源解析
- 脚本原生类型
- NativeTypeAttribute
- NativePackageAttribute
- ExportAttribute
- ReceiverExportAttribute
- AuroraExportValueKind
- AuroraParamAttribute
- AuroraGeneratedExportAttribute
- AuroraGeneratedConstantAttribute
- MatchFailure
- MatchLevel
- IAuroraNativeInstance
- INativeTypedDocument
- AuroraNativeObject
- AuroraNativeObjectAttribute
- 运行时值
- ScriptDatum
- ValueKind
- ScriptObject
- ScriptArray
- ScriptType
- TypeAccess
- ObjectFlags
- NumberValue
- Int64Value
- UInt64Value
- StringValue
- BooleanValue
- NullValue
- ScriptDate
- ScriptError
- ScriptHashMap
- ScriptRegex
- ScriptProxy
- StringBuffer
- ScriptEnumerator
- ScriptFunctionDelegate
- ScriptMethodDelegate
- ClosureFunction
- CLR 互操作
- 宿主 TDoc
- 扩展包
- 序列化与调试
- 异常与诊断