diff options
Diffstat (limited to 'js/src/tests/test262/built-ins/RegExp/prototype/Symbol.replace/match-failure.js')
-rw-r--r-- | js/src/tests/test262/built-ins/RegExp/prototype/Symbol.replace/match-failure.js | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/js/src/tests/test262/built-ins/RegExp/prototype/Symbol.replace/match-failure.js b/js/src/tests/test262/built-ins/RegExp/prototype/Symbol.replace/match-failure.js new file mode 100644 index 0000000000..a0d5317e5b --- /dev/null +++ b/js/src/tests/test262/built-ins/RegExp/prototype/Symbol.replace/match-failure.js @@ -0,0 +1,29 @@ +// 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 original string when no matches occur +es6id: 21.2.5.8 +info: | + 21.2.5.8 RegExp.prototype [ @@replace ] ( string, replaceValue ) + + [...] + 12. Let done be false. + 13. Repeat, while done is false + a. Let result be RegExpExec(rx, S). + b. ReturnIfAbrupt(result). + c. If result is null, set done to true. + [...] + 14. Let accumulatedResult be the empty String value. + 15. Let nextSourcePosition be 0. + [...] + 18. Return the String formed by concatenating the code units of + accumulatedResult with the substring of S consisting of the code units + from nextSourcePosition (inclusive) up through the final code unit of S + (inclusive). +features: [Symbol.replace] +---*/ + +assert.sameValue(/x/[Symbol.replace]('abc', 'X'), 'abc'); + +reportCompare(0, 0); |