Sign in
webkit
/
WebKit
/
5bd663b95d2fa0048c9b51d7e90d3c09992ceb28
/
.
/
JSTests
/
es6
/
RegExp_y_and_u_flags_y_flag_lastIndex.js
blob: 02664fbe82169f3fdca43fe0a43cc52387bf632f [
file
] [
log
] [
blame
]
function
test
()
{
var
re
=
new
RegExp
(
'yy'
,
'y'
);
re
.
lastIndex
=
3
;
var
result
=
re
.
exec
(
'xxxyyxx'
)[
0
];
return
result
===
'yy'
&&
re
.
lastIndex
===
5
;
}
if
(!
test
())
throw
new
Error
(
"Test failed"
);