11//! This module implements the `JsObject` structure.
22//!
33//! The `JsObject` is a garbage collected Object.
4+ #![ allow(
5+ unknown_lints,
6+ reason = "unpredictable_function_pointer_comparisons doesn't exist on 1.84"
7+ ) ]
48
59use super :: {
610 internal_methods:: { InternalMethodContext , InternalObjectMethods , ORDINARY_INTERNAL_METHODS } ,
@@ -408,7 +412,7 @@ impl JsObject {
408412 let get = if let Some ( getter) = self . try_get ( js_string ! ( "get" ) , context) ? {
409413 // b. If IsCallable(getter) is false and getter is not undefined, throw a TypeError exception.
410414 // todo: extract IsCallable to be callable from Value
411- if !getter. is_undefined ( ) && getter. as_object ( ) . map_or ( true , |o| !o. is_callable ( ) ) {
415+ if !getter. is_undefined ( ) && getter. as_object ( ) . is_none_or ( |o| !o. is_callable ( ) ) {
412416 return Err ( JsNativeError :: typ ( )
413417 . with_message ( "Property descriptor getter must be callable" )
414418 . into ( ) ) ;
@@ -425,7 +429,7 @@ impl JsObject {
425429 let set = if let Some ( setter) = self . try_get ( js_string ! ( "set" ) , context) ? {
426430 // 14.b. If IsCallable(setter) is false and setter is not undefined, throw a TypeError exception.
427431 // todo: extract IsCallable to be callable from Value
428- if !setter. is_undefined ( ) && setter. as_object ( ) . map_or ( true , |o| !o. is_callable ( ) ) {
432+ if !setter. is_undefined ( ) && setter. as_object ( ) . is_none_or ( |o| !o. is_callable ( ) ) {
429433 return Err ( JsNativeError :: typ ( )
430434 . with_message ( "Property descriptor setter must be callable" )
431435 . into ( ) ) ;
@@ -748,6 +752,10 @@ impl<T: NativeObject + ?Sized> JsObject<T> {
748752 /// [spec]: https://tc39.es/ecma262/#sec-iscallable
749753 #[ inline]
750754 #[ must_use]
755+ #[ expect(
756+ unpredictable_function_pointer_comparisons,
757+ reason = "can only use `ptr::fn_addr_eq` on rustc 1.85"
758+ ) ]
751759 pub fn is_callable ( & self ) -> bool {
752760 self . inner . vtable . __call__ != ORDINARY_INTERNAL_METHODS . __call__
753761 }
@@ -760,6 +768,10 @@ impl<T: NativeObject + ?Sized> JsObject<T> {
760768 /// [spec]: https://tc39.es/ecma262/#sec-isconstructor
761769 #[ inline]
762770 #[ must_use]
771+ #[ expect(
772+ unpredictable_function_pointer_comparisons,
773+ reason = "can only use `ptr::fn_addr_eq` on rustc 1.85"
774+ ) ]
763775 pub fn is_constructor ( & self ) -> bool {
764776 self . inner . vtable . __construct__ != ORDINARY_INTERNAL_METHODS . __construct__
765777 }
0 commit comments