Crate swc_ecma_utils[][src]

Re-exports

pub use self::ident::id;
pub use self::ident::Id;
pub use self::value::Type::Bool as BoolType;
pub use self::value::Type::Null as NullType;
pub use self::value::Type::Num as NumberType;
pub use self::value::Type::Obj as ObjectType;
pub use self::value::Type::Str as StringType;
pub use self::value::Type::Symbol as SymbolType;
pub use self::value::Type::Undefined as UndefinedType;
pub use self::value::Value::Known;
pub use self::value::Value::Unknown;
pub use self::Purity::MayBeImpure;
pub use self::Purity::Pure;

Modules

constructor
ident
var

Macros

member_expr

Creates a member expression.

private_ident

Shortcut for quote_ident!(span.apply_mark(Mark::fresh(Mark::root())), s)

quote_expr
quote_ident
quote_str

Structs

ArgumentsFinder
DestructuringFinder

Finds all binding idents of variables.

DropSpan
Hoister
IdentFinder
IdentReplacer
LiteralVisitor
RestPatVisitor
ThisVisitor
UsageFinder

Finds usage of ident

Enums

Purity
Type

Type of value.

Value

Runtime value.

Statics

HANDLER

Used for error reporting in transform.

Traits

ExprExt

Extension methods for Expr.

ExprFactory

Extension methods for Expr.

IdentExt
IsDirective
IsEmpty
ModuleItemLike
StmtExt
StmtLike

Functions

alias_ident_for

Used to determine super_class_ident

alias_if_required

Returns (ident, aliased)

calc_literal_cost
contains_arguments
contains_ident_ref
contains_this_expr
default_constructor
drop_span
extract_side_effects_to

Add side effects of expr to to. Thie function preserves order and conditions. (think a() ? yield b() : c())

extract_var_ids

Extracts hoisted variables

find_ids

Finds all binding idents of node.

has_rest_pat
is_literal
is_rest_arguments

Check if e is ...arguments

is_valid_ident
prepend

inject branch after directives

prepend_stmts

inject stmts after directives

preserve_effects

make a new expression which evaluates val preserving side effects, if any.

prop_name_eq
prop_name_to_expr
prop_name_to_expr_value

Similar to prop_name_to_expr, but used for value position.

replace_ident

Replace all from in expr with to.

to_int32

Cast to javascript’s int32

undefined

Type Definitions

BoolValue