Skip to main content
Version: 3.6

AnonymousFunction 匿名函数

1. 结构声明

class AnonymousFunction extends LogicItem {
params: Array<Param>;
body: LogicItem;
typeAnnotation?: TypeAnnotation;
}

2. 节点示例

(1) 示例

AST 如下:

{
"concept": "AnonymousFunction",
"params": [
{
"concept": "Param",
"name": "item",
"description": ""
}
],
"body": {
"concept": "BinaryExpression",
"left": {
"concept": "MemberExpression",
"object": {
"concept": "MemberExpression",
"object": {
"concept": "Identifier",
"namespace": "",
"name": "item"
},
"property": {
"concept": "Identifier",
"namespace": "",
"name": "productReport"
}
},
"property": {
"concept": "Identifier",
"namespace": "",
"name": "executed"
}
},
"right": {
"concept": "NullLiteral"
},
"operator": "!="
}
}

对应的代码如下:

{ item: nasl::core::String => item.productReport.executed != null }