-
Notifications
You must be signed in to change notification settings - Fork 0
API Host ScriptResolveContext
ResolveAsync 解析 import/include 路径时使用的上下文。
Context used by ResolveAsync when resolving import/include paths.
命名空间:AuroraScript.Source。类型:class。
Namespace:
AuroraScript.Source. Kind: class.
Purpose
ScriptResolveContext 是公开宿主类型。通过下方签名选择调用方式;对运行时对象、生命周期和异常,应由宿主在边界处明确处理。
Context used by ResolveAsync when resolving import/include paths.
Simple Example
下面是 ScriptResolveContext 的最小使用方式。
A minimal use of
ScriptResolveContext.
var context = new ScriptResolveContext(".as");
Console.WriteLine(context.Extension); // .asMembers
创建 ScriptResolveContext 实例。
Use the member according to its public signature.
Parameters:
-
extension
脚本文件扩展名。Script file extension.
-
encoding
读写文本使用的编码。Encoding used to read or write text.
Returns
新建的 ScriptResolveContext 实例。
A new
ScriptResolveContextinstance.
调用示意
以下示例展示调用形状;将占位实例和参数替换为宿主中的实际值。
The example shows the call shape; replace placeholder instances and arguments with actual host values.
var value = new ScriptResolveContext(/* 参数 */);读取 Extension 属性。
Use the member according to its public signature.
Parameters:
- 无。
None.
Returns
返回 string。
Returns
string.
调用示意
以下示例展示调用形状;将占位实例和参数替换为宿主中的实际值。
The example shows the call shape; replace placeholder instances and arguments with actual host values.
ScriptResolveContext value = /* 从宿主 API 获取实例 */;
var current = value.Extension;读取 Encoding 属性。
Use the member according to its public signature.
Parameters:
- 无。
None.
Returns
返回 Encoding。
Returns
Encoding.
调用示意
以下示例展示调用形状;将占位实例和参数替换为宿主中的实际值。
The example shows the call shape; replace placeholder instances and arguments with actual host values.
ScriptResolveContext value = /* 从宿主 API 获取实例 */;
var current = value.Encoding;AuroraScript.JIT 4.0.0 · 仓库 · MIT 许可
AuroraScript.JIT 4.0.0 · Repository · MIT License