avm2: Implement Error 1112
This commit is contained in:
parent
5d2d8e080a
commit
b1056311f0
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
use crate::avm2::activation::Activation;
|
use crate::avm2::activation::Activation;
|
||||||
use crate::avm2::class::{Allocator, AllocatorFn, Class, ClassHashWrapper};
|
use crate::avm2::class::{Allocator, AllocatorFn, Class, ClassHashWrapper};
|
||||||
use crate::avm2::error::{make_error_1127, type_error};
|
use crate::avm2::error::{argument_error, make_error_1127, type_error};
|
||||||
use crate::avm2::function::Executable;
|
use crate::avm2::function::Executable;
|
||||||
use crate::avm2::method::Method;
|
use crate::avm2::method::Method;
|
||||||
use crate::avm2::object::function_object::FunctionObject;
|
use crate::avm2::object::function_object::FunctionObject;
|
||||||
|
@ -857,11 +857,18 @@ impl<'gc> TObject<'gc> for ClassObject<'gc> {
|
||||||
|
|
||||||
func.exec(receiver, arguments, activation, self.into())
|
func.exec(receiver, arguments, activation, self.into())
|
||||||
} else {
|
} else {
|
||||||
arguments
|
if arguments.len() == 1 {
|
||||||
.get(0)
|
arguments[0].coerce_to_type(activation, self.inner_class_definition())
|
||||||
.cloned()
|
} else {
|
||||||
.unwrap_or(Value::Undefined)
|
Err(Error::AvmError(argument_error(
|
||||||
.coerce_to_type(activation, self.inner_class_definition())
|
activation,
|
||||||
|
&format!(
|
||||||
|
"Error #1112: Argument count mismatch on class coercion. Expected 1, got {}.",
|
||||||
|
arguments.len()
|
||||||
|
),
|
||||||
|
1112,
|
||||||
|
)?))
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,2 +1 @@
|
||||||
num_ticks = 1
|
num_ticks = 1
|
||||||
known_failure = true
|
|
||||||
|
|
Loading…
Reference in New Issue