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.
6 Substitution pattern: text after match
9 16. Repeat, for each result in results,
11 m. If functionalReplace is true, then
14 i. Let replacement be GetSubstitution(matched, S, position,
15 captures, replaceValue).
18 21.1.3.14.1 Runtime Semantics: GetSubstitution
20 Code units: 0x0024, 0x0027
22 Unicode Characters: $'
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]
31 assert.sameValue(/c/[Symbol.replace]('abc', '[$\']'), 'ab[]');
32 assert.sameValue(/b/[Symbol.replace]('abc', '[$\']'), 'a[c]c');