swc_core::ecma::utils

Trait StmtExt

pub trait StmtExt {
    // Required methods
    fn as_stmt(&self) -> &Stmt;
    fn extract_var_ids(&self) -> Vec<Ident>;
    fn terminates(&self) -> bool;

    // Provided methods
    fn extract_var_ids_as_var(&self) -> Option<VarDecl> { ... }
    fn may_have_side_effects(&self, ctx: &ExprCtx) -> bool { ... }
}
Available on crate features __ecma and __utils only.

Required Methods§

fn as_stmt(&self) -> &Stmt

fn extract_var_ids(&self) -> Vec<Ident>

Extracts hoisted variables

fn terminates(&self) -> bool

stmts contain top level return/break/continue/throw

Provided Methods§

Implementations on Foreign Types§

§

impl StmtExt for Box<Stmt>

§

fn as_stmt(&self) -> &Stmt

§

fn extract_var_ids(&self) -> Vec<Ident>

§

fn terminates(&self) -> bool

Implementors§

§

impl StmtExt for Stmt