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,8 @@
|
|||
use base::id::PipelineId;
|
||||
use dom_struct::dom_struct;
|
||||
use js::jsapi::{Heap, JSObject};
|
||||
use js::jsval::{JSVal, UndefinedValue};
|
||||
use js::rust::{CustomAutoRooter, CustomAutoRooterGuard, HandleValue};
|
||||
use js::jsval::UndefinedValue;
|
||||
use js::rust::{CustomAutoRooter, CustomAutoRooterGuard, HandleValue, MutableHandleValue};
|
||||
use script_traits::{ScriptMsg, StructuredSerializedData};
|
||||
use servo_url::ServoUrl;
|
||||
|
||||
|
@ -167,9 +167,9 @@ impl DissimilarOriginWindowMethods for DissimilarOriginWindow {
|
|||
}
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/#dom-opener
|
||||
fn Opener(&self, _: JSContext) -> JSVal {
|
||||
fn Opener(&self, _: JSContext, mut retval: MutableHandleValue) {
|
||||
// TODO: Implement x-origin opener
|
||||
UndefinedValue()
|
||||
retval.set(UndefinedValue());
|
||||
}
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/#dom-opener
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue