[−][src]Struct boa::builtins::function::Function
Boa representation of a Function Object.
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]
parameter_list: P,
scope: Option<Environment>,
body: FunctionBody,
this_mode: ThisMode,
constructable: bool,
callable: bool
) -> Self where
P: Into<Box<[FormalParameter]>>,
pub fn ordinary<P>(
parameter_list: P,
scope: Environment,
body: StatementList,
this_mode: ThisMode
) -> Self where
P: Into<Box<[FormalParameter]>>,
[src]
parameter_list: P,
scope: Environment,
body: StatementList,
this_mode: ThisMode
) -> Self where
P: Into<Box<[FormalParameter]>>,
This will create an ordinary function object
pub fn builtin<P>(parameter_list: P, body: NativeFunctionData) -> Self where
P: Into<Box<[FormalParameter]>>,
[src]
P: Into<Box<[FormalParameter]>>,
This will create a built-in function object
pub fn call(
&self,
function: Value,
this: &Value,
args_list: &[Value],
interpreter: &mut Interpreter
) -> ResultValue
[src]
&self,
function: Value,
this: &Value,
args_list: &[Value],
interpreter: &mut Interpreter
) -> ResultValue
This will handle calls for both ordinary and built-in functions
https://tc39.es/ecma262/#sec-prepareforordinarycall https://tc39.es/ecma262/#sec-ecmascript-function-objects-call-thisargument-argumentslist
pub fn construct(
&self,
function: Value,
this: &Value,
args_list: &[Value],
interpreter: &mut Interpreter
) -> ResultValue
[src]
&self,
function: Value,
this: &Value,
args_list: &[Value],
interpreter: &mut Interpreter
) -> ResultValue
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]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,