summaryrefslogtreecommitdiffstats
path: root/js/src/tests/test262/built-ins/RegExp/prototype/Symbol.replace/replace-without-trailing.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/src/tests/test262/built-ins/RegExp/prototype/Symbol.replace/replace-without-trailing.js')
-rw-r--r--js/src/tests/test262/built-ins/RegExp/prototype/Symbol.replace/replace-without-trailing.js18
1 files changed, 18 insertions, 0 deletions
diff --git a/js/src/tests/test262/built-ins/RegExp/prototype/Symbol.replace/replace-without-trailing.js b/js/src/tests/test262/built-ins/RegExp/prototype/Symbol.replace/replace-without-trailing.js
new file mode 100644
index 0000000000..e52de7ba56
--- /dev/null
+++ b/js/src/tests/test262/built-ins/RegExp/prototype/Symbol.replace/replace-without-trailing.js
@@ -0,0 +1,18 @@
+// Copyright (C) 2015 the V8 project authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+description: Return value when replacement pattern matches final code point
+es6id: 21.2.5.8
+info: |
+ [...]
+ 17. If nextSourcePosition ≥ lengthS, return accumulatedResult.
+features: [Symbol.replace]
+---*/
+
+assert.sameValue(/abcd/[Symbol.replace]('abcd', 'X'), 'X');
+assert.sameValue(/bcd/[Symbol.replace]('abcd', 'X'), 'aX');
+assert.sameValue(/cd/[Symbol.replace]('abcd', 'X'), 'abX');
+assert.sameValue(/d/[Symbol.replace]('abcd', 'X'), 'abcX');
+
+reportCompare(0, 0);