Trait swc_ecma_utils::ExprFactory [−][src]
pub trait ExprFactory: Into<Expr> {
fn as_arg(self) -> ExprOrSpread { ... }
fn into_stmt(self) -> Stmt { ... }
fn as_callee(self) -> ExprOrSuper { ... }
fn as_iife(self) -> CallExpr { ... }
fn as_obj(self) -> ExprOrSuper { ... }
fn apply(self, span: Span, this: Box<Expr>, args: Vec<ExprOrSpread>) -> Expr { ... }
fn wrap_with_paren(self) -> Expr { ... }
fn make_eq<T>(self, right: T) -> Expr
where
T: Into<Expr>,
{ ... }
fn make_bin<T>(self, op: BinaryOp, right: T) -> Expr
where
T: Into<Expr>,
{ ... }
fn make_member<T>(self, prop: T) -> Expr
where
T: Into<Expr>,
{ ... }
fn computed_member<T>(self, prop: T) -> Expr
where
T: Into<Expr>,
{ ... }
}
Expand description
Extension methods for Expr.
Provided methods
fn as_arg(self) -> ExprOrSpread
fn as_arg(self) -> ExprOrSpread
use swc_common::DUMMY_SP;
use swc_ecma_ast::*;
use swc_ecma_utils::ExprFactory;
let first = Lit::Num(Number {
span: DUMMY_SP,
value: 0.0
});
let _args = vec![first.as_arg()];
fn as_callee(self) -> ExprOrSuper
fn as_obj(self) -> ExprOrSuper
fn wrap_with_paren(self) -> Expr
Creates a binary expr $self $op $rhs