avm1: Fix String.lastIndexOf(undefined)
This commit is contained in:
parent
ea7a9758c4
commit
b2dc564628
|
@ -319,7 +319,7 @@ fn last_index_of<'gc>(
|
|||
.encode_utf16()
|
||||
.collect::<Vec<u16>>();
|
||||
let pattern = match args.get(0) {
|
||||
None | Some(Value::Undefined) => return Ok(Value::Undefined),
|
||||
None => return Ok(Value::Undefined),
|
||||
Some(s) => s
|
||||
.clone()
|
||||
.coerce_to_string(activation)?
|
||||
|
|
|
@ -140,6 +140,12 @@ undefined
|
|||
// s.lastIndexOf(null)
|
||||
17
|
||||
|
||||
// s.lastIndexOf(undefined)
|
||||
-1
|
||||
|
||||
// "hello undefined hi".lastIndexOf(undefined)
|
||||
6
|
||||
|
||||
// slice
|
||||
// s.slice(1, 4)
|
||||
ell
|
||||
|
|
Binary file not shown.
Binary file not shown.
Loading…
Reference in New Issue