Package-level declarations
Types
Base class for the entries of an object literal: ObjectProperty and SpreadObjectProperty.
An array comprehension such as [expr for (x in y) if (cond)]. Node type is Token.ARRAYCOMP. It introduces a scope, so it extends Scope.
One for clause inside an ArrayComprehension or a generator expression. It carries no body: the comprehension result plays that role.
An array literal, which doubles as an array destructuring target. Node type is Token.ARRAYLIT.
An assignment expression such as a = b or a += b. The node type is the assignment operator token.
Root of a parse tree. Holds the statements and functions in the script plus the Comment nodes attached to the script as a whole. Node type is Token.SCRIPT.
A BigInt literal such as 123n. Node type is Token.BIGINT.
A break statement, with or without a label. Node type is Token.BREAK.
One catch clause of a try statement. Node type is Token.CATCH. The catchCondition is the SpiderMonkey catch (e if cond) extension.
A comment. Node type is Token.COMMENT.
A computed property key such as the [a + b] in { [a + b]: 1 }. Node type is Token.COMPUTED_PROPERTY.
A ternary expression test ? then : else. Node type is Token.HOOK.
A continue statement, with or without a label. Node type is Token.CONTINUE.
Shared by ArrayLiteral and ObjectLiteral, the two node types that can appear in a destructuring position.
A bracketed element access such as a[b]. Node type is Token.GETELEM.
An empty expression. Node type is Token.EMPTY. Wrap it in an ExpressionStatement to make an empty statement.
An empty statement, a lone semicolon. Node type is Token.EMPTY.
An error reporter that records problems instead of throwing, for IDE-mode parsing. Only the offset-and-length overloads are supported; the line-based ones throw.
An expression statement. Node type is Token.EXPR_VOID when the value is discarded, and Token.EXPR_RESULT when it becomes the script result.
A function or method call. Node type is Token.CALL.
A JavaScript function declaration or expression. Node type is Token.FUNCTION.
A generator expression such as (expr for (x in y) if (cond)). Node type is Token.GENEXPR. It introduces a scope, so it extends Scope.
One for clause inside a generator expression. Unlike ArrayComprehensionLoop it does not support the for each form.
Error reporting protocol for IDE-mode parsing. If the parser's error reporter implements this interface, these offset/length overloads are called instead of the line-based ErrorReporter versions.
An if statement with an optional else part. Node type is Token.IF.
A binary expression: left op right. The node type is the operator token, so a plus expression has type Token.ADD.
A keyword literal: this, super, null, undefined, true, false or debugger. The node type is the keyword's own token, and setting it rejects anything else.
One label in a LabeledStatement, for example the outer in outer: for (;;) {}. Node type is Token.LABEL.
A labeled statement. A statement can carry several labels, as in a: b: c: while (...) {}. Node type is Token.EXPR_VOID.
A simple name: an identifier that is not a keyword. Node type is Token.NAME.
A new expression. Node type is Token.NEW. The initializer is Rhino's non-standard new Foo() {a: 1} object-initializer extension.
Simple visitor for traversing the AST. Nodes are visited in an arbitrary order; the visitor casts nodes to the right type based on their token type.
A Number literal. Node type is Token.NUMBER.
An object literal, which doubles as an object destructuring target. Node type is Token.OBJECTLIT.
One key: value entry of an object literal, or a getter, setter or method definition. The node type is Token.COLON, Token.GET, Token.SET or Token.METHOD.
A parenthesized expression. Node type is Token.LP.
One error or warning recorded by an ErrorCollector during a parse.
A dotted property access such as a.b. Node type is Token.GETPROP. The target is the left side and the property is the Name on the right.
A regular expression literal. Node type is Token.REGEXP. The value is the pattern without the delimiting slashes and flags are the trailing letters.
A return statement. Node type is Token.RETURN. The returnValue is null for a bare return;.
Base type for AstRoot and FunctionNode, which collect much of the same information.
A ...expr entry of an object literal. Node type is Token.DOTDOTDOT.
A single- or double-quoted string literal. Node type is Token.STRING.
One case or default clause of a switch. Node type is Token.CASE; a null expression means it is the default clause.
A switch statement. Node type is Token.SWITCH. It introduces a scope.
A tagged template such as `tag`a${b}c` `. Node type is Token.TAGGED_TEMPLATE_LITERAL.
The literal text between substitutions in a template literal. Node type is Token.TEMPLATE_CHARS. value is the cooked text and rawValue the source text.
A template literal. Node type is Token.TEMPLATE_LITERAL. Its elements alternate between TemplateCharacters runs and substitution expressions.
A throw statement. Node type is Token.THROW.
A try statement with its catch clauses and optional finally block. Node type is Token.TRY.
A prefix unary expression such as !a, -a, typeof a or void a. The node type is the operator token. Increment and decrement live in UpdateExpression.
A var, const or let declaration holding one or more VariableInitializer entries. The node type is the declaration keyword's token, and setting it rejects anything else.
One name = value entry of a VariableDeclaration. The target is a Name, or an array or object literal for a destructuring binding. Node type matches the declaration keyword.
A with statement. Node type is Token.WITH.
A yield expression. Node type is Token.YIELD, or Token.YIELD_STAR for yield*.