Struct boa::object::ConstructorBuilder [−][src]
pub struct ConstructorBuilder<'context> { /* fields omitted */ }Expand description
Builder for creating constructors objects, like Array.
Implementations
Create a new ConstructorBuilder.
pub fn method<B>(
&mut self,
function: NativeFunction,
binding: B,
length: usize
) -> &mut Self where
B: Into<FunctionBinding>,
pub fn method<B>(
&mut self,
function: NativeFunction,
binding: B,
length: usize
) -> &mut Self where
B: Into<FunctionBinding>,
Add new method to the constructors prototype.
pub fn static_method<B>(
&mut self,
function: NativeFunction,
binding: B,
length: usize
) -> &mut Self where
B: Into<FunctionBinding>,
pub fn static_method<B>(
&mut self,
function: NativeFunction,
binding: B,
length: usize
) -> &mut Self where
B: Into<FunctionBinding>,
Add new static method to the constructors object itself.
Add new data property to the constructor’s prototype.
pub fn static_property<K, V>(
&mut self,
key: K,
value: V,
attribute: Attribute
) -> &mut Self where
K: Into<PropertyKey>,
V: Into<JsValue>,
pub fn static_property<K, V>(
&mut self,
key: K,
value: V,
attribute: Attribute
) -> &mut Self where
K: Into<PropertyKey>,
V: Into<JsValue>,
Add new static data property to the constructor object itself.
Add new accessor property to the constructor’s prototype.
pub fn static_accessor<K>(
&mut self,
key: K,
get: Option<JsObject>,
set: Option<JsObject>,
attribute: Attribute
) -> &mut Self where
K: Into<PropertyKey>,
pub fn static_accessor<K>(
&mut self,
key: K,
get: Option<JsObject>,
set: Option<JsObject>,
attribute: Attribute
) -> &mut Self where
K: Into<PropertyKey>,
Add new static accessor property to the constructor object itself.
pub fn property_descriptor<K, P>(&mut self, key: K, property: P) -> &mut Self where
K: Into<PropertyKey>,
P: Into<PropertyDescriptor>,
pub fn property_descriptor<K, P>(&mut self, key: K, property: P) -> &mut Self where
K: Into<PropertyKey>,
P: Into<PropertyDescriptor>,
Add new property to the constructor’s prototype.
pub fn static_property_descriptor<K, P>(
&mut self,
key: K,
property: P
) -> &mut Self where
K: Into<PropertyKey>,
P: Into<PropertyDescriptor>,
pub fn static_property_descriptor<K, P>(
&mut self,
key: K,
property: P
) -> &mut Self where
K: Into<PropertyKey>,
P: Into<PropertyDescriptor>,
Add new static property to the constructor object itself.
Specify how many arguments the constructor function takes.
Default is 0.
Specify the name of the constructor function.
Default is "[object]"
Specify whether the constructor function can be called.
Default is true
Specify whether the constructor function can be called with new keyword.
Default is true
Specify the prototype this constructor object inherits from.
Default is Object.prototype