[][src]Struct boa::builtins::function::Function

pub struct Function {
    pub body: FunctionBody,
    pub params: Box<[FormalParameter]>,
    pub this_mode: ThisMode,
    pub environment: Option<Environment>,
    // some fields omitted
}

Boa representation of a Function Object.

https://tc39.es/ecma262/#sec-ecmascript-function-objects

Fields

body: FunctionBody

Call/Construct Function body

params: Box<[FormalParameter]>

Formal Paramaters

this_mode: ThisMode

This Mode

environment: Option<Environment>

Implementations

impl Function[src]

pub fn new<P>(
    parameter_list: P,
    scope: Option<Environment>,
    body: FunctionBody,
    this_mode: ThisMode,
    constructable: bool,
    callable: bool
) -> Self where
    P: Into<Box<[FormalParameter]>>, 
[src]

pub fn ordinary<P>(
    parameter_list: P,
    scope: Environment,
    body: StatementList,
    this_mode: ThisMode
) -> Self where
    P: Into<Box<[FormalParameter]>>, 
[src]

This will create an ordinary function object

https://tc39.es/ecma262/#sec-ordinaryfunctioncreate

pub fn builtin<P>(parameter_list: P, body: NativeFunctionData) -> Self where
    P: Into<Box<[FormalParameter]>>, 
[src]

This will create a built-in function object

https://tc39.es/ecma262/#sec-createbuiltinfunction

pub fn call(
    &self,
    function: Value,
    this: &Value,
    args_list: &[Value],
    interpreter: &mut Interpreter
) -> ResultValue
[src]

pub fn construct(
    &self,
    function: Value,
    this: &Value,
    args_list: &[Value],
    interpreter: &mut Interpreter
) -> ResultValue
[src]

pub fn is_callable(&self) -> bool[src]

Returns true if the function object is callable.

pub fn is_constructable(&self) -> bool[src]

Returns true if the function object is constructable.

Trait Implementations

impl Clone for Function[src]

impl Debug for Function[src]

impl Drop for Function[src]

impl Finalize for Function[src]

impl Trace for Function[src]

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

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,