Skip to content

Commit

Permalink
avm2: String.indexOf returns -1 when passed in undefined
Browse files Browse the repository at this point in the history
  • Loading branch information
sleepycatcoding authored and torokati44 committed Aug 18, 2023
1 parent cde49de commit 2f98da4
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 2 deletions.
2 changes: 1 addition & 1 deletion core/src/avm2/globals/string.rs
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ fn index_of<'gc>(
) -> Result<Value<'gc>, 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)?,
};

Expand Down
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
num_ticks = 1
known_failure = true

0 comments on commit 2f98da4

Please sign in to comment.