mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
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>
This commit is contained in:
parent
537958a3cc
commit
25a0764a37
38 changed files with 763 additions and 515 deletions
|
@ -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.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue