aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom/intersectionobserver.rs
diff options
context:
space:
mode:
authorJosh Matthews <josh@joshmatthews.net>2024-11-05 03:29:08 -0500
committerGitHub <noreply@github.com>2024-11-05 08:29:08 +0000
commit25a0764a37a585d032ca352923b24995f8cbf1a0 (patch)
tree1805edc4fc79396de9150f8bc063888926d53d3b /components/script/dom/intersectionobserver.rs
parent537958a3ccb57502c558e4da0963307fd7481a14 (diff)
downloadservo-25a0764a37a585d032ca352923b24995f8cbf1a0.tar.gz
servo-25a0764a37a585d032ca352923b24995f8cbf1a0.zip
Use out parameter for generated methods returning JSVal (#34087)
* Make generated bindings that return a WebIDL `any` value use out parameters. Returning raw JSVal values makes it easier to create GC hazards in code that calls these methods. Accepting a MutableHandle argument instead ensures that the values are rooted by the caller. Signed-off-by: Josh Matthews <josh@joshmatthews.net> * Update mozjs. Signed-off-by: Josh Matthews <josh@joshmatthews.net> * Fix clippy warnings. Signed-off-by: Josh Matthews <josh@joshmatthews.net> --------- Signed-off-by: Josh Matthews <josh@joshmatthews.net>
Diffstat (limited to 'components/script/dom/intersectionobserver.rs')
-rw-r--r--components/script/dom/intersectionobserver.rs7
1 files changed, 2 insertions, 5 deletions
diff --git a/components/script/dom/intersectionobserver.rs b/components/script/dom/intersectionobserver.rs
index 3c02238f52f..7b926e4909a 100644
--- a/components/script/dom/intersectionobserver.rs
+++ b/components/script/dom/intersectionobserver.rs
@@ -5,8 +5,7 @@
use std::rc::Rc;
use dom_struct::dom_struct;
-use js::jsval::{JSVal, NullValue};
-use js::rust::HandleObject;
+use js::rust::{HandleObject, MutableHandleValue};
use super::bindings::codegen::Bindings::IntersectionObserverBinding::{
IntersectionObserverCallback, IntersectionObserverMethods,
@@ -93,9 +92,7 @@ impl IntersectionObserverMethods for IntersectionObserver {
/// > constructor, or the sequence is empty, the value of this attribute will be [0].
///
/// <https://w3c.github.io/IntersectionObserver/#dom-intersectionobserver-thresholds>
- fn Thresholds(&self, _context: JSContext) -> JSVal {
- NullValue()
- }
+ fn Thresholds(&self, _context: JSContext, _retval: MutableHandleValue) {}
/// > A number indicating the minimum delay in milliseconds between notifications from
/// > this observer for a given target.