From 88234f529f9fdc3aa2736a6575a3778e0311110d Mon Sep 17 00:00:00 2001 From: Marijn Haverbeke Date: Thu, 18 Apr 2024 09:41:07 +0200 Subject: [PATCH] Add VariableDeclarator to AnyNode type FIX: Include `VariableDeclarator` in the `AnyNode` type so that walker objects can refer to it without getting a type error. Closes https://github.com/acornjs/acorn/issues/1294 --- acorn/src/acorn.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/acorn/src/acorn.d.ts b/acorn/src/acorn.d.ts index 71b37916e..cd204b1c5 100644 --- a/acorn/src/acorn.d.ts +++ b/acorn/src/acorn.d.ts @@ -562,7 +562,7 @@ export type ModuleDeclaration = | ExportDefaultDeclaration | ExportAllDeclaration -export type AnyNode = Statement | Expression | Declaration | ModuleDeclaration | Literal | Program | SwitchCase | CatchClause | Property | Super | SpreadElement | TemplateElement | AssignmentProperty | ObjectPattern | ArrayPattern | RestElement | AssignmentPattern | ClassBody | MethodDefinition | MetaProperty | ImportSpecifier | ImportDefaultSpecifier | ImportNamespaceSpecifier | ExportSpecifier | AnonymousFunctionDeclaration | AnonymousClassDeclaration | PropertyDefinition | PrivateIdentifier | StaticBlock +export type AnyNode = Statement | Expression | Declaration | ModuleDeclaration | Literal | Program | SwitchCase | CatchClause | Property | Super | SpreadElement | TemplateElement | AssignmentProperty | ObjectPattern | ArrayPattern | RestElement | AssignmentPattern | ClassBody | MethodDefinition | MetaProperty | ImportSpecifier | ImportDefaultSpecifier | ImportNamespaceSpecifier | ExportSpecifier | AnonymousFunctionDeclaration | AnonymousClassDeclaration | PropertyDefinition | PrivateIdentifier | StaticBlock | VariableDeclarator export function parse(input: string, options: Options): Program