pub enum Function {
Native {
function: BuiltInFunction,
constructable: bool,
},
Closure {
function: Box<dyn ClosureFunction>,
constructable: bool,
captures: Captures,
},
Ordinary {
flags: FunctionFlags,
body: RcStatementList,
params: Box<[FormalParameter]>,
environment: Environment,
},
}
Expand description
Boa representation of a Function Object.
FunctionBody is specific to this interpreter, it will either be Rust code or JavaScript code (AST Node)
Variants
Native
Closure
Ordinary
Fields
flags: FunctionFlags
body: RcStatementList
params: Box<[FormalParameter]>
environment: Environment
Implementations
sourceimpl Function
impl Function
sourcepub fn is_constructable(&self) -> bool
pub fn is_constructable(&self) -> bool
Returns true if the function object is constructable.
Trait Implementations
Auto Trait Implementations
impl !RefUnwindSafe for Function
impl !Send for Function
impl !Sync for Function
impl Unpin for Function
impl !UnwindSafe for Function
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more