pub fn force_set_function(
        &mut self,
        name: &str,
        function: NativeFunction<'gc>,
        gc_context: MutationContext<'gc, '_>,
        attributes: Attribute,
        fn_proto: Option<Object<'gc>>,
    ) {
        self.define_value(
            gc_context,
            name,
            FunctionObject::bare_function(
                gc_context,
                Some(function),
                Option::<Executable>::None,
                fn_proto,
            )
            .into(),
            attributes,
        )
    }
/// Declare a native function on the current object.
///
/// This is intended for use with defining host object prototypes. Notably,
/// this creates a function object without an explicit `prototype`, which
/// is only possible when defining host functions. User-defined functions
/// always get a fresh explicit prototype, so you should never force set a
/// user-defined function.
Declare a native function on the current object.
This is intended for use with defining host object prototypes. Notably,
this creates a function object without an explicit `prototype`, which
is only possible when defining host functions. User-defined functions
always get a fresh explicit prototype, so you should never force set a
user-defined function.
Declare a native function on the current object . This is intended for use with defining host object prototypes . Notably this creates a function object without an explicit ` prototype ` which is only possible when defining host functions . User - defined functions always get a fresh explicit prototype so you should never force set a user - defined function .
pub fn force_set_function(
        &mut self,
        name: &str,
        function: NativeFunction<'gc>,
        gc_context: MutationContext<'gc, '_>,
        attributes: Attribute,
        fn_proto: Option<Object<'gc>>,
    ) {
        self.define_value(
            gc_context,
            name,
            FunctionObject::bare_function(
                gc_context,
                Some(function),
                Option::<Executable>::None,
                fn_proto,
            )
            .into(),
            attributes,
        )
    }
pub fn force_set_function ( & mut self , name : & str , function : NativeFunction < ' gc > , gc_context : MutationContext < ' gc , ' _ > , attributes : Attribute , fn_proto : Option < Object < ' gc > > , ) { self . define_value ( gc_context , name , FunctionObject :: bare_function ( gc_context , Some ( function ) , Option :: < Executable > :: None , fn_proto , ) . into ( ) , attributes , ) }
Declare a native function on the current object.
Declare a native function on the current object .
&mut self
name
&str
function
NativeFunction<'gc>
gc_context
MutationContext<'gc, '_>
attributes
Attribute
fn_proto
Option<Object<'gc>>
&mut self
name
&str
function
NativeFunction<'gc>
gc_context
MutationContext<'gc, '_>
attributes
Attribute
fn_proto
Option<Object<'gc>>