Backed out 3 changesets (bug 1892041) for causing failures on async-module-does-not...
[gecko.git] / js / src / tests / test262 / built-ins / RegExp / prototype / Symbol.replace / g-init-lastindex.js
blobea824178e8d2233cb81cf9446c4de9c5deeeb9cd
1 // Copyright (C) 2015 the V8 project authors. All rights reserved.
2 // This code is governed by the BSD license found in the LICENSE file.
4 /*---
5 description: Initialization of `lastIndex` property for "global" instances
6 es6id: 21.2.5.8
7 info: |
8     21.2.5.8 RegExp.prototype [ @@replace ] ( string, replaceValue )
10     [...]
11     10. If global is true, then
12         [...]
13         c. Let setStatus be Set(rx, "lastIndex", 0, true).
14         [...]
15 features: [Symbol.replace]
16 ---*/
18 var r = /./g;
20 r.lastIndex = 1;
22 assert.sameValue(r[Symbol.replace]('aa', 'x'), 'xx');
24 reportCompare(0, 0);