Primitive this values of accessors should not be coerced in strict mode (#3854)

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-05 15:58:10 +02:00
committed by GitHub
parent 10e78a4eef
commit cae6cd08fb
2 changed files with 96 additions and 63 deletions
+16
View File
@@ -32,3 +32,19 @@ Object.defineProperty(Box.prototype, 'data', {
assert(box.data === '=');
box.data = '+';
assert(box.data === '+');
function test_access(value, proto) {
"use strict"
Object.defineProperty(proto, 'test', {
get: function () { assert (this === value) },
set: function () { assert (this === value) }
});
value.test;
value.test = undefined;
}
test_access ("str", String.prototype);
test_access (1, Number.prototype);
test_access (true, Boolean.prototype);