On this page

class JavascriptParser extends Parser
Source Code: lib/javascript/JavascriptParser.js#L498
new JavascriptParser(sourceType?, options?): JavascriptParser
Source Code: lib/javascript/JavascriptParser.js#L504
Attributes
sourceType:"module" | "auto" | "script"
options:Object
importPhases:boolean
parse:(code: string, options: ParseOptions) => ParseResult
strictModeViolations:false | "error" | "warn"
typescript:boolean

Creates an instance of JavascriptParser.

Source Code: lib/javascript/JavascriptParser.js#L746
Source Code: lib/javascript/JavascriptParser.js#L759
Source Code: lib/javascript/JavascriptParser.js#L757
Source Code: lib/javascript/JavascriptParser.js#L506
Type:Object
Type:HookMap<SyncBailHook<[AssignmentExpression], boolean | void>>
Type:HookMap<SyncBailHook<[AssignmentExpression, string[]], boolean | void>>
Type:SyncBailHook<[BinaryExpression], boolean | void>
Type:SyncBailHook<[ImportDeclaration | ExportNamedDeclaration | ExportAllDeclaration | FunctionDeclaration | MaybeNamedFunctionDeclaration | VariableDeclaration | ClassDeclaration | MaybeNamedClassDeclaration | ExpressionStatement | BlockStatement | StaticBlock | EmptyStatement | DebuggerStatement | WithStatement | ReturnStatement | LabeledStatement | BreakStatement | ContinueStatement | IfStatement | SwitchStatement | ThrowStatement | TryStatement | WhileStatement | DoWhileStatement | ForStatement | ForInStatement | ForOfStatement | ExportDefaultDeclaration], boolean | void>
Type:HookMap<SyncBailHook<[ImportDeclaration | ExportNamedDeclaration | ExportAllDeclaration | FunctionDeclaration | MaybeNamedFunctionDeclaration | VariableDeclaration | ClassDeclaration | MaybeNamedClassDeclaration | ExpressionStatement | BlockStatement | StaticBlock | EmptyStatement | DebuggerStatement | WithStatement | ReturnStatement | LabeledStatement | BreakStatement | ContinueStatement | IfStatement | SwitchStatement | ThrowStatement | TryStatement | WhileStatement | DoWhileStatement | ForStatement | ForInStatement | ForOfStatement | ExportDefaultDeclaration], boolean | void>>
Type:HookMap<SyncBailHook<[CallExpression], boolean | void>>
Type:HookMap<SyncBailHook<[CallExpression, string[], boolean[], [number, number][]], boolean | void>>
Type:HookMap<SyncBailHook<[CallExpression, string[], CallExpression, string[], [number, number][]], boolean | void>>
Type:HookMap<SyncBailHook<[Expression], boolean | void>>
Type:SyncBailHook<[StaticBlock | MethodDefinition | PropertyDefinition, ClassExpression | ClassDeclaration | MaybeNamedClassDeclaration], boolean | void>
Type:SyncBailHook<[Expression, MethodDefinition | PropertyDefinition, ClassExpression | ClassDeclaration | MaybeNamedClassDeclaration], boolean | void>
Type:SyncBailHook<[Expression, ClassExpression | ClassDeclaration | MaybeNamedClassDeclaration], boolean | void>
Type:SyncBailHook<[Expression], boolean | void>
Type:SyncBailHook<[Expression], void | GuardCollection>
Type:SyncBailHook<[VariableDeclarator, Statement], boolean | void>
Type:HookMap<SyncBailHook<[ImportExpressionImport | UnaryExpression | ArrayExpression | ArrowFunctionExpression | AssignmentExpression | AwaitExpression | BinaryExpression | SimpleCallExpression | NewExpression | ChainExpression | ClassExpression | ConditionalExpression | FunctionExpression | Identifier | SimpleLiteral | RegExpLiteral | BigIntLiteral | LogicalExpression | MemberExpression | MetaProperty | ObjectExpression | SequenceExpression | TaggedTemplateExpression | TemplateLiteral | ThisExpression | UpdateExpression | YieldExpression | SpreadElement | PrivateIdentifier | Super], undefined | null | BasicEvaluatedExpression>>
Type:HookMap<SyncBailHook<[CallExpression], undefined | null | BasicEvaluatedExpression>>
Type:HookMap<SyncBailHook<[Identifier | MemberExpression | ThisExpression], undefined | null | BasicEvaluatedExpression>>
Type:HookMap<SyncBailHook<[Identifier | MemberExpression | MetaProperty | ThisExpression], undefined | null | BasicEvaluatedExpression>>
Type:HookMap<SyncBailHook<[NewExpression], undefined | null | BasicEvaluatedExpression>>
Type:HookMap<SyncBailHook<[UnaryExpression], undefined | null | BasicEvaluatedExpression>>
Type:SyncBailHook<[ExportNamedDeclaration | ExportDefaultDeclaration], boolean | void>
Type:SyncBailHook<[ExportNamedDeclaration | ExportAllDeclaration | ExportDefaultDeclaration, Declaration], boolean | void>
Type:SyncBailHook<[ExportDefaultDeclaration, ImportExpressionImport | UnaryExpression | ArrayExpression | ArrowFunctionExpression | AssignmentExpression | AwaitExpression | BinaryExpression | SimpleCallExpression | NewExpression | ChainExpression | ClassExpression | ConditionalExpression | FunctionExpression | Identifier | SimpleLiteral | RegExpLiteral | BigIntLiteral | LogicalExpression | MemberExpression | MetaProperty | ObjectExpression | SequenceExpression | TaggedTemplateExpression | TemplateLiteral | ThisExpression | UpdateExpression | YieldExpression | MaybeNamedFunctionDeclaration | MaybeNamedClassDeclaration], boolean | void>
Type:SyncBailHook<[ExportNamedDeclaration | ExportAllDeclaration, ImportSource], boolean | void>
Type:SyncBailHook<[ExportNamedDeclaration | ExportAllDeclaration, ImportSource, null | string, null | string, undefined | number], boolean | void>
Type:SyncBailHook<[ExportNamedDeclaration | ExportAllDeclaration | ExportDefaultDeclaration, string, string, undefined | number], boolean | void>
Type:HookMap<SyncBailHook<[Expression], boolean | void>>
Type:SyncBailHook<[ConditionalExpression], boolean | void>
Type:SyncBailHook<[LogicalExpression], boolean | void>
Type:HookMap<SyncBailHook<[MemberExpression, string[], boolean[], [number, number][]], boolean | void>>
Type:SyncBailHook<[Program, CommentJavascriptParser[]], boolean | void>
Type:SyncBailHook<[ImportDeclaration, ImportSource], boolean | void>
Type:SyncBailHook<[ImportExpressionJavascriptParser, undefined | SimpleCallExpression | NewExpression], boolean | void>
Type:SyncBailHook<[ImportDeclaration, ImportSource, null | string, string], boolean | void>
Type:HookMap<SyncBailHook<[ImportExpressionImport | UnaryExpression | ArrayExpression | ArrowFunctionExpression | AssignmentExpression | AwaitExpression | BinaryExpression | SimpleCallExpression | NewExpression | ChainExpression | ClassExpression | ConditionalExpression | FunctionExpression | Identifier | SimpleLiteral | RegExpLiteral | BigIntLiteral | LogicalExpression | MemberExpression | MetaProperty | ObjectExpression | SequenceExpression | TaggedTemplateExpression | TemplateLiteral | ThisExpression | UpdateExpression | YieldExpression | PrivateIdentifier | FunctionDeclaration | MaybeNamedFunctionDeclaration | VariableDeclaration | ClassDeclaration | MaybeNamedClassDeclaration, number], boolean | void>>
Type:HookMap<SyncBailHook<[LabeledStatement], boolean | void>>
Type:HookMap<SyncBailHook<[Expression, string[], CallExpression, string[], [number, number][]], boolean | void>>
Type:HookMap<SyncBailHook<[NewExpression], boolean | void>>
Type:SyncBailHook<[ChainExpression], boolean | void>
Type:HookMap<SyncBailHook<[Identifier], boolean | void>>
Type:SyncBailHook<[VariableDeclarator, VariableDeclaration], boolean | void>
Type:SyncBailHook<[ImportDeclaration | ExportNamedDeclaration | ExportAllDeclaration | FunctionDeclaration | MaybeNamedFunctionDeclaration | VariableDeclaration | ClassDeclaration | MaybeNamedClassDeclaration | ExpressionStatement | BlockStatement | StaticBlock | EmptyStatement | DebuggerStatement | WithStatement | ReturnStatement | LabeledStatement | BreakStatement | ContinueStatement | IfStatement | SwitchStatement | ThrowStatement | TryStatement | WhileStatement | DoWhileStatement | ForStatement | ForInStatement | ForOfStatement | ExportDefaultDeclaration], boolean | void>
Type:HookMap<SyncBailHook<[ImportDeclaration | ExportNamedDeclaration | ExportAllDeclaration | FunctionDeclaration | MaybeNamedFunctionDeclaration | VariableDeclaration | ClassDeclaration | MaybeNamedClassDeclaration | ExpressionStatement | BlockStatement | StaticBlock | EmptyStatement | DebuggerStatement | WithStatement | ReturnStatement | LabeledStatement | BreakStatement | ContinueStatement | IfStatement | SwitchStatement | ThrowStatement | TryStatement | WhileStatement | DoWhileStatement | ForStatement | ForInStatement | ForOfStatement | ExportDefaultDeclaration], boolean | void>>
Type:SyncBailHook<[Program, CommentJavascriptParser[]], boolean | void>
Type:HookMap<SyncBailHook<[Expression], boolean | void>>
Type:SyncBailHook<[ImportDeclaration | ExportNamedDeclaration | ExportAllDeclaration | FunctionDeclaration | MaybeNamedFunctionDeclaration | VariableDeclaration | ClassDeclaration | MaybeNamedClassDeclaration | ExpressionStatement | BlockStatement | StaticBlock | EmptyStatement | DebuggerStatement | WithStatement | ReturnStatement | LabeledStatement | BreakStatement | ContinueStatement | IfStatement | SwitchStatement | ThrowStatement | TryStatement | WhileStatement | DoWhileStatement | ForStatement | ForInStatement | ForOfStatement | ExportDefaultDeclaration], boolean | void>
Type:SyncBailHook<[IfStatement], boolean | void>
Type:SyncBailHook<[ReturnStatement | ThrowStatement], boolean | void>
Type:SyncBailHook<[ImportExpressionImport | UnaryExpression | ArrayExpression | ArrowFunctionExpression | AssignmentExpression | AwaitExpression | BinaryExpression | SimpleCallExpression | NewExpression | ChainExpression | ClassExpression | ConditionalExpression | FunctionExpression | Identifier | SimpleLiteral | RegExpLiteral | BigIntLiteral | LogicalExpression | MemberExpression | MetaProperty | ObjectExpression | SequenceExpression | TaggedTemplateExpression | TemplateLiteral | ThisExpression | UpdateExpression | YieldExpression | ForOfStatement], boolean | void>
Type:HookMap<SyncBailHook<[Expression], boolean | void>>
Type:HookMap<SyncBailHook<[MemberExpression, string[]], boolean | void>>
Type:SyncBailHook<[Statement], boolean | void>
Type:HookMap<SyncBailHook<[Identifier], boolean | void>>
Type:HookMap<SyncBailHook<[Identifier], boolean | void>>
Type:HookMap<SyncBailHook<[Identifier], boolean | void>>
Type:HookMap<SyncBailHook<[Identifier], boolean | void>>
Type:HookMap<SyncBailHook<[Identifier], boolean | void>>
Source Code: lib/javascript/JavascriptParser.js#L771
Type:Context
Source Code: lib/javascript/JavascriptParser.js#L739
Type:Object
Type:boolean
javascriptParser.options.parse(code, options): ParseResult
Attributes
code:string
options:ParseOptions
Returns:ParseResult
Type:false | "error" | "warn"
Type:boolean
Source Code: lib/javascript/JavascriptParser.js#L755
Type:ClassDeclaration | MaybeNamedClassDeclaration | ClassExpression | Identifier | SimpleLiteral | RegExpLiteral | BigIntLiteral | ArrayExpression | ArrowFunctionExpression | AssignmentExpression | AwaitExpression | BinaryExpression | SimpleCallExpression | NewExpression | ChainExpression | ConditionalExpression | FunctionExpression | ImportExpression | LogicalExpression | MemberExpression | MetaProperty | ObjectExpression | SequenceExpression | TaggedTemplateExpression | TemplateLiteral | ThisExpression | UnaryExpression | UpdateExpression | YieldExpression | FunctionDeclaration | MaybeNamedFunctionDeclaration | ImportDeclaration | ExportNamedDeclaration | ExportDefaultDeclaration | ExportAllDeclaration | ExpressionStatement | BlockStatement | StaticBlock | EmptyStatement | DebuggerStatement | WithStatement | ReturnStatement | LabeledStatement | BreakStatement | ContinueStatement | IfStatement | SwitchStatement | ThrowStatement | TryStatement | WhileStatement | DoWhileStatement | ForStatement | ForInStatement | ForOfStatement | VariableDeclaration
Source Code: lib/javascript/JavascriptParser.js#L742
Source Code: lib/javascript/JavascriptParser.js#L751
Source Code: lib/javascript/JavascriptParser.js#L738
Type:"module" | "auto" | "script"
Source Code: lib/javascript/JavascriptParser.js#L744
Source Code: lib/javascript/JavascriptParser.js#L753
Type:3
Type:1
Type:2
JavascriptParser.getImportAttributes(node): Record<string, string> | undefined
Attributes
node:ImportDeclaration | ExportNamedDeclaration | ExportAllDeclaration | ImportExpressionJavascriptParser
Returns:Record<string, string> | undefined
Type:typeof VariableInfo
Type:Object
Type:0
Type:1
Type:2
Type:4
javascriptParser.blockPreWalkClassDeclaration(statement): void
Source Code: lib/javascript/JavascriptParser.js#L3443
Attributes
statement:ClassDeclaration | MaybeNamedClassDeclaration

Block pre walk class declaration.

javascriptParser.blockPreWalkExportDefaultDeclaration(statement): void
Source Code: lib/javascript/JavascriptParser.js#L3145
Attributes
statement:ExportDefaultDeclaration

Block pre walk export default declaration.

javascriptParser.blockPreWalkExportNamedDeclaration(statement): void
Source Code: lib/javascript/JavascriptParser.js#L3083
Attributes
statement:ExportNamedDeclaration

Block pre walk export named declaration.

javascriptParser.blockPreWalkExpressionStatement(statement): void
Source Code: lib/javascript/JavascriptParser.js#L2908
Attributes
statement:ExpressionStatement

Block pre walk expression statement.

javascriptParser.blockPreWalkStatement(statement): void
Source Code: lib/javascript/JavascriptParser.js#L2322
Attributes
statement:ClassDeclaration | MaybeNamedClassDeclaration | FunctionDeclaration | MaybeNamedFunctionDeclaration | ImportDeclaration | ExportNamedDeclaration | ExportDefaultDeclaration | ExportAllDeclaration | ExpressionStatement | BlockStatement | StaticBlock | EmptyStatement | DebuggerStatement | WithStatement | ReturnStatement | LabeledStatement | BreakStatement | ContinueStatement | IfStatement | SwitchStatement | ThrowStatement | TryStatement | WhileStatement | DoWhileStatement | ForStatement | ForInStatement | ForOfStatement | VariableDeclaration

Block pre walk statement.

javascriptParser.blockPreWalkStatements(statements): void
Source Code: lib/javascript/JavascriptParser.js#L2215
Attributes
statements:(ClassDeclaration | FunctionDeclaration | ImportDeclaration | ExportNamedDeclaration | ExportDefaultDeclaration | ExportAllDeclaration | ExpressionStatement | BlockStatement | StaticBlock | EmptyStatement | DebuggerStatement | WithStatement | ReturnStatement | LabeledStatement | BreakStatement | ContinueStatement | IfStatement | SwitchStatement | ThrowStatement | TryStatement | WhileStatement | DoWhileStatement | ForStatement | ForInStatement | ForOfStatement | VariableDeclaration)[]

Block pre walking iterates the scope for block variable declarations

javascriptParser.blockPreWalkVariableDeclaration(statement): void
Source Code: lib/javascript/JavascriptParser.js#L3241
Attributes
statement:VariableDeclaration

Block pre walk variable declaration.

javascriptParser.callHooksForExpression(hookMap, expr, ...args?): R | undefined
Source Code: lib/javascript/JavascriptParser.js#L4628
Attributes
hookMap:HookMap<SyncBailHook<T, R, UnsetAdditionalOptions>>
expr:ClassExpression | Identifier | SimpleLiteral | RegExpLiteral | BigIntLiteral | ArrayExpression | ArrowFunctionExpression | AssignmentExpression | AwaitExpression | BinaryExpression | SimpleCallExpression | NewExpression | ChainExpression | ConditionalExpression | FunctionExpression | ImportExpression | LogicalExpression | MemberExpression | MetaProperty | ObjectExpression | SequenceExpression | TaggedTemplateExpression | TemplateLiteral | ThisExpression | UnaryExpression | UpdateExpression | YieldExpression | Super
...args:AsArray<T>
Returns:R | undefined

Call hooks for expression.

javascriptParser.callHooksForExpressionWithFallback(hookMap, expr, fallback, defined, ...args?): R | undefined
Source Code: lib/javascript/JavascriptParser.js#L4649
Attributes
hookMap:HookMap<SyncBailHook<T, R, UnsetAdditionalOptions>>
expr:ClassExpression | Identifier | SimpleLiteral | RegExpLiteral | BigIntLiteral | ArrayExpression | ArrowFunctionExpression | AssignmentExpression | AwaitExpression | BinaryExpression | SimpleCallExpression | NewExpression | ChainExpression | ConditionalExpression | FunctionExpression | ImportExpression | LogicalExpression | MemberExpression | MetaProperty | ObjectExpression | SequenceExpression | TaggedTemplateExpression | TemplateLiteral | ThisExpression | UnaryExpression | UpdateExpression | YieldExpression | Super
fallback:((name: string, rootInfo: string | VariableInfo | ScopeInfo, getMembers: () => string[]) => R) | undefined
defined:((result?: string) => R | undefined) | undefined
...args:AsArray<T>
Returns:R | undefined

Call hooks for expression with fallback.

javascriptParser.callHooksForInfo(hookMap, info, ...args?): R | undefined
Source Code: lib/javascript/JavascriptParser.js#L4701
Attributes
hookMap:HookMap<SyncBailHook<T, R, UnsetAdditionalOptions>>
...args:AsArray<T>
Returns:R | undefined

Call hooks for info.

javascriptParser.callHooksForInfoWithFallback(hookMap, info, fallback, defined, ...args?): R | undefined
Source Code: lib/javascript/JavascriptParser.js#L4716
Attributes
hookMap:HookMap<SyncBailHook<T, R, UnsetAdditionalOptions>>
fallback:((name: string) => R | undefined) | undefined
defined:((result?: string) => R | undefined) | undefined
...args:AsArray<T>
Returns:R | undefined

Call hooks for info with fallback.

javascriptParser.callHooksForName(hookMap, name, ...args?): R | undefined
Source Code: lib/javascript/JavascriptParser.js#L4682
Attributes
hookMap:HookMap<SyncBailHook<T, R, UnsetAdditionalOptions>>
name:string
...args:AsArray<T>
Returns:R | undefined

Call hooks for name.

javascriptParser.callHooksForNameWithFallback(hookMap, name, fallback, defined, ...args?): R | undefined
Source Code: lib/javascript/JavascriptParser.js#L4785
Attributes
hookMap:HookMap<SyncBailHook<T, R, UnsetAdditionalOptions>>
name:string
fallback:((value: string) => R | undefined) | undefined
defined:(() => R) | undefined
...args:AsArray<T>
Returns:R | undefined

Call hooks for name with fallback.

javascriptParser.defineVariable(name): void
Source Code: lib/javascript/JavascriptParser.js#L5862
Attributes
name:string

Processes the provided name.

javascriptParser.destructuringAssignmentPropertiesFor(node): Set<DestructuringAssignmentProperty> | undefined
Source Code: lib/javascript/JavascriptParser.js#L2096
Attributes

Destructuring assignment properties for.

javascriptParser.detectMode(statements): void
Source Code: lib/javascript/JavascriptParser.js#L4920
Attributes
statements:(ClassDeclaration | FunctionDeclaration | ImportDeclaration | ExportNamedDeclaration | ExportDefaultDeclaration | ExportAllDeclaration | ExpressionStatement | BlockStatement | StaticBlock | EmptyStatement | DebuggerStatement | WithStatement | ReturnStatement | LabeledStatement | BreakStatement | ContinueStatement | IfStatement | SwitchStatement | ThrowStatement | TryStatement | WhileStatement | DoWhileStatement | ForStatement | ForInStatement | ForOfStatement | VariableDeclaration | Directive)[]

Processes the provided statement.

javascriptParser.enterArrayPattern(pattern, onIdent): void
Source Code: lib/javascript/JavascriptParser.js#L5021
Attributes
pattern:ArrayPattern
onIdent:(ident: string, identifier: Identifier) => void

Enter array pattern.

javascriptParser.enterAssignmentPattern(pattern, onIdent): void
Source Code: lib/javascript/JavascriptParser.js#L5049
Attributes
pattern:AssignmentPattern
onIdent:(ident: string, identifier: Identifier) => void

Enter assignment pattern.

javascriptParser.enterDeclaration(declaration, onIdent): void
Source Code: lib/javascript/JavascriptParser.js#L3017
Attributes
declaration:Declaration
onIdent:(ident: string, identifier: Identifier) => void

Processes the provided declaration.

javascriptParser.enterDestructuringAssignment(pattern, expression): ClassExpression | Identifier | SimpleLiteral | RegExpLiteral | BigIntLiteral | ArrayExpression | ArrowFunctionExpression | AssignmentExpression | AwaitExpression | BinaryExpression | SimpleCallExpression | NewExpression | ChainExpression | ConditionalExpression | FunctionExpression | ImportExpression | LogicalExpression | MemberExpression | MetaProperty | ObjectExpression | SequenceExpression | TaggedTemplateExpression | TemplateLiteral | ThisExpression | UnaryExpression | UpdateExpression | YieldExpression | undefined
Source Code: lib/javascript/JavascriptParser.js#L2930
Attributes
pattern:Pattern
expression:Expression
Returns:ClassExpression | Identifier | SimpleLiteral | RegExpLiteral | BigIntLiteral | ArrayExpression | ArrowFunctionExpression | AssignmentExpression | AwaitExpression | BinaryExpression | SimpleCallExpression | NewExpression | ChainExpression | ConditionalExpression | FunctionExpression | ImportExpression | LogicalExpression | MemberExpression | MetaProperty | ObjectExpression | SequenceExpression | TaggedTemplateExpression | TemplateLiteral | ThisExpression | UnaryExpression | UpdateExpression | YieldExpression | undefined

Enter destructuring assignment.

javascriptParser.enterIdentifier(pattern, onIdent): void
Source Code: lib/javascript/JavascriptParser.js#L4994
Attributes
pattern:Identifier
onIdent:(ident: string, identifier: Identifier) => void

Processes the provided pattern.

javascriptParser.enterObjectPattern(pattern, onIdent): void
Source Code: lib/javascript/JavascriptParser.js#L5005
Attributes
pattern:ObjectPattern
onIdent:(ident: string, identifier: Identifier) => void

Enter object pattern.

javascriptParser.enterPattern(pattern, onIdent): void
Source Code: lib/javascript/JavascriptParser.js#L4958
Attributes
pattern:Property | Identifier | MemberExpression | ObjectPattern | ArrayPattern | RestElement | AssignmentPattern
onIdent:(ident: string, identifier: Identifier) => void

Processes the provided pattern.

javascriptParser.enterPatterns(patterns, onIdent): void
Source Code: lib/javascript/JavascriptParser.js#L4942
Attributes
patterns:(string | Property | Identifier | MemberExpression | ObjectPattern | ArrayPattern | RestElement | AssignmentPattern)[]
onIdent:(ident: string) => void

Processes the provided pattern.

javascriptParser.enterRestElement(pattern, onIdent): void
Source Code: lib/javascript/JavascriptParser.js#L5040
Attributes
pattern:RestElement
onIdent:(ident: string, identifier: Identifier) => void

Enter rest element.

javascriptParser.evaluate(source): BasicEvaluatedExpression
Source Code: lib/javascript/JavascriptParser.js#L5318
Attributes

Returns evaluation result.

javascriptParser.evaluatedVariable(tagInfo): VariableInfo
Source Code: lib/javascript/JavascriptParser.js#L5956
Attributes
tagInfo:TagInfo
Returns:VariableInfo

Evaluated variable.

javascriptParser.evaluateExpression(expression): BasicEvaluatedExpression
Source Code: lib/javascript/JavascriptParser.js#L5058
Attributes
expression:ClassExpression | Identifier | SimpleLiteral | RegExpLiteral | BigIntLiteral | ArrayExpression | ArrowFunctionExpression | AssignmentExpression | AwaitExpression | BinaryExpression | SimpleCallExpression | NewExpression | ChainExpression | ConditionalExpression | FunctionExpression | ImportExpression | LogicalExpression | MemberExpression | MetaProperty | ObjectExpression | SequenceExpression | TaggedTemplateExpression | TemplateLiteral | ThisExpression | UnaryExpression | UpdateExpression | YieldExpression | PrivateIdentifier | SpreadElement | Super

Evaluate expression.

javascriptParser.extractMemberExpressionChain(expression): { memberRanges: [number, number][]; members: string[]; membersOptionals: boolean[]; object: ClassExpression | Identifier | SimpleLiteral | RegExpLiteral | BigIntLiteral | ArrayExpression | ArrowFunctionExpression | AssignmentExpression | AwaitExpression | BinaryExpression | SimpleCallExpression | NewExpression | ChainExpression | ConditionalExpression | FunctionExpression | ImportExpression | LogicalExpression | MemberExpression | MetaProperty | ObjectExpression | SequenceExpression | TaggedTemplateExpression | TemplateLiteral | ThisExpression | UnaryExpression | UpdateExpression | YieldExpression | Super }
Source Code: lib/javascript/JavascriptParser.js#L6017
Attributes
expression:ClassExpression | Identifier | SimpleLiteral | RegExpLiteral | BigIntLiteral | ArrayExpression | ArrowFunctionExpression | AssignmentExpression | AwaitExpression | BinaryExpression | SimpleCallExpression | NewExpression | ChainExpression | ConditionalExpression | FunctionExpression | ImportExpression | LogicalExpression | MemberExpression | MetaProperty | ObjectExpression | SequenceExpression | TaggedTemplateExpression | TemplateLiteral | ThisExpression | UnaryExpression | UpdateExpression | YieldExpression | Super
Returns:{ memberRanges: [number, number][]; members: string[]; membersOptionals: boolean[]; object: ClassExpression | Identifier | SimpleLiteral | RegExpLiteral | BigIntLiteral | ArrayExpression | ArrowFunctionExpression | AssignmentExpression | AwaitExpression | BinaryExpression | SimpleCallExpression | NewExpression | ChainExpression | ConditionalExpression | FunctionExpression | ImportExpression | LogicalExpression | MemberExpression | MetaProperty | ObjectExpression | SequenceExpression | TaggedTemplateExpression | TemplateLiteral | ThisExpression | UnaryExpression | UpdateExpression | YieldExpression | Super }

Extract member expression chain.

javascriptParser.getComments(range): CommentJavascriptParser[]
Source Code: lib/javascript/JavascriptParser.js#L5653
Attributes

Returns comments in the range.

javascriptParser.getFreeInfoFromVariable(varName): { info: string | VariableInfo; name: string } | undefined
Source Code: lib/javascript/JavascriptParser.js#L6064
Attributes
varName:string
Returns:{ info: string | VariableInfo; name: string } | undefined

Gets free info from variable.

javascriptParser.getLocation(node): DependencyLocation
Source Code: lib/javascript/JavascriptParser.js#L5621
Attributes
node:Object
end:number
loc:SourceLocation | null
range:[number, number]
start:number

Returns the location of a node or comment, computed from its offsets so ASTs from parsers without location support work too. Falls back to the node's own loc only when no source text is available (preparsed ASTs). Offsets can only be mapped while parsing — callbacks deferred past the parse() call must take the location upfront.

javascriptParser.getMemberExpressionInfo(expression, allowedTypes): CallExpressionInfo | ExpressionExpressionInfo | undefined
Source Code: lib/javascript/JavascriptParser.js#L6108
Attributes
expression:ClassExpression | Identifier | SimpleLiteral | RegExpLiteral | BigIntLiteral | ArrayExpression | ArrowFunctionExpression | AssignmentExpression | AwaitExpression | BinaryExpression | SimpleCallExpression | NewExpression | ChainExpression | ConditionalExpression | FunctionExpression | ImportExpression | LogicalExpression | MemberExpression | MetaProperty | ObjectExpression | SequenceExpression | TaggedTemplateExpression | TemplateLiteral | ThisExpression | UnaryExpression | UpdateExpression | YieldExpression | Super
allowedTypes:number

Gets member expression info.

javascriptParser.getMemberExpressionRoot(expression): ClassExpression | Identifier | SimpleLiteral | RegExpLiteral | BigIntLiteral | ArrayExpression | ArrowFunctionExpression | AssignmentExpression | AwaitExpression | BinaryExpression | SimpleCallExpression | NewExpression | ChainExpression | ConditionalExpression | FunctionExpression | ImportExpression | LogicalExpression | MemberExpression | MetaProperty | ObjectExpression | SequenceExpression | TaggedTemplateExpression | TemplateLiteral | ThisExpression | UnaryExpression | UpdateExpression | YieldExpression | Super
Source Code: lib/javascript/JavascriptParser.js#L5988
Attributes
expression:ClassExpression | Identifier | SimpleLiteral | RegExpLiteral | BigIntLiteral | ArrayExpression | ArrowFunctionExpression | AssignmentExpression | AwaitExpression | BinaryExpression | SimpleCallExpression | NewExpression | ChainExpression | ConditionalExpression | FunctionExpression | ImportExpression | LogicalExpression | MemberExpression | MetaProperty | ObjectExpression | SequenceExpression | TaggedTemplateExpression | TemplateLiteral | ThisExpression | UnaryExpression | UpdateExpression | YieldExpression | Super
Returns:ClassExpression | Identifier | SimpleLiteral | RegExpLiteral | BigIntLiteral | ArrayExpression | ArrowFunctionExpression | AssignmentExpression | AwaitExpression | BinaryExpression | SimpleCallExpression | NewExpression | ChainExpression | ConditionalExpression | FunctionExpression | ImportExpression | LogicalExpression | MemberExpression | MetaProperty | ObjectExpression | SequenceExpression | TaggedTemplateExpression | TemplateLiteral | ThisExpression | UnaryExpression | UpdateExpression | YieldExpression | Super

Finds the root object of a member expression chain without allocating the member arrays. The traversal/break logic must stay in sync with extractMemberExpressionChain; it lets getMemberExpressionInfo reject unrecognized roots (~77% of calls) before paying for the arrays.

javascriptParser.getNameForExpression(expression): { getMembers: () => string[]; name: string; rootInfo: ExportedVariableInfo } | undefined
Source Code: lib/javascript/JavascriptParser.js#L6173
Attributes
expression:Expression
Returns:{ getMembers: () => string[]; name: string; rootInfo: ExportedVariableInfo } | undefined

Gets name for expression.

javascriptParser.getNameInfoFromVariable(varName): { info: string | VariableInfo; name: string } | undefined
Source Code: lib/javascript/JavascriptParser.js#L6084
Attributes
varName:string
Returns:{ info: string | VariableInfo; name: string } | undefined

Gets name info from variable.

javascriptParser.getRenameIdentifier(expr): string | VariableInfo | undefined
Source Code: lib/javascript/JavascriptParser.js#L2106
Attributes
expr:ClassExpression | Identifier | SimpleLiteral | RegExpLiteral | BigIntLiteral | ArrayExpression | ArrowFunctionExpression | AssignmentExpression | AwaitExpression | BinaryExpression | SimpleCallExpression | NewExpression | ChainExpression | ConditionalExpression | FunctionExpression | ImportExpression | LogicalExpression | MemberExpression | MetaProperty | ObjectExpression | SequenceExpression | TaggedTemplateExpression | TemplateLiteral | ThisExpression | UnaryExpression | UpdateExpression | YieldExpression | SpreadElement

Gets rename identifier.

javascriptParser.getTagData(name, tag): Record<string, any> | TopLevelSymbol | HarmonySettings | ImportSettings | CommonJsImportSettings | CompatibilitySettings | undefined
Source Code: lib/javascript/JavascriptParser.js#L5809
Attributes

Returns tag data.

javascriptParser.getVariableInfo(name): ExportedVariableInfo
Source Code: lib/javascript/JavascriptParser.js#L5917
Attributes

Gets variable info.

javascriptParser.inBlockScope(fn, inExecutedPath?): void
Source Code: lib/javascript/JavascriptParser.js#L4892
Attributes
fn:() => void
inExecutedPath:boolean

Processes the provided fn.

javascriptParser.inClassScope(hasThis, params, fn): void
Source Code: lib/javascript/JavascriptParser.js#L4831
Attributes
hasThis:boolean
params:Identifier[]
fn:() => void

Processes the provided has thi.

javascriptParser.inFunctionScope(hasThis, params, fn): void
Source Code: lib/javascript/JavascriptParser.js#L4862
Attributes
hasThis:boolean
params:(string | Identifier | MemberExpression | ObjectPattern | ArrayPattern | RestElement | AssignmentPattern)[]
fn:() => void

Processes the provided has thi.

javascriptParser.inScope(params, fn): void
Source Code: lib/javascript/JavascriptParser.js#L4802
Stability: 0Deprecated
Attributes
params:(string | Property | Identifier | MemberExpression | ObjectPattern | ArrayPattern | RestElement | AssignmentPattern)[]
fn:() => void

Processes the provided param.

javascriptParser.isAsiPosition(pos): boolean
Source Code: lib/javascript/JavascriptParser.js#L5743
Attributes
pos:number
Returns:boolean

Checks whether this javascript parser is asi position.

javascriptParser.isPure(expr, commentsStartPos): boolean
Source Code: lib/javascript/JavascriptParser.js#L5366
Attributes
expr:ClassDeclaration | MaybeNamedClassDeclaration | ClassExpression | Identifier | SimpleLiteral | RegExpLiteral | BigIntLiteral | ArrayExpression | ArrowFunctionExpression | AssignmentExpression | AwaitExpression | BinaryExpression | SimpleCallExpression | NewExpression | ChainExpression | ConditionalExpression | FunctionExpression | ImportExpression | LogicalExpression | MemberExpression | MetaProperty | ObjectExpression | SequenceExpression | TaggedTemplateExpression | TemplateLiteral | ThisExpression | UnaryExpression | UpdateExpression | YieldExpression | FunctionDeclaration | MaybeNamedFunctionDeclaration | PrivateIdentifier | VariableDeclaration | null | undefined
commentsStartPos:number
Returns:boolean

Checks whether this javascript parser is pure.

javascriptParser.isStatementLevelExpression(expr): boolean
Source Code: lib/javascript/JavascriptParser.js#L5789
Attributes
Returns:boolean

Checks whether this javascript parser is statement level expression.

javascriptParser.isVariableDefined(name): boolean
Source Code: lib/javascript/JavascriptParser.js#L5887
Attributes
name:string
Returns:boolean

Checks whether this javascript parser is variable defined.

javascriptParser.modulePreWalkExportAllDeclaration(statement): void
Source Code: lib/javascript/JavascriptParser.js#L3216
Attributes
statement:ExportAllDeclaration

Module pre walk export all declaration.

javascriptParser.modulePreWalkExportNamedDeclaration(statement): void
Source Code: lib/javascript/JavascriptParser.js#L3042
Attributes
statement:ExportNamedDeclaration

Module pre walk export named declaration.

javascriptParser.modulePreWalkImportDeclaration(statement): void
Source Code: lib/javascript/JavascriptParser.js#L2970
Attributes
statement:ImportDeclaration

Module pre walk import declaration.

javascriptParser.modulePreWalkStatements(statements): void
Source Code: lib/javascript/JavascriptParser.js#L2178
Attributes
statements:(ClassDeclaration | FunctionDeclaration | ImportDeclaration | ExportNamedDeclaration | ExportDefaultDeclaration | ExportAllDeclaration | ExpressionStatement | BlockStatement | StaticBlock | EmptyStatement | DebuggerStatement | WithStatement | ReturnStatement | LabeledStatement | BreakStatement | ContinueStatement | IfStatement | SwitchStatement | ThrowStatement | TryStatement | WhileStatement | DoWhileStatement | ForStatement | ForInStatement | ForOfStatement | VariableDeclaration)[]

Module pre walking iterates the scope for import entries

javascriptParser.parse(source, state): ParserState
Source Code: lib/Parser.js#L35
Attributes
source:string | Buffer<ArrayBufferLike> | PreparsedAst
Returns:ParserState

Parses the provided source and updates the parser state.

javascriptParser.parseCalculatedString(expression): CalculatedStringResult
Source Code: lib/javascript/JavascriptParser.js#L5108
Attributes

Parses calculated string.

javascriptParser.parseCommentOptions(range): { errors: (Error & { comment: CommentJavascriptParser })[] | null; options: Record<string, any> | null }
Source Code: lib/javascript/JavascriptParser.js#L5970
Attributes
range:[number, number]
Returns:{ errors: (Error & { comment: CommentJavascriptParser })[] | null; options: Record<string, any> | null }

Parses comment options.

javascriptParser.parseString(expression): string
Source Code: lib/javascript/JavascriptParser.js#L5083
Attributes
expression:Expression
Returns:string

Returns parsed string.

javascriptParser.preWalkAssignmentExpression(expression): void
Source Code: lib/javascript/JavascriptParser.js#L2920
Attributes
expression:AssignmentExpression

Pre walk assignment expression.

javascriptParser.preWalkBlockStatement(statement): void
Source Code: lib/javascript/JavascriptParser.js#L2461
Attributes
statement:BlockStatement

Pre walk block statement.

javascriptParser.preWalkCatchClause(catchClause): void
Source Code: lib/javascript/JavascriptParser.js#L3513
Attributes
catchClause:CatchClause

Pre walk catch clause.

javascriptParser.preWalkDoWhileStatement(statement): void
Source Code: lib/javascript/JavascriptParser.js#L2723
Attributes
statement:DoWhileStatement

Pre walk do while statement.

javascriptParser.preWalkForInStatement(statement): void
Source Code: lib/javascript/JavascriptParser.js#L2789
Attributes
statement:ForInStatement

Pre walk for in statement.

javascriptParser.preWalkForOfStatement(statement): void
Source Code: lib/javascript/JavascriptParser.js#L2829
Attributes
statement:ForOfStatement

Pre walk for of statement.

javascriptParser.preWalkForStatement(statement): void
Source Code: lib/javascript/JavascriptParser.js#L2742
Attributes
statement:ForStatement

Pre walk for statement.

javascriptParser.preWalkFunctionDeclaration(statement): void
Source Code: lib/javascript/JavascriptParser.js#L2872
Attributes
statement:FunctionDeclaration | MaybeNamedFunctionDeclaration

Pre walk function declaration.

javascriptParser.preWalkIfStatement(statement): void
Source Code: lib/javascript/JavascriptParser.js#L2491
Attributes
statement:IfStatement

Pre walk if statement.

javascriptParser.preWalkLabeledStatement(statement): void
Source Code: lib/javascript/JavascriptParser.js#L2559
Attributes
statement:LabeledStatement

Pre walk labeled statement.

javascriptParser.preWalkStatement(statement): void
Source Code: lib/javascript/JavascriptParser.js#L2252
Attributes
statement:ClassDeclaration | MaybeNamedClassDeclaration | FunctionDeclaration | MaybeNamedFunctionDeclaration | ImportDeclaration | ExportNamedDeclaration | ExportDefaultDeclaration | ExportAllDeclaration | ExpressionStatement | BlockStatement | StaticBlock | EmptyStatement | DebuggerStatement | WithStatement | ReturnStatement | LabeledStatement | BreakStatement | ContinueStatement | IfStatement | SwitchStatement | ThrowStatement | TryStatement | WhileStatement | DoWhileStatement | ForStatement | ForInStatement | ForOfStatement | VariableDeclaration

Walking iterates the statements and expressions and processes them

javascriptParser.preWalkStatements(statements): void
Source Code: lib/javascript/JavascriptParser.js#L2204
Attributes
statements:(ClassDeclaration | FunctionDeclaration | ImportDeclaration | ExportNamedDeclaration | ExportDefaultDeclaration | ExportAllDeclaration | ExpressionStatement | BlockStatement | StaticBlock | EmptyStatement | DebuggerStatement | WithStatement | ReturnStatement | LabeledStatement | BreakStatement | ContinueStatement | IfStatement | SwitchStatement | ThrowStatement | TryStatement | WhileStatement | DoWhileStatement | ForStatement | ForInStatement | ForOfStatement | VariableDeclaration)[]

Pre walking iterates the scope for variable declarations

javascriptParser.preWalkSwitchCases(switchCases): void
Source Code: lib/javascript/JavascriptParser.js#L3461
Attributes
switchCases:SwitchCase[]

Pre walk switch cases.

javascriptParser.preWalkSwitchStatement(statement): void
Source Code: lib/javascript/JavascriptParser.js#L2607
Attributes
statement:SwitchStatement

Pre walk switch statement.

javascriptParser.preWalkTryStatement(statement): void
Source Code: lib/javascript/JavascriptParser.js#L2656
Attributes
statement:TryStatement

Pre walk try statement.

javascriptParser.preWalkVariableDeclaration(statement): void
Source Code: lib/javascript/JavascriptParser.js#L3232
Attributes
statement:VariableDeclaration

Pre walk variable declaration.

javascriptParser.preWalkVariableDeclarator(declarator): void
Source Code: lib/javascript/JavascriptParser.js#L3396
Attributes
declarator:VariableDeclarator

Pre walk variable declarator.

javascriptParser.preWalkWhileStatement(statement): void
Source Code: lib/javascript/JavascriptParser.js#L2704
Attributes
statement:WhileStatement

Pre walk while statement.

javascriptParser.preWalkWithStatement(statement): void
Source Code: lib/javascript/JavascriptParser.js#L2582
Attributes
statement:WithStatement

Pre walk with statement.

javascriptParser.setAsiPosition(pos): void
Source Code: lib/javascript/JavascriptParser.js#L5771
Attributes
pos:number

Updates asi position using the provided po.

javascriptParser.setVariable(name, variableInfo): void
Source Code: lib/javascript/JavascriptParser.js#L5931
Attributes
name:string

Updates variable using the provided name.

javascriptParser.tagVariable(name, tag, data?, flags?): void
Source Code: lib/javascript/JavascriptParser.js#L5827
Attributes

Processes the provided name.

javascriptParser.undefineVariable(name): void
Source Code: lib/javascript/JavascriptParser.js#L5878
Attributes
name:string

Processes the provided name.

javascriptParser.unsetAsiPosition(pos): void
Source Code: lib/javascript/JavascriptParser.js#L5780
Attributes
pos:number

Unset asi position.

javascriptParser.walkArrayExpression(expression): void
Source Code: lib/javascript/JavascriptParser.js#L3758
Attributes
expression:ArrayExpression

Walk array expression.

javascriptParser.walkArrayPattern(pattern): void
Source Code: lib/javascript/JavascriptParser.js#L3594
Attributes
pattern:ArrayPattern

Walk array pattern.

javascriptParser.walkArrowFunctionExpression(expression): void
Source Code: lib/javascript/JavascriptParser.js#L3849
Attributes
expression:ArrowFunctionExpression

Walk arrow function expression.

javascriptParser.walkAssignmentExpression(expression): void
Source Code: lib/javascript/JavascriptParser.js#L4083
Attributes
expression:AssignmentExpression

Walk assignment expression.

javascriptParser.walkAssignmentPattern(pattern): void
Source Code: lib/javascript/JavascriptParser.js#L3568
Attributes
pattern:AssignmentPattern

Walk assignment pattern.

javascriptParser.walkAwaitExpression(expression): void
Source Code: lib/javascript/JavascriptParser.js#L3747
Attributes
expression:AwaitExpression

Walk await expression.

javascriptParser.walkBinaryExpression(expression): void
Source Code: lib/javascript/JavascriptParser.js#L4060
Attributes
expression:BinaryExpression

Walk binary expression.

javascriptParser.walkBlockStatement(statement): void
Source Code: lib/javascript/JavascriptParser.js#L2469
Attributes
statement:BlockStatement | StaticBlock

Walk block statement.

javascriptParser.walkCallExpression(expression): void
Source Code: lib/javascript/JavascriptParser.js#L4352
Attributes
expression:CallExpression

Walk call expression.

javascriptParser.walkCatchClause(catchClause): void
Source Code: lib/javascript/JavascriptParser.js#L3521
Attributes
catchClause:CatchClause

Processes the provided catch clause.

javascriptParser.walkChainExpression(expression): void
Source Code: lib/javascript/JavascriptParser.js#L4248
Attributes
expression:ChainExpression

Walk chain expression.

javascriptParser.walkClass(classy): void
Source Code: lib/javascript/JavascriptParser.js#L2127
Attributes
classy:ClassDeclaration | MaybeNamedClassDeclaration | ClassExpression

Processes the provided classy.

javascriptParser.walkClassDeclaration(statement): void
Source Code: lib/javascript/JavascriptParser.js#L3453
Attributes
statement:ClassDeclaration | MaybeNamedClassDeclaration

Walk class declaration.

javascriptParser.walkClassExpression(expression): void
Source Code: lib/javascript/JavascriptParser.js#L4240
Attributes
expression:ClassExpression

Walk class expression.

javascriptParser.walkConditionalExpression(expression): void
Source Code: lib/javascript/JavascriptParser.js#L4162
Attributes
expression:ConditionalExpression

Walk conditional expression.

javascriptParser.walkDoWhileStatement(statement): void
Source Code: lib/javascript/JavascriptParser.js#L2731
Attributes
statement:DoWhileStatement

Walk do while statement.

javascriptParser.walkExportDefaultDeclaration(statement): void
Source Code: lib/javascript/JavascriptParser.js#L3181
Attributes
statement:ExportDefaultDeclaration

Walk export default declaration.

javascriptParser.walkExportNamedDeclaration(statement): void
Source Code: lib/javascript/JavascriptParser.js#L3135
Attributes
statement:ExportNamedDeclaration

Walk export named declaration.

javascriptParser.walkExpression(expression): void
Source Code: lib/javascript/JavascriptParser.js#L3626
Attributes
expression:ClassExpression | Identifier | SimpleLiteral | RegExpLiteral | BigIntLiteral | ArrayExpression | ArrowFunctionExpression | AssignmentExpression | AwaitExpression | BinaryExpression | SimpleCallExpression | NewExpression | ChainExpression | ConditionalExpression | FunctionExpression | ImportExpression | LogicalExpression | MemberExpression | MetaProperty | ObjectExpression | SequenceExpression | TaggedTemplateExpression | TemplateLiteral | ThisExpression | UnaryExpression | UpdateExpression | YieldExpression | PrivateIdentifier | SpreadElement | Super

Processes the provided expression.

javascriptParser.walkExpressions(expressions): void
Source Code: lib/javascript/JavascriptParser.js#L3613
Attributes
expressions:(ClassExpression | Identifier | SimpleLiteral | RegExpLiteral | BigIntLiteral | ArrayExpression | ArrowFunctionExpression | AssignmentExpression | AwaitExpression | BinaryExpression | SimpleCallExpression | NewExpression | ChainExpression | ConditionalExpression | FunctionExpression | ImportExpression | LogicalExpression | MemberExpression | MetaProperty | ObjectExpression | SequenceExpression | TaggedTemplateExpression | TemplateLiteral | ThisExpression | UnaryExpression | UpdateExpression | YieldExpression | SpreadElement | null)[]

Processes the provided expression.

javascriptParser.walkExpressionStatement(statement): void
Source Code: lib/javascript/JavascriptParser.js#L2483
Attributes
statement:ExpressionStatement

Walk expression statement.

javascriptParser.walkForInStatement(statement): void
Source Code: lib/javascript/JavascriptParser.js#L2800
Attributes
statement:ForInStatement

Walk for in statement.

javascriptParser.walkForOfStatement(statement): void
Source Code: lib/javascript/JavascriptParser.js#L2843
Attributes
statement:ForOfStatement

Walk for of statement.

javascriptParser.walkForStatement(statement): void
Source Code: lib/javascript/JavascriptParser.js#L2753
Attributes
statement:ForStatement

Walk for statement.

javascriptParser.walkFunctionDeclaration(statement): void
Source Code: lib/javascript/JavascriptParser.js#L2882
Attributes
statement:FunctionDeclaration | MaybeNamedFunctionDeclaration

Walk function declaration.

javascriptParser.walkFunctionExpression(expression): void
Source Code: lib/javascript/JavascriptParser.js#L3817
Attributes
expression:FunctionExpression

Walk function expression.

javascriptParser.walkGuardedBranch(frame, walk): void
Source Code: lib/javascript/JavascriptParser.js#L2505
Attributes
walk:() => void

Walks a conditional branch with its guard frame (if any) pushed onto the parser-state guard stack for the duration of the branch body.

javascriptParser.walkIdentifier(expression): void
Source Code: lib/javascript/JavascriptParser.js#L4607
Attributes
expression:Identifier

Processes the provided expression.

javascriptParser.walkIfStatement(statement): void
Source Code: lib/javascript/JavascriptParser.js#L2523
Attributes
statement:IfStatement

Processes the provided statement.

javascriptParser.walkImportExpression(expression): void
Source Code: lib/javascript/JavascriptParser.js#L4341
Attributes

Walk import expression.

javascriptParser.walkLabeledStatement(statement): void
Source Code: lib/javascript/JavascriptParser.js#L2567
Attributes
statement:LabeledStatement

Walk labeled statement.

javascriptParser.walkLeftRightExpression(expression): void
Source Code: lib/javascript/JavascriptParser.js#L4051
Attributes
expression:BinaryExpression | LogicalExpression

Walk left right expression.

javascriptParser.walkLogicalExpression(expression): void
Source Code: lib/javascript/JavascriptParser.js#L4070
Attributes
expression:LogicalExpression

Walk logical expression.

javascriptParser.walkMemberExpression(expression): void
Source Code: lib/javascript/JavascriptParser.js#L4488
Attributes
expression:MemberExpression

Walk member expression.

javascriptParser.walkMemberExpressionWithExpressionName(expression, name, rootInfo, members, onUnhandled): void
Source Code: lib/javascript/JavascriptParser.js#L4560
Attributes
expression:MemberExpression
name:string
rootInfo:string | VariableInfo
members:string[]
onUnhandled:() => R | undefined

Walk member expression with expression name.

javascriptParser.walkMetaProperty(metaProperty): void
Source Code: lib/javascript/JavascriptParser.js#L4615
Attributes
metaProperty:MetaProperty

Walk meta property.

javascriptParser.walkNestedStatement(statement): void
Source Code: lib/javascript/JavascriptParser.js#L2451
Attributes
statement:Statement

Walks a statements that is nested within a parent statement and can potentially be a non-block statement. This enforces the nested statement to never be in ASI position.

javascriptParser.walkNewExpression(expression): void
Source Code: lib/javascript/JavascriptParser.js#L4188
Attributes
expression:NewExpression

Walk new expression.

javascriptParser.walkObjectExpression(expression): void
Source Code: lib/javascript/JavascriptParser.js#L3778
Attributes
expression:ObjectExpression

Walk object expression.

javascriptParser.walkObjectPattern(pattern): void
Source Code: lib/javascript/JavascriptParser.js#L3577
Attributes
pattern:ObjectPattern

Walk object pattern.

javascriptParser.walkPattern(pattern): void
Source Code: lib/javascript/JavascriptParser.js#L3541
Attributes
pattern:Pattern

Processes the provided pattern.

javascriptParser.walkProperty(prop): void
Source Code: lib/javascript/JavascriptParser.js#L3793
Attributes
prop:Property | SpreadElement

Processes the provided prop.

javascriptParser.walkRestElement(pattern): void
Source Code: lib/javascript/JavascriptParser.js#L3605
Attributes
pattern:RestElement

Processes the provided pattern.

javascriptParser.walkReturnStatement(statement): void
Source Code: lib/javascript/JavascriptParser.js#L2640
Attributes
statement:ReturnStatement

Walk return statement.

javascriptParser.walkSequenceExpression(expression): void
Source Code: lib/javascript/JavascriptParser.js#L3876
Attributes
expression:SequenceExpression

Walk sequence expression.

javascriptParser.walkSpreadElement(expression): void
Source Code: lib/javascript/JavascriptParser.js#L3768
Attributes
expression:SpreadElement

Walk spread element.

javascriptParser.walkStatement(statement): void
Source Code: lib/javascript/JavascriptParser.js#L2366
Attributes
statement:ClassDeclaration | MaybeNamedClassDeclaration | FunctionDeclaration | MaybeNamedFunctionDeclaration | ImportDeclaration | ExportNamedDeclaration | ExportDefaultDeclaration | ExportAllDeclaration | ExpressionStatement | BlockStatement | StaticBlock | EmptyStatement | DebuggerStatement | WithStatement | ReturnStatement | LabeledStatement | BreakStatement | ContinueStatement | IfStatement | SwitchStatement | ThrowStatement | TryStatement | WhileStatement | DoWhileStatement | ForStatement | ForInStatement | ForOfStatement | VariableDeclaration

Processes the provided statement.

javascriptParser.walkStatements(statements): void
Source Code: lib/javascript/JavascriptParser.js#L2226
Attributes
statements:(ClassDeclaration | FunctionDeclaration | ImportDeclaration | ExportNamedDeclaration | ExportDefaultDeclaration | ExportAllDeclaration | ExpressionStatement | BlockStatement | StaticBlock | EmptyStatement | DebuggerStatement | WithStatement | ReturnStatement | LabeledStatement | BreakStatement | ContinueStatement | IfStatement | SwitchStatement | ThrowStatement | TryStatement | WhileStatement | DoWhileStatement | ForStatement | ForInStatement | ForOfStatement | VariableDeclaration)[]

Walking iterates the statements and expressions and processes them

javascriptParser.walkSwitchCases(switchCases): void
Source Code: lib/javascript/JavascriptParser.js#L3472
Attributes
switchCases:SwitchCase[]

Processes the provided switch case.

javascriptParser.walkSwitchStatement(statement): void
Source Code: lib/javascript/JavascriptParser.js#L2615
Attributes
statement:SwitchStatement

Walk switch statement.

javascriptParser.walkTaggedTemplateExpression(expression): void
Source Code: lib/javascript/JavascriptParser.js#L4225
Attributes
expression:TaggedTemplateExpression

Walk tagged template expression.

javascriptParser.walkTemplateLiteral(expression): void
Source Code: lib/javascript/JavascriptParser.js#L4215
Attributes
expression:TemplateLiteral

Walk template literal.

javascriptParser.walkTerminatingStatement(statement): void
Source Code: lib/javascript/JavascriptParser.js#L2624
Attributes
statement:ReturnStatement | ThrowStatement

Walk terminating statement.

javascriptParser.walkThisExpression(expression): void
Source Code: lib/javascript/JavascriptParser.js#L4599
Attributes
expression:ThisExpression

Walk this expression.

javascriptParser.walkThrowStatement(statement): void
Source Code: lib/javascript/JavascriptParser.js#L2648
Attributes
statement:ThrowStatement

Walk throw statement.

javascriptParser.walkTryStatement(statement): void
Source Code: lib/javascript/JavascriptParser.js#L2666
Attributes
statement:TryStatement

Walk try statement.

javascriptParser.walkUnaryExpression(expression): void
Source Code: lib/javascript/JavascriptParser.js#L3998
Attributes
expression:UnaryExpression

Walk unary expression.

javascriptParser.walkUpdateExpression(expression): void
Source Code: lib/javascript/JavascriptParser.js#L3915
Attributes
expression:UpdateExpression

Walk update expression.

javascriptParser.walkVariableDeclaration(statement): void
Source Code: lib/javascript/JavascriptParser.js#L3406
Attributes
statement:VariableDeclaration

Walk variable declaration.

javascriptParser.walkWhileStatement(statement): void
Source Code: lib/javascript/JavascriptParser.js#L2712
Attributes
statement:WhileStatement

Walk while statement.

javascriptParser.walkWithStatement(statement): void
Source Code: lib/javascript/JavascriptParser.js#L2590
Attributes
statement:WithStatement

Walk with statement.

javascriptParser.walkYieldExpression(expression): void
Source Code: lib/javascript/JavascriptParser.js#L4205
Attributes
expression:YieldExpression

Walk yield expression.

JavascriptParser.extend(...plugins?): typeof JavascriptParser
Source Code: lib/javascript/JavascriptParser.js#L6327
Attributes
...plugins:((BaseParser: typeof Parser) => typeof Parser)[]
Returns:typeof JavascriptParser

Returns parser.