Trait swc_ecma_utils::ExprExt[][src]

pub trait ExprExt {
    fn as_expr(&self) -> &Expr;

    fn is_immutable_value(&self) -> bool { ... }
fn is_number(&self) -> bool { ... }
fn is_str(&self) -> bool { ... }
fn is_array_lit(&self) -> bool { ... }
fn is_nan(&self) -> bool { ... }
fn is_undefined(&self) -> bool { ... }
fn is_void(&self) -> bool { ... }
fn is_ident_ref_to(&self, id: JsWord) -> bool { ... }
fn as_pure_bool(&self) -> BoolValue { ... }
fn as_bool(&self) -> (Purity, BoolValue) { ... }
fn as_number(&self) -> Value<f64> { ... }
fn as_string(&self) -> Value<Cow<'_, str>> { ... }
fn get_type(&self) -> Value<Type> { ... }
fn is_pure_callee(&self) -> bool { ... }
fn may_have_side_effects(&self) -> bool { ... } }

Extension methods for Expr.

Required methods

fn as_expr(&self) -> &Expr[src]

Loading content...

Provided methods

fn is_immutable_value(&self) -> bool[src]

Returns true if this is an immutable value.

fn is_number(&self) -> bool[src]

fn is_str(&self) -> bool[src]

fn is_array_lit(&self) -> bool[src]

fn is_nan(&self) -> bool[src]

Checks if self is NaN.

fn is_undefined(&self) -> bool[src]

fn is_void(&self) -> bool[src]

fn is_ident_ref_to(&self, id: JsWord) -> bool[src]

Is self an IdentifierReference to id?

fn as_pure_bool(&self) -> BoolValue[src]

Get bool value of self if it does not have any side effects.

fn as_bool(&self) -> (Purity, BoolValue)[src]

This method emulates the Boolean() JavaScript cast function. Note: unlike getPureBooleanValue this function does not return None for expressions with side-effects.

fn as_number(&self) -> Value<f64>[src]

Emulates javascript Number() cast function.

fn as_string(&self) -> Value<Cow<'_, str>>[src]

Returns Known only if it’s pure.

fn get_type(&self) -> Value<Type>[src]

Apply the supplied predicate against all possible result Nodes of the expression.

fn is_pure_callee(&self) -> bool[src]

fn may_have_side_effects(&self) -> bool[src]

Loading content...

Implementations on Foreign Types

impl ExprExt for Box<Expr>[src]

impl ExprExt for Expr[src]

Loading content...

Implementors

Loading content...