@lcap/asl
Version:
NetEase Application Specific Language
30 lines (27 loc) • 638 B
text/typescript
import { immutable } from '../../decorators';
import { ExpressionNode, LOGIC_TYPE } from '../LogicItem';
/**
* JS 代码块
* @TODO: 当前类目前主要用于生成文档
*/
export class JSBlock extends ExpressionNode {
/**
* 逻辑节点类型
*/
()
public readonly type: LOGIC_TYPE = LOGIC_TYPE.JSBlock;
/**
* 代码块内容
*/
()
public readonly code: string = undefined;
/**
* 生成 JS 脚本
*/
toScript() {
return `const jsBlock_number = async () => {
${this.code}
}
await jsBlock_number();`;
}
}