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