| OLD | NEW |
| 1 // Copyright 2016 the V8 project authors. All rights reserved. | 1 // Copyright 2016 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 // Flags: --harmony-unicode-regexps --harmony-regexp-lookbehind | 5 // Flags: --harmony-regexp-lookbehind |
| 6 | 6 |
| 7 // Back reference does not end in the middle of a surrogate pair. | 7 // Back reference does not end in the middle of a surrogate pair. |
| 8 function replace(string) { | 8 function replace(string) { |
| 9 return string.replace(/L/g, "\ud800") | 9 return string.replace(/L/g, "\ud800") |
| 10 .replace(/l/g, "\ud801") | 10 .replace(/l/g, "\ud801") |
| 11 .replace(/T/g, "\udc00") | 11 .replace(/T/g, "\udc00") |
| 12 .replace(/\./g, "[^]"); | 12 .replace(/\./g, "[^]"); |
| 13 } | 13 } |
| 14 | 14 |
| 15 function test(expectation, regexp_source, subject) { | 15 function test(expectation, regexp_source, subject) { |
| (...skipping 28 matching lines...) Expand all Loading... |
| 44 test(null, "([^x]+)x*\\1", "LTxT"); | 44 test(null, "([^x]+)x*\\1", "LTxT"); |
| 45 test(null, "([^x]+)x*\\1", "xLxLT"); | 45 test(null, "([^x]+)x*\\1", "xLxLT"); |
| 46 test(null, "([^x]+)x*\\1", "xTxLT"); | 46 test(null, "([^x]+)x*\\1", "xTxLT"); |
| 47 test(null, "([^x]+)x*\\1", "xLTxL"); | 47 test(null, "([^x]+)x*\\1", "xLTxL"); |
| 48 test(null, "([^x]+)x*\\1", "xLTxT"); | 48 test(null, "([^x]+)x*\\1", "xLTxT"); |
| 49 test(null, "([^x]+)x*\\1", "xxxLxxLTxx"); | 49 test(null, "([^x]+)x*\\1", "xxxLxxLTxx"); |
| 50 test(null, "([^x]+)x*\\1", "xxxTxxLTxx"); | 50 test(null, "([^x]+)x*\\1", "xxxTxxLTxx"); |
| 51 test(null, "([^x]+)x*\\1", "xxxLTxxLxx"); | 51 test(null, "([^x]+)x*\\1", "xxxLTxxLxx"); |
| 52 test(null, "([^x]+)x*\\1", "xxxLTxxTxx"); | 52 test(null, "([^x]+)x*\\1", "xxxLTxxTxx"); |
| 53 test(["LTTxxLTT", "LTT"], "([^x]+)x*\\1", "xxxLTTxxLTTxx"); | 53 test(["LTTxxLTT", "LTT"], "([^x]+)x*\\1", "xxxLTTxxLTTxx"); |
| OLD | NEW |