Module utils

Module utils 

Source

Modules§

call_policies

Structs§

CallPolicyInfo
Controls various details of an IDL operation, such as whether a [LegacyLenientThis] attribute is specified and preconditions that affect the outcome of the “perform a security check” steps.
DOMClass
The struct that holds inheritance information for DOM object reflectors.
DOMJSClass
The JSClass used for DOM object reflectors.

Constants§

DOM_PROTOTYPE_SLOT 🔒
The index of the slot that contains a reference to the ProtoOrIfaceArray.
DOM_PROTO_UNFORGEABLE_HOLDER_SLOT 🔒
The index of the slot where the object holder of that interface’s unforgeable members are defined.
JSCLASS_DOM_GLOBAL 🔒
The flag set on the JSClasses for DOM global objects.

Traits§

CallPolicy

Functions§

call_setter 🔒
define_dictionary_property
Define an own enumerable data property with name property on object. Returns Err(()) on JSAPI failure, or null object, and Ok(()) otherwise.
delete_property_by_id 🔒
Deletes the property id from object.
enumerate_global 🔒
Enumerate lazy properties of a global object. Modeled after https://github.com/mozilla/gecko-dev/blob/3fd619f47/dom/bindings/BindingUtils.cpp#L2814
enumerate_window 🔒
Enumerate lazy properties of a global object that is a Window. https://github.com/mozilla/gecko-dev/blob/3fd619f47/dom/base/nsGlobalWindowInner.cpp#3297
exception_to_promise 🔒
Coverts exception to promise rejection
find_enum_value 🔒
Find the enum equivelent of a string given by v in pairs. Returns Err(()) on JSAPI failure (there is a pending exception), and Ok((None, value)) if there was no matching string.
generic_call 🔒
generic_getter 🔒
Generic getter of IDL interface.
generic_method 🔒
Generic method of IDL interface.
generic_setter 🔒
Generic setter of IDL interface.
generic_static_promise_method 🔒
https://searchfox.org/mozilla-central/rev/7279a1df13a819be254fd4649e07c4ff93e4bd45/dom/bindings/BindingUtils.cpp#3300
get_array_index_from_id
Get an array index from the given jsid. Returns None if the given jsid is not an integer.
get_dictionary_property
Get the property with name property from object. Returns Err(()) on JSAPI failure (there is a pending exception), and Ok(false) if there was no property with the given name.
get_property_on_prototype 🔒
Gets the property id on proxy’s prototype. If it exists, *found is set to true and *vp to the value, otherwise *found is set to false.
get_proto_or_iface_array 🔒
Returns the ProtoOrIfaceArray for the given global object. Fails if global is not a DOM global object.
has_own_property
Checks whether object has an own property named property. Returns Err(()) on JSAPI failure (there is a pending exception), and Ok(false) for null objects or when the property is not own.
has_property_on_prototype
Computes whether proxy has a property id on its prototype and stores the result in found.
latin1_bytes_from_id 🔒
Returns a slice of bytes corresponding to the bytes in the provided string id. Returns an error if the id is not a string, or the string contains non-latin1 characters.
may_resolve_global 🔒
Returns true if the resolve hook for this global may resolve the provided id. https://searchfox.org/mozilla-central/rev/f3c8c63a097b61bb1f01e13629b9514e09395947/dom/bindings/BindingUtils.cpp#2809 https://searchfox.org/mozilla-central/rev/f3c8c63a097b61bb1f01e13629b9514e09395947/js/public/Class.h#283-291
may_resolve_window 🔒
Returns true if the resolve hook for this window may resolve the provided id. https://searchfox.org/mozilla-central/rev/f3c8c63a097b61bb1f01e13629b9514e09395947/dom/base/nsGlobalWindowInner.cpp#3275 https://searchfox.org/mozilla-central/rev/f3c8c63a097b61bb1f01e13629b9514e09395947/js/public/Class.h#283-291
resolve_global 🔒
Resolve a lazy global property, for interface objects and named constructors.
resolve_window 🔒
Resolve a lazy global property for a Window global.
set_dictionary_property
Set the property with name property from object. Returns Err(()) on JSAPI failure, or null object, and Ok(()) otherwise
trace_global 🔒
Trace the resources held by reserved slots of a global object

Type Aliases§

ProtoOrIfaceArray
An array of *mut JSObject of size PROTO_OR_IFACE_LENGTH.