blob: 80991fa4b91c533ae9fe67b0558c09d96722c1f1 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
|
function regexpLastIndex()
{
var n = 0;
var re = /hi/g;
var ss = " hi hi hi hi hi hi hi hi hi hi";
for (var i = 0; i < 10; i++) {
// re.exec(ss);
n += (re.lastIndex > 0) ? 3 : 0;
re.lastIndex = 0;
}
return n;
}
assertEq(regexpLastIndex(), 0);
|