MCPcopy Create free account
hub / github.com/aiscript-dev/aiscript / evalAndSetAttr

Method evalAndSetAttr

src/interpreter/index.ts:1654–1667  ·  view source on GitHub ↗
(attr: Ast.Attribute[], value: Value, scope: Scope, callStack: readonly CallInfo[])

Source from the content-addressed store, hash-verified

1652
1653 @autobind
1654 private async evalAndSetAttr(attr: Ast.Attribute[], value: Value, scope: Scope, callStack: readonly CallInfo[]): Promise<void> {
1655 if (attr.length > 0) {
1656 const attrs: Value['attr'] = [];
1657 for (const nAttr of attr) {
1658 const value = await this._eval(nAttr.value, scope, callStack);
1659 assertValue(value);
1660 attrs.push({
1661 name: nAttr.name,
1662 value,
1663 });
1664 }
1665 value.attr = attrs;
1666 }
1667 }
1668
1669 @autobind
1670 private evalAndSetAttrSync(attr: Ast.Attribute[], value: Value, scope: Scope, callStack: readonly CallInfo[]): void {

Callers 2

collectNsMemberMethod · 0.95
__evalMethod · 0.95

Calls 2

_evalMethod · 0.95
assertValueFunction · 0.85

Tested by

no test coverage detected