chore: cargo fmt
This commit is contained in:
parent
9059e199e2
commit
2c4b260a8c
|
@ -65,7 +65,11 @@ pub fn create_class<'gc>(mc: MutationContext<'gc, '_>) -> GcCell<'gc, Class<'gc>
|
|||
"<Namespace native instance initializer>",
|
||||
mc,
|
||||
));
|
||||
write.set_call_handler(Method::from_builtin(class_call, "<Namespace call handler>", mc));
|
||||
write.set_call_handler(Method::from_builtin(
|
||||
class_call,
|
||||
"<Namespace call handler>",
|
||||
mc,
|
||||
));
|
||||
|
||||
class
|
||||
}
|
||||
|
|
|
@ -274,7 +274,11 @@ pub fn create_class<'gc>(gc_context: MutationContext<'gc, '_>) -> GcCell<'gc, Cl
|
|||
gc_context,
|
||||
);
|
||||
let mut write = object_class.write(gc_context);
|
||||
write.set_call_handler(Method::from_builtin(class_call, "<Object call handler>", gc_context));
|
||||
write.set_call_handler(Method::from_builtin(
|
||||
class_call,
|
||||
"<Object call handler>",
|
||||
gc_context,
|
||||
));
|
||||
|
||||
write.define_class_trait(Trait::from_const(
|
||||
QName::new(Namespace::public(), "length"),
|
||||
|
|
|
@ -56,7 +56,6 @@ fn class_call<'gc>(
|
|||
this: Option<Object<'gc>>,
|
||||
args: &[Value<'gc>],
|
||||
) -> Result<Value<'gc>, Error> {
|
||||
|
||||
let this_class = activation.subclass_object().unwrap();
|
||||
|
||||
if args.len() == 1 {
|
||||
|
@ -295,7 +294,11 @@ pub fn create_class<'gc>(mc: MutationContext<'gc, '_>) -> GcCell<'gc, Class<'gc>
|
|||
|
||||
let mut write = class.write(mc);
|
||||
write.set_instance_allocator(regexp_allocator);
|
||||
write.set_call_handler(Method::from_builtin(class_call, "<RegExp call handler>", mc));
|
||||
write.set_call_handler(Method::from_builtin(
|
||||
class_call,
|
||||
"<RegExp call handler>",
|
||||
mc,
|
||||
));
|
||||
|
||||
const PUBLIC_INSTANCE_PROPERTIES: &[(
|
||||
&str,
|
||||
|
|
|
@ -8,7 +8,7 @@ use crate::avm2::globals::array::{
|
|||
};
|
||||
use crate::avm2::globals::NS_VECTOR;
|
||||
use crate::avm2::method::{Method, NativeMethodImpl};
|
||||
use crate::avm2::names::{Namespace, QName, Multiname};
|
||||
use crate::avm2::names::{Multiname, Namespace, QName};
|
||||
use crate::avm2::object::{vector_allocator, FunctionObject, Object, TObject, VectorObject};
|
||||
use crate::avm2::value::Value;
|
||||
use crate::avm2::vector::VectorStorage;
|
||||
|
@ -1046,7 +1046,11 @@ pub fn create_class<'gc>(mc: MutationContext<'gc, '_>) -> GcCell<'gc, Class<'gc>
|
|||
"<Vector specialized class initializer>",
|
||||
mc,
|
||||
));
|
||||
write.set_call_handler(Method::from_builtin(class_call, "<Vector call handler>", mc));
|
||||
write.set_call_handler(Method::from_builtin(
|
||||
class_call,
|
||||
"<Vector call handler>",
|
||||
mc,
|
||||
));
|
||||
|
||||
const PUBLIC_INSTANCE_PROPERTIES: &[(
|
||||
&str,
|
||||
|
|
|
@ -760,8 +760,7 @@ impl<'gc> TObject<'gc> for ClassObject<'gc> {
|
|||
) -> Result<Value<'gc>, Error> {
|
||||
if let Some(call_handler) = self.0.read().call_handler.clone() {
|
||||
let scope = self.0.read().class_scope;
|
||||
let func =
|
||||
Executable::from_method(call_handler, scope, None, Some(self));
|
||||
let func = Executable::from_method(call_handler, scope, None, Some(self));
|
||||
|
||||
func.exec(receiver, arguments, activation, self.into())
|
||||
} else {
|
||||
|
|
|
@ -573,7 +573,7 @@ impl<'gc> Value<'gc> {
|
|||
pub fn as_object(&self) -> Option<Object<'gc>> {
|
||||
match self {
|
||||
Value::Object(o) => Some(*o),
|
||||
_ => None
|
||||
_ => None,
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue