js-ast-parser
Version:
把javascript代码字符串解析为AST对象
16 lines (15 loc) • 601 B
text/typescript
import { Block } from "../../Block";
import { IdentifierLiteralExpression } from "../expression/IdentifierLiteralExpression";
import { NodeCode } from "../../constants";
import { Statement } from "./Statement";
export class FunctionDeclarationStatement extends Statement {
type = 'FunctionDeclarationStatement';
code = NodeCode.FunctionDeclarationStatement;
identifier: IdentifierLiteralExpression;
params: IdentifierLiteralExpression[] = [];
body: Block;
constructor(currentToken: any) {
super();
this.loc.start = currentToken.loc.start
}
}