avm2: String.toString defaults to ""

This commit is contained in:
sleepycatcoding 2023-08-18 18:13:52 +03:00 committed by TÖRÖK Attila
parent afac907f80
commit 7316f51cb1
4 changed files with 7 additions and 4 deletions

View File

@ -622,7 +622,13 @@ fn to_string<'gc>(
this: Object<'gc>, this: Object<'gc>,
_args: &[Value<'gc>], _args: &[Value<'gc>],
) -> Result<Value<'gc>, Error<'gc>> { ) -> Result<Value<'gc>, Error<'gc>> {
Ok(Value::from(this)) if let Some(this) = this.as_primitive() {
if let Value::String(v) = *this {
return Ok(v.into());
}
}
Ok("".into())
} }
/// Implements `String.valueOf` /// Implements `String.valueOf`

View File

@ -1,2 +1 @@
num_ticks = 1 num_ticks = 1
known_failure = true

View File

@ -1,2 +1 @@
num_ticks = 1 num_ticks = 1
known_failure = true

View File

@ -1,2 +1 @@
num_ticks = 1 num_ticks = 1
known_failure = true