Proxy.[[Set]] should reject falsish trap result in strict mode (#4418)

This patch fixes #4398.

JerryScript-DCO-1.0-Signed-off-by: Robert Fancsik frobert@inf.u-szeged.hu
This commit is contained in:
Robert Fancsik
2021-01-07 17:25:29 +01:00
committed by GitHub
parent 979a0c7826
commit 0a3aa0f48b
3 changed files with 39 additions and 4 deletions
+9 -4
View File
@@ -250,11 +250,16 @@ var handler = {
};
var p = new Proxy(r, handler);
assert (search.call(p, "bba") === 2);
try {
search.call(p, "bba");
assert (false);
} catch (e) {
assert (e instanceof TypeError);
}
assert (get_calls.join(",") === "lastIndex,exec,lastIndex");
assert (set_calls.join(",") === "lastIndex,lastIndex");
assert (r.lastIndex === 3.14);
assert (get_calls.join(",") === "lastIndex");
assert (set_calls.join(",") === "lastIndex");
assert (r.lastIndex === 0);
var o = {
get lastIndex() {