core: Remove AS3-related `coerce_to_object` calls in `MovieClip`

This commit is contained in:
David Wendt 2022-02-11 21:55:56 -05:00 committed by Mike Welsh
parent fe50e98f87
commit 155672d482
1 changed files with 9 additions and 5 deletions

View File

@ -555,13 +555,17 @@ impl<'gc> MovieClip<'gc> {
let domain = library.avm2_domain();
let class_object = domain
.get_defined_value(&mut activation, name)
.and_then(|v| v.coerce_to_object(&mut activation))
.and_then(|v| {
v.as_class_object().ok_or_else(|| {
"Attempted to assign a non-class to symbol"
.to_string()
v.as_object()
.and_then(|o| o.as_class_object())
.ok_or_else(|| {
format!(
"Attempted to assign a non-class {} to symbol {}",
class_name,
name.to_qualified_name(activation.context.gc_context)
)
.into()
})
})
});
match class_object {