#[repr(C, u8)]pub enum Expression<'a> {
Show 43 variants
BooleanLiteral(Box<'a, BooleanLiteral>),
NullLiteral(Box<'a, NullLiteral>),
NumericLiteral(Box<'a, NumericLiteral<'a>>),
BigIntLiteral(Box<'a, BigIntLiteral<'a>>),
RegExpLiteral(Box<'a, RegExpLiteral<'a>>),
StringLiteral(Box<'a, StringLiteral<'a>>),
TemplateLiteral(Box<'a, TemplateLiteral<'a>>),
Identifier(Box<'a, IdentifierReference<'a>>),
MetaProperty(Box<'a, MetaProperty<'a>>),
Super(Box<'a, Super>),
ArrayExpression(Box<'a, ArrayExpression<'a>>),
ArrowFunctionExpression(Box<'a, ArrowFunctionExpression<'a>>),
AssignmentExpression(Box<'a, AssignmentExpression<'a>>),
AwaitExpression(Box<'a, AwaitExpression<'a>>),
BinaryExpression(Box<'a, BinaryExpression<'a>>),
CallExpression(Box<'a, CallExpression<'a>>),
ChainExpression(Box<'a, ChainExpression<'a>>),
ClassExpression(Box<'a, Class<'a>>),
ConditionalExpression(Box<'a, ConditionalExpression<'a>>),
FunctionExpression(Box<'a, Function<'a>>),
ImportExpression(Box<'a, ImportExpression<'a>>),
LogicalExpression(Box<'a, LogicalExpression<'a>>),
NewExpression(Box<'a, NewExpression<'a>>),
ObjectExpression(Box<'a, ObjectExpression<'a>>),
ParenthesizedExpression(Box<'a, ParenthesizedExpression<'a>>),
SequenceExpression(Box<'a, SequenceExpression<'a>>),
TaggedTemplateExpression(Box<'a, TaggedTemplateExpression<'a>>),
ThisExpression(Box<'a, ThisExpression>),
UnaryExpression(Box<'a, UnaryExpression<'a>>),
UpdateExpression(Box<'a, UpdateExpression<'a>>),
YieldExpression(Box<'a, YieldExpression<'a>>),
PrivateInExpression(Box<'a, PrivateInExpression<'a>>),
JSXElement(Box<'a, JSXElement<'a>>),
JSXFragment(Box<'a, JSXFragment<'a>>),
TSAsExpression(Box<'a, TSAsExpression<'a>>),
TSSatisfiesExpression(Box<'a, TSSatisfiesExpression<'a>>),
TSTypeAssertion(Box<'a, TSTypeAssertion<'a>>),
TSNonNullExpression(Box<'a, TSNonNullExpression<'a>>),
TSInstantiationExpression(Box<'a, TSInstantiationExpression<'a>>),
V8IntrinsicExpression(Box<'a, V8IntrinsicExpression<'a>>),
ComputedMemberExpression(Box<'a, ComputedMemberExpression<'a>>),
StaticMemberExpression(Box<'a, StaticMemberExpression<'a>>),
PrivateFieldExpression(Box<'a, PrivateFieldExpression<'a>>),
}Expand description
Represents a type for AST nodes corresponding to JavaScript’s expressions.
Inherits variants from MemberExpression. See ast module docs for explanation of inheritance.
Variants§
BooleanLiteral(Box<'a, BooleanLiteral>)
See BooleanLiteral for AST node details.
NullLiteral(Box<'a, NullLiteral>)
See NullLiteral for AST node details.
NumericLiteral(Box<'a, NumericLiteral<'a>>)
See NumericLiteral for AST node details.
BigIntLiteral(Box<'a, BigIntLiteral<'a>>)
See BigIntLiteral for AST node details.
RegExpLiteral(Box<'a, RegExpLiteral<'a>>)
See RegExpLiteral for AST node details.
StringLiteral(Box<'a, StringLiteral<'a>>)
See StringLiteral for AST node details.
TemplateLiteral(Box<'a, TemplateLiteral<'a>>)
See TemplateLiteral for AST node details.
Identifier(Box<'a, IdentifierReference<'a>>)
See IdentifierReference for AST node details.
MetaProperty(Box<'a, MetaProperty<'a>>)
See MetaProperty for AST node details.
Super(Box<'a, Super>)
See Super for AST node details.
ArrayExpression(Box<'a, ArrayExpression<'a>>)
See ArrayExpression for AST node details.
ArrowFunctionExpression(Box<'a, ArrowFunctionExpression<'a>>)
See ArrowFunctionExpression for AST node details.
AssignmentExpression(Box<'a, AssignmentExpression<'a>>)
See AssignmentExpression for AST node details.
AwaitExpression(Box<'a, AwaitExpression<'a>>)
See AwaitExpression for AST node details.
BinaryExpression(Box<'a, BinaryExpression<'a>>)
See BinaryExpression for AST node details.
CallExpression(Box<'a, CallExpression<'a>>)
See CallExpression for AST node details.
ChainExpression(Box<'a, ChainExpression<'a>>)
See ChainExpression for AST node details.
ClassExpression(Box<'a, Class<'a>>)
See Class for AST node details.
ConditionalExpression(Box<'a, ConditionalExpression<'a>>)
See ConditionalExpression for AST node details.
FunctionExpression(Box<'a, Function<'a>>)
See Function for AST node details.
ImportExpression(Box<'a, ImportExpression<'a>>)
See ImportExpression for AST node details.
LogicalExpression(Box<'a, LogicalExpression<'a>>)
See LogicalExpression for AST node details.
NewExpression(Box<'a, NewExpression<'a>>)
See NewExpression for AST node details.
ObjectExpression(Box<'a, ObjectExpression<'a>>)
See ObjectExpression for AST node details.
ParenthesizedExpression(Box<'a, ParenthesizedExpression<'a>>)
See ParenthesizedExpression for AST node details.
SequenceExpression(Box<'a, SequenceExpression<'a>>)
See SequenceExpression for AST node details.
TaggedTemplateExpression(Box<'a, TaggedTemplateExpression<'a>>)
See TaggedTemplateExpression for AST node details.
ThisExpression(Box<'a, ThisExpression>)
See ThisExpression for AST node details.
UnaryExpression(Box<'a, UnaryExpression<'a>>)
See UnaryExpression for AST node details.
UpdateExpression(Box<'a, UpdateExpression<'a>>)
See UpdateExpression for AST node details.
YieldExpression(Box<'a, YieldExpression<'a>>)
See YieldExpression for AST node details.
PrivateInExpression(Box<'a, PrivateInExpression<'a>>)
See PrivateInExpression for AST node details.
JSXElement(Box<'a, JSXElement<'a>>)
See JSXElement for AST node details.
JSXFragment(Box<'a, JSXFragment<'a>>)
See JSXFragment for AST node details.
TSAsExpression(Box<'a, TSAsExpression<'a>>)
See TSAsExpression for AST node details.
TSSatisfiesExpression(Box<'a, TSSatisfiesExpression<'a>>)
See TSSatisfiesExpression for AST node details.
TSTypeAssertion(Box<'a, TSTypeAssertion<'a>>)
See TSTypeAssertion for AST node details.
TSNonNullExpression(Box<'a, TSNonNullExpression<'a>>)
See TSNonNullExpression for AST node details.
TSInstantiationExpression(Box<'a, TSInstantiationExpression<'a>>)
See TSInstantiationExpression for AST node details.
V8IntrinsicExpression(Box<'a, V8IntrinsicExpression<'a>>)
See V8IntrinsicExpression for AST node details.
ComputedMemberExpression(Box<'a, ComputedMemberExpression<'a>>)
Inherited from MemberExpression.
MemberExpression[?Yield, ?Await] [ Expression[+In, ?Yield, ?Await] ]
StaticMemberExpression(Box<'a, StaticMemberExpression<'a>>)
Inherited from MemberExpression.
MemberExpression[?Yield, ?Await] . IdentifierName
PrivateFieldExpression(Box<'a, PrivateFieldExpression<'a>>)
Inherited from MemberExpression.
MemberExpression[?Yield, ?Await] . PrivateIdentifier
Implementations§
Source§impl<'a> Expression<'a>
impl<'a> Expression<'a>
Sourcepub fn is_member_expression(&self) -> bool
pub fn is_member_expression(&self) -> bool
Return if a Expression is a MemberExpression.
Sourcepub fn into_member_expression(self) -> MemberExpression<'a>
pub fn into_member_expression(self) -> MemberExpression<'a>
Sourcepub fn as_member_expression(&self) -> Option<&MemberExpression<'a>>
pub fn as_member_expression(&self) -> Option<&MemberExpression<'a>>
Convert &Expression to &MemberExpression.
Sourcepub fn as_member_expression_mut(&mut self) -> Option<&mut MemberExpression<'a>>
pub fn as_member_expression_mut(&mut self) -> Option<&mut MemberExpression<'a>>
Convert &mut Expression to &mut MemberExpression.
Sourcepub fn to_member_expression(&self) -> &MemberExpression<'a>
pub fn to_member_expression(&self) -> &MemberExpression<'a>
Sourcepub fn to_member_expression_mut(&mut self) -> &mut MemberExpression<'a>
pub fn to_member_expression_mut(&mut self) -> &mut MemberExpression<'a>
Source§impl<'a> Expression<'a>
impl<'a> Expression<'a>
Sourcepub fn is_typescript_syntax(&self) -> bool
pub fn is_typescript_syntax(&self) -> bool
Returns true if this expression is TypeScript-specific syntax.
Sourcepub fn is_primary_expression(&self) -> bool
pub fn is_primary_expression(&self) -> bool
Returns true if this is a primary expression.
Sourcepub fn is_literal(&self) -> bool
pub fn is_literal(&self) -> bool
true if this Expression is a literal expression for a primitive value.
Does not include TemplateLiterals, object literals, or array literals.
Sourcepub fn is_string_literal(&self) -> bool
pub fn is_string_literal(&self) -> bool
Sourcepub fn is_no_substitution_template(&self) -> bool
pub fn is_no_substitution_template(&self) -> bool
Return true if the expression is a plain template.
Sourcepub fn is_number_literal(&self) -> bool
pub fn is_number_literal(&self) -> bool
Sourcepub fn is_big_int_literal(&self) -> bool
pub fn is_big_int_literal(&self) -> bool
Returns true for bigint literals.
Sourcepub fn is_specific_string_literal(&self, string: &str) -> bool
pub fn is_specific_string_literal(&self, string: &str) -> bool
Returns true for string literals matching the
expected value. Note that non-substitution template
literals are not considered.
Sourcepub fn is_undefined(&self) -> bool
pub fn is_undefined(&self) -> bool
Determines whether the given expr is a undefined literal
Sourcepub fn is_number(&self) -> bool
pub fn is_number(&self) -> bool
Returns true for numeric literals
Sourcepub fn is_number_0(&self) -> bool
pub fn is_number_0(&self) -> bool
Determines whether the given expr is a 0
Sourcepub fn is_number_value(&self, val: f64) -> bool
pub fn is_number_value(&self, val: f64) -> bool
Determines whether the given expr is a specific number literal.
Sourcepub fn is_specific_raw_number_literal(&self, val: &str) -> bool
pub fn is_specific_raw_number_literal(&self, val: &str) -> bool
Determines whether the given numeral literal’s raw value is exactly val
Sourcepub fn evaluate_to_undefined(&self) -> bool
pub fn evaluate_to_undefined(&self) -> bool
Determines whether the given expr evaluate to undefined
Sourcepub fn is_null_or_undefined(&self) -> bool
pub fn is_null_or_undefined(&self) -> bool
Determines whether the given expr is a null or undefined or void 0
Corresponds to a nullish value check.
Sourcepub fn without_parentheses(&self) -> &Expression<'a>
pub fn without_parentheses(&self) -> &Expression<'a>
Remove nested parentheses from this expression.
Sourcepub fn without_parentheses_mut(&mut self) -> &mut Expression<'a>
pub fn without_parentheses_mut(&mut self) -> &mut Expression<'a>
Remove nested parentheses from this expression.
Sourcepub fn is_specific_id(&self, name: &str) -> bool
pub fn is_specific_id(&self, name: &str) -> bool
Returns true if this Expression is an IdentifierReference with specified name.
Sourcepub fn is_specific_member_access(&self, object: &str, property: &str) -> bool
pub fn is_specific_member_access(&self, object: &str, property: &str) -> bool
Returns true if this Expression is a MemberExpression with the specified object
name and property name.
For example, Array.from is a specific member access with object Array and property from
and could be checked like expr.is_specific_member_access("Array", "from").
Sourcepub fn into_inner_expression(self) -> Expression<'a>
pub fn into_inner_expression(self) -> Expression<'a>
Returns the expression inside of this one, if applicable, and takes ownership of it.
For example, if the expression is a ParenthesizedExpression, it will return the
expression inside the parentheses. Or if this is part of a TypeScript expression
like as, satisfies, or !, then it will return the expression that is being type asserted.
For getting a reference to the expression inside, use Expression::get_inner_expression.
Sourcepub fn get_inner_expression(&self) -> &Expression<'a>
pub fn get_inner_expression(&self) -> &Expression<'a>
Gets the expression inside of this one, if applicable, and returns a reference to it.
For example, if the expression is a ParenthesizedExpression, it will return the
expression inside the parentheses. Or if this is part of a TypeScript expression
like as, satisfies, or !, then it will return the expression that is being type asserted.
For taking ownership of the expression inside, use Expression::into_inner_expression.
For getting a mutable reference to the expression inside, use Expression::get_inner_expression_mut.
Sourcepub fn get_inner_expression_mut(&mut self) -> &mut Expression<'a>
pub fn get_inner_expression_mut(&mut self) -> &mut Expression<'a>
Gets the expression inside of this one, if applicable, and returns a mutable reference to it.
For example, if the expression is a ParenthesizedExpression, it will return the
expression inside the parentheses. Or if this is part of a TypeScript expression
like as, satisfies, or !, then it will return the expression that is being type asserted.
For taking ownership of the expression inside, use Expression::into_inner_expression.
For getting an immutable reference to the expression inside, use Expression::get_inner_expression.
Sourcepub fn into_chain_element(self) -> Option<ChainElement<'a>>
pub fn into_chain_element(self) -> Option<ChainElement<'a>>
Turns any chainable expression such as a.b or b() into the chained equivalent
such as a?.b or b?.().
Sourcepub fn is_identifier_reference(&self) -> bool
pub fn is_identifier_reference(&self) -> bool
Returns true if this Expression is an IdentifierReference.
Sourcepub fn get_identifier_reference(&self) -> Option<&IdentifierReference<'a>>
pub fn get_identifier_reference(&self) -> Option<&IdentifierReference<'a>>
Returns the IdentifierReference if this expression is an Expression::Identifier,
or contains an Expression::Identifier and reruns None otherwise.
Sourcepub fn is_function(&self) -> bool
pub fn is_function(&self) -> bool
Returns true if this Expression is a function
(either Function or ArrowFunctionExpression).
Sourcepub fn is_anonymous_function_definition(&self) -> bool
pub fn is_anonymous_function_definition(&self) -> bool
Returns true if this Expression is an anonymous function definition.
Note that this includes Classs.
https://262.ecma-international.org/15.0/#sec-isanonymousfunctiondefinition
Sourcepub fn is_call_expression(&self) -> bool
pub fn is_call_expression(&self) -> bool
Returns true if this Expression is a CallExpression.
Sourcepub fn is_super(&self) -> bool
pub fn is_super(&self) -> bool
Returns true if this Expression is a Super.
Sourcepub fn is_super_call_expression(&self) -> bool
pub fn is_super_call_expression(&self) -> bool
Returns true if this Expression is a CallExpression with Super as callee.
Sourcepub fn is_call_like_expression(&self) -> bool
pub fn is_call_like_expression(&self) -> bool
Returns true if this Expression is a CallExpression, NewExpression,
or ImportExpression.
Sourcepub fn is_binaryish(&self) -> bool
pub fn is_binaryish(&self) -> bool
Returns true if this Expression is a BinaryExpression or LogicalExpression.
Sourcepub fn get_member_expr(&self) -> Option<&MemberExpression<'a>>
pub fn get_member_expr(&self) -> Option<&MemberExpression<'a>>
Returns the MemberExpression if this expression is a MemberExpression, contains a
MemberExpression, or is or part of a ChainExpression (such as a?.b),
and returns None otherwise if this is not a member expression.
Sourcepub fn is_require_call(&self) -> bool
pub fn is_require_call(&self) -> bool
Returns true if this Expression is a require call.
See CallExpression::is_require_call for details of the exact patterns that match.
Sourcepub fn is_assignment(&self) -> bool
pub fn is_assignment(&self) -> bool
Returns true if this is an assignment expression.
Sourcepub fn is_entity_name_expression(&self) -> bool
pub fn is_entity_name_expression(&self) -> bool
Is identifier or a.b expression where a is an identifier.
Sourcepub fn is_property_access_entity_name_expression(&self) -> bool
pub fn is_property_access_entity_name_expression(&self) -> bool
a.b expression where a is an identifier.
Sourcepub fn is_jsx(&self) -> bool
pub fn is_jsx(&self) -> bool
Returns true if this Expression is a JSXElement or JSXFragment.
Trait Implementations§
Source§impl<'new_alloc> CloneIn<'new_alloc> for Expression<'_>
impl<'new_alloc> CloneIn<'new_alloc> for Expression<'_>
Source§type Cloned = Expression<'new_alloc>
type Cloned = Expression<'new_alloc>
Source§fn clone_in(
&self,
allocator: &'new_alloc Allocator,
) -> <Expression<'_> as CloneIn<'new_alloc>>::Cloned
fn clone_in( &self, allocator: &'new_alloc Allocator, ) -> <Expression<'_> as CloneIn<'new_alloc>>::Cloned
self into the given allocator. allocator may be the same one
that self is already in.Source§fn clone_in_with_semantic_ids(
&self,
allocator: &'new_alloc Allocator,
) -> <Expression<'_> as CloneIn<'new_alloc>>::Cloned
fn clone_in_with_semantic_ids( &self, allocator: &'new_alloc Allocator, ) -> <Expression<'_> as CloneIn<'new_alloc>>::Cloned
clone_in, but for some special type, it will also clone the semantic ids.
Please use this method only if you make sure semantic info is synced with the ast node.Source§impl<'a> ConstantEvaluation<'a> for Expression<'a>
impl<'a> ConstantEvaluation<'a> for Expression<'a>
Source§fn evaluate_value_to(
&self,
ctx: &impl ConstantEvaluationCtx<'a>,
target_ty: Option<ValueType>,
) -> Option<ConstantValue<'a>>
fn evaluate_value_to( &self, ctx: &impl ConstantEvaluationCtx<'a>, target_ty: Option<ValueType>, ) -> Option<ConstantValue<'a>>
Source§fn evaluate_value(
&self,
ctx: &impl ConstantEvaluationCtx<'a>,
) -> Option<ConstantValue<'a>>
fn evaluate_value( &self, ctx: &impl ConstantEvaluationCtx<'a>, ) -> Option<ConstantValue<'a>>
Source§fn evaluate_value_to_number(
&self,
ctx: &impl ConstantEvaluationCtx<'a>,
) -> Option<f64>
fn evaluate_value_to_number( &self, ctx: &impl ConstantEvaluationCtx<'a>, ) -> Option<f64>
Source§fn evaluate_value_to_bigint(
&self,
ctx: &impl ConstantEvaluationCtx<'a>,
) -> Option<BigInt>
fn evaluate_value_to_bigint( &self, ctx: &impl ConstantEvaluationCtx<'a>, ) -> Option<BigInt>
Source§fn evaluate_value_to_boolean(
&self,
ctx: &impl ConstantEvaluationCtx<'a>,
) -> Option<bool>
fn evaluate_value_to_boolean( &self, ctx: &impl ConstantEvaluationCtx<'a>, ) -> Option<bool>
Source§fn evaluate_value_to_string(
&self,
ctx: &impl ConstantEvaluationCtx<'a>,
) -> Option<Cow<'a, str>>
fn evaluate_value_to_string( &self, ctx: &impl ConstantEvaluationCtx<'a>, ) -> Option<Cow<'a, str>>
fn get_side_free_number_value( &self, ctx: &impl ConstantEvaluationCtx<'a>, ) -> Option<f64>
fn get_side_free_bigint_value( &self, ctx: &impl ConstantEvaluationCtx<'a>, ) -> Option<BigInt>
fn get_side_free_boolean_value( &self, ctx: &impl ConstantEvaluationCtx<'a>, ) -> Option<bool>
fn get_side_free_string_value( &self, ctx: &impl ConstantEvaluationCtx<'a>, ) -> Option<Cow<'a, str>>
Source§impl ContentEq for Expression<'_>
impl ContentEq for Expression<'_>
Source§fn content_eq(&self, other: &Expression<'_>) -> bool
fn content_eq(&self, other: &Expression<'_>) -> bool
self and other to be equal.Source§fn content_ne(&self, other: &Self) -> bool
fn content_ne(&self, other: &Self) -> bool
self and other not to be equal.
The default implementation is almost always
sufficient, and should not be overridden without very good reason.Source§impl<'a> Debug for Expression<'a>
impl<'a> Debug for Expression<'a>
Source§impl<'a> DetermineValueType<'a> for Expression<'a>
impl<'a> DetermineValueType<'a> for Expression<'a>
fn value_type(&self, ctx: &impl GlobalContext<'a>) -> ValueType
Source§impl<'a> Dummy<'a> for Expression<'a>
impl<'a> Dummy<'a> for Expression<'a>
Source§fn dummy(allocator: &'a Allocator) -> Expression<'a>
fn dummy(allocator: &'a Allocator) -> Expression<'a>
Create a dummy Expression.
Has cost of making 1 allocation (8 bytes).
Source§impl<'a> From<ChainElement<'a>> for Expression<'a>
impl<'a> From<ChainElement<'a>> for Expression<'a>
Source§fn from(value: ChainElement<'a>) -> Expression<'a>
fn from(value: ChainElement<'a>) -> Expression<'a>
Source§impl<'a> From<Expression<'a>> for Argument<'a>
impl<'a> From<Expression<'a>> for Argument<'a>
Source§fn from(value: Expression<'a>) -> Argument<'a>
fn from(value: Expression<'a>) -> Argument<'a>
Convert Expression to Argument.
Source§impl<'a> From<Expression<'a>> for ArrayExpressionElement<'a>
impl<'a> From<Expression<'a>> for ArrayExpressionElement<'a>
Source§fn from(value: Expression<'a>) -> ArrayExpressionElement<'a>
fn from(value: Expression<'a>) -> ArrayExpressionElement<'a>
Convert Expression to ArrayExpressionElement.
Source§impl<'a> From<Expression<'a>> for ExportDefaultDeclarationKind<'a>
impl<'a> From<Expression<'a>> for ExportDefaultDeclarationKind<'a>
Source§fn from(value: Expression<'a>) -> ExportDefaultDeclarationKind<'a>
fn from(value: Expression<'a>) -> ExportDefaultDeclarationKind<'a>
Convert Expression to ExportDefaultDeclarationKind.
Source§impl<'a> From<Expression<'a>> for ForStatementInit<'a>
impl<'a> From<Expression<'a>> for ForStatementInit<'a>
Source§fn from(value: Expression<'a>) -> ForStatementInit<'a>
fn from(value: Expression<'a>) -> ForStatementInit<'a>
Convert Expression to ForStatementInit.
Source§impl<'a> From<Expression<'a>> for JSXExpression<'a>
impl<'a> From<Expression<'a>> for JSXExpression<'a>
Source§fn from(value: Expression<'a>) -> JSXExpression<'a>
fn from(value: Expression<'a>) -> JSXExpression<'a>
Convert Expression to JSXExpression.
Source§impl<'a> From<Expression<'a>> for PropertyKey<'a>
impl<'a> From<Expression<'a>> for PropertyKey<'a>
Source§fn from(value: Expression<'a>) -> PropertyKey<'a>
fn from(value: Expression<'a>) -> PropertyKey<'a>
Convert Expression to PropertyKey.
Source§impl<'a> From<MemberExpression<'a>> for Expression<'a>
impl<'a> From<MemberExpression<'a>> for Expression<'a>
Source§fn from(value: MemberExpression<'a>) -> Expression<'a>
fn from(value: MemberExpression<'a>) -> Expression<'a>
Convert MemberExpression to Expression.
Source§impl<'a> GatherNodeParts<'a> for Expression<'a>
impl<'a> GatherNodeParts<'a> for Expression<'a>
Source§impl GenExpr for Expression<'_>
impl GenExpr for Expression<'_>
Source§fn gen_expr(&self, p: &mut Codegen<'_>, precedence: Precedence, ctx: Context)
fn gen_expr(&self, p: &mut Codegen<'_>, precedence: Precedence, ctx: Context)
Source§fn print_expr(&self, p: &mut Codegen<'_>, precedence: Precedence, ctx: Context)
fn print_expr(&self, p: &mut Codegen<'_>, precedence: Precedence, ctx: Context)
gen_expr.Source§impl GetAddress for Expression<'_>
impl GetAddress for Expression<'_>
Source§impl GetPrecedence for Expression<'_>
impl GetPrecedence for Expression<'_>
fn precedence(&self) -> Precedence
Source§impl GetSpanMut for Expression<'_>
impl GetSpanMut for Expression<'_>
Source§impl IsGlobalReference for Expression<'_>
impl IsGlobalReference for Expression<'_>
Source§impl<'a> IsInt32OrUint32<'a> for Expression<'a>
impl<'a> IsInt32OrUint32<'a> for Expression<'a>
Source§fn is_int32_or_uint32(&self, ctx: &impl GlobalContext<'a>) -> bool
fn is_int32_or_uint32(&self, ctx: &impl GlobalContext<'a>) -> bool
true, we know that the value cannot be NaN or Infinity. Read moreSource§impl<'a> IsLiteralValue<'a, '_> for Expression<'a>
impl<'a> IsLiteralValue<'a, '_> for Expression<'a>
fn is_literal_value( &self, include_functions: bool, ctx: &impl GlobalContext<'a>, ) -> bool
Source§impl<'a> MayHaveSideEffects<'a> for Expression<'a>
impl<'a> MayHaveSideEffects<'a> for Expression<'a>
fn may_have_side_effects( &self, ctx: &impl MayHaveSideEffectsContext<'a>, ) -> bool
Source§impl<'a> TakeIn<'a> for Expression<'a>
impl<'a> TakeIn<'a> for Expression<'a>
Source§fn take_in<A>(&mut self, allocator_accessor: A) -> Selfwhere
A: AllocatorAccessor<'a>,
fn take_in<A>(&mut self, allocator_accessor: A) -> Selfwhere
A: AllocatorAccessor<'a>,
Source§fn take_in_box<A>(&mut self, allocator_accessor: A) -> Box<'a, Self>where
A: AllocatorAccessor<'a>,
fn take_in_box<A>(&mut self, allocator_accessor: A) -> Box<'a, Self>where
A: AllocatorAccessor<'a>,
Source§impl<'a> ToBigInt<'a> for Expression<'a>
impl<'a> ToBigInt<'a> for Expression<'a>
fn to_big_int(&self, ctx: &impl GlobalContext<'a>) -> Option<BigInt>
Source§impl<'a> ToBoolean<'a> for Expression<'a>
impl<'a> ToBoolean<'a> for Expression<'a>
fn to_boolean(&self, ctx: &impl GlobalContext<'a>) -> Option<bool>
Source§impl<'a> ToJsString<'a> for Expression<'a>
impl<'a> ToJsString<'a> for Expression<'a>
fn to_js_string(&self, ctx: &impl GlobalContext<'a>) -> Option<Cow<'a, str>>
Source§impl<'a> ToNumber<'a> for Expression<'a>
impl<'a> ToNumber<'a> for Expression<'a>
Source§impl<'a> ToPrimitive<'a> for Expression<'a>
impl<'a> ToPrimitive<'a> for Expression<'a>
fn to_primitive(&self, ctx: &impl GlobalContext<'a>) -> ToPrimitiveResult
Source§impl<'a> TryFrom<Argument<'a>> for Expression<'a>
impl<'a> TryFrom<Argument<'a>> for Expression<'a>
Source§impl<'a> TryFrom<ArrayExpressionElement<'a>> for Expression<'a>
impl<'a> TryFrom<ArrayExpressionElement<'a>> for Expression<'a>
Source§fn try_from(
value: ArrayExpressionElement<'a>,
) -> Result<Expression<'a>, <Expression<'a> as TryFrom<ArrayExpressionElement<'a>>>::Error>
fn try_from( value: ArrayExpressionElement<'a>, ) -> Result<Expression<'a>, <Expression<'a> as TryFrom<ArrayExpressionElement<'a>>>::Error>
Convert ArrayExpressionElement to Expression.
Source§impl<'a> TryFrom<ExportDefaultDeclarationKind<'a>> for Expression<'a>
impl<'a> TryFrom<ExportDefaultDeclarationKind<'a>> for Expression<'a>
Source§fn try_from(
value: ExportDefaultDeclarationKind<'a>,
) -> Result<Expression<'a>, <Expression<'a> as TryFrom<ExportDefaultDeclarationKind<'a>>>::Error>
fn try_from( value: ExportDefaultDeclarationKind<'a>, ) -> Result<Expression<'a>, <Expression<'a> as TryFrom<ExportDefaultDeclarationKind<'a>>>::Error>
Convert ExportDefaultDeclarationKind to Expression.
Source§impl<'a> TryFrom<Expression<'a>> for MemberExpression<'a>
impl<'a> TryFrom<Expression<'a>> for MemberExpression<'a>
Source§fn try_from(
value: Expression<'a>,
) -> Result<MemberExpression<'a>, <MemberExpression<'a> as TryFrom<Expression<'a>>>::Error>
fn try_from( value: Expression<'a>, ) -> Result<MemberExpression<'a>, <MemberExpression<'a> as TryFrom<Expression<'a>>>::Error>
Convert Expression to MemberExpression.
Source§impl<'a> TryFrom<ForStatementInit<'a>> for Expression<'a>
impl<'a> TryFrom<ForStatementInit<'a>> for Expression<'a>
Source§fn try_from(
value: ForStatementInit<'a>,
) -> Result<Expression<'a>, <Expression<'a> as TryFrom<ForStatementInit<'a>>>::Error>
fn try_from( value: ForStatementInit<'a>, ) -> Result<Expression<'a>, <Expression<'a> as TryFrom<ForStatementInit<'a>>>::Error>
Convert ForStatementInit to Expression.
Source§impl<'a> TryFrom<JSXExpression<'a>> for Expression<'a>
impl<'a> TryFrom<JSXExpression<'a>> for Expression<'a>
Source§fn try_from(
value: JSXExpression<'a>,
) -> Result<Expression<'a>, <Expression<'a> as TryFrom<JSXExpression<'a>>>::Error>
fn try_from( value: JSXExpression<'a>, ) -> Result<Expression<'a>, <Expression<'a> as TryFrom<JSXExpression<'a>>>::Error>
Convert JSXExpression to Expression.
Source§impl<'a> TryFrom<PropertyKey<'a>> for Expression<'a>
impl<'a> TryFrom<PropertyKey<'a>> for Expression<'a>
Source§fn try_from(
value: PropertyKey<'a>,
) -> Result<Expression<'a>, <Expression<'a> as TryFrom<PropertyKey<'a>>>::Error>
fn try_from( value: PropertyKey<'a>, ) -> Result<Expression<'a>, <Expression<'a> as TryFrom<PropertyKey<'a>>>::Error>
Convert PropertyKey to Expression.
Auto Trait Implementations§
impl<'a> Freeze for Expression<'a>
impl<'a> !RefUnwindSafe for Expression<'a>
impl<'a> !Send for Expression<'a>
impl<'a> !Sync for Expression<'a>
impl<'a> Unpin for Expression<'a>
impl<'a> !UnwindSafe for Expression<'a>
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> 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<D> OwoColorize for D
impl<D> OwoColorize for D
Source§fn fg<C>(&self) -> FgColorDisplay<'_, C, Self>where
C: Color,
fn fg<C>(&self) -> FgColorDisplay<'_, C, Self>where
C: Color,
Source§fn bg<C>(&self) -> BgColorDisplay<'_, C, Self>where
C: Color,
fn bg<C>(&self) -> BgColorDisplay<'_, C, Self>where
C: Color,
Source§fn black(&self) -> FgColorDisplay<'_, Black, Self>
fn black(&self) -> FgColorDisplay<'_, Black, Self>
Source§fn on_black(&self) -> BgColorDisplay<'_, Black, Self>
fn on_black(&self) -> BgColorDisplay<'_, Black, Self>
Source§fn red(&self) -> FgColorDisplay<'_, Red, Self>
fn red(&self) -> FgColorDisplay<'_, Red, Self>
Source§fn on_red(&self) -> BgColorDisplay<'_, Red, Self>
fn on_red(&self) -> BgColorDisplay<'_, Red, Self>
Source§fn green(&self) -> FgColorDisplay<'_, Green, Self>
fn green(&self) -> FgColorDisplay<'_, Green, Self>
Source§fn on_green(&self) -> BgColorDisplay<'_, Green, Self>
fn on_green(&self) -> BgColorDisplay<'_, Green, Self>
Source§fn yellow(&self) -> FgColorDisplay<'_, Yellow, Self>
fn yellow(&self) -> FgColorDisplay<'_, Yellow, Self>
Source§fn on_yellow(&self) -> BgColorDisplay<'_, Yellow, Self>
fn on_yellow(&self) -> BgColorDisplay<'_, Yellow, Self>
Source§fn blue(&self) -> FgColorDisplay<'_, Blue, Self>
fn blue(&self) -> FgColorDisplay<'_, Blue, Self>
Source§fn on_blue(&self) -> BgColorDisplay<'_, Blue, Self>
fn on_blue(&self) -> BgColorDisplay<'_, Blue, Self>
Source§fn magenta(&self) -> FgColorDisplay<'_, Magenta, Self>
fn magenta(&self) -> FgColorDisplay<'_, Magenta, Self>
Source§fn on_magenta(&self) -> BgColorDisplay<'_, Magenta, Self>
fn on_magenta(&self) -> BgColorDisplay<'_, Magenta, Self>
Source§fn purple(&self) -> FgColorDisplay<'_, Magenta, Self>
fn purple(&self) -> FgColorDisplay<'_, Magenta, Self>
Source§fn on_purple(&self) -> BgColorDisplay<'_, Magenta, Self>
fn on_purple(&self) -> BgColorDisplay<'_, Magenta, Self>
Source§fn cyan(&self) -> FgColorDisplay<'_, Cyan, Self>
fn cyan(&self) -> FgColorDisplay<'_, Cyan, Self>
Source§fn on_cyan(&self) -> BgColorDisplay<'_, Cyan, Self>
fn on_cyan(&self) -> BgColorDisplay<'_, Cyan, Self>
Source§fn white(&self) -> FgColorDisplay<'_, White, Self>
fn white(&self) -> FgColorDisplay<'_, White, Self>
Source§fn on_white(&self) -> BgColorDisplay<'_, White, Self>
fn on_white(&self) -> BgColorDisplay<'_, White, Self>
Source§fn default_color(&self) -> FgColorDisplay<'_, Default, Self>
fn default_color(&self) -> FgColorDisplay<'_, Default, Self>
Source§fn on_default_color(&self) -> BgColorDisplay<'_, Default, Self>
fn on_default_color(&self) -> BgColorDisplay<'_, Default, Self>
Source§fn bright_black(&self) -> FgColorDisplay<'_, BrightBlack, Self>
fn bright_black(&self) -> FgColorDisplay<'_, BrightBlack, Self>
Source§fn on_bright_black(&self) -> BgColorDisplay<'_, BrightBlack, Self>
fn on_bright_black(&self) -> BgColorDisplay<'_, BrightBlack, Self>
Source§fn bright_red(&self) -> FgColorDisplay<'_, BrightRed, Self>
fn bright_red(&self) -> FgColorDisplay<'_, BrightRed, Self>
Source§fn on_bright_red(&self) -> BgColorDisplay<'_, BrightRed, Self>
fn on_bright_red(&self) -> BgColorDisplay<'_, BrightRed, Self>
Source§fn bright_green(&self) -> FgColorDisplay<'_, BrightGreen, Self>
fn bright_green(&self) -> FgColorDisplay<'_, BrightGreen, Self>
Source§fn on_bright_green(&self) -> BgColorDisplay<'_, BrightGreen, Self>
fn on_bright_green(&self) -> BgColorDisplay<'_, BrightGreen, Self>
Source§fn bright_yellow(&self) -> FgColorDisplay<'_, BrightYellow, Self>
fn bright_yellow(&self) -> FgColorDisplay<'_, BrightYellow, Self>
Source§fn on_bright_yellow(&self) -> BgColorDisplay<'_, BrightYellow, Self>
fn on_bright_yellow(&self) -> BgColorDisplay<'_, BrightYellow, Self>
Source§fn bright_blue(&self) -> FgColorDisplay<'_, BrightBlue, Self>
fn bright_blue(&self) -> FgColorDisplay<'_, BrightBlue, Self>
Source§fn on_bright_blue(&self) -> BgColorDisplay<'_, BrightBlue, Self>
fn on_bright_blue(&self) -> BgColorDisplay<'_, BrightBlue, Self>
Source§fn bright_magenta(&self) -> FgColorDisplay<'_, BrightMagenta, Self>
fn bright_magenta(&self) -> FgColorDisplay<'_, BrightMagenta, Self>
Source§fn on_bright_magenta(&self) -> BgColorDisplay<'_, BrightMagenta, Self>
fn on_bright_magenta(&self) -> BgColorDisplay<'_, BrightMagenta, Self>
Source§fn bright_purple(&self) -> FgColorDisplay<'_, BrightMagenta, Self>
fn bright_purple(&self) -> FgColorDisplay<'_, BrightMagenta, Self>
Source§fn on_bright_purple(&self) -> BgColorDisplay<'_, BrightMagenta, Self>
fn on_bright_purple(&self) -> BgColorDisplay<'_, BrightMagenta, Self>
Source§fn bright_cyan(&self) -> FgColorDisplay<'_, BrightCyan, Self>
fn bright_cyan(&self) -> FgColorDisplay<'_, BrightCyan, Self>
Source§fn on_bright_cyan(&self) -> BgColorDisplay<'_, BrightCyan, Self>
fn on_bright_cyan(&self) -> BgColorDisplay<'_, BrightCyan, Self>
Source§fn bright_white(&self) -> FgColorDisplay<'_, BrightWhite, Self>
fn bright_white(&self) -> FgColorDisplay<'_, BrightWhite, Self>
Source§fn on_bright_white(&self) -> BgColorDisplay<'_, BrightWhite, Self>
fn on_bright_white(&self) -> BgColorDisplay<'_, BrightWhite, Self>
Source§fn bold(&self) -> BoldDisplay<'_, Self>
fn bold(&self) -> BoldDisplay<'_, Self>
Source§fn dimmed(&self) -> DimDisplay<'_, Self>
fn dimmed(&self) -> DimDisplay<'_, Self>
Source§fn italic(&self) -> ItalicDisplay<'_, Self>
fn italic(&self) -> ItalicDisplay<'_, Self>
Source§fn underline(&self) -> UnderlineDisplay<'_, Self>
fn underline(&self) -> UnderlineDisplay<'_, Self>
Source§fn blink(&self) -> BlinkDisplay<'_, Self>
fn blink(&self) -> BlinkDisplay<'_, Self>
Source§fn blink_fast(&self) -> BlinkFastDisplay<'_, Self>
fn blink_fast(&self) -> BlinkFastDisplay<'_, Self>
Source§fn reversed(&self) -> ReversedDisplay<'_, Self>
fn reversed(&self) -> ReversedDisplay<'_, Self>
Source§fn strikethrough(&self) -> StrikeThroughDisplay<'_, Self>
fn strikethrough(&self) -> StrikeThroughDisplay<'_, Self>
Source§fn color<Color>(&self, color: Color) -> FgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
fn color<Color>(&self, color: Color) -> FgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
OwoColorize::fg or
a color-specific method, such as OwoColorize::green, Read moreSource§fn on_color<Color>(&self, color: Color) -> BgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
fn on_color<Color>(&self, color: Color) -> BgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
OwoColorize::bg or
a color-specific method, such as OwoColorize::on_yellow, Read more