class webpack.javascript.JavascriptParser extends Parser
Defines the parser state base type used by this module.
new JavascriptParser(sourceType?, options?): JavascriptParser
"module" | "auto" | "script"boolean(code: string, options: ParseOptions) => ParseResultfalse | "error" | "warn"booleanJavascriptParserCreates an instance of JavascriptParser.
CommentJavascriptParser[]Record<string, any> | TopLevelSymbol | HarmonySettings | ImportSettings | CommonJsImportSettings | CompatibilitySettingsWeakMap<Expression, Set<DestructuringAssignmentProperty>>Context{ importPhases?: boolean; parse?: (code: string, options: ParseOptions) => ParseResult; strictModeViolations?: false | "error" | "warn"; typescript?: boolean }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 | VariableDeclarationScopeInfo"module" | "auto" | "script"JavascriptParserStateStatementPathItem[]312(node: ImportDeclaration | ExportNamedDeclaration | ExportAllDeclaration | ImportExpressionJavascriptParser) => Record<string, string> | undefinedtypeof VariableInfoReadonly<{ Evaluated: 0; Free: 1; Normal: 2; Tagged: 4 }>blockPreWalkClassDeclaration(statement): void
ClassDeclaration | MaybeNamedClassDeclarationvoidBlock pre walk class declaration.
blockPreWalkExportDefaultDeclaration(statement): void
ExportDefaultDeclarationvoidBlock pre walk export default declaration.
blockPreWalkExportNamedDeclaration(statement): void
ExportNamedDeclarationvoidBlock pre walk export named declaration.
blockPreWalkExpressionStatement(statement): void
ExpressionStatementvoidBlock pre walk expression statement.
blockPreWalkStatement(statement): void
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 | VariableDeclarationvoidBlock pre walk statement.
blockPreWalkStatements(statements): void
(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)[]voidBlock pre walking iterates the scope for block variable declarations
blockPreWalkVariableDeclaration(statement): void
VariableDeclarationvoidBlock pre walk variable declaration.
callHooksForExpression(hookMap, expr, ...args?): R | undefined
HookMap<SyncBailHook<T, R, UnsetAdditionalOptions>>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 | SuperAsArray<T>R | undefinedCall hooks for expression.
callHooksForExpressionWithFallback(hookMap, expr, fallback, defined, ...args?): R | undefined
HookMap<SyncBailHook<T, R, UnsetAdditionalOptions>>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((name: string, rootInfo: string | VariableInfo | ScopeInfo, getMembers: () => string[]) => R) | undefinedAsArray<T>R | undefinedCall hooks for expression with fallback.
callHooksForInfo(hookMap, info, ...args?): R | undefined
HookMap<SyncBailHook<T, R, UnsetAdditionalOptions>>ExportedVariableInfoAsArray<T>R | undefinedCall hooks for info.
callHooksForInfoWithFallback(hookMap, info, fallback, defined, ...args?): R | undefined
HookMap<SyncBailHook<T, R, UnsetAdditionalOptions>>ExportedVariableInfoAsArray<T>R | undefinedCall hooks for info with fallback.
callHooksForName(hookMap, name, ...args?): R | undefined
Call hooks for name.
callHooksForNameWithFallback(hookMap, name, fallback, defined, ...args?): R | undefined
Call hooks for name with fallback.
defineVariable(name): void
Processes the provided name.
destructuringAssignmentPropertiesFor(node): Set<DestructuringAssignmentProperty> | undefined
ExpressionSet<DestructuringAssignmentProperty> | undefinedDestructuring assignment properties for.
detectMode(statements): void
(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)[]voidProcesses the provided statement.
enterArrayPattern(pattern, onIdent): void
Enter array pattern.
enterAssignmentPattern(pattern, onIdent): void
Enter assignment pattern.
enterDeclaration(declaration, onIdent): void
DeclarationvoidProcesses the provided declaration.
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
PatternExpressionClassExpression | 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 | undefinedEnter destructuring assignment.
enterIdentifier(pattern, onIdent): void
Processes the provided pattern.
enterObjectPattern(pattern, onIdent): void
Enter object pattern.
enterPattern(pattern, onIdent): void
Processes the provided pattern.
enterPatterns(patterns, onIdent): void
Processes the provided pattern.
enterRestElement(pattern, onIdent): void
Enter rest element.
evaluate(source): BasicEvaluatedExpression
stringBasicEvaluatedExpressionReturns evaluation result.
evaluatedVariable(tagInfo): VariableInfo
TagInfoVariableInfoEvaluated variable.
evaluateExpression(expression): BasicEvaluatedExpression
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 | SuperBasicEvaluatedExpressionEvaluate expression.
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 }
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{ 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.
getComments(range): CommentJavascriptParser[]
CommentJavascriptParser[]Returns comments in the range.
getFreeInfoFromVariable(varName): { info: string | VariableInfo; name: string } | undefined
string{ info: string | VariableInfo; name: string } | undefinedGets free info from variable.
getLocation(node): DependencyLocation
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.
getMemberExpressionInfo(expression, allowedTypes): CallExpressionInfo | ExpressionExpressionInfo | undefined
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 | SupernumberCallExpressionInfo | ExpressionExpressionInfo | undefinedGets member expression info.
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
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 | SuperClassExpression | 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 | SuperFinds 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.
getNameForExpression(expression): { getMembers: () => string[]; name: string; rootInfo: ExportedVariableInfo } | undefined
Expression{ getMembers: () => string[]; name: string; rootInfo: ExportedVariableInfo } | undefinedGets name for expression.
getNameInfoFromVariable(varName): { info: string | VariableInfo; name: string } | undefined
string{ info: string | VariableInfo; name: string } | undefinedGets name info from variable.
getRenameIdentifier(expr): string | VariableInfo | undefined
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 | SpreadElementstring | VariableInfo | undefinedGets rename identifier.
getTagData(name, tag): Record<string, any> | TopLevelSymbol | HarmonySettings | ImportSettings | CommonJsImportSettings | CompatibilitySettings | undefined
stringsymbolRecord<string, any> | TopLevelSymbol | HarmonySettings | ImportSettings | CommonJsImportSettings | CompatibilitySettings | undefinedReturns tag data.
getVariableInfo(name): ExportedVariableInfo
stringExportedVariableInfoGets variable info.
inBlockScope(fn, inExecutedPath?): void
Processes the provided fn.
inClassScope(hasThis, params, fn): void
Processes the provided has thi.
inFunctionScope(hasThis, params, fn): void
Processes the provided has thi.
inScope(params, fn): void
Processes the provided param.
isAsiPosition(pos): boolean
Checks whether this javascript parser is asi position.
isPure(expr, commentsStartPos): boolean
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 | undefinednumberbooleanChecks whether this javascript parser is pure.
isStatementLevelExpression(expr): boolean
ExpressionbooleanChecks whether this javascript parser is statement level expression.
isVariableDefined(name): boolean
Checks whether this javascript parser is variable defined.
modulePreWalkExportAllDeclaration(statement): void
ExportAllDeclarationvoidModule pre walk export all declaration.
modulePreWalkExportNamedDeclaration(statement): void
ExportNamedDeclarationvoidModule pre walk export named declaration.
modulePreWalkImportDeclaration(statement): void
ImportDeclarationvoidModule pre walk import declaration.
modulePreWalkStatements(statements): void
(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)[]voidModule pre walking iterates the scope for import entries
parse(source, state): ParserState
string | Buffer<ArrayBufferLike> | PreparsedAstParserStateParserStateParses the provided source and updates the parser state.
parseCalculatedString(expression): CalculatedStringResult
ExpressionCalculatedStringResultParses calculated string.
parseCommentOptions(range): { errors: (Error & { comment: CommentJavascriptParser })[] | null; options: Record<string, any> | null }
Parses comment options.
parseString(expression): string
ExpressionstringReturns parsed string.
preWalkAssignmentExpression(expression): void
AssignmentExpressionvoidPre walk assignment expression.
preWalkBlockStatement(statement): void
BlockStatementvoidPre walk block statement.
preWalkCatchClause(catchClause): void
CatchClausevoidPre walk catch clause.
preWalkDoWhileStatement(statement): void
DoWhileStatementvoidPre walk do while statement.
preWalkForInStatement(statement): void
ForInStatementvoidPre walk for in statement.
preWalkForOfStatement(statement): void
ForOfStatementvoidPre walk for of statement.
preWalkForStatement(statement): void
ForStatementvoidPre walk for statement.
preWalkFunctionDeclaration(statement): void
FunctionDeclaration | MaybeNamedFunctionDeclarationvoidPre walk function declaration.
preWalkIfStatement(statement): void
IfStatementvoidPre walk if statement.
preWalkLabeledStatement(statement): void
LabeledStatementvoidPre walk labeled statement.
preWalkStatement(statement): void
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 | VariableDeclarationvoidWalking iterates the statements and expressions and processes them
preWalkStatements(statements): void
(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)[]voidPre walking iterates the scope for variable declarations
preWalkSwitchCases(switchCases): void
SwitchCase[]voidPre walk switch cases.
preWalkSwitchStatement(statement): void
SwitchStatementvoidPre walk switch statement.
preWalkTryStatement(statement): void
TryStatementvoidPre walk try statement.
preWalkVariableDeclaration(statement): void
VariableDeclarationvoidPre walk variable declaration.
preWalkVariableDeclarator(declarator): void
VariableDeclaratorvoidPre walk variable declarator.
preWalkWhileStatement(statement): void
WhileStatementvoidPre walk while statement.
preWalkWithStatement(statement): void
WithStatementvoidPre walk with statement.
setAsiPosition(pos): void
Updates asi position using the provided po.
setVariable(name, variableInfo): void
Updates variable using the provided name.
tagVariable(name, tag, data?, flags?): void
stringsymbolRecord<string, any> | TopLevelSymbol | HarmonySettings | ImportSettings | CommonJsImportSettings | CompatibilitySettings0 | 2 | 1 | 4voidProcesses the provided name.
undefineVariable(name): void
Processes the provided name.
unsetAsiPosition(pos): void
Unset asi position.
walkArrayExpression(expression): void
ArrayExpressionvoidWalk array expression.
walkArrayPattern(pattern): void
ArrayPatternvoidWalk array pattern.
walkArrowFunctionExpression(expression): void
ArrowFunctionExpressionvoidWalk arrow function expression.
walkAssignmentExpression(expression): void
AssignmentExpressionvoidWalk assignment expression.
walkAssignmentPattern(pattern): void
AssignmentPatternvoidWalk assignment pattern.
walkAwaitExpression(expression): void
AwaitExpressionvoidWalk await expression.
walkBinaryExpression(expression): void
BinaryExpressionvoidWalk binary expression.
walkBlockStatement(statement): void
BlockStatement | StaticBlockvoidWalk block statement.
walkCallExpression(expression): void
CallExpressionvoidWalk call expression.
walkCatchClause(catchClause): void
CatchClausevoidProcesses the provided catch clause.
walkChainExpression(expression): void
ChainExpressionvoidWalk chain expression.
walkClass(classy): void
ClassDeclaration | MaybeNamedClassDeclaration | ClassExpressionvoidProcesses the provided classy.
walkClassDeclaration(statement): void
ClassDeclaration | MaybeNamedClassDeclarationvoidWalk class declaration.
walkClassExpression(expression): void
ClassExpressionvoidWalk class expression.
walkConditionalExpression(expression): void
ConditionalExpressionvoidWalk conditional expression.
walkDoWhileStatement(statement): void
DoWhileStatementvoidWalk do while statement.
walkExportDefaultDeclaration(statement): void
ExportDefaultDeclarationvoidWalk export default declaration.
walkExportNamedDeclaration(statement): void
ExportNamedDeclarationvoidWalk export named declaration.
walkExpression(expression): void
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 | SupervoidProcesses the provided expression.
walkExpressions(expressions): void
(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)[]voidProcesses the provided expression.
walkExpressionStatement(statement): void
ExpressionStatementvoidWalk expression statement.
walkForInStatement(statement): void
ForInStatementvoidWalk for in statement.
walkForOfStatement(statement): void
ForOfStatementvoidWalk for of statement.
walkForStatement(statement): void
ForStatementvoidWalk for statement.
walkFunctionDeclaration(statement): void
FunctionDeclaration | MaybeNamedFunctionDeclarationvoidWalk function declaration.
walkFunctionExpression(expression): void
FunctionExpressionvoidWalk function expression.
walkGuardedBranch(frame, 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.
walkIdentifier(expression): void
IdentifiervoidProcesses the provided expression.
walkIfStatement(statement): void
IfStatementvoidProcesses the provided statement.
walkImportExpression(expression): void
ImportExpressionJavascriptParservoidWalk import expression.
walkLabeledStatement(statement): void
LabeledStatementvoidWalk labeled statement.
walkLeftRightExpression(expression): void
BinaryExpression | LogicalExpressionvoidWalk left right expression.
walkLogicalExpression(expression): void
LogicalExpressionvoidWalk logical expression.
walkMemberExpression(expression): void
MemberExpressionvoidWalk member expression.
walkMemberExpressionWithExpressionName(expression, name, rootInfo, members, onUnhandled): void
Walk member expression with expression name.
walkMetaProperty(metaProperty): void
MetaPropertyvoidWalk meta property.
walkNestedStatement(statement): void
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.
walkNewExpression(expression): void
NewExpressionvoidWalk new expression.
walkObjectExpression(expression): void
ObjectExpressionvoidWalk object expression.
walkObjectPattern(pattern): void
ObjectPatternvoidWalk object pattern.
walkPattern(pattern): void
Processes the provided pattern.
walkProperty(prop): void
Property | SpreadElementvoidProcesses the provided prop.
walkRestElement(pattern): void
RestElementvoidProcesses the provided pattern.
walkReturnStatement(statement): void
ReturnStatementvoidWalk return statement.
walkSequenceExpression(expression): void
SequenceExpressionvoidWalk sequence expression.
walkSpreadElement(expression): void
SpreadElementvoidWalk spread element.
walkStatement(statement): void
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 | VariableDeclarationvoidProcesses the provided statement.
walkStatements(statements): void
(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)[]voidWalking iterates the statements and expressions and processes them
walkSwitchCases(switchCases): void
SwitchCase[]voidProcesses the provided switch case.
walkSwitchStatement(statement): void
SwitchStatementvoidWalk switch statement.
walkTaggedTemplateExpression(expression): void
TaggedTemplateExpressionvoidWalk tagged template expression.
walkTemplateLiteral(expression): void
TemplateLiteralvoidWalk template literal.
walkTerminatingStatement(statement): void
ReturnStatement | ThrowStatementvoidWalk terminating statement.
walkThisExpression(expression): void
ThisExpressionvoidWalk this expression.
walkThrowStatement(statement): void
ThrowStatementvoidWalk throw statement.
walkTryStatement(statement): void
TryStatementvoidWalk try statement.
walkUnaryExpression(expression): void
UnaryExpressionvoidWalk unary expression.
walkUpdateExpression(expression): void
UpdateExpressionvoidWalk update expression.
walkVariableDeclaration(statement): void
VariableDeclarationvoidWalk variable declaration.
walkWhileStatement(statement): void
WhileStatementvoidWalk while statement.
walkWithStatement(statement): void
WithStatementvoidWalk with statement.
walkYieldExpression(expression): void
YieldExpressionvoidWalk yield expression.
typeof JavascriptParserReturns parser.
voidvoidbinaryExpression(binaryExpression): boolean | void
blockPreStatement(arg0): boolean | void
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 | ExportDefaultDeclarationvoidvoidvoidvoidvoidclassBodyElement(arg0, arg1): boolean | void
classBodyValue(expression, arg1, arg2): boolean | void
ExpressionMethodDefinition | PropertyDefinitionClassExpression | ClassDeclaration | MaybeNamedClassDeclarationclassExtendsExpression(expression, arg1): boolean | void
ExpressionClassExpression | ClassDeclaration | MaybeNamedClassDeclarationcollectDestructuringAssignmentProperties(expression): boolean | void
ExpressioncollectGuards(expression): void | GuardCollection
Expressionvoid | GuardCollectiondeclarator(variableDeclarator, statement): boolean | void
voidvoidvoidvoidvoidvoidvoidexport(arg0): boolean | void
exportDeclaration(arg0, declaration): boolean | void
ExportNamedDeclaration | ExportAllDeclaration | ExportDefaultDeclarationDeclarationexportExpression(exportDefaultDeclaration, arg1): boolean | void
ExportDefaultDeclarationImportExpressionImport | 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 | MaybeNamedClassDeclarationexportImport(arg0, importSource): boolean | void
exportImportSpecifier(arg0, importSource, arg2, arg3, arg4): boolean | void
exportSpecifier(arg0, string, string, arg3): boolean | void
voidexpressionConditionalOperator(conditionalExpression): boolean | void
expressionLogicalOperator(logicalExpression): boolean | void
voidfinish(program, arg1): boolean | void
import(importDeclaration, importSource): boolean | void
importCall(importExpressionJavascriptParser, arg1): boolean | void
ImportExpressionJavascriptParserundefined | SimpleCallExpression | NewExpressionimportSpecifier(importDeclaration, importSource, arg2, string): boolean | void
voidvoidvoidvoidoptionalChaining(chainExpression): boolean | void
voidpreDeclarator(variableDeclarator, variableDeclaration): boolean | void
preStatement(arg0): boolean | void
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 | ExportDefaultDeclarationvoidprogram(program, arg1): boolean | void
voidstatement(arg0): boolean | void
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 | ExportDefaultDeclarationstatementIf(ifStatement): boolean | void
terminate(arg0): boolean | void
topLevelAwait(arg0): boolean | void
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 | ForOfStatementvoidvoidunusedStatement(statement): boolean | void
voidvoidvoidvoidvoidCallExpressionstring() => string[]() => string[]() => boolean[]stringstring | VariableInfo"call"FunctionDeclaration | VariableDeclaration | ClassDeclarationHelper function for joining two ranges into a single range. This is useful when working with AST nodes, as it allows you to combine the ranges of child nodes to create the range of the parent node.
string | VariableInfo | ScopeInfoImportExpressionImport | 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 | YieldExpressionParserStateBase & Record<string, any> & KnownJavascriptParserStateIdentifier | MemberExpression | ObjectPattern | ArrayPattern | RestElement | AssignmentPatternFunctionDeclaration | VariableDeclaration | ClassDeclaration | ExpressionStatement | BlockStatement | StaticBlock | EmptyStatement | DebuggerStatement | WithStatement | ReturnStatement | LabeledStatement | BreakStatement | ContinueStatement | IfStatement | SwitchStatement | ThrowStatement | TryStatement | WhileStatement | DoWhileStatement | ForStatement | ForInStatement | ForOfStatementImportDeclaration | ExportNamedDeclaration | ExportAllDeclaration | 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 | 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