Update Symbol.split functions for String and Regexp to match new standard (#3942)

In newest ES standard limit parameter is calculated using
ToUint32 function instead of ToLength.

JerryScript-DCO-1.0-Signed-off-by: Rafal Walczyna r.walczyna@samsung.com
This commit is contained in:
Rafal Walczyna
2020-06-30 16:03:11 +02:00
committed by GitHub
parent 3e866258db
commit 9d2b7334bc
6 changed files with 48 additions and 5 deletions
+11
View File
@@ -107,3 +107,14 @@ try {
} catch (e) {
assert (e === "abrupt capture");
}
Object.defineProperty(RegExp.prototype, "exec", { value: function (str) {
this.lastIndex = 10;
return { };
}});
var result = split.call ({flags: "g"}, "string");
assert(result.length === 2)
assert(result[0] === "")
assert(result[1] === "")