class webpack.javascript.JavascriptParser extends ParserDefines 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): voidClassDeclaration | MaybeNamedClassDeclarationvoidBlock pre walk class declaration.
blockPreWalkExportDefaultDeclaration(statement): voidExportDefaultDeclarationvoidBlock pre walk export default declaration.
blockPreWalkExportNamedDeclaration(statement): voidExportNamedDeclarationvoidBlock pre walk export named declaration.
blockPreWalkExpressionStatement(statement): voidExpressionStatementvoidBlock pre walk expression statement.
blockPreWalkStatement(statement): voidClassDeclaration | 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): voidVariableDeclarationvoidBlock pre walk variable declaration.
callHooksForExpression(hookMap, expr, ...args?): R | undefinedHookMap<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 | undefinedHookMap<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 | undefinedHookMap<SyncBailHook<T, R, UnsetAdditionalOptions>>ExportedVariableInfoAsArray<T>R | undefinedCall hooks for info.
callHooksForInfoWithFallback(hookMap, info, fallback, defined, ...args?): R | undefinedHookMap<SyncBailHook<T, R, UnsetAdditionalOptions>>ExportedVariableInfoAsArray<T>R | undefinedCall hooks for info with fallback.
callHooksForName(hookMap, name, ...args?): R | undefinedCall hooks for name.
callHooksForNameWithFallback(hookMap, name, fallback, defined, ...args?): R | undefinedCall hooks for name with fallback.
defineVariable(name): voidProcesses the provided name.
destructuringAssignmentPropertiesFor(node): Set<DestructuringAssignmentProperty> | undefinedExpressionSet<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): voidEnter array pattern.
enterAssignmentPattern(pattern, onIdent): voidEnter assignment pattern.
enterDeclaration(declaration, onIdent): voidDeclarationvoidProcesses 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 | undefinedPatternExpressionClassExpression | 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): voidProcesses the provided pattern.
enterObjectPattern(pattern, onIdent): voidEnter object pattern.
enterPattern(pattern, onIdent): voidProcesses the provided pattern.
enterPatterns(patterns, onIdent): voidProcesses the provided pattern.
enterRestElement(pattern, onIdent): voidEnter rest element.
evaluate(source): BasicEvaluatedExpressionstringBasicEvaluatedExpressionReturns evaluation result.
evaluatedVariable(tagInfo): VariableInfoTagInfoVariableInfoEvaluated variable.
evaluateExpression(expression): BasicEvaluatedExpressionClassExpression | 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 } | undefinedstring{ info: string | VariableInfo; name: string } | undefinedGets free info from variable.
getLocation(node): DependencyLocationReturns 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 | undefinedClassExpression | 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 | 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 | 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 } | undefinedExpression{ getMembers: () => string[]; name: string; rootInfo: ExportedVariableInfo } | undefinedGets name for expression.
getNameInfoFromVariable(varName): { info: string | VariableInfo; name: string } | undefinedstring{ info: string | VariableInfo; name: string } | undefinedGets name info from variable.
getRenameIdentifier(expr): string | VariableInfo | undefinedClassExpression | 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 | undefinedstringsymbolRecord<string, any> | TopLevelSymbol | HarmonySettings | ImportSettings | CommonJsImportSettings | CompatibilitySettings | undefinedReturns tag data.
getVariableInfo(name): ExportedVariableInfostringExportedVariableInfoGets variable info.
inBlockScope(fn, inExecutedPath?): voidProcesses the provided fn.
inClassScope(hasThis, params, fn): voidProcesses the provided has thi.
inFunctionScope(hasThis, params, fn): voidProcesses the provided has thi.
inScope(params, fn): voidProcesses the provided param.
isAsiPosition(pos): booleanChecks whether this javascript parser is asi position.
isPure(expr, commentsStartPos): booleanClassDeclaration | 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): booleanExpressionbooleanChecks whether this javascript parser is statement level expression.
isVariableDefined(name): booleanChecks whether this javascript parser is variable defined.
modulePreWalkExportAllDeclaration(statement): voidExportAllDeclarationvoidModule pre walk export all declaration.
modulePreWalkExportNamedDeclaration(statement): voidExportNamedDeclarationvoidModule pre walk export named declaration.
modulePreWalkImportDeclaration(statement): voidImportDeclarationvoidModule 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): ParserStatestring | Buffer<ArrayBufferLike> | PreparsedAstParserStateParserStateParses the provided source and updates the parser state.
parseCalculatedString(expression): CalculatedStringResultExpressionCalculatedStringResultParses calculated string.
parseCommentOptions(range): { errors: (Error & { comment: CommentJavascriptParser })[] | null; options: Record<string, any> | null }Parses comment options.
parseString(expression): stringExpressionstringReturns parsed string.
preWalkAssignmentExpression(expression): voidAssignmentExpressionvoidPre walk assignment expression.
preWalkBlockStatement(statement): voidBlockStatementvoidPre walk block statement.
preWalkCatchClause(catchClause): voidCatchClausevoidPre walk catch clause.
preWalkDoWhileStatement(statement): voidDoWhileStatementvoidPre walk do while statement.
preWalkForInStatement(statement): voidForInStatementvoidPre walk for in statement.
preWalkForOfStatement(statement): voidForOfStatementvoidPre walk for of statement.
preWalkForStatement(statement): voidForStatementvoidPre walk for statement.
preWalkFunctionDeclaration(statement): voidFunctionDeclaration | MaybeNamedFunctionDeclarationvoidPre walk function declaration.
preWalkIfStatement(statement): voidIfStatementvoidPre walk if statement.
preWalkLabeledStatement(statement): voidLabeledStatementvoidPre walk labeled statement.
preWalkStatement(statement): voidClassDeclaration | 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): voidSwitchCase[]voidPre walk switch cases.
preWalkSwitchStatement(statement): voidSwitchStatementvoidPre walk switch statement.
preWalkTryStatement(statement): voidTryStatementvoidPre walk try statement.
preWalkVariableDeclaration(statement): voidVariableDeclarationvoidPre walk variable declaration.
preWalkVariableDeclarator(declarator): voidVariableDeclaratorvoidPre walk variable declarator.
preWalkWhileStatement(statement): voidWhileStatementvoidPre walk while statement.
preWalkWithStatement(statement): voidWithStatementvoidPre walk with statement.
setAsiPosition(pos): voidUpdates asi position using the provided po.
setVariable(name, variableInfo): voidUpdates variable using the provided name.
tagVariable(name, tag, data?, flags?): voidstringsymbolRecord<string, any> | TopLevelSymbol | HarmonySettings | ImportSettings | CommonJsImportSettings | CompatibilitySettings0 | 2 | 1 | 4voidProcesses the provided name.
undefineVariable(name): voidProcesses the provided name.
unsetAsiPosition(pos): voidUnset asi position.
walkArrayExpression(expression): voidArrayExpressionvoidWalk array expression.
walkArrayPattern(pattern): voidArrayPatternvoidWalk array pattern.
walkArrowFunctionExpression(expression): voidArrowFunctionExpressionvoidWalk arrow function expression.
walkAssignmentExpression(expression): voidAssignmentExpressionvoidWalk assignment expression.
walkAssignmentPattern(pattern): voidAssignmentPatternvoidWalk assignment pattern.
walkAwaitExpression(expression): voidAwaitExpressionvoidWalk await expression.
walkBinaryExpression(expression): voidBinaryExpressionvoidWalk binary expression.
walkBlockStatement(statement): voidBlockStatement | StaticBlockvoidWalk block statement.
walkCallExpression(expression): voidCallExpressionvoidWalk call expression.
walkCatchClause(catchClause): voidCatchClausevoidProcesses the provided catch clause.
walkChainExpression(expression): voidChainExpressionvoidWalk chain expression.
walkClass(classy): voidClassDeclaration | MaybeNamedClassDeclaration | ClassExpressionvoidProcesses the provided classy.
walkClassDeclaration(statement): voidClassDeclaration | MaybeNamedClassDeclarationvoidWalk class declaration.
walkClassExpression(expression): voidClassExpressionvoidWalk class expression.
walkConditionalExpression(expression): voidConditionalExpressionvoidWalk conditional expression.
walkDoWhileStatement(statement): voidDoWhileStatementvoidWalk do while statement.
walkExportDefaultDeclaration(statement): voidExportDefaultDeclarationvoidWalk export default declaration.
walkExportNamedDeclaration(statement): voidExportNamedDeclarationvoidWalk export named declaration.
walkExpression(expression): voidClassExpression | 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): voidExpressionStatementvoidWalk expression statement.
walkForInStatement(statement): voidForInStatementvoidWalk for in statement.
walkForOfStatement(statement): voidForOfStatementvoidWalk for of statement.
walkForStatement(statement): voidForStatementvoidWalk for statement.
walkFunctionDeclaration(statement): voidFunctionDeclaration | MaybeNamedFunctionDeclarationvoidWalk function declaration.
walkFunctionExpression(expression): voidFunctionExpressionvoidWalk function expression.
walkGuardedBranch(frame, walk): voidWalks 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): voidIdentifiervoidProcesses the provided expression.
walkIfStatement(statement): voidIfStatementvoidProcesses the provided statement.
walkImportExpression(expression): voidImportExpressionJavascriptParservoidWalk import expression.
walkLabeledStatement(statement): voidLabeledStatementvoidWalk labeled statement.
walkLeftRightExpression(expression): voidBinaryExpression | LogicalExpressionvoidWalk left right expression.
walkLogicalExpression(expression): voidLogicalExpressionvoidWalk logical expression.
walkMemberExpression(expression): voidMemberExpressionvoidWalk member expression.
walkMemberExpressionWithExpressionName(expression, name, rootInfo, members, onUnhandled): voidWalk member expression with expression name.
walkMetaProperty(metaProperty): voidMetaPropertyvoidWalk meta property.
walkNestedStatement(statement): voidWalks 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): voidNewExpressionvoidWalk new expression.
walkObjectExpression(expression): voidObjectExpressionvoidWalk object expression.
walkObjectPattern(pattern): voidObjectPatternvoidWalk object pattern.
walkPattern(pattern): voidProcesses the provided pattern.
walkProperty(prop): voidProperty | SpreadElementvoidProcesses the provided prop.
walkRestElement(pattern): voidRestElementvoidProcesses the provided pattern.
walkReturnStatement(statement): voidReturnStatementvoidWalk return statement.
walkSequenceExpression(expression): voidSequenceExpressionvoidWalk sequence expression.
walkSpreadElement(expression): voidSpreadElementvoidWalk spread element.
walkStatement(statement): voidClassDeclaration | 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): voidSwitchCase[]voidProcesses the provided switch case.
walkSwitchStatement(statement): voidSwitchStatementvoidWalk switch statement.
walkTaggedTemplateExpression(expression): voidTaggedTemplateExpressionvoidWalk tagged template expression.
walkTemplateLiteral(expression): voidTemplateLiteralvoidWalk template literal.
walkTerminatingStatement(statement): voidReturnStatement | ThrowStatementvoidWalk terminating statement.
walkThisExpression(expression): voidThisExpressionvoidWalk this expression.
walkThrowStatement(statement): voidThrowStatementvoidWalk throw statement.
walkTryStatement(statement): voidTryStatementvoidWalk try statement.
walkUnaryExpression(expression): voidUnaryExpressionvoidWalk unary expression.
walkUpdateExpression(expression): voidUpdateExpressionvoidWalk update expression.
walkVariableDeclaration(statement): voidVariableDeclarationvoidWalk variable declaration.
walkWhileStatement(statement): voidWhileStatementvoidWalk while statement.
walkWithStatement(statement): voidWithStatementvoidWalk with statement.
walkYieldExpression(expression): voidYieldExpressionvoidWalk yield expression.
typeof JavascriptParserReturns parser.
voidvoidbinaryExpression(binaryExpression): boolean | voidblockPreStatement(arg0): boolean | voidImportDeclaration | 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 | voidclassBodyValue(expression, arg1, arg2): boolean | voidExpressionMethodDefinition | PropertyDefinitionClassExpression | ClassDeclaration | MaybeNamedClassDeclarationclassExtendsExpression(expression, arg1): boolean | voidExpressionClassExpression | ClassDeclaration | MaybeNamedClassDeclarationcollectDestructuringAssignmentProperties(expression): boolean | voidExpressioncollectGuards(expression): void | GuardCollectionExpressionvoid | GuardCollectiondeclarator(variableDeclarator, statement): boolean | voidvoidvoidvoidvoidvoidvoidvoidexport(arg0): boolean | voidexportDeclaration(arg0, declaration): boolean | voidExportNamedDeclaration | ExportAllDeclaration | ExportDefaultDeclarationDeclarationexportExpression(exportDefaultDeclaration, arg1): boolean | voidExportDefaultDeclarationImportExpressionImport | 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 | voidexportImportSpecifier(arg0, importSource, arg2, arg3, arg4): boolean | voidexportSpecifier(arg0, string, string, arg3): boolean | voidvoidexpressionConditionalOperator(conditionalExpression): boolean | voidexpressionLogicalOperator(logicalExpression): boolean | voidvoidfinish(program, arg1): boolean | voidimport(importDeclaration, importSource): boolean | voidimportCall(importExpressionJavascriptParser, arg1): boolean | voidImportExpressionJavascriptParserundefined | SimpleCallExpression | NewExpressionimportSpecifier(importDeclaration, importSource, arg2, string): boolean | voidvoidvoidvoidvoidoptionalChaining(chainExpression): boolean | voidvoidpreDeclarator(variableDeclarator, variableDeclaration): boolean | voidpreStatement(arg0): boolean | voidImportDeclaration | 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 | voidvoidstatement(arg0): boolean | voidImportDeclaration | 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 | voidterminate(arg0): boolean | voidtopLevelAwait(arg0): boolean | voidImportExpressionImport | 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 | voidvoidvoidvoidvoidvoidCallExpressionstring() => 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