From e74a042efdf01ab2ff32e82e203bd1d954b599bd Mon Sep 17 00:00:00 2001 From: Usman Yahaya Baba <91813795+uthmaniv@users.noreply.github.com> Date: Sun, 6 Apr 2025 16:46:32 +0100 Subject: [PATCH] Remove unsafe from cross_origin_property_fallback (#36373) Remove unsafe from cross_origin_property_fallback - Refactors `cross_origin_property_fallback` to remove the `unsafe` annotation from the function signature, as it now uses safe wrappers instead of raw pointers - Adds an `unsafe` block around `MutableHandle::from_raw` Testing: Changes does not require test Fixes: https://github.com/servo/servo/issues/36359 Signed-off-by: Uthman Yahaya Baba --- components/script_bindings/proxyhandler.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/components/script_bindings/proxyhandler.rs b/components/script_bindings/proxyhandler.rs index c7d3860b3b9..beafaaed8bf 100644 --- a/components/script_bindings/proxyhandler.rs +++ b/components/script_bindings/proxyhandler.rs @@ -742,7 +742,7 @@ pub(crate) unsafe fn cross_origin_set( /// for a maybe-cross-origin object. /// /// [`CrossOriginPropertyFallback`]: https://html.spec.whatwg.org/multipage/#crossoriginpropertyfallback-(-p-) -pub(crate) unsafe fn cross_origin_property_fallback( +pub(crate) fn cross_origin_property_fallback( cx: SafeJSContext, _proxy: RawHandleObject, id: RawHandleId, @@ -757,7 +757,7 @@ pub(crate) unsafe fn cross_origin_property_fallback( // > [[Configurable]]: true }`. if is_cross_origin_allowlisted_prop(cx, id) { set_property_descriptor( - MutableHandle::from_raw(desc), + unsafe { MutableHandle::from_raw(desc) }, HandleValue::undefined(), jsapi::JSPROP_READONLY as u32, is_none,