PromucFlow_constructor/app/client/src/constants/ast.ts
Rishabh Rathod c6e22c73ed
fix: JsObject parsing (#14842)
- Change the parsing logic to track variableDeclarator and check for JSObject being declared and find its properties using the AST Node.
- As we are exactly checking JSObject Node we won’t have any incorrect properties defined or any property missed
2022-06-29 10:03:36 +05:30

31 lines
1.1 KiB
TypeScript

export const ECMA_VERSION = 11;
/* Indicates the mode the code should be parsed in.
This influences global strict mode and parsing of import and export declarations.
*/
export enum SourceType {
script = "script",
module = "module",
}
// Each node has an attached type property which further defines
// what all properties can the node have.
// We will just define the ones we are working with
export enum NodeTypes {
Identifier = "Identifier",
AssignmentPattern = "AssignmentPattern",
Literal = "Literal",
Property = "Property",
// Declaration - https://github.com/estree/estree/blob/master/es5.md#declarations
FunctionDeclaration = "FunctionDeclaration",
ExportDefaultDeclaration = "ExportDefaultDeclaration",
VariableDeclarator = "VariableDeclarator",
// Expression - https://github.com/estree/estree/blob/master/es5.md#expressions
MemberExpression = "MemberExpression",
FunctionExpression = "FunctionExpression",
ArrowFunctionExpression = "ArrowFunctionExpression",
ObjectExpression = "ObjectExpression",
ArrayExpression = "ArrayExpression",
ThisExpression = "ThisExpression",
}