frozen array in XRInputSourcesChangeEvent, update to_frozen_array doc (#34100)

* frozen array in XRInputSourcesChangeEvent, update 	o_frozen_array doc

Signed-off-by: L Ashwin B <lashwinib@gmail.com>

* simplified changes

Signed-off-by: L Ashwin B <lashwinib@gmail.com>

* added tests

Signed-off-by: L Ashwin B <lashwinib@gmail.com>

---------

Signed-off-by: L Ashwin B <lashwinib@gmail.com>
This commit is contained in:
chickenleaf 2024-11-02 19:57:59 +05:30 committed by GitHub
parent f47cc927a0
commit 900d13fc2f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 18 additions and 13 deletions

View file

@ -116,7 +116,7 @@ impl Clone for DOMJSClass {
}
unsafe impl Sync for DOMJSClass {}
/// Returns a JSVal representing a frozen array of ports
/// Returns a JSVal representing the frozen JavaScript array
pub fn to_frozen_array<T: ToJSValConvertible>(convertibles: &[T], cx: SafeJSContext) -> JSVal {
rooted!(in(*cx) let mut ports = UndefinedValue());
unsafe { convertibles.to_jsval(*cx, ports.handle_mut()) };