You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: function.rs
    path of file: ./repos/ruffle/core/src/avm2/globals
    
    the code of the file until where you have to start completion: //! Function builtin and prototype

use crate::avm2::activation::Activation;
use crate::avm2::class::Class;
use crate::avm2::error::eval_error;
use crate::avm2::globals::array::resolve_array_hole;
use crate::avm2::method::{Method, NativeMethodImpl};
use crate::avm2::object::{function_allocator, FunctionObject, Object, TObject};
use crate::avm2::value::Value;
use crate::avm2::Error;
use crate::avm2::Multiname;
use crate::avm2::QName;
use gc_arena::GcCell;

/// Implements `Function`'s instance initializer.
pub fn instance_init<'gc>(
    activation: &mut Activation<'_, 'gc>,
    this: Object<'gc>,
    args: &[Value<'gc>],
) -> Result<Value<'gc>, Error<'gc>> {
    if !args.is_empty() {
        return Err(Error::AvmError(eval_error(
            activation,
            "Error #1066: The form function('function body') is not supported.",
            1066,
        )?));
    }

    activation.super_init(this, &[])?;

    Ok(Value::Undefined)
}

pub fn class_call<'gc>(
    activation: &mut Activation<'_, 'gc>,
    _this: Object<'gc>,
    args: &[Value<'gc>],
) -> Result<Value<'gc>, Error<'gc>> {
    Ok(activation
        .avm2()
        .classes()
        .function
        .construct(activation, args)?
        .into())
}

/// Implements `Function`'s class initializer.
pub fn class_init<'gc>(
    activation: &mut Activation<'_, 'gc>,
    this: Object<'gc>,
    _args: &[Value<'gc>],
) -> Result<Value<'gc>, Error<'gc>> {
    let scope = activation.create_scopechain();
    let this_class = this.as_class_object().unwrap();
    let function_proto = this_class.prototype();

    function_proto.set_string_property_local(
        "call",
        FunctionObject::from_method(
            activation,
            Method::f
    
pub fn create_class<'gc>(activation: &mut Activation<'_, 'gc>) -> GcCell<'gc, Class<'gc>> {
    let gc_context = activation.context.gc_context;
    let function_class = Class::new(
        QName::new(activation.avm2().public_namespace_base_version, "Function"),
        Some(Multiname::new(
            activation.avm2().public_namespace_base_version,
            "Object",
        )),
        Method::from_builtin(instance_init, "<Function instance initializer>", gc_context),
        Method::from_builtin(class_init, "<Function class initializer>", gc_context),
        gc_context,
    );

    let mut write = function_class.write(gc_context);

    // Fixed traits (in AS3 namespace)
    const AS3_INSTANCE_METHODS: &[(&str, NativeMethodImpl)] = &[("call", call), ("apply", apply)];
    write.define_builtin_instance_methods(
        gc_context,
        activation.avm2().as3_namespace,
        AS3_INSTANCE_METHODS,
    );

    const PUBLIC_INSTANCE_PROPERTIES: &[(
        &str,
        Option<NativeMethodImpl>,
        Option<NativeMethodImpl>,
    )] = &[
        ("prototype", Some(prototype), Some(set_prototype)),
        ("length", Some(length), None),
    ];
    write.define_builtin_instance_properties(
        gc_context,
        activation.avm2().public_namespace_base_version,
        PUBLIC_INSTANCE_PROPERTIES,
    );

    const CONSTANTS_INT: &[(&str, i32)] = &[("length", 1)];
    write.define_constant_int_class_traits(
        activation.avm2().public_namespace_base_version,
        CONSTANTS_INT,
        activation,
    );

    write.set_instance_allocator(function_allocator);
    write.set_call_handler(Method::from_builtin(
        class_call,
        "<Function call handler>",
        gc_context,
    ));

    function_class
}