Module expr

Source
Expand description

Expressions, these include this, identifiers, arrays, objects, binary expressions, unary expressions, and more.

See the ECMAScript spec.

Constants§

ASSIGN_TOKENS
EXPR_RECOVERY_SET
LITERAL
STARTS_EXPR

Functions§

args
Arguments to a function.
array_expr
An array literal such as [foo, bar, ...baz].
assign_expr
An assignment expression such as foo += bar or foo = 5.
binary_expr
A binary expression such as 2 + 2 or foo * bar + 2
bracket_expr
An array expression for property access or indexing, such as foo[0] or foo?.["bar"]
conditional_expr
A conditional expression such as foo ? bar : baz
dot_expr
A dot expression for accessing a property
expr
A general expression.
expr_or_spread
identifier_name
An identifier name, either an ident or a keyword
identifier_reference
lhs_expr
A left hand side expression, either a member expression or a call expression such as foo().
literal
A literal expression.
member_or_new_expr
A member or new expression with subscripts. e.g. new foo, new Foo(), foo, or foo().bar[5]
object_expr
An object literal such as { a: b, "b": 5 + 5 }.
object_prop_name
object_property
An individual object property such as "a": b or 5: 6 + 6.
paren_expr
A parenthesis expression, also called a grouping expression.
paren_or_arrow_expr
postfix_expr
A postifx expression, either LHSExpr [no linebreak] ++ or LHSExpr [no linebreak] --.
primary_expr
A primary expression such as a literal, an object, an array, or this.
spread_element
A spread element consisting of three dots and an assignment expression such as ...foo
subscripts
Dot, Array, or Call expr subscripts. Including optional chaining.
template
A template literal such as “abcd ${efg}
unary_expr
A unary expression such as !foo or ++bar
yield_expr