|
shim_val_t * | shim_obj_new (shim_ctx_t *context, shim_val_t *klass, shim_val_t *proto) |
|
shim_val_t * | shim_obj_new_instance (shim_ctx_t *context, shim_val_t *klass, size_t argc, shim_val_t **argv) |
|
shim_val_t * | shim_obj_clone (shim_ctx_t *ctx, shim_val_t *src) |
|
shim_bool_t | shim_obj_has_name (shim_ctx_t *ctx, shim_val_t *obj, const char *name) |
|
shim_bool_t | shim_obj_has_id (shim_ctx_t *ctx, shim_val_t *obj, uint32_t id) |
|
shim_bool_t | shim_obj_has_sym (shim_ctx_t *ctx, shim_val_t *obj, shim_val_t *sym) |
|
shim_bool_t | shim_obj_set_prop_name (shim_ctx_t *ctx, shim_val_t *recv, const char *name, shim_val_t *val) |
|
shim_bool_t | shim_obj_set_prop_id (shim_ctx_t *ctx, shim_val_t *recv, uint32_t id, shim_val_t *val) |
|
shim_bool_t | shim_obj_set_prop_sym (shim_ctx_t *ctx, shim_val_t *recv, shim_val_t *sym, shim_val_t *val) |
|
shim_bool_t | shim_obj_set_private (shim_ctx_t *ctx, shim_val_t *obj, void *data) |
|
shim_bool_t | shim_obj_set_funcs (shim_ctx_t *ctx, shim_val_t *recv, const shim_fspec_t *funcs) |
|
shim_bool_t | shim_obj_get_prop_name (shim_ctx_t *ctx, shim_val_t *obj, const char *name, shim_val_t *rval) |
|
shim_bool_t | shim_obj_get_prop_id (shim_ctx_t *ctx, shim_val_t *obj, uint32_t id, shim_val_t *rval) |
|
shim_bool_t | shim_obj_get_prop_sym (shim_ctx_t *ctx, shim_val_t *obj, shim_val_t *sym, shim_val_t *rval) |
|
shim_bool_t | shim_obj_get_private (shim_ctx_t *ctx, shim_val_t *obj, void **data) |
|
Methods for creating and manipulation javascript objects
Create a second wrapper of the given object
- Parameters
-
ctx | The currently executing context |
src | The given value |
- Returns
- The new Local value representing the previous value
Use this when you might want to create a Local of a persistent
- See Also
- Persistent methods
Get the arbitrary data associated with the object
- Parameters
-
ctx | The currently executing context |
obj | The the given object |
data | The actual data |
- Returns
- TRUE if the object had hidden data, otherwise FALSE
Get the value for the given id
- Parameters
-
ctx | The currently executing context |
obj | The the given object |
idx | The id of the property |
rval | The actual value returned |
- Returns
- TRUE if object had the propert, otherwise FALSE
Get the value for the property name
- Parameters
-
ctx | The currently executing context |
obj | The the given object |
name | The name of the property |
rval | The actual value returned |
- Returns
- TRUE if object had the propert, otherwise FALSE
Get the value for the given symbol
- Parameters
-
ctx | The currently executing context |
obj | The the given object |
sym | The symbol of the property |
rval | The actual value returned |
- Returns
- TRUE if object had the propert, otherwise FALSE
Check the object has the given id
- Parameters
-
ctx | The currently executing context |
val | The given object |
id | The id of the property |
- Returns
- TRUE if the object has the indexed property, otherwise FALSE
Object can have ordered properties, or may be an array, use this to check if either exist.
Check the object has the given name
- Parameters
-
ctx | The currently executing context |
val | The given object |
name | The name of the property |
- Returns
- TRUE if the object has the named property, otherwise FALSE
Has the name
Check the object has the given symbol
- Parameters
-
ctx | The currently executing context |
val | The given object |
sym | The symbol of the property |
- Returns
- TRUE if the object has the property, otherwise FALSE
Use this if you are keeping a reference to a commonly used symbol name or are passed a value to lookup
Create a new object
- Parameters
-
ctx | The currently executing context |
klass | The constructor to be used (may be NULL) |
proto | The prototype that should be used (may be NULL) |
- Returns
- A pointer to the created object
- See Also
- shim_value_release()
Create a new object by calling the given constructor with arguments
- Parameters
-
ctx | The currently executing context |
klass | The given constructor |
argc | The amount of arguments being passed |
argv | The array of arguments to be passed |
- Returns
- The returned object
Use this to instantiate an object with the given arguments
Adds a set of functions to an object
- Parameters
-
ctx | The currently executing context |
recv | The object to add the functions to |
funcs | The null terminated array of functions |
- Returns
- TRUE if all functions were able to be added, otherwise FALSE
Add arbitrary data to given object
- Parameters
-
ctx | The currently executing context |
obj | The given object |
data | The data to be associated with the object |
- Returns
- TRUE if the data was able to be associated, otherwise FALSE
Use this to associate C memory with a given object, which can be recalled at a later time with shim_obj_get_private()
- See Also
- shim_obj_make_weak()
Set the value for the given id
- Parameters
-
ctx | The currently executing context |
obj | The given object |
id | The id of the property |
val | The value to be stored |
- Returns
- TRUE if the property was set, otherwise FALSE
Set the value for the named property
- Parameters
-
ctx | The currently executing context |
obj | The given object |
name | The name of the property |
val | The value to be stored |
- Returns
- TRUE if the property was set, otherwise FALSE
Set the value for the given symbol
- Parameters
-
ctx | The currently executing context |
obj | The given object |
sym | The symbol of the property |
val | The value to be stored |
- Returns
- TRUE if the property was set, otherwise FALSE