Crate swc_ecma_utils

Source

Re-exports§

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
function
ident
number
parallel
Module for parallel processing
stack_size
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
As we have multiple identifier types, the expected usage is quote_ident!("foo").into().
quote_str

Structs§

ArgumentsFinder
BindingCollector
BindingIdentifierVisitor
Finds all binding idents of variables.
DestructuringFinder
Finds all binding idents of variables.
DropSpan
ExprCtx
Hoister
IdentRefFinder
IdentRenamer
Replacer for [Id] => ]Id]
IdentReplacer
IdentUsageFinder
Finds usage of ident
LiteralVisitor
NodeIgnoringSpan
A newtype that will ignore Span while doing eq or hash.
RefRewriter
Replace foo with bar or bar.baz
Remapper
Variable remapper
RestPatVisitor
ThisVisitor
TopLevelAwait

Enums§

Purity
Type
Type of value.
Value
Runtime value.

Traits§

ExprExt
Extension methods for [Expr].
ExprFactory
Extension methods for [Expr].
FunctionFactory
IntoIndirectCall
IsDirective
IsEmpty
Merge
ModuleItemLike
QueryRef
StmtExt
StmtLike
StmtLikeInjector
Prepends statements after directive statements.
StmtOrModuleItem

Functions§

alias_ident_for
Used to determine super_class_ident
alias_ident_for_simple_assign_tatget
Used to determine super_class_ident
alias_if_required
Returns (ident, aliased)
calc_literal_cost
class_has_side_effect
collect_decls
Collects binding identifiers.
collect_decls_with_ctxt
Collects binding identifiers, but only if it has a context which is identical to ctxt.
contains_arguments
contains_ident_ref
contains_this_expr
This does not recurse into a function if this is changed by it.
contains_top_level_await
default_constructor_with_span
super_call_span should be the span of the class definition Use value of [Class::span].
drop_span
extract_var_ids
Extracts hoisted variables
find_pat_ids
Finds all binding idents of node.
for_each_binding_ident
Finds all binding idents of node. Any nested identifiers in expressions are ignored.
has_rest_pat
is_literal
is_maybe_branch_directive
If the stmt is maybe a directive like "use strict";
is_rest_arguments
Check if e is ...arguments
is_simple_pure_expr
is_simple_pure_member_expr
is_valid_ident
is_valid_prop_ident
num_from_str
opt_chain_test
prepend_stmt
inject branch after directives
prepend_stmts
inject stmts after directives
prop_name_eq
prop_name_to_expr
prop_name_to_expr_value
Similar to prop_name_to_expr, but used for value position.
prop_name_to_member_prop
replace_ident
Replace all from in expr with to.
to_int32
Cast to javascript’s int32

Type Aliases§

BoolValue