summaryrefslogtreecommitdiffstats
path: root/js/src/tests/test262/built-ins/RegExp/prototype/Symbol.replace/u-advance-after-empty.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/src/tests/test262/built-ins/RegExp/prototype/Symbol.replace/u-advance-after-empty.js')
-rw-r--r--js/src/tests/test262/built-ins/RegExp/prototype/Symbol.replace/u-advance-after-empty.js32
1 files changed, 32 insertions, 0 deletions
diff --git a/js/src/tests/test262/built-ins/RegExp/prototype/Symbol.replace/u-advance-after-empty.js b/js/src/tests/test262/built-ins/RegExp/prototype/Symbol.replace/u-advance-after-empty.js
new file mode 100644
index 0000000000..69d57d61fb
--- /dev/null
+++ b/js/src/tests/test262/built-ins/RegExp/prototype/Symbol.replace/u-advance-after-empty.js
@@ -0,0 +1,32 @@
+// Copyright (C) 2015 the V8 project authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+description: lastIndex is advanced according to width of astral symbols
+es6id: 21.2.5.8
+info: |
+ 21.2.5.8 RegExp.prototype [ @@replace ] ( string, replaceValue )
+
+ [...]
+ 10. If global is true, then
+ a. Let fullUnicode be ToBoolean(Get(rx, "unicode")).
+ b. ReturnIfAbrupt(fullUnicode).
+ [...]
+ 13. Repeat, while done is false
+ [...]
+ d. Else result is not null,
+ [...]
+ iii. Else,
+ [...]
+ 3. If matchStr is the empty String, then
+ [...]
+ c. Let nextIndex be AdvanceStringIndex(S, thisIndex,
+ fullUnicode).
+ d. Let setStatus be Set(rx, "lastIndex", nextIndex, true).
+features: [Symbol.replace]
+---*/
+
+var str = /^|\udf06/ug[Symbol.replace]('\ud834\udf06', 'XXX');
+assert.sameValue(str, 'XXX\ud834\udf06');
+
+reportCompare(0, 0);