Skip to main content
Version: 3.8

Param 输入参数

1. 结构声明

class Param extends BaseNode {
name: string = '';
description?: string;
spread?: boolean;
typeAnnotation?: TypeAnnotation;
defaultValue?: DefaultValue;
}

2. 节点示例

(1) 示例

AST 如下:

{
"concept": "Param",
"name": "filter",
"description": "",
"typeAnnotation": {
"concept": "TypeAnnotation",
"typeKind": "primitive",
"typeNamespace": "nasl.core",
"typeName": "Date",
"inferred": false,
"ruleMap": {}
}
}

对应的代码如下:

filter: Date

(2) 无类型标注的参数

AST 如下:

{
"concept": "Param",
"name": "index",
"description": ""
}

对应的代码如下:

index: String