aboutsummaryrefslogtreecommitdiffstats
path: root/components/script_bindings
diff options
context:
space:
mode:
authorUsman Yahaya Baba <91813795+uthmaniv@users.noreply.github.com>2025-04-06 16:46:32 +0100
committerGitHub <noreply@github.com>2025-04-06 15:46:32 +0000
commite74a042efdf01ab2ff32e82e203bd1d954b599bd (patch)
tree75a2f09e23ef7362536ffb5add64336126f50891 /components/script_bindings
parentfab5e029726a85c179b57b834eae547abf006256 (diff)
downloadservo-e74a042efdf01ab2ff32e82e203bd1d954b599bd.tar.gz
servo-e74a042efdf01ab2ff32e82e203bd1d954b599bd.zip
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 <uthmanyahayababa@gmail.com>
Diffstat (limited to 'components/script_bindings')
-rw-r--r--components/script_bindings/proxyhandler.rs4
1 files 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<D: DomTypes>(
/// for a maybe-cross-origin object.
///
/// [`CrossOriginPropertyFallback`]: https://html.spec.whatwg.org/multipage/#crossoriginpropertyfallback-(-p-)
-pub(crate) unsafe fn cross_origin_property_fallback<D: DomTypes>(
+pub(crate) fn cross_origin_property_fallback<D: DomTypes>(
cx: SafeJSContext,
_proxy: RawHandleObject,
id: RawHandleId,
@@ -757,7 +757,7 @@ pub(crate) unsafe fn cross_origin_property_fallback<D: DomTypes>(
// > [[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,