Fix string position calculation in @@replace (#3831)

Fixes #3817.

JerryScript-DCO-1.0-Signed-off-by: Dániel Bátyai dbatyai@inf.u-szeged.hu
This commit is contained in:
Dániel Bátyai
2020-06-02 16:15:23 +02:00
committed by GitHub
parent d06c3a7f50
commit 9ceece8eb4
3 changed files with 36 additions and 1 deletions
+4
View File
@@ -621,6 +621,10 @@ try {
assert (e instanceof TypeError);
}
assert(replace.call({ exec : ( ) => { return { } } }, 'һ', "a") === "a");
assert(replace.call({ exec : ( ) => { return { } } }, 'һһһһһһһһһ', "a") === "a");
assert(replace.call({ exec : ( ) => { return { } } }, 'һһһһһһһһһһ', "a") === "aһ");
/* Object with custom @@replace method */
var o = {}
o[Symbol.replace] = function () {