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()
|
.encode_utf16()
|
||||||
.collect::<Vec<u16>>();
|
.collect::<Vec<u16>>();
|
||||||
let pattern = match args.get(0) {
|
let pattern = match args.get(0) {
|
||||||
None | Some(Value::Undefined) => return Ok(Value::Undefined),
|
None => return Ok(Value::Undefined),
|
||||||
Some(s) => s
|
Some(s) => s
|
||||||
.clone()
|
.clone()
|
||||||
.coerce_to_string(activation)?
|
.coerce_to_string(activation)?
|
||||||
|
|
|
@ -140,6 +140,12 @@ undefined
|
||||||
// s.lastIndexOf(null)
|
// s.lastIndexOf(null)
|
||||||
17
|
17
|
||||||
|
|
||||||
|
// s.lastIndexOf(undefined)
|
||||||
|
-1
|
||||||
|
|
||||||
|
// "hello undefined hi".lastIndexOf(undefined)
|
||||||
|
6
|
||||||
|
|
||||||
// slice
|
// slice
|
||||||
// s.slice(1, 4)
|
// s.slice(1, 4)
|
||||||
ell
|
ell
|
||||||
|
|
Binary file not shown.
Binary file not shown.
Loading…
Reference in New Issue