Struct swc_ecma_utils::function::FunctionWrapper [−][src]
pub struct FunctionWrapper<T> {
pub binding_ident: Option<Ident>,
pub function: Expr,
// some fields omitted
}
Fields
binding_ident: Option<Ident>
function: Expr
Trait Implementations
Performs the conversion.
Performs the conversion.
If a function has a function name, it may be called recursively. We use the named expression to hoist the function name internally Therefore, its recursive calls refer to the correct identity.
Else if a function has a binding name, it may be called recursively as well. But it refer the binding name which exist the outer scope. It is safe to using anonymous expression wrapper.
Optimization: A function without a name cannot be recursively referenced by Ident. It’s safe to return the expr without wrapper if the params.len is 0.
Auto Trait Implementations
impl<T> RefUnwindSafe for FunctionWrapper<T> where
T: RefUnwindSafe,
impl<T> Send for FunctionWrapper<T> where
T: Send,
impl<T> Sync for FunctionWrapper<T> where
T: Sync,
impl<T> Unpin for FunctionWrapper<T> where
T: Unpin,
impl<T> UnwindSafe for FunctionWrapper<T> where
T: UnwindSafe,
Blanket Implementations
Mutably borrows from an owned value. Read more
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more