/// The `indexOf()` method returns the index within the calling `String` object of the first occurrence of the specified value, starting the search at `fromIndex`.
/// The `indexOf()` method returns the index within the calling `String` object of the first occurrence
/// of the specified value, starting the search at `fromIndex`.
/// The `lastIndexOf()` method returns the index within the calling `String` object of the last occurrence of the specified value, searching backwards from `fromIndex`.
/// The `lastIndexOf()` method returns the index within the calling `String` object of the last occurrence
/// of the specified value, searching backwards from `fromIndex`.
///
/// Returns -1 if the value is not found.
/// Returns `-1` if the value is not found.
///
/// More information:
/// - [ECMAScript reference][spec]
@ -586,41 +588,30 @@ impl String {
args: &[Value],
ctx: &mutInterpreter,
)-> ResultValue{
// First we get it the actual string a private field stored on the object only the engine has access to.
// Then we convert it into a Rust String by wrapping it in from_value
letprimitive_val=ctx.to_string(this)?;
// TODO: Should throw TypeError if search_string is regular expression
letsearch_string=ctx.to_string(
args.get(0)
.expect("failed to get argument for String method"),