Add String#lastIndexOf and improve tests (#163)

This commit is contained in:
Max Graey
2018-07-10 04:31:51 +03:00
committed by Daniel Wirtz
parent c4199673ef
commit 365884ff73
11 changed files with 2112 additions and 1172 deletions

View File

@ -201,6 +201,7 @@
(local $6 i32)
(local $7 i32)
(local $8 i32)
(local $9 i32)
(if
(i32.eqz
(i32.ne
@ -212,7 +213,7 @@
(call $~lib/env/abort
(i32.const 0)
(i32.const 12)
(i32.const 231)
(i32.const 255)
(i32.const 4)
)
(unreachable)
@ -235,32 +236,37 @@
(get_local $0)
)
)
(set_local $7
(select
(tee_local $5
(select
(tee_local $5
(get_local $3)
)
(tee_local $6
(i32.const 0)
)
(i32.gt_s
(get_local $5)
(get_local $6)
(set_local $8
(block $~lib/internal/string/clamp<isize>|inlined.0 (result i32)
(set_local $5
(i32.const 0)
)
(select
(tee_local $6
(select
(tee_local $6
(get_local $3)
)
(tee_local $7
(get_local $4)
)
(i32.lt_s
(get_local $6)
(get_local $7)
)
)
)
)
(tee_local $6
(get_local $4)
)
(i32.lt_s
(get_local $5)
(get_local $6)
(tee_local $7
(get_local $5)
)
(i32.gt_s
(get_local $6)
(get_local $7)
)
)
)
)
(set_local $8
(set_local $9
(i32.load
(get_local $1)
)
@ -268,8 +274,8 @@
(if
(i32.gt_s
(i32.add
(get_local $9)
(get_local $8)
(get_local $7)
)
(get_local $4)
)
@ -285,7 +291,7 @@
(i32.const 4)
)
(i32.shl
(get_local $7)
(get_local $8)
(i32.const 1)
)
)
@ -294,7 +300,7 @@
(i32.const 4)
)
(i32.shl
(get_local $8)
(get_local $9)
(i32.const 1)
)
)