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 / subst-after.js
blob92dcae5319f4807bc0f38a513bba053886d3e475
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: >
6     Substitution pattern: text after match
7 es6id: 21.2.5.8
8 info: |
9     16. Repeat, for each result in results,
10         [...]
11         m. If functionalReplace is true, then
12            [...]
13         n. Else,
14            i. Let replacement be GetSubstitution(matched, S, position,
15               captures, replaceValue).
16         [...]
18     21.1.3.14.1 Runtime Semantics: GetSubstitution
20     Code units: 0x0024, 0x0027
22     Unicode Characters: $'
24     Replacement text:
25     If tailPos ≥ stringLength, the replacement is the empty String. Otherwise
26     the replacement is the substring of str that starts at index tailPos and
27     continues to the end of str.
28 features: [Symbol.replace]
29 ---*/
31 assert.sameValue(/c/[Symbol.replace]('abc', '[$\']'), 'ab[]');
32 assert.sameValue(/b/[Symbol.replace]('abc', '[$\']'), 'a[c]c');
34 reportCompare(0, 0);