avm2: Use correct error in toString with invalid radix
This commit is contained in:
parent
c9c2e213bb
commit
8bbf8f4ea1
|
@ -225,7 +225,13 @@ fn to_string<'gc>(
|
||||||
.coerce_to_u32(activation)? as usize;
|
.coerce_to_u32(activation)? as usize;
|
||||||
|
|
||||||
if radix < 2 || radix > 36 {
|
if radix < 2 || radix > 36 {
|
||||||
return Err("toString can only print in bases 2 thru 36.".into());
|
return Err(Error::AvmError(range_error(
|
||||||
|
activation,
|
||||||
|
&format!(
|
||||||
|
"Error #1003: The radix argument must be between 2 and 36; got {radix}."
|
||||||
|
),
|
||||||
|
1003,
|
||||||
|
)?));
|
||||||
}
|
}
|
||||||
|
|
||||||
return Ok(print_with_radix(activation, number as f64, radix)?.into());
|
return Ok(print_with_radix(activation, number as f64, radix)?.into());
|
||||||
|
|
|
@ -321,7 +321,13 @@ fn to_string<'gc>(
|
||||||
.coerce_to_u32(activation)? as usize;
|
.coerce_to_u32(activation)? as usize;
|
||||||
|
|
||||||
if radix < 2 || radix > 36 {
|
if radix < 2 || radix > 36 {
|
||||||
return Err("toString can only print in bases 2 thru 36.".into());
|
return Err(Error::AvmError(range_error(
|
||||||
|
activation,
|
||||||
|
&format!(
|
||||||
|
"Error #1003: The radix argument must be between 2 and 36; got {radix}."
|
||||||
|
),
|
||||||
|
1003,
|
||||||
|
)?));
|
||||||
}
|
}
|
||||||
|
|
||||||
return Ok(print_with_radix(activation, number, radix)?.into());
|
return Ok(print_with_radix(activation, number, radix)?.into());
|
||||||
|
|
|
@ -224,7 +224,13 @@ fn to_string<'gc>(
|
||||||
.coerce_to_u32(activation)? as usize;
|
.coerce_to_u32(activation)? as usize;
|
||||||
|
|
||||||
if radix < 2 || radix > 36 {
|
if radix < 2 || radix > 36 {
|
||||||
return Err("toString can only print in bases 2 thru 36.".into());
|
return Err(Error::AvmError(range_error(
|
||||||
|
activation,
|
||||||
|
&format!(
|
||||||
|
"Error #1003: The radix argument must be between 2 and 36; got {radix}."
|
||||||
|
),
|
||||||
|
1003,
|
||||||
|
)?));
|
||||||
}
|
}
|
||||||
|
|
||||||
return Ok(print_with_radix(activation, number as f64, radix)?.into());
|
return Ok(print_with_radix(activation, number as f64, radix)?.into());
|
||||||
|
|
|
@ -1,2 +1 @@
|
||||||
num_ticks = 1
|
num_ticks = 1
|
||||||
known_failure = true
|
|
||||||
|
|
Loading…
Reference in New Issue