Sign in
webkit
/
WebKit
/
b02737e0dcbaa3a4c4e66931839e0609e605d359
/
.
/
JSTests
/
microbenchmarks
/
regexp-last-index.js
blob: 977b92d8e2b6d816422ca557605feabead1e96ba [
file
] [
log
] [
blame
]
(
function
()
{
var
re
=
/foo/
g
;
re
.
exec
(
"bar foo bar"
);
var
result
=
0
;
var
n
=
10000000
;
for
(
var
i
=
0
;
i
<
n
;
++
i
)
result
+=
re
.
lastIndex
;
if
(
result
!=
7
*
n
)
throw
"Error: bad result: "
+
result
;
})();