pub enum Expression {
Show 33 variants
This(This),
Identifier(Identifier),
Literal(Literal),
RegExpLiteral(RegExpLiteral),
ArrayLiteral(ArrayLiteral),
ObjectLiteral(ObjectLiteral),
Spread(Spread),
FunctionExpression(FunctionExpression),
ArrowFunction(ArrowFunction),
AsyncArrowFunction(AsyncArrowFunction),
GeneratorExpression(GeneratorExpression),
AsyncFunctionExpression(AsyncFunctionExpression),
AsyncGeneratorExpression(AsyncGeneratorExpression),
ClassExpression(Box<ClassExpression>),
TemplateLiteral(TemplateLiteral),
PropertyAccess(PropertyAccess),
New(New),
Call(Call),
SuperCall(SuperCall),
ImportCall(ImportCall),
Optional(Optional),
TaggedTemplate(TaggedTemplate),
NewTarget(NewTarget),
ImportMeta(ImportMeta),
Assign(Assign),
Unary(Unary),
Update(Update),
Binary(Binary),
BinaryInPrivate(BinaryInPrivate),
Conditional(Conditional),
Await(Await),
Yield(Yield),
Parenthesized(Parenthesized),
// some variants omitted
}Expand description
The Expression Parse Node.
See the module level documentation for more information.
Variants§
This(This)
The ECMAScript this keyword refers to the object it belongs to.
A property of an execution context (global, function or eval) that, in non–strict mode, is always a reference to an object and in strict mode can be any value.
More information:
Identifier(Identifier)
See Identifier.
Literal(Literal)
See Literal.
RegExpLiteral(RegExpLiteral)
See RegExpLiteral.
ArrayLiteral(ArrayLiteral)
See ArrayLiteral.
ObjectLiteral(ObjectLiteral)
See ObjectLiteral.
Spread(Spread)
See Spread,
FunctionExpression(FunctionExpression)
See FunctionExpression.
ArrowFunction(ArrowFunction)
See ArrowFunction.
AsyncArrowFunction(AsyncArrowFunction)
See AsyncArrowFunction.
GeneratorExpression(GeneratorExpression)
See GeneratorExpression.
AsyncFunctionExpression(AsyncFunctionExpression)
AsyncGeneratorExpression(AsyncGeneratorExpression)
ClassExpression(Box<ClassExpression>)
See ClassExpression.
TemplateLiteral(TemplateLiteral)
See TemplateLiteral.
PropertyAccess(PropertyAccess)
See PropertyAccess.
New(New)
See New.
Call(Call)
See Call.
SuperCall(SuperCall)
See SuperCall.
ImportCall(ImportCall)
See ImportCall.
Optional(Optional)
See Optional.
TaggedTemplate(TaggedTemplate)
See TaggedTemplate.
NewTarget(NewTarget)
The new.target pseudo-property expression.
ImportMeta(ImportMeta)
The import.meta pseudo-property expression.
Assign(Assign)
See Assign.
Unary(Unary)
See Unary.
Update(Update)
See Unary.
Binary(Binary)
See Binary.
BinaryInPrivate(BinaryInPrivate)
See BinaryInPrivate.
Conditional(Conditional)
See Conditional.
Await(Await)
See Await.
Yield(Yield)
See Yield.
Parenthesized(Parenthesized)
See Parenthesized.
Implementations§
Source§impl Expression
impl Expression
Sourcepub const fn is_anonymous_function_definition(&self) -> bool
pub const fn is_anonymous_function_definition(&self) -> bool
Returns if the expression is a function definition without a name.
More information:
Sourcepub fn set_anonymous_function_definition_name(&mut self, name: &Identifier)
pub fn set_anonymous_function_definition_name(&mut self, name: &Identifier)
Sets the name of an anonymous function definition.
This is used to set the name of a function expression when it is assigned to a variable. If the function already has a name, this does nothing.
Sourcepub const fn flatten(&self) -> &Expression
pub const fn flatten(&self) -> &Expression
Returns the expression without any outer parenthesized expressions.
Trait Implementations§
Source§impl Clone for Expression
impl Clone for Expression
Source§fn clone(&self) -> Expression
fn clone(&self) -> Expression
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for Expression
impl Debug for Expression
Source§impl<'de> Deserialize<'de> for Expression
impl<'de> Deserialize<'de> for Expression
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<Expression, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<Expression, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Source§impl<'a> From<&'a Expression> for NodeRef<'a>
impl<'a> From<&'a Expression> for NodeRef<'a>
Source§fn from(node: &'a Expression) -> NodeRef<'a>
fn from(node: &'a Expression) -> NodeRef<'a>
Source§impl<'a> From<&'a mut Expression> for NodeRefMut<'a>
impl<'a> From<&'a mut Expression> for NodeRefMut<'a>
Source§fn from(node: &'a mut Expression) -> NodeRefMut<'a>
fn from(node: &'a mut Expression) -> NodeRefMut<'a>
Source§impl From<ArrayLiteral> for Expression
impl From<ArrayLiteral> for Expression
Source§fn from(arr: ArrayLiteral) -> Expression
fn from(arr: ArrayLiteral) -> Expression
Source§impl From<ArrowFunction> for Expression
impl From<ArrowFunction> for Expression
Source§fn from(decl: ArrowFunction) -> Expression
fn from(decl: ArrowFunction) -> Expression
Source§impl From<Assign> for Expression
impl From<Assign> for Expression
Source§fn from(op: Assign) -> Expression
fn from(op: Assign) -> Expression
Source§impl From<AsyncArrowFunction> for Expression
impl From<AsyncArrowFunction> for Expression
Source§fn from(decl: AsyncArrowFunction) -> Expression
fn from(decl: AsyncArrowFunction) -> Expression
Source§impl From<AsyncFunctionExpression> for Expression
impl From<AsyncFunctionExpression> for Expression
Source§fn from(expr: AsyncFunctionExpression) -> Expression
fn from(expr: AsyncFunctionExpression) -> Expression
Source§impl From<AsyncGeneratorExpression> for Expression
impl From<AsyncGeneratorExpression> for Expression
Source§fn from(expr: AsyncGeneratorExpression) -> Expression
fn from(expr: AsyncGeneratorExpression) -> Expression
Source§impl From<Await> for Expression
impl From<Await> for Expression
Source§fn from(awaitexpr: Await) -> Expression
fn from(awaitexpr: Await) -> Expression
Source§impl From<Binary> for Expression
impl From<Binary> for Expression
Source§fn from(op: Binary) -> Expression
fn from(op: Binary) -> Expression
Source§impl From<BinaryInPrivate> for Expression
impl From<BinaryInPrivate> for Expression
Source§fn from(op: BinaryInPrivate) -> Expression
fn from(op: BinaryInPrivate) -> Expression
Source§impl From<Call> for Expression
impl From<Call> for Expression
Source§fn from(call: Call) -> Expression
fn from(call: Call) -> Expression
Source§impl From<ClassExpression> for Expression
impl From<ClassExpression> for Expression
Source§fn from(expr: ClassExpression) -> Expression
fn from(expr: ClassExpression) -> Expression
Source§impl From<Conditional> for Expression
impl From<Conditional> for Expression
Source§fn from(cond_op: Conditional) -> Expression
fn from(cond_op: Conditional) -> Expression
Source§impl From<Expression> for ForLoopInitializer
impl From<Expression> for ForLoopInitializer
Source§fn from(expr: Expression) -> ForLoopInitializer
fn from(expr: Expression) -> ForLoopInitializer
Source§impl From<Expression> for PropertyAccessField
impl From<Expression> for PropertyAccessField
Source§fn from(expr: Expression) -> PropertyAccessField
fn from(expr: Expression) -> PropertyAccessField
Source§impl From<Expression> for PropertyName
impl From<Expression> for PropertyName
Source§fn from(name: Expression) -> PropertyName
fn from(name: Expression) -> PropertyName
Source§impl From<Expression> for Statement
impl From<Expression> for Statement
Source§fn from(expr: Expression) -> Statement
fn from(expr: Expression) -> Statement
Source§impl From<FunctionExpression> for Expression
impl From<FunctionExpression> for Expression
Source§fn from(expr: FunctionExpression) -> Expression
fn from(expr: FunctionExpression) -> Expression
Source§impl From<GeneratorExpression> for Expression
impl From<GeneratorExpression> for Expression
Source§fn from(expr: GeneratorExpression) -> Expression
fn from(expr: GeneratorExpression) -> Expression
Source§impl From<Identifier> for Expression
impl From<Identifier> for Expression
Source§fn from(local: Identifier) -> Expression
fn from(local: Identifier) -> Expression
Source§impl From<ImportCall> for Expression
impl From<ImportCall> for Expression
Source§fn from(call: ImportCall) -> Expression
fn from(call: ImportCall) -> Expression
Source§impl From<ImportMeta> for Expression
impl From<ImportMeta> for Expression
Source§fn from(value: ImportMeta) -> Expression
fn from(value: ImportMeta) -> Expression
Source§impl From<Literal> for Expression
impl From<Literal> for Expression
Source§fn from(lit: Literal) -> Expression
fn from(lit: Literal) -> Expression
Source§impl From<New> for Expression
impl From<New> for Expression
Source§fn from(new: New) -> Expression
fn from(new: New) -> Expression
Source§impl From<NewTarget> for Expression
impl From<NewTarget> for Expression
Source§fn from(value: NewTarget) -> Expression
fn from(value: NewTarget) -> Expression
Source§impl From<ObjectLiteral> for Expression
impl From<ObjectLiteral> for Expression
Source§fn from(obj: ObjectLiteral) -> Expression
fn from(obj: ObjectLiteral) -> Expression
Source§impl From<Optional> for Expression
impl From<Optional> for Expression
Source§fn from(opt: Optional) -> Expression
fn from(opt: Optional) -> Expression
Source§impl From<Parenthesized> for Expression
impl From<Parenthesized> for Expression
Source§fn from(p: Parenthesized) -> Expression
fn from(p: Parenthesized) -> Expression
Source§impl From<PropertyAccess> for Expression
impl From<PropertyAccess> for Expression
Source§fn from(access: PropertyAccess) -> Expression
fn from(access: PropertyAccess) -> Expression
Source§impl From<RegExpLiteral> for Expression
impl From<RegExpLiteral> for Expression
Source§fn from(value: RegExpLiteral) -> Expression
fn from(value: RegExpLiteral) -> Expression
Source§impl From<Spread> for Expression
impl From<Spread> for Expression
Source§fn from(spread: Spread) -> Expression
fn from(spread: Spread) -> Expression
Source§impl From<SuperCall> for Expression
impl From<SuperCall> for Expression
Source§fn from(call: SuperCall) -> Expression
fn from(call: SuperCall) -> Expression
Source§impl From<TaggedTemplate> for Expression
impl From<TaggedTemplate> for Expression
Source§fn from(template: TaggedTemplate) -> Expression
fn from(template: TaggedTemplate) -> Expression
Source§impl From<TemplateLiteral> for Expression
impl From<TemplateLiteral> for Expression
Source§fn from(tem: TemplateLiteral) -> Expression
fn from(tem: TemplateLiteral) -> Expression
Source§impl From<This> for Expression
impl From<This> for Expression
Source§fn from(value: This) -> Expression
fn from(value: This) -> Expression
Source§impl From<Unary> for Expression
impl From<Unary> for Expression
Source§fn from(op: Unary) -> Expression
fn from(op: Unary) -> Expression
Source§impl From<Update> for Expression
impl From<Update> for Expression
Source§fn from(op: Update) -> Expression
fn from(op: Update) -> Expression
Source§impl From<Yield> for Expression
impl From<Yield> for Expression
Source§fn from(yield: Yield) -> Expression
fn from(yield: Yield) -> Expression
Source§impl PartialEq for Expression
impl PartialEq for Expression
Source§impl Serialize for Expression
impl Serialize for Expression
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Source§impl Spanned for Expression
impl Spanned for Expression
Source§impl ToIndentedString for Expression
impl ToIndentedString for Expression
Source§impl VisitWith for Expression
impl VisitWith for Expression
Source§fn visit_with<'a, V>(
&'a self,
visitor: &mut V,
) -> ControlFlow<<V as Visitor<'a>>::BreakTy>where
V: Visitor<'a>,
fn visit_with<'a, V>(
&'a self,
visitor: &mut V,
) -> ControlFlow<<V as Visitor<'a>>::BreakTy>where
V: Visitor<'a>,
Source§fn visit_with_mut<'a, V>(
&'a mut self,
visitor: &mut V,
) -> ControlFlow<<V as VisitorMut<'a>>::BreakTy>where
V: VisitorMut<'a>,
fn visit_with_mut<'a, V>(
&'a mut self,
visitor: &mut V,
) -> ControlFlow<<V as VisitorMut<'a>>::BreakTy>where
V: VisitorMut<'a>,
impl StructuralPartialEq for Expression
Auto Trait Implementations§
impl Freeze for Expression
impl !RefUnwindSafe for Expression
impl !Send for Expression
impl !Sync for Expression
impl Unpin for Expression
impl !UnwindSafe for Expression
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Pipe for Twhere
T: ?Sized,
impl<T> Pipe for Twhere
T: ?Sized,
Source§fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
Source§fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
self and passes that borrow into the pipe function. Read moreSource§fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
self and passes that borrow into the pipe function. Read moreSource§fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
Source§fn pipe_borrow_mut<'a, B, R>(
&'a mut self,
func: impl FnOnce(&'a mut B) -> R,
) -> R
fn pipe_borrow_mut<'a, B, R>( &'a mut self, func: impl FnOnce(&'a mut B) -> R, ) -> R
Source§fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
self, then passes self.as_ref() into the pipe function.Source§fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
self, then passes self.as_mut() into the pipe
function.Source§fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
self, then passes self.deref() into the pipe function.Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> Serialize for T
impl<T> Serialize for T
fn erased_serialize(&self, serializer: &mut dyn Serializer) -> Result<(), Error>
fn do_erased_serialize( &self, serializer: &mut dyn Serializer, ) -> Result<(), ErrorImpl>
Source§impl<T> Tap for T
impl<T> Tap for T
Source§fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
Borrow<B> of a value. Read moreSource§fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
BorrowMut<B> of a value. Read moreSource§fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
AsRef<R> view of a value. Read moreSource§fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
AsMut<R> view of a value. Read moreSource§fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
Deref::Target of a value. Read moreSource§fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
Deref::Target of a value. Read moreSource§fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
.tap() only in debug builds, and is erased in release builds.Source§fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
.tap_mut() only in debug builds, and is erased in release
builds.Source§fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
.tap_borrow() only in debug builds, and is erased in release
builds.Source§fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
.tap_borrow_mut() only in debug builds, and is erased in release
builds.Source§fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
.tap_ref() only in debug builds, and is erased in release
builds.Source§fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
.tap_ref_mut() only in debug builds, and is erased in release
builds.Source§fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
.tap_deref() only in debug builds, and is erased in release
builds.