pub struct Object;
Expand description
The global JavaScript object.
Implementations
sourceimpl Object
impl Object
sourcepub fn create(
_: &JsValue,
args: &[JsValue],
context: &mut Context
) -> JsResult<JsValue>
pub fn create(
_: &JsValue,
args: &[JsValue],
context: &mut Context
) -> JsResult<JsValue>
Object.create( proto, [propertiesObject] )
Creates a new object from the provided prototype.
More information:
sourcepub fn get_own_property_descriptor(
_: &JsValue,
args: &[JsValue],
context: &mut Context
) -> JsResult<JsValue>
pub fn get_own_property_descriptor(
_: &JsValue,
args: &[JsValue],
context: &mut Context
) -> JsResult<JsValue>
Object.getOwnPropertyDescriptor( object, property )
Returns an object describing the configuration of a specific property on a given object.
More information:
sourcepub fn get_own_property_descriptors(
_: &JsValue,
args: &[JsValue],
context: &mut Context
) -> JsResult<JsValue>
pub fn get_own_property_descriptors(
_: &JsValue,
args: &[JsValue],
context: &mut Context
) -> JsResult<JsValue>
Object.getOwnPropertyDescriptors( object )
Returns all own property descriptors of a given object.
More information:
sourcepub fn is(_: &JsValue, args: &[JsValue], _: &mut Context) -> JsResult<JsValue>
pub fn is(_: &JsValue, args: &[JsValue], _: &mut Context) -> JsResult<JsValue>
Uses the SameValue algorithm to check equality of objects
sourcepub fn get_prototype_of(
_: &JsValue,
args: &[JsValue],
ctx: &mut Context
) -> JsResult<JsValue>
pub fn get_prototype_of(
_: &JsValue,
args: &[JsValue],
ctx: &mut Context
) -> JsResult<JsValue>
Get the prototype
of an object.
sourcepub fn set_prototype_of(
_: &JsValue,
args: &[JsValue],
ctx: &mut Context
) -> JsResult<JsValue>
pub fn set_prototype_of(
_: &JsValue,
args: &[JsValue],
ctx: &mut Context
) -> JsResult<JsValue>
Set the prototype
of an object.
sourcepub fn is_prototype_of(
this: &JsValue,
args: &[JsValue],
context: &mut Context
) -> JsResult<JsValue>
pub fn is_prototype_of(
this: &JsValue,
args: &[JsValue],
context: &mut Context
) -> JsResult<JsValue>
Object.prototype.isPrototypeOf( proto )
Check whether or not an object exists within another object’s prototype chain.
More information:
sourcepub fn define_property(
_: &JsValue,
args: &[JsValue],
context: &mut Context
) -> JsResult<JsValue>
pub fn define_property(
_: &JsValue,
args: &[JsValue],
context: &mut Context
) -> JsResult<JsValue>
Define a property in an object
sourcepub fn define_properties(
_: &JsValue,
args: &[JsValue],
context: &mut Context
) -> JsResult<JsValue>
pub fn define_properties(
_: &JsValue,
args: &[JsValue],
context: &mut Context
) -> JsResult<JsValue>
Object.defineProperties( proto, [propertiesObject] )
Creates or update own properties to the object
More information:
sourcepub fn to_string(
this: &JsValue,
_: &[JsValue],
context: &mut Context
) -> JsResult<JsValue>
pub fn to_string(
this: &JsValue,
_: &[JsValue],
context: &mut Context
) -> JsResult<JsValue>
Object.prototype.toString()
This method returns a string representing the object.
More information:
sourcepub fn has_own_property(
this: &JsValue,
args: &[JsValue],
context: &mut Context
) -> JsResult<JsValue>
pub fn has_own_property(
this: &JsValue,
args: &[JsValue],
context: &mut Context
) -> JsResult<JsValue>
Object.prototype.hasOwnPrototype( property )
The method returns a boolean indicating whether the object has the specified property as its own property (as opposed to inheriting it).
More information:
sourcepub fn property_is_enumerable(
this: &JsValue,
args: &[JsValue],
context: &mut Context
) -> JsResult<JsValue>
pub fn property_is_enumerable(
this: &JsValue,
args: &[JsValue],
context: &mut Context
) -> JsResult<JsValue>
Object.prototype.propertyIsEnumerable( property )
This method returns a Boolean indicating whether the specified property is enumerable and is the object’s own property.
More information:
sourcepub fn assign(
_: &JsValue,
args: &[JsValue],
context: &mut Context
) -> JsResult<JsValue>
pub fn assign(
_: &JsValue,
args: &[JsValue],
context: &mut Context
) -> JsResult<JsValue>
Object.assign( target, ...sources )
This method copies all enumerable own properties from one or more source objects to a target object. It returns the target object.
More information:
sourcepub fn keys(
_: &JsValue,
args: &[JsValue],
context: &mut Context
) -> JsResult<JsValue>
pub fn keys(
_: &JsValue,
args: &[JsValue],
context: &mut Context
) -> JsResult<JsValue>
Object.keys( target )
This method returns an array of a given object’s own enumerable property names, iterated in the same order that a normal loop would.
More information:
sourcepub fn entries(
_: &JsValue,
args: &[JsValue],
context: &mut Context
) -> JsResult<JsValue>
pub fn entries(
_: &JsValue,
args: &[JsValue],
context: &mut Context
) -> JsResult<JsValue>
Object.entries( target )
This method returns an array of a given object’s own enumerable string-keyed property [key, value] pairs. This is the same as iterating with a for…in loop, except that a for…in loop enumerates properties in the prototype chain as well).
More information: