diff --git a/core/src/avm2/globals/string.rs b/core/src/avm2/globals/string.rs index 8b68592025f7..cd0664f5c9da 100644 --- a/core/src/avm2/globals/string.rs +++ b/core/src/avm2/globals/string.rs @@ -201,7 +201,7 @@ fn index_of<'gc>( ) -> Result, Error<'gc>> { let this = Value::from(this).coerce_to_string(activation)?; let pattern = match args.get(0) { - None => return Ok(Value::Undefined), + None => return Ok(Value::Integer(-1)), Some(s) => s.clone().coerce_to_string(activation)?, }; diff --git a/tests/tests/swfs/from_avmplus/ecma3/String/e15_5_4_6_1/test.toml b/tests/tests/swfs/from_avmplus/ecma3/String/e15_5_4_6_1/test.toml index 29f3cef79022..cf6123969a1d 100644 --- a/tests/tests/swfs/from_avmplus/ecma3/String/e15_5_4_6_1/test.toml +++ b/tests/tests/swfs/from_avmplus/ecma3/String/e15_5_4_6_1/test.toml @@ -1,2 +1 @@ num_ticks = 1 -known_failure = true