avm1: Fix test failures

This commit is contained in:
CUB3D 2023-02-12 20:42:01 +00:00 committed by Nathan Adams
parent d1d38091ff
commit 693e29a82d
2 changed files with 4 additions and 13 deletions

View File

@ -582,18 +582,6 @@ impl<'a, 'gc> Activation<'a, 'gc> {
let a = self.context.avm1.pop().to_primitive(self)?;
let b = self.context.avm1.pop().to_primitive(self)?;
let a = if let Value::MovieClip(_, _) = a {
a.coerce_to_string(self)?.into()
} else {
a
};
let b = if let Value::MovieClip(_, _) = b {
b.coerce_to_string(self)?.into()
} else {
b
};
let result: Value<'_> = match (a, b) {
(Value::String(a), Value::String(b)) => {
AvmString::concat(self.context.gc_context, b, a).into()

View File

@ -393,7 +393,10 @@ impl<'gc> Value<'gc> {
Value::Bool(true) if activation.swf_version() < 5 => "1".into(),
Value::Bool(false) if activation.swf_version() < 5 => "0".into(),
Value::Object(object) => {
if let Some(object) = object.as_display_object() {
if let Some(object) = object
.as_display_object()
.filter(|_| !matches!(object, Object::SuperObject(_)))
{
// StageObjects are special-cased to return their path.
AvmString::new(activation.context.gc_context, object.path())
} else {