On this page

class webpack.javascript.JavascriptParser extends ParserClass
new JavascriptParser(sourceType?, options?): void

Creates an instance of JavascriptParser.

Attributes
destructuringAssignmentProperties:<WeakMap>
hooks:
<Readonly> < <object> >
magicCommentContext:
{Context}
options:<object>
prevStatement:
<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>
semicolons:<Set>
sourceType:
<"module"> | <"auto"> | <"script">
statementPath:<StatementPathItem>
[]
ALLOWED_MEMBER_TYPES_ALL:
{3}
ALLOWED_MEMBER_TYPES_CALL_EXPRESSION:
{1}
ALLOWED_MEMBER_TYPES_EXPRESSION:
{2}
getImportAttributes:<Function>
VariableInfo:
{typeof VariableInfo}
VariableInfoFlags:
<Readonly> < <object> >
blockPreWalkClassDeclaration(statement): void
  • statement <ClassDeclaration> | <MaybeNamedClassDeclaration>
  • Returns: <void>

Block pre walk class declaration.


blockPreWalkExportDefaultDeclaration(statement): void
  • statement {ExportDefaultDeclaration}
  • Returns: <void>

Block pre walk export default declaration.


blockPreWalkExportNamedDeclaration(statement): void
  • statement {ExportNamedDeclaration}
  • Returns: <void>

Block pre walk export named declaration.


blockPreWalkExpressionStatement(statement): void
  • statement {ExpressionStatement}
  • Returns: <void>

Block pre walk expression statement.


blockPreWalkStatement(statement): void
  • 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>
  • Returns: <void>

Block pre walk statement.


blockPreWalkStatements(statements): void
  • 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[]>
  • Returns: <void>

Block pre walking iterates the scope for block variable declarations


blockPreWalkVariableDeclaration(statement): void
  • statement {VariableDeclaration}
  • Returns: <void>

Block pre walk variable declaration.


callHooksForExpression(hookMap, expr, ...args?): void
  • 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.


callHooksForExpressionWithFallback(hookMap, expr, fallback, defined, ...args?): void
  • 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 <Function> | <undefined>
  • defined <Function> | <undefined>
  • args <AsArray><<T>>
  • Returns: <R> | <undefined>

Call hooks for expression with fallback.


callHooksForInfo(hookMap, info, ...args?): void

Call hooks for info.


callHooksForInfoWithFallback(hookMap, info, fallback, defined, ...args?): void

Call hooks for info with fallback.


callHooksForName(hookMap, name, ...args?): void
  • hookMap <HookMap><<SyncBailHook><<T>, <R>, <UnsetAdditionalOptions>>>
  • name <string>
  • args <AsArray><<T>>
  • Returns: <R> | <undefined>

Call hooks for name.


callHooksForNameWithFallback(hookMap, name, fallback, defined, ...args?): void

Call hooks for name with fallback.


defineVariable(name): void
Attributes
Returns:<void>

Processes the provided name.


destructuringAssignmentPropertiesFor(node): Set
Attributes

Destructuring assignment properties for.


detectMode(statements): void
  • 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[]>
  • Returns: <void>

Processes the provided statement.


enterArrayPattern(pattern, onIdent): void

Enter array pattern.


enterAssignmentPattern(pattern, onIdent): void

Enter assignment pattern.


enterDeclaration(declaration, onIdent): void
Attributes
declaration:<Declaration>
onIdent:<Function>
Returns:<void>

Processes 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
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.


enterIdentifier(pattern, onIdent): void

Processes the provided pattern.


enterObjectPattern(pattern, onIdent): void

Enter object pattern.


enterPattern(pattern, onIdent): void
  • pattern <Property> | <Identifier> | <MemberExpression> | <ObjectPattern> | <ArrayPattern> | <RestElement> | <AssignmentPattern>
  • onIdent <Function>
  • Returns: <void>

Processes the provided pattern.


enterPatterns(patterns, onIdent): void
Attributes
patterns:<string> | <Property> | <Identifier> | <MemberExpression> | <ObjectPattern> | <ArrayPattern> | <RestElement> | <AssignmentPattern[]>
onIdent:<Function>
Returns:<void>

Processes the provided pattern.


enterRestElement(pattern, onIdent): void

Enter rest element.


evaluate(source): BasicEvaluatedExpression
Attributes

Returns evaluation result.


evaluatedVariable(tagInfo): VariableInfo
Attributes
tagInfo:<TagInfo>

Evaluated variable.


evaluateExpression(expression): void
  • 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>
  • Returns: <BasicEvaluatedExpression>

Evaluate expression.


extractMemberExpressionChain(expression): void
  • 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: <object>

Extract member expression chain.


getComments(range): void

Returns comments in the range.


getFreeInfoFromVariable(varName): object | undefined
Attributes
varName:<string>

Gets free info from variable.


getMemberExpressionInfo(expression, allowedTypes): void
  • 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>
  • Returns: <CallExpressionInfo> | <ExpressionExpressionInfo> | <undefined>

Gets member expression info.


getNameForExpression(expression): object | undefined
Attributes
expression:<Expression>

Gets name for expression.


getNameInfoFromVariable(varName): object | undefined
Attributes
varName:<string>

Gets name info from variable.


getRenameIdentifier(expr): void
  • 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>
  • Returns: <string> | <VariableInfo> | <undefined>

Gets rename identifier.


getTagData(name, tag): Record
Attributes

Returns tag data.


getVariableInfo(name): ExportedVariableInfo
Attributes

Gets variable info.


inBlockScope(fn, inExecutedPath?): void
Attributes
inExecutedPath:<boolean>
Returns:<void>

Processes the provided fn.


inClassScope(hasThis, params, fn): void
Attributes
hasThis:<boolean>
params:
{Identifier[]}
Returns:<void>

Processes the provided has thi.


inFunctionScope(hasThis, params, fn): void
Attributes
hasThis:<boolean>
params:<string> | <Identifier> | <MemberExpression> | <ObjectPattern> | <ArrayPattern> | <RestElement> | <AssignmentPattern[]>
Returns:<void>

Processes the provided has thi.


inScope(params, fn): void
Stability: 0Deprecated
Attributes
params:<string> | <Property> | <Identifier> | <MemberExpression> | <ObjectPattern> | <ArrayPattern> | <RestElement> | <AssignmentPattern[]>
Returns:<void>

Processes the provided param.


isAsiPosition(pos): boolean
Attributes
Returns:<boolean>

Checks whether this javascript parser is asi position.


isPure(expr, commentsStartPos): void
  • 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.


isStatementLevelExpression(expr): boolean
Attributes

Checks whether this javascript parser is statement level expression.


isVariableDefined(name): boolean
Attributes
Returns:<boolean>

Checks whether this javascript parser is variable defined.


modulePreWalkExportAllDeclaration(statement): void
  • statement {ExportAllDeclaration}
  • Returns: <void>

Module pre walk export all declaration.


modulePreWalkExportNamedDeclaration(statement): void
  • statement {ExportNamedDeclaration}
  • Returns: <void>

Module pre walk export named declaration.


modulePreWalkImportDeclaration(statement): void
  • statement {ImportDeclaration}
  • Returns: <void>

Module pre walk import declaration.


modulePreWalkStatements(statements): void
  • 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[]>
  • Returns: <void>

Module pre walking iterates the scope for import entries


parse(source, state): ParserState
Attributes
source:<string> | <Buffer>
< <ArrayBufferLike> > | <PreparsedAst>

Parses the provided source and updates the parser state.


parseCalculatedString(expression): CalculatedStringResult
Attributes

Parses calculated string.


parseCommentOptions(range): void

Parses comment options.


parseString(expression): string
Attributes
expression:<Expression>
Returns:<string>

Returns parsed string.


preWalkAssignmentExpression(expression): void
  • expression {AssignmentExpression}
  • Returns: <void>

Pre walk assignment expression.


preWalkBlockStatement(statement): void
  • statement {BlockStatement}
  • Returns: <void>

Pre walk block statement.


preWalkCatchClause(catchClause): void
  • catchClause {CatchClause}
  • Returns: <void>

Pre walk catch clause.


preWalkDoWhileStatement(statement): void
  • statement {DoWhileStatement}
  • Returns: <void>

Pre walk do while statement.


preWalkForInStatement(statement): void
  • statement {ForInStatement}
  • Returns: <void>

Pre walk for in statement.


preWalkForOfStatement(statement): void
  • statement {ForOfStatement}
  • Returns: <void>

Pre walk for of statement.


preWalkForStatement(statement): void
  • statement {ForStatement}
  • Returns: <void>

Pre walk for statement.


preWalkFunctionDeclaration(statement): void
  • statement <FunctionDeclaration> | <MaybeNamedFunctionDeclaration>
  • Returns: <void>

Pre walk function declaration.


preWalkIfStatement(statement): void
  • statement {IfStatement}
  • Returns: <void>

Pre walk if statement.


preWalkLabeledStatement(statement): void
  • statement {LabeledStatement}
  • Returns: <void>

Pre walk labeled statement.


preWalkStatement(statement): void
  • 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>
  • Returns: <void>

Walking iterates the statements and expressions and processes them


preWalkStatements(statements): void
  • 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[]>
  • Returns: <void>

Pre walking iterates the scope for variable declarations


preWalkSwitchCases(switchCases): void
  • switchCases {SwitchCase[]}
  • Returns: <void>

Pre walk switch cases.


preWalkSwitchStatement(statement): void
  • statement {SwitchStatement}
  • Returns: <void>

Pre walk switch statement.


preWalkTryStatement(statement): void
  • statement {TryStatement}
  • Returns: <void>

Pre walk try statement.


preWalkVariableDeclaration(statement): void
  • statement {VariableDeclaration}
  • Returns: <void>

Pre walk variable declaration.


preWalkVariableDeclarator(declarator): void
  • declarator {VariableDeclarator}
  • Returns: <void>

Pre walk variable declarator.


preWalkWhileStatement(statement): void
  • statement {WhileStatement}
  • Returns: <void>

Pre walk while statement.


preWalkWithStatement(statement): void
  • statement {WithStatement}
  • Returns: <void>

Pre walk with statement.


setAsiPosition(pos): void
Attributes
Returns:<void>

Updates asi position using the provided po.


setVariable(name, variableInfo): void
Attributes
Returns:<void>

Updates variable using the provided name.


tagVariable(name, tag, data?, flags?): void
Attributes

Processes the provided name.


undefineVariable(name): void
Attributes
Returns:<void>

Processes the provided name.


unsetAsiPosition(pos): void
Attributes
Returns:<void>

Unset asi position.


walkArrayExpression(expression): void
  • expression {ArrayExpression}
  • Returns: <void>

Walk array expression.


walkArrayPattern(pattern): void
  • pattern {ArrayPattern}
  • Returns: <void>

Walk array pattern.


walkArrowFunctionExpression(expression): void
  • expression {ArrowFunctionExpression}
  • Returns: <void>

Walk arrow function expression.


walkAssignmentExpression(expression): void
  • expression {AssignmentExpression}
  • Returns: <void>

Walk assignment expression.


walkAssignmentPattern(pattern): void
  • pattern {AssignmentPattern}
  • Returns: <void>

Walk assignment pattern.


walkAwaitExpression(expression): void
  • expression {AwaitExpression}
  • Returns: <void>

Walk await expression.


walkBinaryExpression(expression): void
  • expression {BinaryExpression}
  • Returns: <void>

Walk binary expression.


walkBlockStatement(statement): void
  • statement <BlockStatement> | <StaticBlock>
  • Returns: <void>

Walk block statement.


walkCallExpression(expression): void
Attributes
expression:<CallExpression>
Returns:<void>

Walk call expression.


walkCatchClause(catchClause): void
  • catchClause {CatchClause}
  • Returns: <void>

Processes the provided catch clause.


walkChainExpression(expression): void
  • expression {ChainExpression}
  • Returns: <void>

Walk chain expression.


walkClass(classy): void
  • classy <ClassDeclaration> | <MaybeNamedClassDeclaration> | <ClassExpression>
  • Returns: <void>

Processes the provided classy.


walkClassDeclaration(statement): void
  • statement <ClassDeclaration> | <MaybeNamedClassDeclaration>
  • Returns: <void>

Walk class declaration.


walkClassExpression(expression): void
  • expression {ClassExpression}
  • Returns: <void>

Walk class expression.


walkConditionalExpression(expression): void
  • expression {ConditionalExpression}
  • Returns: <void>

Walk conditional expression.


walkDoWhileStatement(statement): void
  • statement {DoWhileStatement}
  • Returns: <void>

Walk do while statement.


walkExportDefaultDeclaration(statement): void
  • statement {ExportDefaultDeclaration}
  • Returns: <void>

Walk export default declaration.


walkExportNamedDeclaration(statement): void
  • statement {ExportNamedDeclaration}
  • Returns: <void>

Walk export named declaration.


walkExpression(expression): void
  • 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>
  • Returns: <void>

Processes the provided expression.


walkExpressions(expressions): void
  • 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>[]
  • Returns: <void>

Processes the provided expression.


walkExpressionStatement(statement): void
  • statement {ExpressionStatement}
  • Returns: <void>

Walk expression statement.


walkForInStatement(statement): void
  • statement {ForInStatement}
  • Returns: <void>

Walk for in statement.


walkForOfStatement(statement): void
  • statement {ForOfStatement}
  • Returns: <void>

Walk for of statement.


walkForStatement(statement): void
  • statement {ForStatement}
  • Returns: <void>

Walk for statement.


walkFunctionDeclaration(statement): void
  • statement <FunctionDeclaration> | <MaybeNamedFunctionDeclaration>
  • Returns: <void>

Walk function declaration.


walkFunctionExpression(expression): void
  • expression {FunctionExpression}
  • Returns: <void>

Walk function expression.


walkIdentifier(expression): void
  • expression {Identifier}
  • Returns: <void>

Processes the provided expression.


walkIfStatement(statement): void
  • statement {IfStatement}
  • Returns: <void>

Processes the provided statement.


walkImportExpression(expression): void
Attributes

Walk import expression.


walkLabeledStatement(statement): void
  • statement {LabeledStatement}
  • Returns: <void>

Walk labeled statement.


walkLeftRightExpression(expression): void
  • expression <BinaryExpression> | <LogicalExpression>
  • Returns: <void>

Walk left right expression.


walkLogicalExpression(expression): void
  • expression {LogicalExpression}
  • Returns: <void>

Walk logical expression.


walkMemberExpression(expression): void
  • expression {MemberExpression}
  • Returns: <void>

Walk member expression.


walkMemberExpressionWithExpressionName(expression, name, rootInfo, members, onUnhandled): void

Walk member expression with expression name.


walkMetaProperty(metaProperty): void
  • metaProperty {MetaProperty}
  • Returns: <void>

Walk meta property.


walkNestedStatement(statement): void
Attributes
statement:<Statement>
Returns:<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
  • expression {NewExpression}
  • Returns: <void>

Walk new expression.


walkObjectExpression(expression): void
  • expression {ObjectExpression}
  • Returns: <void>

Walk object expression.


walkObjectPattern(pattern): void
  • pattern {ObjectPattern}
  • Returns: <void>

Walk object pattern.


walkPattern(pattern): void
Attributes
pattern:<Pattern>
Returns:<void>

Processes the provided pattern.


walkProperty(prop): void
  • prop <Property> | <SpreadElement>
  • Returns: <void>

Processes the provided prop.


walkRestElement(pattern): void
  • pattern {RestElement}
  • Returns: <void>

Processes the provided pattern.


walkReturnStatement(statement): void
  • statement {ReturnStatement}
  • Returns: <void>

Walk return statement.


walkSequenceExpression(expression): void
  • expression {SequenceExpression}
  • Returns: <void>

Walk sequence expression.


walkSpreadElement(expression): void
  • expression {SpreadElement}
  • Returns: <void>

Walk spread element.


walkStatement(statement): void
  • 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>
  • Returns: <void>

Processes the provided statement.


walkStatements(statements): void
  • 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[]>
  • Returns: <void>

Walking iterates the statements and expressions and processes them


walkSwitchCases(switchCases): void
  • switchCases {SwitchCase[]}
  • Returns: <void>

Processes the provided switch case.


walkSwitchStatement(statement): void
  • statement {SwitchStatement}
  • Returns: <void>

Walk switch statement.


walkTaggedTemplateExpression(expression): void
  • expression {TaggedTemplateExpression}
  • Returns: <void>

Walk tagged template expression.


walkTemplateLiteral(expression): void
  • expression {TemplateLiteral}
  • Returns: <void>

Walk template literal.


walkTerminatingStatement(statement): void
  • statement <ReturnStatement> | <ThrowStatement>
  • Returns: <void>

Walk terminating statement.


walkThisExpression(expression): void
  • expression {ThisExpression}
  • Returns: <void>

Walk this expression.


walkThrowStatement(statement): void
  • statement {ThrowStatement}
  • Returns: <void>

Walk throw statement.


walkTryStatement(statement): void
  • statement {TryStatement}
  • Returns: <void>

Walk try statement.


walkUnaryExpression(expression): void
  • expression {UnaryExpression}
  • Returns: <void>

Walk unary expression.


walkUpdateExpression(expression): void
  • expression {UpdateExpression}
  • Returns: <void>

Walk update expression.


walkVariableDeclaration(statement): void
  • statement {VariableDeclaration}
  • Returns: <void>

Walk variable declaration.


walkWhileStatement(statement): void
  • statement {WhileStatement}
  • Returns: <void>

Walk while statement.


walkWithStatement(statement): void
  • statement {WithStatement}
  • Returns: <void>

Walk with statement.


walkYieldExpression(expression): void
  • expression {YieldExpression}
  • Returns: <void>

Walk yield expression.


Attributes
plugins:<Function>
[]
Returns:
{typeof JavascriptParser}

Returns parser.

Attributes
conditional:
range:
<Tuple> < <number> , <number> >
value:<string>

Attributes
calleeName:<string>
getCalleeMembers:<Function>
getMemberRanges:<Function>
getMembers:<Function>
getMembersOptionals:<Function>
type:
{"call"}

Type:
<FunctionDeclaration> | <VariableDeclaration> | <ClassDeclaration>

Helper 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.

Attributes
loc:
{SourceLocation}
range:
<Tuple> < <number> , <number> >
shorthand:<string> | <boolean>


Type:
<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>

Attributes
getMemberRanges:<Function>
getMembers:<Function>
getMembersOptionals:<Function>
type:
{"expression"}

Type:<undefined> | <null> | <string> | <SimpleLiteral> | <RegExpLiteral> | <BigIntLiteral>


Attributes
harmonyNamedExports:<Set>
harmonyStarExports:<HarmonyStarExportsList>
lastHarmonyImportOrder:<number>
localModules:<LocalModule>
[]

Type:
<Identifier> | <MemberExpression> | <ObjectPattern> | <ArrayPattern> | <RestElement> | <AssignmentPattern>

Type:
<FunctionDeclaration> | <VariableDeclaration> | <ClassDeclaration> | <ExpressionStatement> | <BlockStatement> | <StaticBlock> | <EmptyStatement> | <DebuggerStatement> | <WithStatement> | <ReturnStatement> | <LabeledStatement> | <BreakStatement> | <ContinueStatement> | <IfStatement> | <SwitchStatement> | <ThrowStatement> | <TryStatement> | <WhileStatement> | <DoWhileStatement> | <ForStatement> | <ForInStatement> | <ForOfStatement>

Type:
<ImportDeclaration> | <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>